| 1 |
/** |
| 2 |
* \file ToFLevel2.cpp |
| 3 |
* \author Gianfranca DeRosa, Wolfgang Menn |
| 4 |
*/ |
| 5 |
|
| 6 |
#include <TObject.h> |
| 7 |
#include <ToFLevel2.h> |
| 8 |
#include <iostream> |
| 9 |
using namespace std; |
| 10 |
ClassImp(ToFPMT); |
| 11 |
ClassImp(ToFTrkVar); |
| 12 |
ClassImp(ToFLevel2); |
| 13 |
|
| 14 |
ToFPMT::ToFPMT(){ |
| 15 |
pmt_id = 0; |
| 16 |
adc = 0.; |
| 17 |
tdc_tw = 0.; |
| 18 |
tdc = 0.; |
| 19 |
} |
| 20 |
|
| 21 |
ToFPMT::ToFPMT(const ToFPMT &t){ |
| 22 |
pmt_id = t.pmt_id; |
| 23 |
adc = t.adc; |
| 24 |
tdc_tw = t.tdc_tw; |
| 25 |
tdc = t.tdc; |
| 26 |
} |
| 27 |
|
| 28 |
void ToFPMT::Clear(){ |
| 29 |
pmt_id = 0; |
| 30 |
adc = 0.; |
| 31 |
tdc_tw = 0.; |
| 32 |
tdc = 0.; |
| 33 |
} |
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
ToFTrkVar::ToFTrkVar() { |
| 38 |
trkseqno = 0; |
| 39 |
npmttdc = 0; |
| 40 |
npmtadc = 0; |
| 41 |
pmttdc = TArrayI(48); |
| 42 |
pmtadc = TArrayI(48); |
| 43 |
tdcflag = TArrayI(48); // gf: 30 Nov 2006 |
| 44 |
adcflag = TArrayI(48); // gf: 30 Nov 2006 |
| 45 |
dedx = TArrayF(48); |
| 46 |
// |
| 47 |
// |
| 48 |
memset(beta, 0, 13*sizeof(Float_t)); |
| 49 |
memset(xtofpos, 0, 3*sizeof(Float_t)); |
| 50 |
memset(ytofpos, 0, 3*sizeof(Float_t)); |
| 51 |
memset(xtr_tof, 0, 6*sizeof(Float_t)); |
| 52 |
memset(ytr_tof, 0, 6*sizeof(Float_t)); |
| 53 |
// |
| 54 |
}; |
| 55 |
|
| 56 |
void ToFTrkVar::Clear() { |
| 57 |
trkseqno = 0; |
| 58 |
npmttdc = 0; |
| 59 |
npmtadc = 0; |
| 60 |
pmttdc.Reset(); |
| 61 |
pmtadc.Reset(); |
| 62 |
tdcflag.Reset(); // gf: 30 Nov 2006 |
| 63 |
adcflag.Reset(); // gf: 30 Nov 2006 |
| 64 |
dedx.Reset(); |
| 65 |
// |
| 66 |
memset(beta, 0, 13*sizeof(Float_t)); |
| 67 |
memset(xtofpos, 0, 3*sizeof(Float_t)); |
| 68 |
memset(ytofpos, 0, 3*sizeof(Float_t)); |
| 69 |
memset(xtr_tof, 0, 6*sizeof(Float_t)); |
| 70 |
memset(ytr_tof, 0, 6*sizeof(Float_t)); |
| 71 |
// |
| 72 |
}; |
| 73 |
|
| 74 |
ToFTrkVar::ToFTrkVar(const ToFTrkVar &t){ |
| 75 |
|
| 76 |
trkseqno = t.trkseqno; |
| 77 |
// |
| 78 |
npmttdc = t.npmttdc; |
| 79 |
npmtadc = t.npmtadc; |
| 80 |
(t.pmttdc).Copy(pmttdc); |
| 81 |
(t.pmtadc).Copy(pmtadc); |
| 82 |
(t.tdcflag).Copy(tdcflag); // gf: 30 Nov 2006 |
| 83 |
(t.adcflag).Copy(adcflag); // gf: 30 Nov 2006 |
| 84 |
(t.dedx).Copy(dedx); |
| 85 |
// |
| 86 |
memcpy(beta,t.beta,sizeof(beta)); |
| 87 |
memcpy(xtofpos,t.xtofpos,sizeof(xtofpos)); |
| 88 |
memcpy(ytofpos,t.ytofpos,sizeof(ytofpos)); |
| 89 |
memcpy(xtr_tof,t.xtr_tof,sizeof(xtr_tof)); |
| 90 |
memcpy(ytr_tof,t.ytr_tof,sizeof(ytr_tof)); |
| 91 |
// |
| 92 |
}; |
| 93 |
|
| 94 |
ToFLevel2::ToFLevel2() { |
| 95 |
// |
| 96 |
// PMT = new TClonesArray("ToFPMT",12); //ELENA |
| 97 |
// ToFTrk = new TClonesArray("ToFTrkVar",2); //ELENA |
| 98 |
PMT = 0; //ELENA |
| 99 |
ToFTrk = 0; //ELENA |
| 100 |
// |
| 101 |
this->Clear(); |
| 102 |
// |
| 103 |
}; |
| 104 |
|
| 105 |
void ToFLevel2::Set(){//ELENA |
| 106 |
if(!PMT)PMT = new TClonesArray("ToFPMT",12); //ELENA |
| 107 |
if(!ToFTrk)ToFTrk = new TClonesArray("ToFTrkVar",2); //ELENA |
| 108 |
}//ELENA |
| 109 |
|
| 110 |
void ToFLevel2::Clear(){ |
| 111 |
// |
| 112 |
if(ToFTrk)ToFTrk->Delete(); //ELENA |
| 113 |
if(PMT)PMT->Delete(); //ELENA |
| 114 |
memset(tof_j_flag, 0, 6*sizeof(Int_t)); |
| 115 |
unpackError = 0; |
| 116 |
// |
| 117 |
}; |
| 118 |
|
| 119 |
void ToFLevel2::Delete(){ //ELENA |
| 120 |
// |
| 121 |
if(ToFTrk){ |
| 122 |
ToFTrk->Delete(); //ELENA |
| 123 |
delete ToFTrk; //ELENA |
| 124 |
} |
| 125 |
if(PMT){ |
| 126 |
PMT->Delete(); //ELENA |
| 127 |
delete PMT; //ELENA |
| 128 |
} //ELENA |
| 129 |
// |
| 130 |
}; //ELENA |
| 131 |
|
| 132 |
ToFTrkVar *ToFLevel2::GetToFTrkVar(Int_t itrk){ |
| 133 |
// |
| 134 |
if(itrk >= ntrk()){ |
| 135 |
printf(" ToFLevel2 ERROR: track related variables set %i does not exists! \n",itrk); |
| 136 |
printf(" stored track related variables = %i \n",ntrk()); |
| 137 |
return(NULL); |
| 138 |
} |
| 139 |
// |
| 140 |
if(!ToFTrk)return 0; //ELENA |
| 141 |
TClonesArray &t = *(ToFTrk); |
| 142 |
ToFTrkVar *toftrack = (ToFTrkVar*)t[itrk]; |
| 143 |
return toftrack; |
| 144 |
} |
| 145 |
|
| 146 |
ToFPMT *ToFLevel2::GetToFPMT(Int_t ihit){ |
| 147 |
// |
| 148 |
if(ihit >= npmt()){ |
| 149 |
printf(" ToFLevel2 ERROR: pmt variables set %i does not exists! \n",ihit); |
| 150 |
printf(" stored pmt variables = %i \n",npmt()); |
| 151 |
return(NULL); |
| 152 |
} |
| 153 |
// |
| 154 |
if(!PMT)return 0; //ELENA |
| 155 |
TClonesArray &t = *(PMT); |
| 156 |
ToFPMT *tofpmt = (ToFPMT*)t[ihit]; |
| 157 |
return tofpmt; |
| 158 |
} |
| 159 |
//-------------------------------------- |
| 160 |
// |
| 161 |
// |
| 162 |
//-------------------------------------- |
| 163 |
/** |
| 164 |
* Method to get the plane ID (11 12 21 22 31 32) from the plane index (0 1 2 3 4 5) |
| 165 |
* @param Plane index (0,1,2,3,4,5). |
| 166 |
*/ |
| 167 |
Int_t ToFLevel2::GetToFPlaneID(Int_t ip){ |
| 168 |
if(ip>=0 && ip<6)return 10*((int)(ip/2+1.1))+(ip%2)+1; |
| 169 |
else return -1; |
| 170 |
}; |
| 171 |
/** |
| 172 |
* Method to get the plane index (0 1 2 3 4 5) from the plane ID (11 12 21 22 31 32) |
| 173 |
* @param plane Plane ID (11, 12, 21, 22, 31, 32) |
| 174 |
*/ |
| 175 |
Int_t ToFLevel2::GetToFPlaneIndex(Int_t plane_id){ |
| 176 |
if( |
| 177 |
plane_id == 11 || |
| 178 |
plane_id == 12 || |
| 179 |
plane_id == 21 || |
| 180 |
plane_id == 22 || |
| 181 |
plane_id == 31 || |
| 182 |
plane_id == 32 || |
| 183 |
false)return (Int_t)(plane_id/10)*2-1- plane_id%2; |
| 184 |
else return -1; |
| 185 |
}; |
| 186 |
/** |
| 187 |
* Method to know if a given ToF paddle was hit, that is there is a TDC signal |
| 188 |
* from both PMTs. The method uses the "tof_j_flag" variable. |
| 189 |
* @param plane Plane ID (11, 12, 21, 22, 31, 32) or Plane index (0,1,2,3,4,5). |
| 190 |
* @param paddle_id Paddle ID. |
| 191 |
* @return 1 if the paddle was hit. |
| 192 |
*/ |
| 193 |
Bool_t ToFLevel2::HitPaddle(Int_t plane, Int_t paddle_id){ //<<< NEW |
| 194 |
Int_t ip = -1; |
| 195 |
if (plane>=6 ) ip = GetToFPlaneIndex(plane); |
| 196 |
else if(plane>=0 && plane < 6) ip = plane; |
| 197 |
Int_t flag=0; |
| 198 |
if(ip != -1)flag = tof_j_flag[ip] & (int)pow(2.,(double)paddle_id); |
| 199 |
if( |
| 200 |
(ip == 0 && paddle_id < 8 && flag) || |
| 201 |
(ip == 1 && paddle_id < 6 && flag) || |
| 202 |
(ip == 2 && paddle_id < 2 && flag) || |
| 203 |
(ip == 3 && paddle_id < 2 && flag) || |
| 204 |
(ip == 4 && paddle_id < 3 && flag) || |
| 205 |
(ip == 5 && paddle_id < 3 && flag) || |
| 206 |
false) return true; |
| 207 |
else return false; |
| 208 |
}; |
| 209 |
/** |
| 210 |
* Method to get the number of hit paddles on a ToF plane. |
| 211 |
* @param plane Plane ID (11, 12, 21, 22, 31, 32) or Plane index (0,1,2,3,4,5). |
| 212 |
*/ |
| 213 |
Int_t ToFLevel2::GetNHitPaddles(Int_t plane){ |
| 214 |
Int_t npad=0; |
| 215 |
for(Int_t i=0; i<8; i++)npad = npad + (int)HitPaddle(plane,i); |
| 216 |
return npad; |
| 217 |
}; |
| 218 |
|
| 219 |
|
| 220 |
//gf Apr 07 |
| 221 |
/** |
| 222 |
* Method to get the mean dEdx from a given ToF plane. This current version |
| 223 |
* is just summing up all PMT signals, which will not give proper results, |
| 224 |
* and needs a revision. |
| 225 |
* @param notrack Track Number |
| 226 |
* @param plane Plane index (0,1,2,3,4,5) |
| 227 |
* @param adcflag in the plane (100<-> independent of the adcflag; !=0&&!=100 <-> at least one PMT with adcflag!=0; ) |
| 228 |
*/ |
| 229 |
Float_t ToFLevel2::GetdEdx(Int_t notrack, Int_t plane, Int_t adcfl){ |
| 230 |
|
| 231 |
Float_t dedx = 0.; |
| 232 |
Float_t PadEdx =0.; |
| 233 |
Int_t SatWarning; |
| 234 |
Int_t pad=-1; |
| 235 |
// |
| 236 |
ToFTrkVar *trk = GetToFTrkVar(notrack); |
| 237 |
if(!trk) return 0; //ELENA |
| 238 |
// |
| 239 |
for (Int_t ii=0; ii<GetNPaddle(plane); ii++){ |
| 240 |
Int_t paddleid=ii; |
| 241 |
pad = GetPaddleid(plane,paddleid); |
| 242 |
GetdEdxPaddle(notrack, pad, adcfl, PadEdx, SatWarning); |
| 243 |
dedx += PadEdx; |
| 244 |
}; |
| 245 |
// |
| 246 |
return(dedx); |
| 247 |
}; |
| 248 |
|
| 249 |
/** |
| 250 |
* Method to fill the ADC_C 4x12 matrix with the dEdx values and the TDC 4x12 matrix |
| 251 |
* with the time-walk corrected TDC values. |
| 252 |
* @param notrack Track Number |
| 253 |
* @param adc ADC_C matrix with dEdx values |
| 254 |
* @param tdc TDC matrix |
| 255 |
*/ |
| 256 |
void ToFLevel2::GetMatrix(Int_t notrack, Float_t adc[4][12], Float_t tdc[4][12]){ |
| 257 |
// |
| 258 |
for (Int_t aa=0; aa<4;aa++){ |
| 259 |
for (Int_t bb=0; bb<12;bb++){ |
| 260 |
adc[aa][bb] = 1000.; |
| 261 |
tdc[aa][bb] = 4095.; |
| 262 |
}; |
| 263 |
}; |
| 264 |
// |
| 265 |
Int_t pmt_id = 0; |
| 266 |
Int_t hh = 0; |
| 267 |
Int_t kk = 0; |
| 268 |
// |
| 269 |
ToFTrkVar *trk = GetToFTrkVar(notrack); |
| 270 |
if(!trk)return; //ELENA |
| 271 |
// |
| 272 |
for (Int_t i=0; i<trk->npmtadc; i++){ |
| 273 |
// |
| 274 |
pmt_id = (trk->pmtadc).At(i); |
| 275 |
// |
| 276 |
GetPMTIndex(pmt_id,hh,kk); |
| 277 |
adc[kk][hh] = (trk->dedx).At(i); |
| 278 |
// |
| 279 |
}; |
| 280 |
// |
| 281 |
for (Int_t i=0; i<npmt(); i++){ |
| 282 |
// |
| 283 |
ToFPMT *pmt = GetToFPMT(i); |
| 284 |
if(!pmt)break; //ELENA |
| 285 |
// |
| 286 |
GetPMTIndex(pmt->pmt_id,hh,kk); |
| 287 |
// |
| 288 |
tdc[kk][hh] = pmt->tdc_tw; |
| 289 |
// |
| 290 |
}; |
| 291 |
// |
| 292 |
return; |
| 293 |
}; |
| 294 |
|
| 295 |
|
| 296 |
/** |
| 297 |
* Method to get the plane index (0 - 5) for the PMT_ID as input |
| 298 |
* @param pmt_id PMT_ID (0 - 47) |
| 299 |
*/ |
| 300 |
Int_t ToFLevel2::GetPlaneIndex(Int_t pmt_id){ |
| 301 |
TString pmtname = GetPMTName(pmt_id); |
| 302 |
pmtname.Resize(3); |
| 303 |
if ( !strcmp(pmtname,"S11") ) return(0); |
| 304 |
if ( !strcmp(pmtname,"S12") ) return(1); |
| 305 |
if ( !strcmp(pmtname,"S21") ) return(2); |
| 306 |
if ( !strcmp(pmtname,"S22") ) return(3); |
| 307 |
if ( !strcmp(pmtname,"S31") ) return(4); |
| 308 |
if ( !strcmp(pmtname,"S32") ) return(5); |
| 309 |
return(-1); |
| 310 |
}; |
| 311 |
|
| 312 |
|
| 313 |
/** |
| 314 |
* Method to get the PMT_ID if the index (4,12) is given. We have 4 channels on |
| 315 |
* each of the 12 half-boards, this method decodes which PMT is cables to which |
| 316 |
* channel. |
| 317 |
* @param hh Channel |
| 318 |
* @param kk HalfBoard |
| 319 |
*/ |
| 320 |
Int_t ToFLevel2::GetPMTid(Int_t hh, Int_t kk){ |
| 321 |
// |
| 322 |
short tof[4][24] = { |
| 323 |
{4, 4, 4, 4, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 2, 3, 3, 3, 3, 4}, |
| 324 |
{1, 3, 5, 7, 10, 12, 2, 4, 2, 4, 6, 8, 10, 12, 1, 5, 3, 9, 7, 9, 11, 1, 5, 9}, |
| 325 |
{2, 2, 2, 2, 1, 1, 1, 1, 4, 4, 4, 4, 4, 4, 2, 1, 2, 1, 2, 2, 2, 3, 3, 4}, |
| 326 |
{6, 8, 12, 10, 8, 6, 4, 2, 12, 10, 8, 6, 4, 2, 9, 7, 11, 11, 5, 3, 1, 3, 7, 11} |
| 327 |
}; |
| 328 |
// |
| 329 |
Int_t ind = 0; |
| 330 |
Int_t k = 0; |
| 331 |
while (k < 24){ |
| 332 |
Int_t j = 0; |
| 333 |
while (j < 2){ |
| 334 |
Int_t ch = tof[2*j][k] - 1; |
| 335 |
Int_t hb = tof[2*j + 1][k] - 1; |
| 336 |
/* tofEvent->tdc[ch][hb] */ |
| 337 |
if( ch == hh && hb == kk ){ |
| 338 |
ind = 2*k + j; |
| 339 |
break; |
| 340 |
}; |
| 341 |
j++; |
| 342 |
}; |
| 343 |
k++; |
| 344 |
}; |
| 345 |
return ind; |
| 346 |
}; |
| 347 |
|
| 348 |
|
| 349 |
/** |
| 350 |
* Method to get the PMT index if the PMT ID is given. This method is the |
| 351 |
* "reverse" of method "GetPMTid" |
| 352 |
* @param ind PMT_ID (0 - 47) |
| 353 |
* @param hb HalfBoard |
| 354 |
* @param ch Channel |
| 355 |
*/ |
| 356 |
void ToFLevel2::GetPMTIndex(Int_t ind, Int_t &hb, Int_t &ch){ |
| 357 |
// |
| 358 |
short tof[4][24] = { |
| 359 |
{4, 4, 4, 4, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 2, 3, 3, 3, 3, 4}, |
| 360 |
{1, 3, 5, 7, 10, 12, 2, 4, 2, 4, 6, 8, 10, 12, 1, 5, 3, 9, 7, 9, 11, 1, 5, 9}, |
| 361 |
{2, 2, 2, 2, 1, 1, 1, 1, 4, 4, 4, 4, 4, 4, 2, 1, 2, 1, 2, 2, 2, 3, 3, 4}, |
| 362 |
{6, 8, 12, 10, 8, 6, 4, 2, 12, 10, 8, 6, 4, 2, 9, 7, 11, 11, 5, 3, 1, 3, 7, 11} |
| 363 |
}; |
| 364 |
// |
| 365 |
Int_t k = 0; |
| 366 |
while (k < 24){ |
| 367 |
Int_t j = 0; |
| 368 |
while (j < 2){ |
| 369 |
/* tofEvent->tdc[ch][hb] */ |
| 370 |
if( ind == 2*k + j ){ |
| 371 |
ch = tof[2*j][k] - 1; |
| 372 |
hb = tof[2*j + 1][k] - 1; |
| 373 |
return; |
| 374 |
}; |
| 375 |
j++; |
| 376 |
}; |
| 377 |
k++; |
| 378 |
}; |
| 379 |
return; |
| 380 |
}; |
| 381 |
|
| 382 |
|
| 383 |
|
| 384 |
|
| 385 |
/// gf Apr 07 |
| 386 |
|
| 387 |
/** |
| 388 |
* Method to get the dEdx from a given ToF paddle. |
| 389 |
* @param notrack Track Number |
| 390 |
* @param Paddle index (0,1,...,23). |
| 391 |
* @param adcflag in the paddle (100<-> independent of the adcflag; !=0&&!=100 <-> at least one PMT with adcflag!=0; ) |
| 392 |
* @param PadEdx dEdx from a given ToF paddle |
| 393 |
* @param SatWarning 1 if the PMT ios near saturation region (adcraw ~3000) |
| 394 |
*/ |
| 395 |
void ToFLevel2::GetdEdxPaddle(Int_t notrack, Int_t paddleid, Int_t adcfl, Float_t &PadEdx, Int_t &SatWarning){ |
| 396 |
|
| 397 |
PadEdx = 0.; |
| 398 |
SatWarning = 1000; |
| 399 |
|
| 400 |
Float_t dEdx[48] = {0}; |
| 401 |
Int_t pmt_id = -1; |
| 402 |
Float_t adcraw[48]; |
| 403 |
// |
| 404 |
ToFTrkVar *trk = GetToFTrkVar(notrack); |
| 405 |
if(!trk) return; //ELENA |
| 406 |
// |
| 407 |
|
| 408 |
Int_t pmtleft=-1; |
| 409 |
Int_t pmtright=-1; |
| 410 |
GetPaddlePMT(paddleid, pmtleft, pmtright); |
| 411 |
|
| 412 |
adcraw[pmtleft] = 4095; |
| 413 |
adcraw[pmtright] = 4095; |
| 414 |
|
| 415 |
|
| 416 |
for (Int_t jj=0; jj<npmt(); jj++){ |
| 417 |
|
| 418 |
ToFPMT *pmt = GetToFPMT(jj); |
| 419 |
if(!pmt)break; //ELENA |
| 420 |
|
| 421 |
pmt_id = pmt->pmt_id; |
| 422 |
if(pmt_id==pmtleft){ |
| 423 |
adcraw[pmtleft] = pmt->adc; |
| 424 |
} |
| 425 |
|
| 426 |
if(pmt_id==pmtright){ |
| 427 |
adcraw[pmtright] = pmt->adc; |
| 428 |
} |
| 429 |
} |
| 430 |
|
| 431 |
for (Int_t i=0; i<trk->npmtadc; i++){ |
| 432 |
|
| 433 |
if((trk->adcflag).At(i)==0 || adcfl==100){ |
| 434 |
if((trk->pmtadc).At(i) == pmtleft)dEdx[pmtleft] = (trk->dedx).At(i); |
| 435 |
if((trk->pmtadc).At(i) == pmtright)dEdx[pmtright] = (trk->dedx).At(i); |
| 436 |
}else{ |
| 437 |
if((trk->pmtadc).At(i) == pmtleft)dEdx[pmtleft] = 0.; |
| 438 |
if((trk->pmtadc).At(i) == pmtright)dEdx[pmtright] = 0.; |
| 439 |
} |
| 440 |
} |
| 441 |
|
| 442 |
if( adcraw[pmtleft] >3000 || adcraw[pmtright] >3000)SatWarning=1; |
| 443 |
|
| 444 |
if(dEdx[pmtleft]!=0 && dEdx[pmtright]!=0){ |
| 445 |
PadEdx = (dEdx[pmtleft]+dEdx[pmtright])*0.5; |
| 446 |
} |
| 447 |
if(dEdx[pmtleft]==0 && dEdx[pmtright]!=0){ |
| 448 |
PadEdx = dEdx[pmtright]; |
| 449 |
} |
| 450 |
if(dEdx[pmtleft]!=0 && dEdx[pmtright]==0){ |
| 451 |
PadEdx = dEdx[pmtleft]; |
| 452 |
} |
| 453 |
|
| 454 |
return; |
| 455 |
}; |
| 456 |
// |
| 457 |
|
| 458 |
|
| 459 |
// gf Apr 07 |
| 460 |
|
| 461 |
/** |
| 462 |
* Method to get the PMT name (like "S11_1A") if the PMT_ID is given. |
| 463 |
* Indexes of corresponding plane, paddle and pmt are also given as output. |
| 464 |
* @param ind PMT_ID (0 - 47) |
| 465 |
* @param iplane plane index (0 - 5) |
| 466 |
* @param ipaddle paddle index (relative to the plane) |
| 467 |
* @param ipmt pmt index (0(A), 1(B)) |
| 468 |
*/ |
| 469 |
TString ToFLevel2::GetPMTName(Int_t ind, Int_t &iplane, Int_t &ipaddle,Int_t &ipmt){ |
| 470 |
|
| 471 |
TString pmtname = " "; |
| 472 |
|
| 473 |
TString photoS[48] = { |
| 474 |
"S11_1A", "S11_1B", "S11_2A", "S11_2B", "S11_3A", "S11_3B", "S11_4A", |
| 475 |
"S11_4B", |
| 476 |
"S11_5A", "S11_5B", "S11_6A", "S11_6B", "S11_7A", "S11_7B", "S11_8A", |
| 477 |
"S11_8B", |
| 478 |
"S12_1A", "S12_1B", "S12_2A", "S12_2B", "S12_3A", "S12_3B", "S12_4A", |
| 479 |
"S12_4B", "S12_5A", "S12_5B", "S12_6A", "S12_6B", |
| 480 |
"S21_1A", "S21_1B", "S21_2A", "S21_2B", |
| 481 |
"S22_1A", "S22_1B", "S22_2A", "S22_2B", |
| 482 |
"S31_1A", "S31_1B", "S31_2A", "S31_2B", "S31_3A", "S31_3B", |
| 483 |
"S32_1A", "S32_1B", "S32_2A", "S32_2B", "S32_3A", "S32_3B" |
| 484 |
}; |
| 485 |
|
| 486 |
|
| 487 |
pmtname = photoS[ind].Data(); |
| 488 |
|
| 489 |
TString ss = pmtname(1,2); |
| 490 |
iplane = (int)(atoi(ss.Data())/10)*2-3+atoi(ss.Data())%10; |
| 491 |
ss = pmtname(4); |
| 492 |
ipaddle = atoi(ss.Data())-1 ; |
| 493 |
if( pmtname.Contains("A") )ipmt=0; |
| 494 |
if( pmtname.Contains("B") )ipmt=1; |
| 495 |
|
| 496 |
return pmtname; |
| 497 |
}; |
| 498 |
/** |
| 499 |
* Method to get the PMT name (like "S11_1A") if the PMT_ID is given |
| 500 |
* @param ind PMT_ID (0 - 47) |
| 501 |
*/ |
| 502 |
TString ToFLevel2::GetPMTName(Int_t ind){ |
| 503 |
|
| 504 |
Int_t iplane = -1; |
| 505 |
Int_t ipaddle = -1; |
| 506 |
Int_t ipmt = -1; |
| 507 |
return GetPMTName(ind,iplane,ipaddle,ipmt); |
| 508 |
|
| 509 |
}; |
| 510 |
|
| 511 |
|
| 512 |
// gf Apr 07 |
| 513 |
Int_t ToFLevel2::GetPaddleIdOfTrack(Float_t xtr, Float_t ytr, Int_t plane){ |
| 514 |
|
| 515 |
Double_t xt,yt,xl,xh,yl,yh; |
| 516 |
|
| 517 |
Float_t tof11_x[8] = {-17.85,-12.75,-7.65,-2.55,2.55,7.65,12.75,17.85}; |
| 518 |
Float_t tof12_y[6] = { -13.75,-8.25,-2.75,2.75,8.25,13.75}; |
| 519 |
Float_t tof21_y[2] = { 3.75,-3.75}; |
| 520 |
Float_t tof22_x[2] = { -4.5,4.5}; |
| 521 |
Float_t tof31_x[3] = { -6.0,0.,6.0}; |
| 522 |
Float_t tof32_y[3] = { -5.0,0.0,5.0}; |
| 523 |
|
| 524 |
// S11 8 paddles 33.0 x 5.1 cm |
| 525 |
// S12 6 paddles 40.8 x 5.5 cm |
| 526 |
// S21 2 paddles 18.0 x 7.5 cm |
| 527 |
// S22 2 paddles 15.0 x 9.0 cm |
| 528 |
// S31 3 paddles 15.0 x 6.0 cm |
| 529 |
// S32 3 paddles 18.0 x 5.0 cm |
| 530 |
|
| 531 |
Int_t paddleidoftrack=-1; |
| 532 |
// |
| 533 |
|
| 534 |
//--- S11 ------ |
| 535 |
|
| 536 |
if(plane==0){ |
| 537 |
xt = xtr; |
| 538 |
yt = ytr; |
| 539 |
paddleidoftrack=-1; |
| 540 |
yl = -33.0/2. ; |
| 541 |
yh = 33.0/2. ; |
| 542 |
if ((yt>yl)&&(yt<yh)) { |
| 543 |
for (Int_t i1=0; i1<8;i1++){ |
| 544 |
xl = tof11_x[i1] - (5.1-0.4)/2. ; |
| 545 |
xh = tof11_x[i1] + (5.1-0.4)/2. ; |
| 546 |
if ((xt>xl)&&(xt<xh)) paddleidoftrack=i1; |
| 547 |
} |
| 548 |
} |
| 549 |
} |
| 550 |
// cout<<"S11 "<<paddleidoftrack[0]<<"\n"; |
| 551 |
|
| 552 |
//--- S12 ------- |
| 553 |
if(plane==1){ |
| 554 |
xt = xtr; |
| 555 |
yt = ytr; |
| 556 |
paddleidoftrack=-1; |
| 557 |
xl = -40.8/2. ; |
| 558 |
xh = 40.8/2. ; |
| 559 |
|
| 560 |
if ((xt>xl)&&(xt<xh)) { |
| 561 |
for (Int_t i1=0; i1<6;i1++){ |
| 562 |
yl = tof12_y[i1] - (5.5-0.4)/2. ; |
| 563 |
yh = tof12_y[i1] + (5.5-0.4)/2. ; |
| 564 |
if ((yt>yl)&&(yt<yh)) paddleidoftrack=i1; |
| 565 |
} |
| 566 |
} |
| 567 |
} |
| 568 |
|
| 569 |
//--- S21 ------ |
| 570 |
|
| 571 |
if(plane==2){ |
| 572 |
xt = xtr; |
| 573 |
yt = ytr; |
| 574 |
paddleidoftrack=-1; |
| 575 |
xl = -18./2. ; |
| 576 |
xh = 18./2. ; |
| 577 |
|
| 578 |
if ((xt>xl)&&(xt<xh)) { |
| 579 |
for (Int_t i1=0; i1<2;i1++){ |
| 580 |
yl = tof21_y[i1] - (7.5-0.4)/2. ; |
| 581 |
yh = tof21_y[i1] + (7.5-0.4)/2. ; |
| 582 |
if ((yt>yl)&&(yt<yh)) paddleidoftrack=i1; |
| 583 |
} |
| 584 |
} |
| 585 |
} |
| 586 |
|
| 587 |
//--- S22 ------ |
| 588 |
if(plane==3){ |
| 589 |
xt = xtr; |
| 590 |
yt = ytr; |
| 591 |
paddleidoftrack=-1; |
| 592 |
yl = -15./2. ; |
| 593 |
yh = 15./2. ; |
| 594 |
|
| 595 |
if ((yt>yl)&&(yt<yh)) { |
| 596 |
for (Int_t i1=0; i1<2;i1++){ |
| 597 |
xl = tof22_x[i1] - (9.0-0.4)/2. ; |
| 598 |
xh = tof22_x[i1] + (9.0-0.4)/2. ; |
| 599 |
if ((xt>xl)&&(xt<xh)) paddleidoftrack=i1; |
| 600 |
} |
| 601 |
} |
| 602 |
} |
| 603 |
|
| 604 |
//--- S31 ------ |
| 605 |
if(plane==4){ |
| 606 |
xt = xtr; |
| 607 |
yt = ytr; |
| 608 |
paddleidoftrack=-1; |
| 609 |
yl = -15.0/2. ; |
| 610 |
yh = 15.0/2. ; |
| 611 |
|
| 612 |
if ((yt>yl)&&(yt<yh)) { |
| 613 |
for (Int_t i1=0; i1<3;i1++){ |
| 614 |
xl = tof31_x[i1] - (6.0-0.4)/2. ; |
| 615 |
xh = tof31_x[i1] + (6.0-0.4)/2. ; |
| 616 |
if ((xt>xl)&&(xt<xh)) paddleidoftrack=i1; |
| 617 |
} |
| 618 |
} |
| 619 |
} |
| 620 |
|
| 621 |
//--- S32 ------ |
| 622 |
if(plane==5){ |
| 623 |
xt = xtr; |
| 624 |
yt = ytr; |
| 625 |
paddleidoftrack=-1; |
| 626 |
xl = -18.0/2. ; |
| 627 |
xh = 18.0/2. ; |
| 628 |
|
| 629 |
if ((xt>xl)&&(xt<xh)) { |
| 630 |
for (Int_t i1=0; i1<3;i1++){ |
| 631 |
yl = tof32_y[i1] - (5.0-0.4)/2. ; |
| 632 |
yh = tof32_y[i1] + (5.0-0.4)/2. ; |
| 633 |
if ((yt>yl)&&(yt<yh)) paddleidoftrack=i1; |
| 634 |
} |
| 635 |
} |
| 636 |
} |
| 637 |
|
| 638 |
return paddleidoftrack; |
| 639 |
|
| 640 |
} |
| 641 |
|
| 642 |
// |
| 643 |
|
| 644 |
// gf Apr 07 |
| 645 |
|
| 646 |
void ToFLevel2::GetPMTPaddle(Int_t pmt_id, Int_t &plane, Int_t &paddle){ |
| 647 |
|
| 648 |
plane = GetPlaneIndex(pmt_id); |
| 649 |
|
| 650 |
if(plane == 0){ |
| 651 |
if(pmt_id==0 || pmt_id==1)paddle=0; |
| 652 |
if(pmt_id==2 || pmt_id==3)paddle=1; |
| 653 |
if(pmt_id==4 || pmt_id==5)paddle=2; |
| 654 |
if(pmt_id==6 || pmt_id==7)paddle=3; |
| 655 |
if(pmt_id==8 || pmt_id==9)paddle=4; |
| 656 |
if(pmt_id==10 || pmt_id==11)paddle=5; |
| 657 |
if(pmt_id==12 || pmt_id==13)paddle=6; |
| 658 |
if(pmt_id==14 || pmt_id==15)paddle=7; |
| 659 |
} |
| 660 |
|
| 661 |
if(plane == 1){ |
| 662 |
if(pmt_id==16 || pmt_id==17)paddle=0; |
| 663 |
if(pmt_id==18 || pmt_id==19)paddle=1; |
| 664 |
if(pmt_id==20 || pmt_id==21)paddle=2; |
| 665 |
if(pmt_id==22 || pmt_id==23)paddle=3; |
| 666 |
if(pmt_id==24 || pmt_id==25)paddle=4; |
| 667 |
if(pmt_id==26 || pmt_id==27)paddle=5; |
| 668 |
} |
| 669 |
|
| 670 |
if(plane == 2){ |
| 671 |
if(pmt_id==28 || pmt_id==29)paddle=0; |
| 672 |
if(pmt_id==30 || pmt_id==31)paddle=1; |
| 673 |
} |
| 674 |
|
| 675 |
if(plane == 3){ |
| 676 |
if(pmt_id==32 || pmt_id==33)paddle=0; |
| 677 |
if(pmt_id==34 || pmt_id==35)paddle=1; |
| 678 |
} |
| 679 |
|
| 680 |
if(plane == 4){ |
| 681 |
if(pmt_id==36 || pmt_id==37)paddle=0; |
| 682 |
if(pmt_id==38 || pmt_id==39)paddle=1; |
| 683 |
if(pmt_id==40 || pmt_id==41)paddle=2; |
| 684 |
} |
| 685 |
|
| 686 |
if(plane == 5){ |
| 687 |
if(pmt_id==42 || pmt_id==43)paddle=0; |
| 688 |
if(pmt_id==44 || pmt_id==45)paddle=1; |
| 689 |
if(pmt_id==46 || pmt_id==47)paddle=2; |
| 690 |
} |
| 691 |
return; |
| 692 |
} |
| 693 |
|
| 694 |
// |
| 695 |
|
| 696 |
// gf Apr 07 |
| 697 |
|
| 698 |
void ToFLevel2::GetPaddlePMT(Int_t paddle, Int_t &pmtleft, Int_t &pmtright){ |
| 699 |
|
| 700 |
if(paddle==0){ |
| 701 |
pmtleft=0; |
| 702 |
pmtright=1; |
| 703 |
} |
| 704 |
|
| 705 |
if(paddle==1){ |
| 706 |
pmtleft=2; |
| 707 |
pmtright=3; |
| 708 |
} |
| 709 |
|
| 710 |
if(paddle==2){ |
| 711 |
pmtleft=4; |
| 712 |
pmtright=5; |
| 713 |
} |
| 714 |
|
| 715 |
if(paddle==3){ |
| 716 |
pmtleft=6; |
| 717 |
pmtright=7; |
| 718 |
} |
| 719 |
|
| 720 |
if(paddle==4){ |
| 721 |
pmtleft=8; |
| 722 |
pmtright=9; |
| 723 |
} |
| 724 |
|
| 725 |
if(paddle==5){ |
| 726 |
pmtleft=10; |
| 727 |
pmtright=11; |
| 728 |
} |
| 729 |
|
| 730 |
if(paddle==6){ |
| 731 |
pmtleft=12; |
| 732 |
pmtright=13; |
| 733 |
} |
| 734 |
|
| 735 |
if(paddle==7){ |
| 736 |
pmtleft=14; |
| 737 |
pmtright=15; |
| 738 |
} |
| 739 |
|
| 740 |
if(paddle==8){ |
| 741 |
pmtleft=16; |
| 742 |
pmtright=17; |
| 743 |
} |
| 744 |
|
| 745 |
if(paddle==9){ |
| 746 |
pmtleft=18; |
| 747 |
pmtright=19; |
| 748 |
} |
| 749 |
|
| 750 |
if(paddle==10){ |
| 751 |
pmtleft=20; |
| 752 |
pmtright=21; |
| 753 |
} |
| 754 |
|
| 755 |
if(paddle==11){ |
| 756 |
pmtleft=22; |
| 757 |
pmtright=23; |
| 758 |
} |
| 759 |
|
| 760 |
if(paddle==12){ |
| 761 |
pmtleft=24; |
| 762 |
pmtright=25; |
| 763 |
} |
| 764 |
|
| 765 |
if(paddle==13){ |
| 766 |
pmtleft=26; |
| 767 |
pmtright=27; |
| 768 |
} |
| 769 |
|
| 770 |
if(paddle==14){ |
| 771 |
pmtleft=28; |
| 772 |
pmtright=29; |
| 773 |
} |
| 774 |
|
| 775 |
if(paddle==15){ |
| 776 |
pmtleft=30; |
| 777 |
pmtright=31; |
| 778 |
} |
| 779 |
|
| 780 |
if(paddle==16){ |
| 781 |
pmtleft=32; |
| 782 |
pmtright=33; |
| 783 |
} |
| 784 |
|
| 785 |
if(paddle==17){ |
| 786 |
pmtleft=34; |
| 787 |
pmtright=35; |
| 788 |
} |
| 789 |
|
| 790 |
if(paddle==18){ |
| 791 |
pmtleft=36; |
| 792 |
pmtright=37; |
| 793 |
} |
| 794 |
|
| 795 |
if(paddle==19){ |
| 796 |
pmtleft=38; |
| 797 |
pmtright=39; |
| 798 |
} |
| 799 |
|
| 800 |
if(paddle==20){ |
| 801 |
pmtleft=40; |
| 802 |
pmtright=41; |
| 803 |
} |
| 804 |
|
| 805 |
if(paddle==21){ |
| 806 |
pmtleft=42; |
| 807 |
pmtright=43; |
| 808 |
} |
| 809 |
|
| 810 |
if(paddle==22){ |
| 811 |
pmtleft=44; |
| 812 |
pmtright=45; |
| 813 |
} |
| 814 |
|
| 815 |
if(paddle==23){ |
| 816 |
pmtleft=46; |
| 817 |
pmtright=47; |
| 818 |
} |
| 819 |
|
| 820 |
return; |
| 821 |
} |
| 822 |
|
| 823 |
// |
| 824 |
|
| 825 |
|
| 826 |
|
| 827 |
// // gf Apr 07 |
| 828 |
|
| 829 |
void ToFLevel2::GetPaddleGeometry(Int_t plane, Int_t paddle, Float_t &xleft, Float_t &xright, Float_t &yleft, Float_t &yright){ |
| 830 |
|
| 831 |
Int_t i1; |
| 832 |
|
| 833 |
Float_t tof11_x[8] = {-17.85,-12.75,-7.65,-2.55,2.55,7.65,12.75,17.85}; |
| 834 |
Float_t tof12_y[6] = { -13.75,-8.25,-2.75,2.75,8.25,13.75}; |
| 835 |
Float_t tof21_y[2] = { 3.75,-3.75}; |
| 836 |
Float_t tof22_x[2] = { -4.5,4.5}; |
| 837 |
Float_t tof31_x[3] = { -6.0,0.,6.0}; |
| 838 |
Float_t tof32_y[3] = { -5.0,0.0,5.0}; |
| 839 |
|
| 840 |
// S11 8 paddles 33.0 x 5.1 cm |
| 841 |
// S12 6 paddles 40.8 x 5.5 cm |
| 842 |
// S21 2 paddles 18.0 x 7.5 cm |
| 843 |
// S22 2 paddles 15.0 x 9.0 cm |
| 844 |
// S31 3 paddles 15.0 x 6.0 cm |
| 845 |
// S32 3 paddles 18.0 x 5.0 cm |
| 846 |
|
| 847 |
if(plane==0) |
| 848 |
{ |
| 849 |
for (i1=0; i1<8;i1++){ |
| 850 |
if(i1 == paddle){ |
| 851 |
xleft = tof11_x[i1] - 5.1/2.; |
| 852 |
xright = tof11_x[i1] + 5.1/2.; |
| 853 |
yleft = -33.0/2.; |
| 854 |
yright = 33.0/2.; |
| 855 |
} |
| 856 |
} |
| 857 |
} |
| 858 |
|
| 859 |
if(plane==1) |
| 860 |
{ |
| 861 |
for (i1=0; i1<6;i1++){ |
| 862 |
if(i1 == paddle){ |
| 863 |
xleft = -40.8/2.; |
| 864 |
xright = 40.8/2.; |
| 865 |
yleft = tof12_y[i1] - 5.5/2.; |
| 866 |
yright = tof12_y[i1] + 5.5/2.; |
| 867 |
} |
| 868 |
} |
| 869 |
} |
| 870 |
|
| 871 |
if(plane==2) |
| 872 |
{ |
| 873 |
for (i1=0; i1<2;i1++){ |
| 874 |
if(i1 == paddle){ |
| 875 |
xleft = -18./2.; |
| 876 |
xright = 18./2.; |
| 877 |
yleft = tof21_y[i1] - 7.5/2.; |
| 878 |
yright = tof21_y[i1] + 7.5/2.; |
| 879 |
} |
| 880 |
} |
| 881 |
} |
| 882 |
|
| 883 |
if(plane==3) |
| 884 |
{ |
| 885 |
for (i1=0; i1<2;i1++){ |
| 886 |
if(i1 == paddle){ |
| 887 |
xleft = tof22_x[i1] - 9.0/2.; |
| 888 |
xright = tof22_x[i1] + 9.0/2.; |
| 889 |
yleft = -15./2.; |
| 890 |
yright = 15./2.; |
| 891 |
} |
| 892 |
} |
| 893 |
} |
| 894 |
|
| 895 |
|
| 896 |
if(plane==4) |
| 897 |
{ |
| 898 |
for (i1=0; i1<3;i1++){ |
| 899 |
if(i1 == paddle){ |
| 900 |
xleft = tof31_x[i1] - 6.0/2.; |
| 901 |
xright = tof31_x[i1] + 6.0/2.; |
| 902 |
yleft = -15./2.; |
| 903 |
yright = 15./2.; |
| 904 |
} |
| 905 |
} |
| 906 |
} |
| 907 |
|
| 908 |
if(plane==5) |
| 909 |
{ |
| 910 |
for (i1=0; i1<3;i1++){ |
| 911 |
if(i1 == paddle){ |
| 912 |
xleft = -18.0/2.; |
| 913 |
xright = 18.0/2.; |
| 914 |
yleft = tof32_y[i1] - 5.0/2.; |
| 915 |
yright = tof32_y[i1] + 5.0/2.; |
| 916 |
} |
| 917 |
} |
| 918 |
} |
| 919 |
return; |
| 920 |
} |
| 921 |
|
| 922 |
// gf Apr 07 |
| 923 |
/** |
| 924 |
* Method to get the paddle index (0,...23) if the plane ID and the paddle id in the plane is given. |
| 925 |
* This method is the |
| 926 |
* "reverse" of method "GetPaddlePlane" |
| 927 |
* @param plane (0 - 5) |
| 928 |
* @param paddle (plane=0, paddle = 0,...5) |
| 929 |
* @param padid (0 - 23) |
| 930 |
*/ |
| 931 |
Int_t ToFLevel2::GetPaddleid(Int_t plane, Int_t paddle) |
| 932 |
{ |
| 933 |
|
| 934 |
Int_t padid=-1; |
| 935 |
Int_t pads11=8; |
| 936 |
Int_t pads12=6; |
| 937 |
Int_t pads21=2; |
| 938 |
Int_t pads22=2; |
| 939 |
Int_t pads31=3; |
| 940 |
// Int_t pads32=3; |
| 941 |
|
| 942 |
|
| 943 |
if(plane == 0){ |
| 944 |
padid=paddle; |
| 945 |
} |
| 946 |
|
| 947 |
if(plane == 1){ |
| 948 |
padid=pads11+paddle; |
| 949 |
} |
| 950 |
|
| 951 |
if(plane == 2){ |
| 952 |
padid=pads11+pads12+paddle; |
| 953 |
} |
| 954 |
|
| 955 |
if(plane == 3){ |
| 956 |
padid=pads11+pads12+pads21+paddle; |
| 957 |
} |
| 958 |
|
| 959 |
if(plane == 4){ |
| 960 |
padid=pads11+pads12+pads21+pads22+paddle; |
| 961 |
} |
| 962 |
|
| 963 |
if(plane == 5){ |
| 964 |
padid=pads11+pads12+pads21+pads22+pads31+paddle; |
| 965 |
} |
| 966 |
|
| 967 |
return padid; |
| 968 |
|
| 969 |
} |
| 970 |
|
| 971 |
|
| 972 |
// gf Apr 07 |
| 973 |
/** |
| 974 |
* Method to get the plane ID and the paddle id in the plane if the paddle index (0,...23) is given. |
| 975 |
* This method is the |
| 976 |
* "reverse" of method "GetPaddleid" |
| 977 |
* @param pad (0 - 23) |
| 978 |
* @param plane (0 - 5) |
| 979 |
* @param paddle (plane=0, paddle = 0,...5) |
| 980 |
*/ |
| 981 |
void ToFLevel2::GetPaddlePlane(Int_t pad, Int_t &plane, Int_t &paddle) |
| 982 |
{ |
| 983 |
|
| 984 |
Int_t pads11=8; |
| 985 |
Int_t pads12=6; |
| 986 |
Int_t pads21=2; |
| 987 |
Int_t pads22=2; |
| 988 |
Int_t pads31=3; |
| 989 |
// Int_t pads32=3; |
| 990 |
|
| 991 |
if(pad<8){ |
| 992 |
plane=0; |
| 993 |
paddle=pad; |
| 994 |
return; |
| 995 |
} |
| 996 |
|
| 997 |
if(7<pad<14){ |
| 998 |
plane=1; |
| 999 |
paddle=pad-pads11; |
| 1000 |
return; |
| 1001 |
} |
| 1002 |
|
| 1003 |
if(13<pad<16){ |
| 1004 |
plane=2; |
| 1005 |
paddle=pad-pads11-pads12; |
| 1006 |
return; |
| 1007 |
} |
| 1008 |
|
| 1009 |
if(15<pad<18){ |
| 1010 |
plane=3; |
| 1011 |
paddle=pad-pads11-pads12-pads21; |
| 1012 |
return; |
| 1013 |
} |
| 1014 |
|
| 1015 |
if(17<pad<21){ |
| 1016 |
plane=4; |
| 1017 |
paddle=pad-pads11-pads12-pads21-pads22; |
| 1018 |
return; |
| 1019 |
} |
| 1020 |
|
| 1021 |
if(20<pad<24){ |
| 1022 |
plane=5; |
| 1023 |
paddle=pad-pads11-pads12-pads21-pads22-pads31; |
| 1024 |
return; |
| 1025 |
} |
| 1026 |
|
| 1027 |
} |
| 1028 |
|
| 1029 |
|
| 1030 |
Int_t ToFLevel2::GetNPaddle(Int_t plane){ |
| 1031 |
|
| 1032 |
Int_t npaddle=-1; |
| 1033 |
|
| 1034 |
Int_t pads11=8; |
| 1035 |
Int_t pads12=6; |
| 1036 |
Int_t pads21=2; |
| 1037 |
Int_t pads22=2; |
| 1038 |
Int_t pads31=3; |
| 1039 |
Int_t pads32=3; |
| 1040 |
|
| 1041 |
if(plane==0)npaddle=pads11; |
| 1042 |
if(plane==1)npaddle=pads12; |
| 1043 |
if(plane==2)npaddle=pads21; |
| 1044 |
if(plane==3)npaddle=pads22; |
| 1045 |
if(plane==4)npaddle=pads31; |
| 1046 |
if(plane==5)npaddle=pads32; |
| 1047 |
|
| 1048 |
return npaddle; |
| 1049 |
|
| 1050 |
} |
| 1051 |
|
| 1052 |
//////////////////////////////////////////////////// |
| 1053 |
|
| 1054 |
|
| 1055 |
|
| 1056 |
/** |
| 1057 |
* Fills a struct cToFLevel2 with values from a ToFLevel2 object (to put data into a F77 common). |
| 1058 |
*/ |
| 1059 |
void ToFLevel2::GetLevel2Struct(cToFLevel2 *l2) const{ |
| 1060 |
|
| 1061 |
for(Int_t i=0;i<6;i++) |
| 1062 |
l2->tof_j_flag[i]=tof_j_flag[i]; |
| 1063 |
|
| 1064 |
if(ToFTrk){ //ELENA |
| 1065 |
l2->ntoftrk = ToFTrk->GetEntries(); |
| 1066 |
for(Int_t j=0;j<l2->ntoftrk;j++){ |
| 1067 |
l2->toftrkseqno[j]= ((ToFTrkVar*)ToFTrk->At(j))->trkseqno; |
| 1068 |
l2->npmttdc[j]= ((ToFTrkVar*)ToFTrk->At(j))->npmttdc; |
| 1069 |
for(Int_t i=0;i<l2->npmttdc[j];i++){ |
| 1070 |
l2->pmttdc[i][j] = ((ToFTrkVar*)ToFTrk->At(j))->pmttdc.At(i); |
| 1071 |
l2->tdcflag[i][j] = ((ToFTrkVar*)ToFTrk->At(j))->tdcflag.At(i); // gf: 30 Nov 2006 |
| 1072 |
} |
| 1073 |
for(Int_t i=0;i<13;i++) |
| 1074 |
l2->beta[i][j] = ((ToFTrkVar*)ToFTrk->At(j))->beta[i]; |
| 1075 |
|
| 1076 |
l2->npmtadc[j]= ((ToFTrkVar*)ToFTrk->At(j))->npmtadc; |
| 1077 |
for(Int_t i=0;i<l2->npmtadc[j];i++){ |
| 1078 |
l2->pmtadc[i][j] = ((ToFTrkVar*)ToFTrk->At(j))->pmtadc.At(i); |
| 1079 |
l2->adcflag[i][j] = ((ToFTrkVar*)ToFTrk->At(j))->adcflag.At(i); // gf: 30 Nov 2006 |
| 1080 |
l2->dedx[i][j] = ((ToFTrkVar*)ToFTrk->At(j))->dedx.At(i); |
| 1081 |
} |
| 1082 |
for(Int_t i=0;i<3;i++){ |
| 1083 |
l2->xtofpos[i][j]=((ToFTrkVar*)ToFTrk->At(j))->xtofpos[i]; |
| 1084 |
l2->ytofpos[i][j]=((ToFTrkVar*)ToFTrk->At(j))->ytofpos[i]; |
| 1085 |
} |
| 1086 |
for(Int_t i=0;i<6;i++){ |
| 1087 |
l2->xtr_tof[i][j]=((ToFTrkVar*)ToFTrk->At(j))->xtr_tof[i]; |
| 1088 |
l2->ytr_tof[i][j]=((ToFTrkVar*)ToFTrk->At(j))->ytr_tof[i]; |
| 1089 |
} |
| 1090 |
} |
| 1091 |
} //ELENA |
| 1092 |
|
| 1093 |
if(PMT){ //ELENA |
| 1094 |
l2->npmt = PMT->GetEntries(); |
| 1095 |
for(Int_t j=0;j<l2->npmt;j++){ |
| 1096 |
l2->pmt_id[j] = ((ToFPMT*)PMT->At(j))->pmt_id; |
| 1097 |
l2->adc[j] =((ToFPMT*)PMT->At(j))->adc; |
| 1098 |
l2->tdc_tw[j] =((ToFPMT*)PMT->At(j))->tdc_tw; |
| 1099 |
} |
| 1100 |
} //ELENA |
| 1101 |
} |