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 |
// |
// |
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)); |
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)); |
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(){ |
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 |
|
|
225 |
pmt_id = (trk->pmtadc).At(i); |
pmt_id = (trk->pmtadc).At(i); |
226 |
// |
// |
227 |
GetPMTIndex(pmt_id,hh,kk); |
GetPMTIndex(pmt_id,hh,kk); |
228 |
adc[hh][kk] = (trk->dedx).At(i); |
adc[kk][hh] = (trk->dedx).At(i); |
229 |
// |
// |
230 |
}; |
}; |
231 |
// |
// |
235 |
// |
// |
236 |
GetPMTIndex(pmt->pmt_id,hh,kk); |
GetPMTIndex(pmt->pmt_id,hh,kk); |
237 |
// |
// |
238 |
tdc[hh][kk] = pmt->tdc_tw; |
tdc[kk][hh] = pmt->tdc_tw; |
239 |
// |
// |
240 |
}; |
}; |
241 |
// |
// |
306 |
}; |
}; |
307 |
|
|
308 |
|
|
309 |
void ToFLevel2::GetPMTIndex(Int_t ind, Int_t hb, Int_t ch){ |
void ToFLevel2::GetPMTIndex(Int_t ind, Int_t &hb, Int_t &ch){ |
310 |
// |
// |
311 |
short tof[4][24] = { |
short tof[4][24] = { |
312 |
{4, 4, 4, 4, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 2, 3, 3, 3, 3, 4}, |
{4, 4, 4, 4, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 2, 3, 3, 3, 3, 4}, |
319 |
while (k < 24){ |
while (k < 24){ |
320 |
Int_t j = 0; |
Int_t j = 0; |
321 |
while (j < 2){ |
while (j < 2){ |
322 |
|
/* tofEvent->tdc[ch][hb] */ |
|
/* tofEvent->tdc[ch][hb] */ |
|
|
|
|
323 |
if( ind == 2*k + j ){ |
if( ind == 2*k + j ){ |
324 |
ch = tof[2*j][k] - 1; |
ch = tof[2*j][k] - 1; |
325 |
hb = tof[2*j + 1][k] - 1; |
hb = tof[2*j + 1][k] - 1; |
326 |
break; |
return; |
327 |
}; |
}; |
328 |
j++; |
j++; |
329 |
}; |
}; |
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 |
|
} |