StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
L2eemcGamma2012.cxx
1 #include <stdio.h>
2 #include <string.h>
3 #include <stdlib.h>
4 #include <time.h>
5 #include <math.h>
6 #include <fakeRtsLog.h>
7 
8 /*********************************************************************
9  * $Id: L2eemcGamma2012.cxx,v 1.4 2012/03/21 18:18:03 jml Exp $
10  * \author Jan Balewski,MIT , 2008
11  *********************************************************************
12  * Descripion: see .h
13  *********************************************************************
14  */
15 
16 
17 #ifdef IS_REAL_L2 //in l2-ana environment
18  #include "../L2algoUtil/L2EmcDb2012.h"
19  #include "../L2algoUtil/L2Histo.h"
20 #else //full path needed for cvs'd code
21  #include "StTriggerUtilities/L2Emulator/L2algoUtil/L2EmcDb2012.h"
22  #include "StTriggerUtilities/L2Emulator/L2algoUtil/L2Histo.h"
23  #include "StTriggerUtilities/L2Emulator/L2algoUtil/L2EmcGeom2012.h"
24 #endif
25 
26 #include "L2eemcGamma2012.h"
27 
28 
29 //=================================================
30 //=================================================
31 void L2eemcGamma2012::quickSort(int array[], int start, int end)
32 {
33  int i = start; // index of left-to-right scan
34  int k = end; // index of right-to-left scan
35 
36  if (end - start >= 1) // check that there are at least two elements to sort
37  {
38  float pivot = wrkEtow_et[array[start]]; // set the pivot as the first element in the partition
39 
40  while (k > i) // while the scan indices from left and right have not met,
41  {
42  while (wrkEtow_et[array[i]] <= pivot && i <= end && k > i) // from the left, look for the first
43  i++; // element greater than the pivot
44  while (wrkEtow_et[array[k]] > pivot && k >= start && k >= i) // from the right, look for the first
45  k--; // element not greater than the pivot
46  if (k > i) // if the left seekindex is still smaller than
47  swap(array, i, k); // the right index, swap the corresponding elements
48  }
49  swap(array, start, k); // after the indices have crossed, swap the last element in
50  // the left partition with the pivot
51  quickSort(array, start, k - 1); // quicksort the left partition
52  quickSort(array, k + 1, end); // quicksort the right partition
53  }
54  else // if there is only one element in the partition, do not do any sorting
55  {
56  return; // the array is sorted, so exit
57  }
58 }
59 
60 void L2eemcGamma2012::swap(int array[], int index1, int index2)
61 // pre: array is full and index1, index2 < array.length
62 // post: the values at indices 1 and 2 have been swapped
63 {
64  int temp = array[index1]; // store the first value in a temp
65  array[index1] = array[index2]; // copy the value of the second into the first
66  array[index2] = temp; // copy the value of the temp into the second
67 }
68 
69 
70 
71 //=================================================
72 //=================================================
73 L2eemcGamma2012::L2eemcGamma2012(const char* name, const char *uid, L2EmcDb2012* db, L2EmcGeom2012 *geoX, char* outDir, int resOff) : L2VirtualAlgo2012( name, uid, db, outDir, false,true, resOff) {
74  /* called one per days
75  all memory allocation must be done here
76  */
77  mGeom=geoX;
78  if (!mGeom)
79  criticalError("L2eemcGamma is broken -- can't find geom.");
80 
81  setMaxHist(16); // set upper range, I uses only 2^N -it is easier to remember
82  createHisto();
83 
84  //------- self-consistency checks, should never fail
85  if (sizeof(L2gammaResult2012)!= L2gammaResult2012::mySizeChar)
86 
87  criticalError("L2eemcGamma has failed consistency check. sizeof(L2gammaResult2012)!= L2gammaResult2012::mySizeChar");
88 
89 
90 
91 }
92 
93 /* ========================================
94  ======================================== */
95 int
96 L2eemcGamma2012::initRunUser( int runNo, int *rc_ints, float *rc_floats) {
97 
98  // unpack params from run control GUI
99  par_dbg = rc_ints[0];
100  par_RndAcceptPrescale = rc_ints[1];
101  par_seedEtThres = rc_floats[0];
102  par_clusterEtThres= rc_floats[1];
103  par_eventEtThres = rc_floats[2];
104 
105  // verify consistency of input params
106  int kBad=0;
107  kBad+=0x00001 * (par_seedEtThres<1.0);
108  kBad+=0x00002 * (par_clusterEtThres<par_seedEtThres);
109 
110  if (mLogFile) {
111  fprintf(mLogFile,"L2%s algorithm initRun(R=%d), compiled: %s , %s\n params:\n",getName(),mRunNumber,__DATE__,__TIME__);
112  fprintf(mLogFile," - use Thres/GeV seed=%.2f, clusterList=%.2f debug=%d, prescale=%d\n", par_seedEtThres,par_clusterEtThres, par_dbg,par_RndAcceptPrescale);
113 
114  fprintf(mLogFile," - accept event cluster Thres/GeV=%.2f\n",par_eventEtThres);
115  fprintf(mLogFile,"initRun() params checked for consistency, Error flag=0x%04x\n",kBad);
116  }
117 
118 
119  // clear content of all histograms & token-dependent memory
120  int i;
121  for (i=0; i<mxHA;i++) if(hA[i])hA[i]->reset();
122 
123  if(kBad) return -1*kBad;
124 
125  memset(mEtow,0,sizeof(mEtow));
126 
127  // update tiltles of histos
128  char txt[1000];
129  sprintf(txt,"ETOW-compute: #seed towers ET>%.2f GeV / event; x: # ETOW towers; y: counts",par_seedEtThres);
130  hA[3]->setTitle(txt);
131 
132  sprintf(txt,"ETOW-decision: #cluster ET>%.2f GeV / event ; x: # ETOW towers; y: counts",par_clusterEtThres);
133  hA[4]->setTitle(txt);
134 
135  sprintf(txt,"ETOW-decision: acc cluster ET>%.2f GeV; x:cluster ET(GeV) ; y: counts",par_eventEtThres);
136  hA[4]->setTitle(txt);
137 
138 
139 
140  for ( int index=0; index<EmcDbIndexMax; index++ )
141  {
142  const L2EmcDb2012::EmcCDbItem *x = mDb->getByIndex(index);
143  if ( x==0 ) continue;
144  if ( !mDb->isETOW(x) ) continue;
145  int sec = x->sec - 1;
146  int sub = 8192;
147  sub = x->sub - 'A';
148  int eta = x->eta - 1;
149  int phi = EtowGeom::mxSubs *sec + sub;
150  int tow = EtowGeom::mxEtaBin *phi + eta; // phi- changes faster
151  int rdo = x->rdo;
152  if (tow<0 || tow>mxEtow || rdo<0 || rdo>mxEtow) return -101;
153 
154  mTower2rdo[ tow ] = rdo; // returns rdo channel for given tower
155  mRdo2tower[ rdo ] = tow; // returns tower for given rdo channel
156  }
157  return 0; //OK
158 
159 }
160 
161 /* ========================================
162  ======================================== */
163 int
164 L2eemcGamma2012::countNonZeroTow(int phi, int eta) {
165  int tow = EtowGeom::mxEtaBin *((phi+EtowGeom::mxPhiBin)%EtowGeom::mxPhiBin) + ((eta+EtowGeom::mxEtaBin)%EtowGeom::mxEtaBin); // phi- changes faster
166  const int maxTowers = EtowGeom::mxEtaBin * EtowGeom::mxPhiBin;
167  int towPlusOne;
168  int count=0;
169 
170  if (etow_used[tow]==0) {
171  if(wrkEtow_et[tow]!=0) count++;
172  }
173 
174  towPlusOne = tow+1;
175  towPlusOne%= maxTowers;
176  if (etow_used[towPlusOne]==0) {
177  if(wrkEtow_et[towPlusOne]!=0) count++;
178  }
179 
180  tow+=EtowGeom::mxEtaBin;
181  tow%=maxTowers;
182  if (etow_used[tow]==0) {
183  if(wrkEtow_et[tow]!=0) count++;
184  }
185 
186  towPlusOne = tow+1;
187  towPlusOne%= maxTowers;
188  if (etow_used[towPlusOne]==0) {
189  if(wrkEtow_et[towPlusOne]!=0) count++;
190  }
191  return count;
192 }
193 
194 
195 /* ========================================
196  ======================================== */
197 void
198 L2eemcGamma2012::flagUsed(int phi, int eta) {
199  int tow = EtowGeom::mxEtaBin *((phi+EtowGeom::mxPhiBin)%EtowGeom::mxPhiBin) + ((eta+EtowGeom::mxEtaBin)%EtowGeom::mxEtaBin); // phi- changes faster
200  const int maxTowers = EtowGeom::mxEtaBin * EtowGeom::mxPhiBin;
201  int towPlusOne;
202  etow_used[tow] = 1;
203 
204  towPlusOne = tow+1;
205  towPlusOne%= maxTowers;
206  etow_used[towPlusOne] = 1;
207 
208  tow+=EtowGeom::mxEtaBin;
209  tow%=maxTowers;
210  etow_used[tow] = 1;
211 
212  towPlusOne = tow+1;
213  towPlusOne%= maxTowers;
214  etow_used[towPlusOne] = 1;
215 }
216 
217 /* ========================================
218  ======================================== */
219 void
220 L2eemcGamma2012::averageEtaPhi(int phi, int eta, float *avePhi, float *aveEta) {
221  int tow = EtowGeom::mxEtaBin *((phi+EtowGeom::mxPhiBin)%EtowGeom::mxPhiBin) + ((eta+EtowGeom::mxEtaBin)%EtowGeom::mxEtaBin); // phi- changes faster
222  const int maxTowers = EtowGeom::mxEtaBin * EtowGeom::mxPhiBin;
223  int towPlusOne;
224  float ETsum;
225  float etaSum;
226  float phiSum;
227 
228  ETsum=wrkEtow_et[tow];
229  etaSum = wrkEtow_et[tow]*(float)eta;
230  phiSum = wrkEtow_et[tow]*(float)phi;
231 
232  towPlusOne = tow+1;
233  towPlusOne%= maxTowers;
234  ETsum+=wrkEtow_et[towPlusOne];
235  etaSum += wrkEtow_et[towPlusOne]*(float)(eta+1);
236  phiSum += wrkEtow_et[towPlusOne]*(float)phi;
237 
238  tow+=EtowGeom::mxEtaBin;
239  tow%=maxTowers;
240  ETsum+=wrkEtow_et[tow];
241  etaSum += wrkEtow_et[tow]*(float)eta;
242  phiSum += wrkEtow_et[tow]*(float)(phi+1);
243 
244  towPlusOne = tow+1;
245  towPlusOne%= maxTowers;
246  ETsum+=wrkEtow_et[towPlusOne];
247  etaSum += wrkEtow_et[towPlusOne]*(float)(eta+1);
248  phiSum += wrkEtow_et[towPlusOne]*(float)(phi+1);
249 
250 
251  *aveEta = etaSum/ETsum;
252  *avePhi = phiSum/ETsum;
253 }
254 
255 
256 /* ========================================
257  ======================================== */
258 float
259 L2eemcGamma2012::sumET(int phi, int eta) {
260  int tow = EtowGeom::mxEtaBin *((phi+EtowGeom::mxPhiBin)%EtowGeom::mxPhiBin) + ((eta+EtowGeom::mxEtaBin)%EtowGeom::mxEtaBin); // phi- changes faster
261 
262  const int maxTowers = EtowGeom::mxEtaBin * EtowGeom::mxPhiBin;
263  int towPlusOne;
264  float sum;
265  sum=0;
266  if (etow_used[tow]==0) {
267  sum=wrkEtow_et[tow];
268  }
269  towPlusOne = tow+1;
270  towPlusOne%= maxTowers;
271  if (etow_used[towPlusOne]==0) {
272  sum+=wrkEtow_et[towPlusOne];
273  }
274 
275  tow+=EtowGeom::mxEtaBin;
276  tow%=maxTowers;
277  if (etow_used[tow]==0) {
278  sum+=wrkEtow_et[tow];
279  }
280  towPlusOne = tow+1;
281  towPlusOne%= maxTowers;
282  if (etow_used[towPlusOne]==0) {
283  sum+=wrkEtow_et[towPlusOne];
284  }
285  return sum;
286 }
287 
288 
289 /* ========================================
290  ======================================== */
291 void
293  // token range is guaranteed by virtual08-class
294 
295  /* 2x2 cluster finder:
296  - can find clusters through the tower border in Phi
297  - sorts hit towers by Et and selects Highest Seed Towers first
298  */
299 
300  clearEvent(token);
301 
302  // ------ PROJECT INPUT LIST TO 2D ARRAY AND SCAN FOR SEED TOWERS ----
303  int i;
304 
305  L2eemcGammaEvent2012 *etowEve=mEtow+token;
306  const HitTower1 *hit=mEveStream_etow[token].get_hits();
307  const int hitSize=mEveStream_etow[token].get_hitSize();
308  for(i=0;i< hitSize;i++,hit++) {
309  //sortIndex[i] = i;
310  int tower=mRdo2tower[hit->rdo];
311  wrkEtow_tower_index[i]=tower;
312  wrkEtow_et[tower]=hit->et;
313  //if(hit->et<par_seedEtThres)continue;
314  //wrkEtow_tower_seed[wrkEtow_tower_seed_size++]=tower;
315  }
316  hA[2]->fill(hitSize);
317  // long int start, stop;
318 
319  quickSort(wrkEtow_tower_index,0,hitSize-1);
320  //print4(token,hitSize);
321 
322  // ----------- FIND 2x2 CLUSTER AROUND EVERY SEED -----
323  for(i=hitSize-1;i >= 0; i--) {
324  if(wrkEtow_et[wrkEtow_tower_index[i]] < par_seedEtThres) {
325  i = -1; // Early loop termination condition. Remaining elements are below threshold
326  continue;
327  }
328  int seedTow=wrkEtow_tower_index[i];
329  int seedEta=seedTow%EtowGeom::mxEtaBin;
330  int seedPhi=seedTow/EtowGeom::mxEtaBin;
331 
332  // ........drop seeds close to boundaries, fix it
334  //if(seedEta==0 || seedEta==EtowGeom::mxEtaBin-1) continue;
335  //if(seedPhi==0 || seedPhi==EtowGeom::mxPhiBin-1) continue;
336  // now every seed has 4 2x2 clusters
337 
338  //.... find max of 4 possible clusters
339  float maxET;
340  float sum;
341 
342  if (etow_used[seedTow]!=0) continue; // if seed tower has been used in another cluster
343  wrkEtow_tower_seed_size++;
344 
345  int high_quadrant;
346  high_quadrant = 0;
347  maxET = 0;
348  if(seedEta < EtowGeom::mxEtaBin) {
349  maxET = sumET(seedPhi,seedEta);
350  sum=sumET(seedPhi-1,seedEta);
351  if(maxET<sum) {
352  maxET=sum;
353  high_quadrant = 1;
354  }
355  }
356  if (seedEta > 0) {
357  sum=sumET(seedPhi-1,seedEta-1);
358  if(maxET<sum) {
359  maxET=sum;
360  high_quadrant = 2;
361  }
362  sum=sumET(seedPhi,seedEta-1);
363  if(maxET<sum) {
364  maxET=sum;
365  high_quadrant = 3;
366  }
367  }
368 
369  if(maxET<par_clusterEtThres)continue;
370  //........record clusters....
371 
372  hA[6]->fill((int)(maxET));
373  hA[7]->fill(seedTow);
374  hA[8]->fill(hitSize-i);
375  //hA[9]->fill(high_quadrant);
376  //hA[10]->fill((int)maxET);
377  hA[11]->fill((int)wrkEtow_et[seedTow]);
378  hA[12]->fill((int)(10.*wrkEtow_et[seedTow]/maxET));
379 
380  if(etowEve->size>=L2eemcGammaEvent2012::mxClust) continue; // overflow protection
381  etowEve->clusterET[etowEve->size]=maxET;
382  etowEve->clusterQuad[etowEve->size]=high_quadrant;
383  etowEve->clusterSeedTow[etowEve->size]=seedTow;
384 
385 
386 
387  // flag all towers used in this cluster so they will
388  // not be used in other clusters
389  int numNonZeroTow=0;
390  float clusterEta;
391  float clusterPhi;
392  if (high_quadrant==0) {
393  numNonZeroTow = countNonZeroTow(seedPhi, seedEta);
394  flagUsed(seedPhi, seedEta);
395  averageEtaPhi(seedPhi, seedEta,&clusterPhi, &clusterEta);
396  } else if (high_quadrant==1) {
397  numNonZeroTow = countNonZeroTow(seedPhi-1, seedEta);
398  flagUsed(seedPhi-1, seedEta);
399  averageEtaPhi(seedPhi-1, seedEta,&clusterPhi, &clusterEta);
400  } else if (high_quadrant==2) {
401  numNonZeroTow = countNonZeroTow(seedPhi-1, seedEta-1);
402  flagUsed(seedPhi-1, seedEta-1);
403  averageEtaPhi(seedPhi-1, seedEta-1,&clusterPhi, &clusterEta);
404  } else if (high_quadrant==3) {
405  numNonZeroTow = countNonZeroTow(seedPhi, seedEta-1);
406  flagUsed(seedPhi, seedEta-1);
407  averageEtaPhi(seedPhi, seedEta-1,&clusterPhi, &clusterEta);
408  }
409  hA[13]->fill(numNonZeroTow);
410  etowEve->clusterEta[etowEve->size]=clusterEta;
411  etowEve->clusterPhi[etowEve->size]=clusterPhi;
412 
413  etowEve->size++;
414 
415  }// end of cluster search
416 
417  hA[3]->fill(wrkEtow_tower_seed_size);
418  hA[4]->fill(etowEve->size);
419 
420  // debugging should be off for any time critical computation
421  if(par_dbg>0){
422  LOG(DBG,"dbg=%s, etow-adcL-size=%d\n",getName(),hitSize);
423  // if(par_dbg>0) print1();
424  print2();
425  print3();// tmp, must have token
426  }
427 }
428 
429 
430 /* ========================================
431  ======================================== */
432 bool
433 L2eemcGamma2012::decisionUser(int token, int *myL2Result){
434  // INPUT: token + comput() results stored internally
435  // OUTPUT: yes/now + pointer to L2Result
436 
437  //the below is now handled in virtual algo
438  //if(par_prescale>0) {
439  // prescale++;
440  // prescale %= par_prescale;
441  //};
442 
443  // get pointers to internal private event storage
444  L2eemcGammaEvent2012 *etowEve=mEtow+token;
445 
446  int ic;
447 
448  //...... some histos just for fun
449  if(etowEve->size>= L2eemcGammaEvent2012::mxClust) mhN->fill(5); // was overflow
450  if(etowEve->isFresh>L2eemcGammaEvent2012::kDataFresh) mhN->fill(6); // stale data
451  etowEve->isFresh++; // mark the data as stale
452 
453  hA[4]->fill(etowEve->size);
454 
455  for(ic=0;ic<etowEve->size;ic++) {
456  float clustET=etowEve->clusterET[ic];
457  hA[5]->fill((int)clustET);
458  if(clustET<par_eventEtThres) continue;
459  hA[6]->fill((int)clustET);
460  }
461 
462  //........ fill (some) L2Result
463  //etowEve->resultBlob.kTicksCompute=mComputeTimeDiff[token]/1000;
464  //etowEve->resultBlob.decision=0;
465  //etowEve->resultBlob.numberOfL2Clust=etowEve->size;
466 
467  float maxClusterEt;
468  maxClusterEt=-1;
469  int maxClusterID;
470  maxClusterID =-1;
471 
472  //........ compute the final decision
473  for(ic=0;ic<etowEve->size;ic++) {
474  if(etowEve->clusterET[ic]>maxClusterEt) {
475  maxClusterEt = etowEve->clusterET[ic];
476  maxClusterID = ic;
477  }
478  }
479  if(maxClusterEt>par_eventEtThres) {
480  etowEve->resultBlob.clusterEt=(unsigned char)(etowEve->clusterET[maxClusterID]*256.0/60.0);
481  etowEve->resultBlob.TowerID=(unsigned short)etowEve->clusterSeedTow[maxClusterID]+(etowEve->clusterQuad[maxClusterID]<<13);
482  etowEve->resultBlob.meanEtaBin=(unsigned char)((int)(etowEve->clusterEta[maxClusterID]*256.0/EtowGeom::mxEtaBin)%256);
483  etowEve->resultBlob.meanPhiBin=(unsigned char)((int)(etowEve->clusterPhi[maxClusterID]*256.0/EtowGeom::mxPhiBin)%256);
484  etowEve->resultBlob.isolationSum=(unsigned char)1;
485  etowEve->resultBlob.Time=(unsigned char)(mComputeTimeDiff[token]/1000);
486  etowEve->resultBlob.trigger=(unsigned char)5;
487  if (mRandomAccept) {//accept at random - never gets there for events below threshold, JanB
488  etowEve->resultBlob.trigger=(unsigned char)7;
489  }
490 
491  hA[9]->fill(etowEve->clusterQuad[maxClusterID]);
492  hA[10]->fill((int)etowEve->clusterET[maxClusterID]);
493  if(etowEve->size>= L2eemcGammaEvent2012::mxClust) mhN->fill(15);
494  mhN->fill(15);
495  memcpy(myL2Result,&(etowEve->resultBlob),sizeof(L2gammaResult2012));
496  return true;
497  }
498 
499  // never gets there for accepted events, JanB
500  if (mRandomAccept) {
501  etowEve->resultBlob.trigger=(unsigned char)6;
502  etowEve->resultBlob.Time=(unsigned char)(mComputeTimeDiff[token]/1000);
503  mhN->fill(16);
504  memcpy(myL2Result,&(etowEve->resultBlob),sizeof(L2gammaResult2012));
505  return false; //randomAccept is handled in the virtualAlgo, so return false here and let Virtual do the ||
506  }
507 
508  memcpy(myL2Result,&(etowEve->resultBlob),sizeof(L2gammaResult2012));
509  return false;
510 
511 }
512 
513 
514 /* ========================================
515  ======================================== */
516 void
517 L2eemcGamma2012::finishRunUser() { /* called once at the end of the run */
518  // do whatever you want, log-file & histo-file are still open
519 
520  if (mLogFile){
521  fprintf(mLogFile,"finishRunUser-%s bhla bhla\n",getName());
522  }
523 
524 }
525 
526 
527 //=======================================
528 //=======================================
529 void
530 L2eemcGamma2012::createHisto() {
531  setMaxHist(15); // PMN added - histogram count does not seem to be initialiazed anywere.
532  //memset(hA,0,sizeof(hA));
533 
534  hA[2]=new L2Histo(2,"ETOW-compute: #towers w/ energy /event; x: # ETOW towers; y: counts", 100);
535  hA[3]=new L2Histo(3,"ETOW-compute: #seed ....... ", 100); // title in initRun
536  hA[4]=new L2Histo(4,"ETOW-decision: #clust ....... ", 50); // title in initRun
537 
538  hA[5]=new L2Histo(5,"ETOW-decision: any cluster ; x: ET(GeV)", 30);
539  hA[6]=new L2Histo(6,"ETOW-decision: accepted clust ... ; x: ET(GeV)", 30);// title in initRun
540 
541  hA[7]=new L2Histo(7,"ETOW: Seed Tower Number", 5000); // title in initRun
542  hA[8]=new L2Histo(8,"ETOW: Seed Tower Rank", 20); // title in initRun
543  hA[9]=new L2Histo(9,"ETOW: Seed Tower Quadrant", 5); // title in initRun
544  hA[10]=new L2Histo(10,"ETOW: Cluster Et Sum GeV", 30); // title in initRun
545  hA[11]=new L2Histo(11,"ETOW: Cluster Seed Et GeV", 30); // title in initRun
546  hA[12]=new L2Histo(12,"ETOW: 10*Seed Et/Cluster Et GeV", 30); // title in initRun
547  hA[13]=new L2Histo(13,"ETOW: # non-zero towers per cluster", 5); // title in initRun
548 
549 }
550 
551 //=======================================
552 //=======================================
553 void
554 L2eemcGamma2012::clearEvent(int token){
555  memset(wrkEtow_et,0,sizeof(wrkEtow_et));
556  memset(etow_used,0,sizeof(etow_used));
557  memset(wrkEtow_tower_seed,0,sizeof(wrkEtow_tower_seed));
558  wrkEtow_tower_seed_size=0;
559  //etow_clusterET_size=0;
560  mEtow[token].size=0;
561  //previously the fresh flag was not set here, but now it is, since it was never being set anywhere else either.
562  mEtow[token].isFresh=L2eemcGammaEvent2012::kDataFresh;
563 // do not set 'fresh-flag here, only after compute() finishes
564  memset(&(mEtow[token].resultBlob),0, sizeof(L2gammaResult2012));
565 }
566 
567 /* ========================================
568  ======================================== */
569 void
570 L2eemcGamma2012::print2(){ // full , local ADC array
571  int i;
572  printf("pr2-%s: ---ETOW ADC 2D array, only non-zero\n",getName());
573 
574  for(i=0;i<mxEtow;i++) {
575  if(wrkEtow_et[i]<=0) continue;
576  int rdo=mTower2rdo[i];
577  float et=wrkEtow_et[i];
578  printf(" etow: tower=%4d rdo=%4d et=%.3f \n",i,rdo,et);
579  }
580 
581 }
582 
583 /* ========================================
584  ======================================== */
585 void
586 L2eemcGamma2012::print3(){ // seed list
587  int i;
588  printf("pr3-%s: ---seed list, size=%d\n",getName(),wrkEtow_tower_seed_size);
589 
590  for(i=0;i<wrkEtow_tower_seed_size;i++) {
591  int tower=wrkEtow_tower_seed[i];
592  float et=wrkEtow_et[tower];
593  printf(" etow: i=%4d tower=%4d et=%.3f \n",i,tower,et);
594  }
595 
596 }
597 
598 /* ========================================
599  ======================================== */
600 void
601 L2eemcGamma2012::print4(int token, int hitSize){ // L2-algo input list
602  int i;
603  printf("print4 IS NOT Fully FUNCTIONAL **********************\n");
604  printf("pr1-%s: ---ETOW Sorted ADC list--- size=%d\n",getName(),hitSize);
605  //const HitTower *hit=globEve_etow_hit;
606  for(i=0;i< hitSize;i++) {
607  int adc=0;//(mEveStream_etow[token].get_hits()[wrkEtow_tower_index[i]]).adc;
608  int rdo=0;//(mEveStream_etow[token].get_hits()[wrkEtow_tower_index[i]]).rdo;
609  float et=wrkEtow_et[wrkEtow_tower_index[i]];
610  float ene=0;//(mEveStream_etow[token].get_hits()[wrkEtow_tower_index[i]]).ene;
611  printf(" tower=%2d ",wrkEtow_tower_index[i]);
612  printf(" etow: i=%2d rdo=%4d adc=%d et=%.3f ene=%.3f\n",i,rdo,adc,et,ene);
613  }
614 }
615 
616 /**********************************************************************
617  $Log: L2eemcGamma2012.cxx,v $
618  Revision 1.4 2012/03/21 18:18:03 jml
619  got rid of printfs from 2012 files
620 
621  Revision 1.3 2011/10/19 16:12:11 jml
622  more 2012 stuff
623 
624  Revision 1.2 2011/10/19 15:39:43 jml
625  2012
626 
627  Revision 1.1 2011/10/18 15:11:42 jml
628  adding 2012 algorithms
629 
630  Revision 1.1 2011/03/09 16:29:07 pibero
631  Added L2gamma2009
632 
633  Revision 1.6 2008/01/30 21:56:40 balewski
634  E+B high-enery-filter L2-algo fuly functional
635 
636  Revision 1.5 2008/01/30 00:47:17 balewski
637  Added L2-Etow-calib
638 
639  Revision 1.4 2008/01/18 23:29:13 balewski
640  now L2result is exported
641 
642  Revision 1.3 2008/01/17 23:15:51 balewski
643  bug in token-addressed memory fixed
644 
645  Revision 1.2 2008/01/16 23:32:35 balewski
646  toward token dependent compute()
647 
648  Revision 1.1 2007/12/19 02:30:18 balewski
649  new L2-etow-calib-2008
650 
651 
652 
653 */
654 
655 
void computeUser(int token)