/[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.5 by mocchiut, Thu May 24 07:50:48 2007 UTC revision 1.13 by mocchiut, Fri Mar 14 09:24:35 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 107  void CaloNuclei::Process(Int_t ntr){ Line 110  void CaloNuclei::Process(Int_t ntr){
110    //    //
111    Clear();    Clear();
112    //    //
113      if ( debug ) printf(" Always calculate stdedx1 \n");
114      //
115    // Always calculate stdedx1    // Always calculate stdedx1
116    //    //
117    Int_t view = 0;    Int_t view = 0;
# Line 132  void CaloNuclei::Process(Int_t ntr){ Line 137  void CaloNuclei::Process(Int_t ntr){
137      //      //
138    };    };
139    //    //
140      if ( debug ) printf(" find energy released along the strip of maximum on the first plane and on the two neighbour strips \n");
141      //
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];
149        if ( (mindx+1)<96 && stfpl[ii] == stfpl[mindx+1] ) stdedx1 += vfpl[ii];        if ( (mindx+1)<96 && stfpl[ii] == (stfpl[mindx]+1) ) stdedx1 += vfpl[ii];
150          //      if ( (mindx-1)>=0 && stfpl[ii] == stfpl[mindx-1] ) stdedx1 += vfpl[ii];
151          //      if ( (mindx+1)<96 && stfpl[ii] == stfpl[mindx+1] ) stdedx1 += vfpl[ii];
152      };      };
153    } else {    } else {
154      stdedx1 = 0.;      stdedx1 = 0.;
155    };    };
156    //    //
157      if ( debug ) printf(" if ( !usetrack ) return: usetrack %i ntr %i \n",usetrack,ntr);
158    //    //
159    //    //
160    if ( !usetrack ) return;    //  if ( !usetrack ) return;
161    //    //
162    PamTrack *ptrack = 0;    PamTrack *ptrack = 0;
163    CaloTrkVar *track = 0;    CaloTrkVar *track = 0;
   if ( ntr >= 0 ){  
     ptrack = L2->GetTrack(ntr);  
     track = ptrack->GetCaloTrack();  
   } else {  
     track = L2->GetCaloStoredTrack(ntr);  
   };  
164    //    //
165    if ( !track && ntr >= 0 ){    if ( usetrack ){
166      printf(" ERROR: cannot find any track!\n");      if ( ntr >= 0 ){
167      printf(" ERROR: CaloNuclei variables not completely filled \n");        ptrack = L2->GetTrack(ntr);
168      return;          if ( ptrack ) track = ptrack->GetCaloTrack();
169        } else {
170          track = L2->GetCaloStoredTrack(ntr);
171        };
172        //
173        if ( !track && ntr >= 0 ){
174          printf(" ERROR: cannot find any track!\n");
175          printf(" ERROR: CaloNuclei variables not completely filled \n");
176          return;  
177        };
178      } else {
179        if ( ntr >= 0 ){
180          if ( debug ) printf(" ERROR: you asked not to use a track but you are looking for track number %i !\n",ntr);
181          if ( debug ) printf(" ERROR: CaloNuclei variables not completely filled \n");
182          return;      
183        };
184    };    };
185    //    //
186    //  Float_t defethr = 6. * 0.90;    //  Float_t defethr = 6. * 0.90;
# Line 487  void CaloNuclei::Process(Int_t ntr){ Line 506  void CaloNuclei::Process(Int_t ntr){
506      };      };
507      //      //
508      qpremeanN /= (Float_t)RN;      qpremeanN /= (Float_t)RN;
509        UN = RN;
510      //      //
511      if ( debug ) printf(" charge is %f \n",sqrt(qpremean));      if ( debug ) printf(" charge is %f \n",sqrt(qpremean));
512      //      //
# Line 498  void CaloNuclei::Process(Int_t ntr){ Line 518  void CaloNuclei::Process(Int_t ntr){
518          mesethr = mesethr2;          mesethr = mesethr2;
519        };        };
520        aldone = true;        aldone = true;
521        if ( mesethr > defethr ) goto retry;        if ( mesethr > defethr ){
522            interplane = 0;
523            preq = 0.;
524            postq = 0.;
525            qpremean = 0.;
526            qpremeanN = 0.;
527            multhit = false;
528            gap = false;
529            goto retry;
530          };
531      };      };
532    };    };
533    //    //

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.13

  ViewVC Help
Powered by ViewVC 1.1.23