/[PAMELA software]/DarthVader/ToFLevel2/src/ToFLevel2.cpp
ViewVC logotype

Diff of /DarthVader/ToFLevel2/src/ToFLevel2.cpp

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

revision 1.5 by mocchiut, Fri Jul 14 14:06:16 2006 UTC revision 1.8 by mocchiut, Thu Nov 9 17:05:48 2006 UTC
# Line 76  ToFLevel2::ToFLevel2() {     Line 76  ToFLevel2::ToFLevel2() {    
76    PMT = new TClonesArray("ToFPMT",12);    PMT = new TClonesArray("ToFPMT",12);
77    ToFTrk = new TClonesArray("ToFTrkVar",2);    ToFTrk = new TClonesArray("ToFTrkVar",2);
78    //    //
79    memset(tof_j_flag, 0, 6*sizeof(Int_t));    this->Clear();
80      //
81  };  };
82    
83  void ToFLevel2::Clear(){  void ToFLevel2::Clear(){
# Line 84  void ToFLevel2::Clear(){ Line 85  void ToFLevel2::Clear(){
85    ToFTrk->Clear();    ToFTrk->Clear();
86    PMT->Clear();    PMT->Clear();
87    memset(tof_j_flag, 0, 6*sizeof(Int_t));    memset(tof_j_flag, 0, 6*sizeof(Int_t));
88      unpackError = 0;
89    //    //
90  };  };
91    
# Line 323  void ToFLevel2::GetPMTIndex(Int_t ind, I Line 325  void ToFLevel2::GetPMTIndex(Int_t ind, I
325    };    };
326    return;    return;
327  };  };
328    
329    /**
330     * Fills a struct cToFLevel2 with values from a ToFLevel2 object (to put data into a F77 common).
331     */
332    void ToFLevel2::GetLevel2Struct(cToFLevel2 *l2) const{
333    
334      for(Int_t i=0;i<6;i++)
335        l2->tof_j_flag[i]=tof_j_flag[i];
336    
337      l2->ntoftrk = ToFTrk->GetEntries();
338      for(Int_t j=0;j<l2->ntoftrk;j++){
339        l2->toftrkseqno[j]= ((ToFTrkVar*)ToFTrk->At(j))->trkseqno;
340        l2->npmttdc[j]= ((ToFTrkVar*)ToFTrk->At(j))->npmttdc;
341        for(Int_t i=0;i<l2->npmttdc[j];i++)
342          l2->pmttdc[i][j] = ((ToFTrkVar*)ToFTrk->At(j))->pmttdc.At(i);
343        for(Int_t i=0;i<13;i++)
344          l2->beta[i][j] = ((ToFTrkVar*)ToFTrk->At(j))->beta[i];
345    
346        l2->npmtadc[j]= ((ToFTrkVar*)ToFTrk->At(j))->npmtadc;
347        for(Int_t i=0;i<l2->npmtadc[j];i++){
348          l2->pmtadc[i][j] = ((ToFTrkVar*)ToFTrk->At(j))->pmtadc.At(i);
349          l2->dedx[i][j] = ((ToFTrkVar*)ToFTrk->At(j))->dedx.At(i);
350        }
351        for(Int_t i=0;i<3;i++){
352          l2->xtofpos[i][j]=((ToFTrkVar*)ToFTrk->At(j))->xtofpos[i];
353          l2->ytofpos[i][j]=((ToFTrkVar*)ToFTrk->At(j))->ytofpos[i];
354        }
355      }
356        
357      l2->npmt = PMT->GetEntries();
358       for(Int_t j=0;j<l2->npmt;j++){
359         l2->pmt_id[j] = ((ToFPMT*)PMT->At(j))->pmt_id;
360         l2->adc[j] =((ToFPMT*)PMT->At(j))->adc;
361         l2->tdc_tw[j] =((ToFPMT*)PMT->At(j))->tdc_tw;
362       }
363    }

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

  ViewVC Help
Powered by ViewVC 1.1.23