Index: fact/tools/pyscripts/sandbox/kraehenb/CalFitsPerformanceWeave.py
===================================================================
--- fact/tools/pyscripts/sandbox/kraehenb/CalFitsPerformanceWeave.py	(revision 13460)
+++ fact/tools/pyscripts/sandbox/kraehenb/CalFitsPerformanceWeave.py	(revision 13461)
@@ -61,12 +61,12 @@
     int singles = 0;
     double threshold = 2.5;
-    for(int px=0; px<1440; px++) {
-        lastslice = npcalevent(px*300);
-        for(int sl=1; sl<300-14; sl++) {
-            slice = npcalevent(px*300+sl);
+    for(int px=0; px<npix; px++) {
+        lastslice = npcalevent(px*nroi);
+        for(int sl=1; sl<nroi-14; sl++) {
+            slice = npcalevent(px*nroi+sl);
             if((lastslice<threshold)&&(slice>threshold)) {
                 integral = 0;
                 for(int l=5; l<15; l++) {
-                    integral += npcalevent(px*1440+sl+l);
+                    integral += npcalevent(px*nroi+sl+l);
                 }
                 c_integrals(singles) = integral;
@@ -79,5 +79,11 @@
 //    std::cout << std::endl << singles << std::endl;
     """
-    weave.inline(cppcode, ['c_integrals', 'npcalevent'], type_converters=converters.blitz)
+    
+    #Passing the caltest object to weave is not possible
+    #The int() statement is necessary to add additional data type information to the variable (ie. otherwise some things would work in the C-code, other would not)
+    nroi = int(caltest.nroi)
+    npix = int(caltest.npix)
+    
+    weave.inline(cppcode, ['c_integrals', 'npcalevent','nroi','npix'], type_converters=converters.blitz)
     
 #    print "CalFitsPerformanceWeave"
