Changeset 13461 for fact/tools
- Timestamp:
- 04/26/12 14:24:02 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/tools/pyscripts/sandbox/kraehenb/CalFitsPerformanceWeave.py
r13452 r13461 61 61 int singles = 0; 62 62 double threshold = 2.5; 63 for(int px=0; px< 1440; px++) {64 lastslice = npcalevent(px* 300);65 for(int sl=1; sl< 300-14; sl++) {66 slice = npcalevent(px* 300+sl);63 for(int px=0; px<npix; px++) { 64 lastslice = npcalevent(px*nroi); 65 for(int sl=1; sl<nroi-14; sl++) { 66 slice = npcalevent(px*nroi+sl); 67 67 if((lastslice<threshold)&&(slice>threshold)) { 68 68 integral = 0; 69 69 for(int l=5; l<15; l++) { 70 integral += npcalevent(px* 1440+sl+l);70 integral += npcalevent(px*nroi+sl+l); 71 71 } 72 72 c_integrals(singles) = integral; … … 79 79 // std::cout << std::endl << singles << std::endl; 80 80 """ 81 weave.inline(cppcode, ['c_integrals', 'npcalevent'], type_converters=converters.blitz) 81 82 #Passing the caltest object to weave is not possible 83 #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) 84 nroi = int(caltest.nroi) 85 npix = int(caltest.npix) 86 87 weave.inline(cppcode, ['c_integrals', 'npcalevent','nroi','npix'], type_converters=converters.blitz) 82 88 83 89 # print "CalFitsPerformanceWeave"
Note:
See TracChangeset
for help on using the changeset viewer.