/[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.9 by mocchiut, Wed Nov 22 08:31:11 2006 UTC revision 1.10 by pam-fi, Thu Jan 11 09:32:54 2007 UTC
# Line 86  CaloTrkVar::CaloTrkVar(const CaloTrkVar Line 86  CaloTrkVar::CaloTrkVar(const CaloTrkVar
86  **/  **/
87  CaloLevel2::CaloLevel2() {      CaloLevel2::CaloLevel2() {    
88    //    //
89    CaloTrk = new TClonesArray("CaloTrkVar",1);  //  CaloTrk = new TClonesArray("CaloTrkVar",1); //ELENA
90      CaloTrk = 0; //ELENA
91    //    //
92    this->Clear();    this->Clear();
93    //    //
# Line 97  CaloLevel2::CaloLevel2() {     Line 98  CaloLevel2::CaloLevel2() {    
98   **/   **/
99  void CaloLevel2::Clear() {      void CaloLevel2::Clear() {    
100    //    //
101    CaloTrk->Clear();  //  CaloTrk->Clear(); //ELENA
102      if(CaloTrk)CaloTrk->Delete(); //ELENA
103    //    //
104    nstrip = 0;    nstrip = 0;
105    qtot = 0.;    qtot = 0.;
# Line 124  void CaloLevel2::Clear() {     Line 126  void CaloLevel2::Clear() {    
126    //    //
127  };  };
128    
129    /**
130     * Delete the CaloLevel2 object
131     **/
132    void CaloLevel2::Delete() {     //ELENA
133      if(CaloTrk){ //ELENA
134          CaloTrk->Delete(); //ELENA
135          delete CaloTrk; //ELENA
136      }     //ELENA
137    } //ELENA
138    
139  /**  /**
140   * Fills a struct cCaloLevel2 with values from a CaloLevel2 object (to put data into a F77 common).   * Fills a struct cCaloLevel2 with values from a CaloLevel2 object (to put data into a F77 common).
# Line 156  void CaloLevel2::GetLevel2Struct(cCaloLe Line 167  void CaloLevel2::GetLevel2Struct(cCaloLe
167      l2->qq[i] = qq[i];        l2->qq[i] = qq[i];  
168    }    }
169    
170    l2->calntrk = CaloTrk->GetEntries();    if(CaloTrk){ //ELENA
171            l2->calntrk = CaloTrk->GetEntries();  
172    for(Int_t i=0;i<l2->calntrk;i++){        for(Int_t i=0;i<l2->calntrk;i++){
173      l2->caltrkseqno[i] = ((CaloTrkVar *)CaloTrk->At(i))->trkseqno;              l2->caltrkseqno[i] = ((CaloTrkVar *)CaloTrk->At(i))->trkseqno;  
174      l2->ncore[i] = ((CaloTrkVar *)CaloTrk->At(i))->ncore;                l2->ncore[i] = ((CaloTrkVar *)CaloTrk->At(i))->ncore;    
175      l2->noint[i] = ((CaloTrkVar *)CaloTrk->At(i))->noint;                l2->noint[i] = ((CaloTrkVar *)CaloTrk->At(i))->noint;    
176      l2->ncyl[i] = ((CaloTrkVar *)CaloTrk->At(i))->ncyl;                  l2->ncyl[i] = ((CaloTrkVar *)CaloTrk->At(i))->ncyl;      
177      l2->nlast[i] = ((CaloTrkVar *)CaloTrk->At(i))->nlast;                l2->nlast[i] = ((CaloTrkVar *)CaloTrk->At(i))->nlast;    
178      l2->npre[i] = ((CaloTrkVar *)CaloTrk->At(i))->npre;                  l2->npre[i] = ((CaloTrkVar *)CaloTrk->At(i))->npre;      
179      l2->npresh[i] = ((CaloTrkVar *)CaloTrk->At(i))->npresh;                l2->npresh[i] = ((CaloTrkVar *)CaloTrk->At(i))->npresh;    
180      l2->ntr[i] = ((CaloTrkVar *)CaloTrk->At(i))->ntr;                  l2->ntr[i] = ((CaloTrkVar *)CaloTrk->At(i))->ntr;      
181      l2->planetot[i] = ((CaloTrkVar *)CaloTrk->At(i))->planetot;              l2->planetot[i] = ((CaloTrkVar *)CaloTrk->At(i))->planetot;  
182      l2->nlow[i] = ((CaloTrkVar *)CaloTrk->At(i))->nlow;                  l2->nlow[i] = ((CaloTrkVar *)CaloTrk->At(i))->nlow;      
183      l2->qcore[i] =((CaloTrkVar *)CaloTrk->At(i))->qcore ;              l2->qcore[i] =((CaloTrkVar *)CaloTrk->At(i))->qcore ;  
184      l2->qcyl[i] = ((CaloTrkVar *)CaloTrk->At(i))->qcyl;                l2->qcyl[i] = ((CaloTrkVar *)CaloTrk->At(i))->qcyl;    
185      l2->qlast[i] = ((CaloTrkVar *)CaloTrk->At(i))->qlast;              l2->qlast[i] = ((CaloTrkVar *)CaloTrk->At(i))->qlast;  
186      l2->qpre[i] = ((CaloTrkVar *)CaloTrk->At(i))->qpre;                l2->qpre[i] = ((CaloTrkVar *)CaloTrk->At(i))->qpre;    
187      l2->qpresh[i] = ((CaloTrkVar *)CaloTrk->At(i))->qpresh;              l2->qpresh[i] = ((CaloTrkVar *)CaloTrk->At(i))->qpresh;  
188      l2->qtr[i] = ((CaloTrkVar *)CaloTrk->At(i))->qtr;                l2->qtr[i] = ((CaloTrkVar *)CaloTrk->At(i))->qtr;    
189      l2->qtrack[i] = ((CaloTrkVar *)CaloTrk->At(i))->qtrack;              l2->qtrack[i] = ((CaloTrkVar *)CaloTrk->At(i))->qtrack;  
190      l2->qtrackx[i] = ((CaloTrkVar *)CaloTrk->At(i))->qtrackx;            l2->qtrackx[i] = ((CaloTrkVar *)CaloTrk->At(i))->qtrackx;
191      l2->qtracky[i] = ((CaloTrkVar *)CaloTrk->At(i))->qtracky;            l2->qtracky[i] = ((CaloTrkVar *)CaloTrk->At(i))->qtracky;
192      l2->dxtrack[i] = ((CaloTrkVar *)CaloTrk->At(i))->dxtrack;            l2->dxtrack[i] = ((CaloTrkVar *)CaloTrk->At(i))->dxtrack;
193      l2->dytrack[i] = ((CaloTrkVar *)CaloTrk->At(i))->dytrack;            l2->dytrack[i] = ((CaloTrkVar *)CaloTrk->At(i))->dytrack;
194      l2->qmean[i] = ((CaloTrkVar *)CaloTrk->At(i))->qmean;              l2->qmean[i] = ((CaloTrkVar *)CaloTrk->At(i))->qmean;  
195      l2->qlow[i] = ((CaloTrkVar *)CaloTrk->At(i))->qlow;                l2->qlow[i] = ((CaloTrkVar *)CaloTrk->At(i))->qlow;    
196      l2->dX0l[i] = ((CaloTrkVar *)CaloTrk->At(i))->dX0l;              l2->dX0l[i] = ((CaloTrkVar *)CaloTrk->At(i))->dX0l;  
197      for (Int_t j=0; j<2; j++){            for (Int_t j=0; j<2; j++){
198        for (Int_t k=0; k<22; k++){                for (Int_t k=0; k<22; k++){
199          l2->tbar[i][k][j] = ((CaloTrkVar *)CaloTrk->At(i))->tbar[k][j];                    l2->tbar[i][k][j] = ((CaloTrkVar *)CaloTrk->At(i))->tbar[k][j];
200        };                };
201      };            };
202    }          }  
203      } //ELENA
204  }  }
205    
206  /**  /**
# Line 214  CaloTrkVar *CaloLevel2::GetCaloTrkVar(In Line 225  CaloTrkVar *CaloLevel2::GetCaloTrkVar(In
225      printf("                   stored track related variables = %i \n",ntrk());      printf("                   stored track related variables = %i \n",ntrk());
226      return(NULL);      return(NULL);
227    }    }
228      if(!CaloTrk)return 0; //ELENA
229    TClonesArray &t = *(CaloTrk);    TClonesArray &t = *(CaloTrk);
230    CaloTrkVar *calotrack = (CaloTrkVar*)t[itrk];    CaloTrkVar *calotrack = (CaloTrkVar*)t[itrk];
231    return calotrack;    return calotrack;

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

  ViewVC Help
Powered by ViewVC 1.1.23