/[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.11 by pam-fi, Tue Jan 16 10:09:45 2007 UTC revision 1.12 by mocchiut, Mon Jan 22 09:16:59 2007 UTC
# Line 109  void CaloLevel2::Clear() {     Line 109  void CaloLevel2::Clear() {    
109    //    //
110    nstrip = 0;    nstrip = 0;
111    qtot = 0.;    qtot = 0.;
112    impx = 0.;    //  impx = 0.;
113    impy = 0.;    //  impy = 0.;
   tanx = 0.;  
   tany = 0.;  
114    qmax = 0.;    qmax = 0.;
115    nx22 = 0;    nx22 = 0;
116    qx22 = 0.;    qx22 = 0.;
# Line 122  void CaloLevel2::Clear() {     Line 120  void CaloLevel2::Clear() {    
120    memset(swerr, 0, 4*sizeof(Int_t));    memset(swerr, 0, 4*sizeof(Int_t));
121    memset(crc, 0, 4*sizeof(Int_t));    memset(crc, 0, 4*sizeof(Int_t));
122    memset(qq, 0, 4*sizeof(Int_t));    memset(qq, 0, 4*sizeof(Int_t));
123    memset(varcfit, 0, 2*sizeof(Float_t));    memset(varcfit, 0, 4*sizeof(Float_t));
124    memset(npcfit, 0, 2*sizeof(Int_t));    memset(npcfit, 0, 4*sizeof(Int_t));
125      memset(tanx, 0, 2*sizeof(Int_t));
126      memset(tany, 0, 2*sizeof(Int_t));
127      memset(fitmode, 0, 2*sizeof(Int_t));
128    memset(planemax, 0, 2*sizeof(Int_t));    memset(planemax, 0, 2*sizeof(Int_t));
129    memset(cibar, 0, 2*22*sizeof(Int_t));    memset(cibar, 0, 2*22*sizeof(Int_t));
130    memset(cbar, 0, 2*22*sizeof(Float_t));    memset(cbar, 0, 2*22*sizeof(Float_t));
# Line 154  void CaloLevel2::GetLevel2Struct(cCaloLe Line 155  void CaloLevel2::GetLevel2Struct(cCaloLe
155    l2->qtot = qtot;        l2->qtot = qtot;    
156    l2->qx22 = qx22;        l2->qx22 = qx22;    
157    l2->qmax = qmax;        l2->qmax = qmax;    
158    l2->impx = impx;        //  l2->impx = impx;    
159    l2->impy = impy;        //  l2->impy = impy;    
160    l2->tanx = tanx;        //  l2->tanx = tanx;    
161    l2->tany = tany;      //  l2->tany = tany;  
162    l2->elen = elen;          l2->elen = elen;      
163    l2->selen = selen;    l2->selen = selen;
164                    
# Line 210  void CaloLevel2::GetLevel2Struct(cCaloLe Line 211  void CaloLevel2::GetLevel2Struct(cCaloLe
211  }  }
212    
213  /**  /**
214     * Returns the impact position on the top of the calorimeter as determined by the calorimeter itself.
215     * @param tr : if tr = 0 use the calorimeter "normal" fit, if 1 use the calorimeter "selftrigger" fit (if any!)
216    **/
217    Float_t CaloLevel2::impx(Int_t tr){
218      if ( tr == 0 ) return(cbar[0][0]);
219      if ( tr == 1 ) {
220        if ( !CaloTrk ) return(-110.);
221        TClonesArray &t = *(CaloTrk);
222        for (Int_t itrk=0; itrk<ntrk(); itrk++){
223          CaloTrkVar *calotrack = (CaloTrkVar*)t[itrk];
224          if ( calotrack->trkseqno == -1 ) return(calotrack->tbar[0][0]);
225        };
226      };
227      if ( tr !=0 && tr !=1 ){
228        printf(" Cannot get impx for other than calo or selftrigger tracks!\n");
229      } else {
230        printf(" Cannot find selftrigger block\n");
231      };
232      return(-100.);
233    };
234    
235    /**
236     * Returns the impact position on the top of the calorimeter as determined by the calorimeter itself.
237     * @param tr : if tr = 0 use the calorimeter "normal" fit, if 1 use the calorimeter "selftrigger" fit (if any!)
238    **/
239    Float_t CaloLevel2::impy(Int_t tr){
240      if ( tr == 0 ) return(cbar[0][1]);
241      if ( tr == 1 ) {
242        if ( !CaloTrk ) return(-110.);
243        TClonesArray &t = *(CaloTrk);
244        for (Int_t itrk=0; itrk<ntrk(); itrk++){
245          CaloTrkVar *calotrack = (CaloTrkVar*)t[itrk];
246          if ( calotrack->trkseqno == -1 ) return(calotrack->tbar[0][1]);
247        };
248      };
249      if ( tr !=0 && tr !=1 ){
250        printf(" Cannot get impy for other than calo or selftrigger tracks!\n");
251      } else {
252        printf(" Cannot find selftrigger block\n");
253      };
254      return(-100.);
255    };
256    /**
257   * 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
258   * using a parametrization taken from Monte Carlo simulation   * using a parametrization taken from Monte Carlo simulation
259  **/  **/

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

  ViewVC Help
Powered by ViewVC 1.1.23