/[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.6 by mocchiut, Wed May 30 11:36:30 2007 UTC revision 1.12 by mocchiut, Wed Mar 12 14:19:21 2008 UTC
# Line 29  CaloNuclei::CaloNuclei(PamLevel2 *l2p){ Line 29  CaloNuclei::CaloNuclei(PamLevel2 *l2p){
29    
30  void CaloNuclei::Clear(){  void CaloNuclei::Clear(){
31    //    //
32      UN = 0;
33    tr = 0;    tr = 0;
34    sntr = 0;    sntr = 0;
35    interplane = 0;    interplane = 0;
36    preq = 0.;    preq = 0.;
37    postq = 0.;    postq = 0.;
38      stdedx1 = 0.;
39      ethr = 0.;
40    dedx1 = 0.;    dedx1 = 0.;
41    dedx3 = 0.;    dedx3 = 0.;
42    qpremean = 0.;    qpremean = 0.;
# Line 106  void CaloNuclei::Process(Int_t ntr){ Line 109  void CaloNuclei::Process(Int_t ntr){
109    if ( debug ) 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);
110    //    //
111    Clear();    Clear();
112      //
113    if ( debug ) printf(" Always calculate stdedx1 \n");    if ( debug ) printf(" Always calculate stdedx1 \n");
114    //    //
115    // Always calculate stdedx1    // Always calculate stdedx1
# Line 138  void CaloNuclei::Process(Int_t ntr){ Line 142  void CaloNuclei::Process(Int_t ntr){
142    // find energy released along the strip of maximum on the first plane and on the two neighbour strips    // find energy released along the strip of maximum on the first plane and on the two neighbour strips
143    //    //
144    if ( indx > 0 ){    if ( indx > 0 ){
145      Int_t mindx = (Int_t)TMath::LocMax(indx,stfpl);      Int_t mindx = (Int_t)TMath::LocMax(indx,vfpl);
146      for (Int_t ii=0; ii<indx; ii++){      for (Int_t ii=0; ii<indx; ii++){
147        if ( stfpl[ii] == stfpl[mindx] ) stdedx1 += vfpl[ii];        if ( stfpl[ii] == stfpl[mindx] ) stdedx1 += vfpl[ii];
148        if ( (mindx-1)>=0 && stfpl[ii] == stfpl[mindx-1] ) stdedx1 += vfpl[ii];        if ( (mindx-1)>=0 && stfpl[ii] == stfpl[mindx-1] ) stdedx1 += vfpl[ii];
# Line 151  void CaloNuclei::Process(Int_t ntr){ Line 155  void CaloNuclei::Process(Int_t ntr){
155    if ( debug ) printf(" if ( !usetrack ) return: usetrack %i ntr %i \n",usetrack,ntr);    if ( debug ) printf(" if ( !usetrack ) return: usetrack %i ntr %i \n",usetrack,ntr);
156    //    //
157    //    //
158    if ( !usetrack ) return;    //  if ( !usetrack ) return;
159    //    //
160    PamTrack *ptrack = 0;    PamTrack *ptrack = 0;
161    CaloTrkVar *track = 0;    CaloTrkVar *track = 0;
   if ( ntr >= 0 ){  
     ptrack = L2->GetTrack(ntr);  
     if ( ptrack ) track = ptrack->GetCaloTrack();  
   } else {  
     track = L2->GetCaloStoredTrack(ntr);  
   };  
162    //    //
163    if ( !track && ntr >= 0 ){    if ( usetrack ){
164      printf(" ERROR: cannot find any track!\n");      if ( ntr >= 0 ){
165      printf(" ERROR: CaloNuclei variables not completely filled \n");        ptrack = L2->GetTrack(ntr);
166      return;          if ( ptrack ) track = ptrack->GetCaloTrack();
167        } else {
168          track = L2->GetCaloStoredTrack(ntr);
169        };
170        //
171        if ( !track && ntr >= 0 ){
172          printf(" ERROR: cannot find any track!\n");
173          printf(" ERROR: CaloNuclei variables not completely filled \n");
174          return;  
175        };
176      } else {
177        if ( ntr >= 0 ){
178          if ( debug ) printf(" ERROR: you asked not to use a track but you are looking for track number %i !\n",ntr);
179          if ( debug ) printf(" ERROR: CaloNuclei variables not completely filled \n");
180          return;      
181        };
182    };    };
183    //    //
184    //  Float_t defethr = 6. * 0.90;    //  Float_t defethr = 6. * 0.90;
# Line 491  void CaloNuclei::Process(Int_t ntr){ Line 504  void CaloNuclei::Process(Int_t ntr){
504      };      };
505      //      //
506      qpremeanN /= (Float_t)RN;      qpremeanN /= (Float_t)RN;
507        UN = RN;
508      //      //
509      if ( debug ) printf(" charge is %f \n",sqrt(qpremean));      if ( debug ) printf(" charge is %f \n",sqrt(qpremean));
510      //      //
# Line 502  void CaloNuclei::Process(Int_t ntr){ Line 516  void CaloNuclei::Process(Int_t ntr){
516          mesethr = mesethr2;          mesethr = mesethr2;
517        };        };
518        aldone = true;        aldone = true;
519        if ( mesethr > defethr ) goto retry;        if ( mesethr > defethr ){
520            interplane = 0;
521            preq = 0.;
522            postq = 0.;
523            qpremean = 0.;
524            qpremeanN = 0.;
525            multhit = false;
526            gap = false;
527            goto retry;
528          };
529      };      };
530    };    };
531    //    //

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.12

  ViewVC Help
Powered by ViewVC 1.1.23