/[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.9 by mocchiut, Thu Nov 30 15:44:55 2006 UTC
# Line 32  ToFTrkVar::ToFTrkVar() { Line 32  ToFTrkVar::ToFTrkVar() {
32    npmtadc = 0;    npmtadc = 0;
33    pmttdc = TArrayI(48);    pmttdc = TArrayI(48);
34    pmtadc = TArrayI(48);    pmtadc = TArrayI(48);
35      tdcflag = TArrayI(48); // gf: 30 Nov 2006
36      adcflag = TArrayI(48); // gf: 30 Nov 2006
37    dedx = TArrayF(48);    dedx = TArrayF(48);
38    //    //
39    //    //
# Line 47  void ToFTrkVar::Clear() { Line 49  void ToFTrkVar::Clear() {
49    npmtadc = 0;    npmtadc = 0;
50    pmttdc.Reset();    pmttdc.Reset();
51    pmtadc.Reset();    pmtadc.Reset();
52      tdcflag.Reset(); // gf: 30 Nov 2006
53      adcflag.Reset(); // gf: 30 Nov 2006
54    dedx.Reset();    dedx.Reset();
55    //    //
56    memset(beta,  0, 13*sizeof(Float_t));    memset(beta,  0, 13*sizeof(Float_t));
# Line 63  ToFTrkVar::ToFTrkVar(const ToFTrkVar &t) Line 67  ToFTrkVar::ToFTrkVar(const ToFTrkVar &t)
67    npmtadc = t.npmtadc;    npmtadc = t.npmtadc;
68    (t.pmttdc).Copy(pmttdc);    (t.pmttdc).Copy(pmttdc);
69    (t.pmtadc).Copy(pmtadc);    (t.pmtadc).Copy(pmtadc);
70      (t.tdcflag).Copy(tdcflag); // gf: 30 Nov 2006
71      (t.adcflag).Copy(adcflag); // gf: 30 Nov 2006
72    (t.dedx).Copy(dedx);    (t.dedx).Copy(dedx);
73    //    //
74    memcpy(beta,t.beta,sizeof(beta));    memcpy(beta,t.beta,sizeof(beta));
# Line 76  ToFLevel2::ToFLevel2() {     Line 82  ToFLevel2::ToFLevel2() {    
82    PMT = new TClonesArray("ToFPMT",12);    PMT = new TClonesArray("ToFPMT",12);
83    ToFTrk = new TClonesArray("ToFTrkVar",2);    ToFTrk = new TClonesArray("ToFTrkVar",2);
84    //    //
85    memset(tof_j_flag, 0, 6*sizeof(Int_t));    this->Clear();
86      //
87  };  };
88    
89  void ToFLevel2::Clear(){  void ToFLevel2::Clear(){
# Line 84  void ToFLevel2::Clear(){ Line 91  void ToFLevel2::Clear(){
91    ToFTrk->Clear();    ToFTrk->Clear();
92    PMT->Clear();    PMT->Clear();
93    memset(tof_j_flag, 0, 6*sizeof(Int_t));    memset(tof_j_flag, 0, 6*sizeof(Int_t));
94      unpackError = 0;
95    //    //
96  };  };
97    
# Line 323  void ToFLevel2::GetPMTIndex(Int_t ind, I Line 331  void ToFLevel2::GetPMTIndex(Int_t ind, I
331    };    };
332    return;    return;
333  };  };
334    
335    /**
336     * Fills a struct cToFLevel2 with values from a ToFLevel2 object (to put data into a F77 common).
337     */
338    void ToFLevel2::GetLevel2Struct(cToFLevel2 *l2) const{
339    
340      for(Int_t i=0;i<6;i++)
341        l2->tof_j_flag[i]=tof_j_flag[i];
342    
343      l2->ntoftrk = ToFTrk->GetEntries();
344      for(Int_t j=0;j<l2->ntoftrk;j++){
345        l2->toftrkseqno[j]= ((ToFTrkVar*)ToFTrk->At(j))->trkseqno;
346        l2->npmttdc[j]= ((ToFTrkVar*)ToFTrk->At(j))->npmttdc;
347        for(Int_t i=0;i<l2->npmttdc[j];i++){
348          l2->pmttdc[i][j] = ((ToFTrkVar*)ToFTrk->At(j))->pmttdc.At(i);
349          l2->tdcflag[i][j] = ((ToFTrkVar*)ToFTrk->At(j))->tdcflag.At(i); // gf: 30 Nov 2006
350        }
351        for(Int_t i=0;i<13;i++)
352          l2->beta[i][j] = ((ToFTrkVar*)ToFTrk->At(j))->beta[i];
353        
354        l2->npmtadc[j]= ((ToFTrkVar*)ToFTrk->At(j))->npmtadc;
355        for(Int_t i=0;i<l2->npmtadc[j];i++){
356          l2->pmtadc[i][j] = ((ToFTrkVar*)ToFTrk->At(j))->pmtadc.At(i);
357          l2->adcflag[i][j] = ((ToFTrkVar*)ToFTrk->At(j))->adcflag.At(i); // gf: 30 Nov 2006
358          l2->dedx[i][j] = ((ToFTrkVar*)ToFTrk->At(j))->dedx.At(i);
359        }
360        for(Int_t i=0;i<3;i++){
361          l2->xtofpos[i][j]=((ToFTrkVar*)ToFTrk->At(j))->xtofpos[i];
362          l2->ytofpos[i][j]=((ToFTrkVar*)ToFTrk->At(j))->ytofpos[i];
363        }
364      }
365        
366      l2->npmt = PMT->GetEntries();
367       for(Int_t j=0;j<l2->npmt;j++){
368         l2->pmt_id[j] = ((ToFPMT*)PMT->At(j))->pmt_id;
369         l2->adc[j] =((ToFPMT*)PMT->At(j))->adc;
370         l2->tdc_tw[j] =((ToFPMT*)PMT->At(j))->tdc_tw;
371       }
372    }

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

  ViewVC Help
Powered by ViewVC 1.1.23