/[PAMELA software]/calo/flight/CaloNuclei/src/CaloNuclei.cpp
ViewVC logotype

Diff of /calo/flight/CaloNuclei/src/CaloNuclei.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by mocchiut, Wed Apr 4 11:31:27 2007 UTC revision 1.4 by mocchiut, Thu Apr 5 13:38:32 2007 UTC
# Line 22  CaloNuclei::CaloNuclei(PamLevel2 *l2p){ Line 22  CaloNuclei::CaloNuclei(PamLevel2 *l2p){
22    N = 5;    N = 5;
23    R = 3;    R = 3;
24    //    //
25      debug = false;
26      //
27  };  };
28    
29  void CaloNuclei::Clear(){  void CaloNuclei::Clear(){
# Line 97  void CaloNuclei::Process(Int_t ntr){ Line 99  void CaloNuclei::Process(Int_t ntr){
99    //    //
100    tr = ntr;    tr = ntr;
101    //    //
102    //  printf(" Processing event at OBT %u PKT %u time %u \n",OBT,PKT,atime);    if ( debug ) printf(" Processing event at OBT %u PKT %u time %u \n",OBT,PKT,atime);
103    //    //
104    Clear();    Clear();
105    //    //
# Line 144  void CaloNuclei::Process(Int_t ntr){ Line 146  void CaloNuclei::Process(Int_t ntr){
146    //    //
147   retry:   retry:
148    //    //
149    //  printf("retry\n");    if ( debug ) printf("retry\n");
150    //    //
151    interplane = 0;    interplane = 0;
152    //    //
# Line 168  void CaloNuclei::Process(Int_t ntr){ Line 170  void CaloNuclei::Process(Int_t ntr){
170      if ( strip != -1 && mip > ethr && !wmulthit[view] && !wgap[view] &&      if ( strip != -1 && mip > ethr && !wmulthit[view] && !wgap[view] &&
171           ( strip == (track->GetCaloTrack()->tibar[plane][view]-1) || strip == (track->GetCaloTrack()->tibar[plane][view]-2) || strip == (track->GetCaloTrack()->tibar[plane][view]) )           ( strip == (track->GetCaloTrack()->tibar[plane][view]-1) || strip == (track->GetCaloTrack()->tibar[plane][view]-2) || strip == (track->GetCaloTrack()->tibar[plane][view]) )
172           && true ){                 && true ){      
173        //      printf(" inside loop: ii %i mip %f view %i plane %i strip %i tibar %i nhit %i splane %i sview %i \n",ii,mip,view,plane,strip,track->GetCaloTrack()->tibar[plane][view]-1,nhit[view],splane[view],sview[view]);        if ( debug ) printf(" inside loop: ii %i mip %f view %i plane %i strip %i tibar %i nhit %i splane %i sview %i \n",ii,mip,view,plane,strip,track->GetCaloTrack()->tibar[plane][view]-1,nhit[view],splane[view],sview[view]);
174        interpl[view] = plane;        interpl[view] = plane;
175        interv[view] = view;        interv[view] = view;
176        if ( splane[view] != plane || sview[view] != view ){        if ( splane[view] != plane || sview[view] != view ){
177          if ( nhit[view] > 1 ){          if ( nhit[view] > 1 ){
178            wmulthit[view] = true;            wmulthit[view] = true;
179              //      if ( splane[view] == -1 ) splane[view] = 0; //
180              //      if ( sview[view] == -1 ) sview[view] = view; //
181            interpl[view] = splane[view];            interpl[view] = splane[view];
182            interv[view] = sview[view];            interv[view] = sview[view];    
           //      ii = L2->GetCaloLevel1()->istrip;  
183          };          };
184          if ( plane > splane[view]+gapth ){          if ( plane > splane[view]+gapth ){
185            wgap[view] = true;            wgap[view] = true;
186              //      if ( splane[view] == -1 ) splane[view] = 0;//
187              //      if ( sview[view] == -1 ) sview[view] = view; //
188            interpl[view] = splane[view];            interpl[view] = splane[view];
189            interv[view] = sview[view];            interv[view] = sview[view];
           //      ii = L2->GetCaloLevel1()->istrip;  
190          };          };
191          splane[view] = plane;          splane[view] = plane;
192          sview[view] = view;          sview[view] = view;
# Line 196  void CaloNuclei::Process(Int_t ntr){ Line 200  void CaloNuclei::Process(Int_t ntr){
200      //          //    
201    };    };
202    //    //
203    //  printf("conversion interpl %i interv %i multhit %i interplane %i \n",interpl[0],interv[0],multhit,interplane);    if (debug ) printf("conversion interpl %i interv %i multhit %i interplane %i \n",interpl[0],interv[0],multhit,interplane);
204    Int_t winterplane[2] = {-1,-1};    Int_t winterplane[2] = {-1,-1};
205    //    //
206    for ( Int_t view = 0; view < 2; view++){    for ( Int_t view = 0; view < 2; view++){
# Line 235  void CaloNuclei::Process(Int_t ntr){ Line 239  void CaloNuclei::Process(Int_t ntr){
239      };      };
240    };    };
241    //      //  
242    //  printf("2conversion interpl %i interv %i multhit %i interplane %i \n",interpl[1],interv[1],multhit,interplane);    if ( debug ) printf("2conversion interpl %i interv %i multhit %i interplane %i \n",interpl[1],interv[1],multhit,interplane);
243    //  printf("3conversion winterpl0 %i winterpl1 %i \n",winterplane[0],winterplane[1]);    if ( debug ) printf("3conversion winterpl0 %i winterpl1 %i \n",winterplane[0],winterplane[1]);
244    //    //
245    Int_t ipl = 0;    Int_t ipl = 0;
246    if ( interplane > 0 ){    if ( interplane > 0 ){
# Line 274  void CaloNuclei::Process(Int_t ntr){ Line 278  void CaloNuclei::Process(Int_t ntr){
278                qsplane = plane;                qsplane = plane;
279                qsview = view;                qsview = view;
280                ind++;                ind++;
281                if ( ind > 199 ) printf(" AAAGH!! \n");                if ( debug && ind > 199 ) printf(" AAAGH!! \n");
282                qme[ind] = 0.;                qme[ind] = 0.;
283              };              };
284              qme[ind] += mip;              qme[ind] += mip;
# Line 286  void CaloNuclei::Process(Int_t ntr){ Line 290  void CaloNuclei::Process(Int_t ntr){
290                  qsplane2 = plane;                  qsplane2 = plane;
291                  qsview2 = view;                  qsview2 = view;
292                  ind2++;                  ind2++;
293                  if ( ind2 > 2112 ) printf(" AAAGH!! \n");                  if ( debug && ind2 > 2112 ) printf(" AAAGH!! \n");
294                  qme2[ind2] = 0.;                  qme2[ind2] = 0.;
295                };                };
296                qme2[ind2] += mip;                qme2[ind2] += mip;
# Line 302  void CaloNuclei::Process(Int_t ntr){ Line 306  void CaloNuclei::Process(Int_t ntr){
306      //      //
307      // here we must calculate qpremean, order vector qme, select 3 lowest measurements and caculate the mean...      // here we must calculate qpremean, order vector qme, select 3 lowest measurements and caculate the mean...
308      //          //    
309  //     for (Int_t l=0; l < interplane; l++){      if ( debug ){
310  //       printf(" qme[%i] = %f \n",l,qme[l]);          for (Int_t l=0; l < interplane; l++){
311  //     //       //      if ( qme[ind] < 6.25 ) qme[ind] = 10000.;                printf(" qme[%i] = %f \n",l,qme[l]);  
312  //     };        };
313        };
314        //
315      Long64_t work[200];      Long64_t work[200];
316      ind = 0;      ind = 0;
317      Int_t l = 0;      Int_t l = 0;
# Line 321  void CaloNuclei::Process(Int_t ntr){ Line 327  void CaloNuclei::Process(Int_t ntr){
327        if ( qm >= qmt ){        if ( qm >= qmt ){
328          if ( l < 3 ) qpremean += qm;          if ( l < 3 ) qpremean += qm;
329          l++;          l++;
330          //      printf(" value no %i qm %f qmt %f \n",l,qm,qmt);          if ( debug ) printf(" value no %i qm %f qmt %f \n",l,qm,qmt);
331        };        };
332        ind++;        ind++;
333      };      };
334      //      //
335        qpremean /= l;
336        //
337      ind = 0;      ind = 0;
338      l = 0;      l = 0;
339      while ( l < uplim && ind < interplane ){      while ( l < uplim && ind < interplane ){
# Line 333  void CaloNuclei::Process(Int_t ntr){ Line 341  void CaloNuclei::Process(Int_t ntr){
341        if ( qm2 >= qmt ){                if ( qm2 >= qmt ){        
342          if ( l < N ) qpremeanN += qm2;          if ( l < N ) qpremeanN += qm2;
343          l++;          l++;
344          //      printf(" value no %i qm %f qmt %f \n",l,qm,qmt);          if ( debug ) printf(" qm2 value no %i qm %f qmt %f \n",l,qm2,qmt);
345        };        };
346        ind++;        ind++;
347      };      };
348      //      //
349      qpremean /= l;      qpremeanN /= l;
     qpremeanN /= N;  
     //  
     //  printf(" charge is %f \n",sqrt(qpremean));  
350      //      //
351      //    printf("preq postq\n");          if ( debug ) printf(" charge is %f \n",sqrt(qpremean));
352      //      //
353      if ( mesethr != ethr && interplane >= 3 && !aldone ){      if ( mesethr != ethr && interplane >= 3 && !aldone ){
354        Float_t mesethr2 = (sqrt(qpremean) - 0.50)*(sqrt(qpremean) - 0.50);        Float_t mesethr2 = (sqrt(qpremean) - 0.50)*(sqrt(qpremean) - 0.50);
# Line 357  void CaloNuclei::Process(Int_t ntr){ Line 362  void CaloNuclei::Process(Int_t ntr){
362      };      };
363    };    };
364    //    //
365    //  printf(" esci \n");    if ( debug ) printf(" esci \n");
366    //    //
367  };  };

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

  ViewVC Help
Powered by ViewVC 1.1.23