/[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.7 by mocchiut, Thu May 31 10:10:52 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 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];
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.;
# Line 151  void CaloNuclei::Process(Int_t ntr){ Line 157  void CaloNuclei::Process(Int_t ntr){
157    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);
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);  
     if ( ptrack ) 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 491  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      //      //

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

  ViewVC Help
Powered by ViewVC 1.1.23