/[PAMELA software]/DarthVader/CalorimeterLevel2/src/CaloLevel2.cpp
ViewVC logotype

Diff of /DarthVader/CalorimeterLevel2/src/CaloLevel2.cpp

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

revision 1.12 by mocchiut, Mon Jan 22 09:16:59 2007 UTC revision 1.15 by mocchiut, Fri Nov 23 16:42:34 2007 UTC
# Line 15  ClassImp(CaloLevel2); Line 15  ClassImp(CaloLevel2);
15  **/  **/
16  CaloTrkVar::CaloTrkVar() {  CaloTrkVar::CaloTrkVar() {
17    this->Clear();    this->Clear();
18  };  }
19    
20  /**  /**
21   * Clear variables   * Clear variables
22  **/  **/
23  void CaloTrkVar::Clear() {  void CaloTrkVar::Clear(Option_t *t) {
24      //void CaloTrkVar::Clear() {
25    trkseqno = 0;    trkseqno = 0;
26    noint = 0;    noint = 0;
27    ncore = 0;    ncore = 0;
# Line 91  CaloLevel2::CaloLevel2() {     Line 92  CaloLevel2::CaloLevel2() {    
92    //    //
93    this->Clear();    this->Clear();
94    //    //
95  };  }
96  /**  /**
97   * Create the TClonesArray   * Create the TClonesArray
98  **/  **/
# Line 102  void CaloLevel2::Set(){//ELENA Line 103  void CaloLevel2::Set(){//ELENA
103  /**  /**
104   * Clear the CaloLevel2 object   * Clear the CaloLevel2 object
105   **/   **/
106  void CaloLevel2::Clear() {      void CaloLevel2::Clear(Option_t *t ) {    
107    //    //
108  //  CaloTrk->Clear(); //ELENA    //  CaloTrk->Clear(); //ELENA
109    if(CaloTrk)CaloTrk->Delete(); //ELENA    if(CaloTrk)CaloTrk->Delete(); //ELENA
110    //    //
111    nstrip = 0;    nstrip = 0;
# Line 126  void CaloLevel2::Clear() {     Line 127  void CaloLevel2::Clear() {    
127    memset(tany, 0, 2*sizeof(Int_t));    memset(tany, 0, 2*sizeof(Int_t));
128    memset(fitmode, 0, 2*sizeof(Int_t));    memset(fitmode, 0, 2*sizeof(Int_t));
129    memset(planemax, 0, 2*sizeof(Int_t));    memset(planemax, 0, 2*sizeof(Int_t));
130      memset(selfdelay, 0, 4*7*sizeof(Int_t));
131    memset(cibar, 0, 2*22*sizeof(Int_t));    memset(cibar, 0, 2*22*sizeof(Int_t));
132    memset(cbar, 0, 2*22*sizeof(Float_t));    memset(cbar, 0, 2*22*sizeof(Float_t));
133    good = 0;    good = 0;
134    selftrigger = 0;    selftrigger = 0;
135    //    //
136  };  }
137    
138  /**  /**
139   * Delete the CaloLevel2 object   * Delete the CaloLevel2 object
140   **/   **/
141  void CaloLevel2::Delete() {     //ELENA  void CaloLevel2::Delete(Option_t *t) {     //ELENA
142    if(CaloTrk){ //ELENA    if(CaloTrk){ //ELENA
143        CaloTrk->Delete(); //ELENA        CaloTrk->Delete(); //ELENA
144        delete CaloTrk; //ELENA        delete CaloTrk; //ELENA
# Line 230  Float_t CaloLevel2::impx(Int_t tr){ Line 232  Float_t CaloLevel2::impx(Int_t tr){
232      printf(" Cannot find selftrigger block\n");      printf(" Cannot find selftrigger block\n");
233    };    };
234    return(-100.);    return(-100.);
235  };  }
236    
237  /**  /**
238   * Returns the impact position on the top of the calorimeter as determined by the calorimeter itself.   * Returns the impact position on the top of the calorimeter as determined by the calorimeter itself.
# Line 252  Float_t CaloLevel2::impy(Int_t tr){ Line 254  Float_t CaloLevel2::impy(Int_t tr){
254      printf(" Cannot find selftrigger block\n");      printf(" Cannot find selftrigger block\n");
255    };    };
256    return(-100.);    return(-100.);
257  };  }
258  /**  /**
259   * Should return the energy in GeV if the particle would be an electron   * Should return the energy in GeV if the particle would be an electron
260   * using a parametrization taken from Monte Carlo simulation   * using a parametrization taken from Monte Carlo simulation
# Line 263  void CaloLevel2::GetElectronEnergy(Float Line 265  void CaloLevel2::GetElectronEnergy(Float
265    sigma = 0.;    sigma = 0.;
266    if ( energy > 0. ) sigma = energy * (0.01183 + 0.121/sqrt(energy));    if ( energy > 0. ) sigma = energy * (0.01183 + 0.121/sqrt(energy));
267    return;    return;
268  };  }
269    
270  /**  /**
271   * Returns pointer to the set of track-related variables "itrk"   * Returns pointer to the set of track-related variables "itrk"
# Line 280  CaloTrkVar *CaloLevel2::GetCaloTrkVar(In Line 282  CaloTrkVar *CaloLevel2::GetCaloTrkVar(In
282    CaloTrkVar *calotrack = (CaloTrkVar*)t[itrk];    CaloTrkVar *calotrack = (CaloTrkVar*)t[itrk];
283    return calotrack;    return calotrack;
284  }  }
285    
286    /**
287     * Retrieves the calorimeter track matching the seqno-th tracker stored track.
288     * (If seqno = -1 retrieves the self-trigger calorimeter track)
289     */
290    CaloTrkVar *CaloLevel2::GetCaloStoredTrack(int seqno){
291    
292      if( ntrk()==0 ){
293        printf("CaloLevel2::GetCaloStoredTrack(int) : requested tracker SeqNo %i but no Calorimeter tracks are stored\n",seqno);
294        return NULL;
295      };
296      
297      CaloTrkVar *c = 0;
298      Int_t it_calo=0;
299        
300      do {
301        c = GetCaloTrkVar(it_calo);
302        it_calo++;
303      } while( c && seqno != c->trkseqno && it_calo < ntrk());      
304      
305      if(!c || seqno != c->trkseqno){
306        c = 0;
307        if(seqno!=-1 && seqno !=-2 && seqno!=-3 ) printf("CaloLevel2::GetCaloStoredTrack(int) : requested tracker SeqNo %i does not match Calorimeter stored tracks\n",seqno);
308      };
309      return c;
310        
311    }

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

  ViewVC Help
Powered by ViewVC 1.1.23