| 217 |
pmt_id = (trk->pmtadc).At(i); |
pmt_id = (trk->pmtadc).At(i); |
| 218 |
// |
// |
| 219 |
GetPMTIndex(pmt_id,hh,kk); |
GetPMTIndex(pmt_id,hh,kk); |
| 220 |
adc[hh][kk] = (trk->dedx).At(i); |
adc[kk][hh] = (trk->dedx).At(i); |
| 221 |
// |
// |
| 222 |
}; |
}; |
| 223 |
// |
// |
| 227 |
// |
// |
| 228 |
GetPMTIndex(pmt->pmt_id,hh,kk); |
GetPMTIndex(pmt->pmt_id,hh,kk); |
| 229 |
// |
// |
| 230 |
tdc[hh][kk] = pmt->tdc_tw; |
tdc[kk][hh] = pmt->tdc_tw; |
| 231 |
// |
// |
| 232 |
}; |
}; |
| 233 |
// |
// |
| 298 |
}; |
}; |
| 299 |
|
|
| 300 |
|
|
| 301 |
void ToFLevel2::GetPMTIndex(Int_t ind, Int_t hb, Int_t ch){ |
void ToFLevel2::GetPMTIndex(Int_t ind, Int_t &hb, Int_t &ch){ |
| 302 |
// |
// |
| 303 |
short tof[4][24] = { |
short tof[4][24] = { |
| 304 |
{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}, |
| 311 |
while (k < 24){ |
while (k < 24){ |
| 312 |
Int_t j = 0; |
Int_t j = 0; |
| 313 |
while (j < 2){ |
while (j < 2){ |
| 314 |
|
/* tofEvent->tdc[ch][hb] */ |
|
/* tofEvent->tdc[ch][hb] */ |
|
|
|
|
| 315 |
if( ind == 2*k + j ){ |
if( ind == 2*k + j ){ |
| 316 |
ch = tof[2*j][k] - 1; |
ch = tof[2*j][k] - 1; |
| 317 |
hb = tof[2*j + 1][k] - 1; |
hb = tof[2*j + 1][k] - 1; |
| 318 |
break; |
return; |
| 319 |
}; |
}; |
| 320 |
j++; |
j++; |
| 321 |
}; |
}; |
| 323 |
}; |
}; |
| 324 |
return; |
return; |
| 325 |
}; |
}; |
| 326 |
|
|
| 327 |
|
/** |
| 328 |
|
* Fills a struct cToFLevel2 with values from a ToFLevel2 object (to put data into a F77 common). |
| 329 |
|
*/ |
| 330 |
|
void ToFLevel2::GetLevel2Struct(cToFLevel2 *l2) const{ |
| 331 |
|
|
| 332 |
|
for(Int_t i=0;i<6;i++) |
| 333 |
|
l2->tof_j_flag[i]=tof_j_flag[i]; |
| 334 |
|
|
| 335 |
|
l2->ntoftrk = ToFTrk->GetEntries(); |
| 336 |
|
for(Int_t j=0;j<l2->ntoftrk;j++){ |
| 337 |
|
l2->toftrkseqno[j]= ((ToFTrkVar*)ToFTrk->At(j))->trkseqno; |
| 338 |
|
l2->npmttdc[j]= ((ToFTrkVar*)ToFTrk->At(j))->npmttdc; |
| 339 |
|
for(Int_t i=0;i<l2->npmttdc[j];i++) |
| 340 |
|
l2->pmttdc[i][j] = ((ToFTrkVar*)ToFTrk->At(j))->pmttdc.At(i); |
| 341 |
|
for(Int_t i=0;i<13;i++) |
| 342 |
|
l2->beta[i][j] = ((ToFTrkVar*)ToFTrk->At(j))->beta[i]; |
| 343 |
|
|
| 344 |
|
l2->npmtadc[j]= ((ToFTrkVar*)ToFTrk->At(j))->npmtadc; |
| 345 |
|
for(Int_t i=0;i<l2->npmtadc[j];i++){ |
| 346 |
|
l2->pmtadc[i][j] = ((ToFTrkVar*)ToFTrk->At(j))->pmtadc.At(i); |
| 347 |
|
l2->dedx[i][j] = ((ToFTrkVar*)ToFTrk->At(j))->dedx.At(i); |
| 348 |
|
} |
| 349 |
|
for(Int_t i=0;i<3;i++){ |
| 350 |
|
l2->xtofpos[i][j]=((ToFTrkVar*)ToFTrk->At(j))->xtofpos[i]; |
| 351 |
|
l2->ytofpos[i][j]=((ToFTrkVar*)ToFTrk->At(j))->ytofpos[i]; |
| 352 |
|
} |
| 353 |
|
} |
| 354 |
|
|
| 355 |
|
l2->npmt = PMT->GetEntries(); |
| 356 |
|
for(Int_t j=0;j<l2->npmt;j++){ |
| 357 |
|
l2->pmt_id[j] = ((ToFPMT*)PMT->At(j))->pmt_id; |
| 358 |
|
l2->adc[j] =((ToFPMT*)PMT->At(j))->adc; |
| 359 |
|
l2->tdc_tw[j] =((ToFPMT*)PMT->At(j))->tdc_tw; |
| 360 |
|
} |
| 361 |
|
} |