| 17 |
// |
// |
| 18 |
if ( !L2->IsORB() ) printf(" WARNING: OrbitalInfo Tree is needed, the plugin could not work properly without it \n"); |
if ( !L2->IsORB() ) printf(" WARNING: OrbitalInfo Tree is needed, the plugin could not work properly without it \n"); |
| 19 |
// |
// |
|
OBT = 0; |
|
|
PKT = 0; |
|
|
atime = 0; |
|
|
sntr = "start"; |
|
|
AOBT = 0; |
|
|
APKT = 0; |
|
|
aatime = 0; |
|
|
asntr = "start"; |
|
|
// |
|
|
debug = false; |
|
|
// |
|
|
fLong = false; |
|
| 20 |
fSimu = false; |
fSimu = false; |
| 21 |
fPl = 1; |
this->Set(); |
|
// |
|
|
this->DefineGeometry(); |
|
|
fXosel = true; |
|
|
fXesel = true; |
|
|
fYosel = true; |
|
|
fYesel = true; |
|
|
fConv_r = 44.4; |
|
| 22 |
// |
// |
| 23 |
} |
} |
| 24 |
|
|
| 30 |
// |
// |
| 31 |
if ( !L2->IsORB() ) printf(" WARNING: OrbitalInfo Tree is needed, the plugin could not work properly without it \n"); |
if ( !L2->IsORB() ) printf(" WARNING: OrbitalInfo Tree is needed, the plugin could not work properly without it \n"); |
| 32 |
// |
// |
| 33 |
|
fSimu = simulation; |
| 34 |
|
this->Set(); |
| 35 |
|
// |
| 36 |
|
} |
| 37 |
|
|
| 38 |
|
void CaloEnergy::Set(){ |
| 39 |
OBT = 0; |
OBT = 0; |
| 40 |
PKT = 0; |
PKT = 0; |
| 41 |
atime = 0; |
atime = 0; |
| 49 |
debug = false; |
debug = false; |
| 50 |
// |
// |
| 51 |
fLong = false; |
fLong = false; |
|
fSimu = simulation; |
|
| 52 |
fPl = 1; |
fPl = 1; |
| 53 |
|
fRad = -1; |
| 54 |
// |
// |
| 55 |
this->DefineGeometry(); |
this->DefineGeometry(); |
| 56 |
fXosel =true; |
fXosel =true; |
| 57 |
fXesel = true; |
fXesel = true; |
| 58 |
fYosel = true; |
fYosel = true; |
| 59 |
fYesel = true; |
fYesel = true; |
| 60 |
fConv_r = 44.4; |
fConv_rxe = 44.4; |
| 61 |
// |
fConv_rxo = 44.4; |
| 62 |
|
fConv_ryo = 44.4; |
| 63 |
|
fConv_rye = 44.4; |
| 64 |
|
fXomin = 1000; |
| 65 |
|
fXemin = 1000; |
| 66 |
|
fYomin = 1000; |
| 67 |
|
fYemin = 1000; |
| 68 |
|
} |
| 69 |
|
|
| 70 |
|
void CaloEnergy::SetMinimumContainment(TString section, Int_t plane){ |
| 71 |
|
section.ToUpper(); |
| 72 |
|
if ( section.Contains("XO") ) fXomin = plane; |
| 73 |
|
if ( section.Contains("XE") ) fXemin = plane; |
| 74 |
|
if ( section.Contains("YO") ) fYomin = plane; |
| 75 |
|
if ( section.Contains("YE") ) fYemin = plane; |
| 76 |
|
} |
| 77 |
|
|
| 78 |
|
Int_t CaloEnergy::GetMinimumContainment(TString section){ |
| 79 |
|
section.ToUpper(); |
| 80 |
|
if ( section.Contains("XO") ) return(fXomin); |
| 81 |
|
if ( section.Contains("XE") ) return(fXemin); |
| 82 |
|
if ( section.Contains("YE") ) return(fYemin); |
| 83 |
|
if ( section.Contains("YO") ) return(fYomin); |
| 84 |
|
printf(" ERROR: section not recognized \n"); |
| 85 |
|
return(-1000); |
| 86 |
|
} |
| 87 |
|
|
| 88 |
|
void CaloEnergy::SetConversionFactor(TString section, Float_t conv){ |
| 89 |
|
section.ToUpper(); |
| 90 |
|
if ( section.Contains("XO") ) fConv_rxo = conv; |
| 91 |
|
if ( section.Contains("XE") ) fConv_rxe = conv; |
| 92 |
|
if ( section.Contains("YO") ) fConv_ryo = conv; |
| 93 |
|
if ( section.Contains("YE") ) fConv_rye = conv; |
| 94 |
|
} |
| 95 |
|
|
| 96 |
|
Float_t CaloEnergy::GetConversionFactor(TString section){ |
| 97 |
|
section.ToUpper(); |
| 98 |
|
if ( section.Contains("XO") ) return(fConv_rxo); |
| 99 |
|
if ( section.Contains("XE") ) return(fConv_rxe); |
| 100 |
|
if ( section.Contains("YO") ) return(fConv_ryo); |
| 101 |
|
if ( section.Contains("YE") ) return(fConv_rye); |
| 102 |
|
printf(" ERROR: section not recognized \n"); |
| 103 |
|
return(-1000.); |
| 104 |
|
} |
| 105 |
|
|
| 106 |
|
Int_t CaloEnergy::GetMaxplane(TString section){ |
| 107 |
|
section.ToUpper(); |
| 108 |
|
if ( section.Contains("XO") ) return fMax_planexo; |
| 109 |
|
if ( section.Contains("XE") ) return fMax_planexe; |
| 110 |
|
if ( section.Contains("YO") ) return fMax_planeyo; |
| 111 |
|
if ( section.Contains("YE") ) return fMax_planeye; |
| 112 |
|
return(-1); |
| 113 |
} |
} |
| 114 |
|
|
| 115 |
void CaloEnergy::DefineGeometry(){ |
void CaloEnergy::DefineGeometry(){ |
| 116 |
// |
// |
| 117 |
fM = 2.; |
fM = 2. + 0.096; // real position from cbar |
| 118 |
fM1 = fM - 0.122 -0.096; |
fM1 = 2. - 0.122 - 0.096; // due to calculation of xe1 etc. |
| 119 |
if ( fM1 < 0. ) fM1 = 0.; |
if ( fM1 < 0. ) fM1 = 0.; |
| 120 |
// |
// |
| 121 |
CaloStrip *cs = new CaloStrip(fSimu); |
CaloStrip *cs = new CaloStrip(fSimu); |
| 215 |
|
|
| 216 |
void CaloEnergy::Clear(){ |
void CaloEnergy::Clear(){ |
| 217 |
// |
// |
| 218 |
|
fPartsel = false; |
| 219 |
|
fSel = false; |
| 220 |
|
fXosel = false; |
| 221 |
|
fXesel = false; |
| 222 |
|
fYosel = false; |
| 223 |
|
fYesel = false; |
| 224 |
|
fCount = 0.; |
| 225 |
fEnergy = 0.; |
fEnergy = 0.; |
| 226 |
|
fEnergyxe = 0.; |
| 227 |
|
fEnergyxo = 0.; |
| 228 |
|
fEnergyye = 0.; |
| 229 |
|
fEnergyyo = 0.; |
| 230 |
|
fMax_plane = 0; |
| 231 |
|
fMax_planexo = 0; |
| 232 |
|
fMax_planexe = 0; |
| 233 |
|
fMax_planeyo = 0; |
| 234 |
|
fMax_planeye = 0; |
| 235 |
memset(enstrip,0,2*22*96*(sizeof(Float_t))); |
memset(enstrip,0,2*22*96*(sizeof(Float_t))); |
| 236 |
en = 0.; |
en = 0.; |
| 237 |
view = 0; |
view = 0; |
| 241 |
energyyo = 0.; |
energyyo = 0.; |
| 242 |
energyxo = 0.; |
energyxo = 0.; |
| 243 |
energyye = 0.; |
energyye = 0.; |
| 244 |
|
fYoout = 0; |
| 245 |
|
fYeout = 0; |
| 246 |
|
fXoout = 0; |
| 247 |
|
fXeout = 0; |
| 248 |
memset(en_xep,0,11*sizeof(Float_t)); |
memset(en_xep,0,11*sizeof(Float_t)); |
| 249 |
memset(en_yep,0,11*sizeof(Float_t)); |
memset(en_yep,0,11*sizeof(Float_t)); |
| 250 |
memset(en_xop,0,11*sizeof(Float_t)); |
memset(en_xop,0,11*sizeof(Float_t)); |
| 257 |
printf("========================================================================\n"); |
printf("========================================================================\n"); |
| 258 |
printf(" OBT: %u PKT: %u ATIME: %u \n",OBT,PKT,atime); |
printf(" OBT: %u PKT: %u ATIME: %u \n",OBT,PKT,atime); |
| 259 |
printf(" fEnergy :.............. %f \n",fEnergy); |
printf(" fEnergy :.............. %f \n",fEnergy); |
| 260 |
printf(" fMax_plane :........... %i \n",fMax_plane); |
printf(" fMax_plane :........... %f \n",fMax_plane); |
| 261 |
|
printf(" fMax_planexo :......... %i \n",fMax_planexo); |
| 262 |
|
printf(" fMax_planexe :......... %i \n",fMax_planexe); |
| 263 |
|
printf(" fMax_planeyo :......... %i \n",fMax_planeyo); |
| 264 |
|
printf(" fMax_planeye :......... %i \n",fMax_planeye); |
| 265 |
printf(" fCount :.............. %f \n",fCount); |
printf(" fCount :.............. %f \n",fCount); |
| 266 |
|
printf(" fSel :.............. %i \n",fSel); |
| 267 |
|
printf(" fPartsel:.............. %i \n",fPartsel); |
| 268 |
printf(" fXesel :.............. %i \n",fXesel); |
printf(" fXesel :.............. %i \n",fXesel); |
| 269 |
printf(" fXosel :.............. %i \n",fXosel); |
printf(" fXosel :.............. %i \n",fXosel); |
| 270 |
printf(" fYesel :.............. %i \n",fYesel); |
printf(" fYesel :.............. %i \n",fYesel); |
| 271 |
printf(" fYosel :.............. %i \n",fYosel); |
printf(" fYosel :.............. %i \n",fYosel); |
| 272 |
|
printf(" fXemin :.............. %i \n",fXemin); |
| 273 |
|
printf(" fXomin :.............. %i \n",fXomin); |
| 274 |
|
printf(" fYemin :.............. %i \n",fYemin); |
| 275 |
|
printf(" fYomin :.............. %i \n",fYomin); |
| 276 |
|
printf(" fXeout :.............. %i \n",fXeout); |
| 277 |
|
printf(" fXoout :.............. %i \n",fXoout); |
| 278 |
|
printf(" fYeout :.............. %i \n",fYeout); |
| 279 |
|
printf(" fYoout :.............. %i \n",fYoout); |
| 280 |
printf(" fSimu :.............. %i \n",fSimu); |
printf(" fSimu :.............. %i \n",fSimu); |
| 281 |
printf(" fM :.............. %f \n",fM); |
printf(" fM :.............. %f \n",fM); |
| 282 |
printf(" fM1 :.............. %f \n",fM1); |
printf(" fM1 :.............. %f \n",fM1); |
| 283 |
printf(" fPl :.............. %f \n",fPl); |
printf(" fRad :.............. %i \n",fRad); |
| 284 |
printf(" fConv_r :.............. %f \n",fConv_r); |
printf(" fPl :.............. %i \n",fPl); |
| 285 |
|
printf(" fConv_rxe ............. %f \n",fConv_rxe); |
| 286 |
|
printf(" fConv_rxo ............. %f \n",fConv_rxo); |
| 287 |
|
printf(" fConv_ryo ............. %f \n",fConv_ryo); |
| 288 |
|
printf(" fConv_rye ............. %f \n",fConv_rye); |
| 289 |
printf(" fLong :.............. %i \n",fLong); |
printf(" fLong :.............. %i \n",fLong); |
| 290 |
printf(" energyxe:.............. %f \n",energyxe); |
printf(" energyxe:.............. %f \n",energyxe); |
| 291 |
printf(" energyxo:.............. %f \n",energyxo); |
printf(" energyxo:.............. %f \n",energyxo); |
| 303 |
|
|
| 304 |
|
|
| 305 |
Bool_t CaloEnergy::IsInsideAcceptance(TString section){ |
Bool_t CaloEnergy::IsInsideAcceptance(TString section){ |
|
return(this->IsInsideAcceptance(section,true)); |
|
|
} |
|
|
|
|
|
Bool_t CaloEnergy::IsInsideAcceptance(TString section, Bool_t fast){ |
|
| 306 |
// |
// |
| 307 |
// |
// |
| 308 |
TString ntr = section; |
TString ntr = section; |
| 330 |
// |
// |
| 331 |
if ( debug ) printf(" ########## IsInsideAcceptance ######### \n"); |
if ( debug ) printf(" ########## IsInsideAcceptance ######### \n"); |
| 332 |
// |
// |
| 333 |
fSel = false; |
this->Clear(); |
| 334 |
|
// |
| 335 |
section.ToUpper(); |
section.ToUpper(); |
|
fXosel = false; |
|
|
fXesel = false; |
|
|
fYosel = false; |
|
|
fYesel = false; |
|
|
fCount = 0.; |
|
| 336 |
// |
// |
| 337 |
Int_t ss = Int_t(section.Contains("XO"))+Int_t(section.Contains("XE"))+Int_t(section.Contains("YO"))+Int_t(section.Contains("YE")); |
Int_t ss = Int_t(section.Contains("XO"))+Int_t(section.Contains("XE"))+Int_t(section.Contains("YO"))+Int_t(section.Contains("YE")); |
|
if ( ss > 1 ) fast = false; |
|
| 338 |
if ( !ss ){ |
if ( !ss ){ |
| 339 |
printf(" ERROR: section must be XO or XE or YO or YE while it is %s \n",section.Data()); |
printf(" ERROR: section must be XO or XE or YO or YE while it is %s \n",section.Data()); |
| 340 |
|
return false; |
| 341 |
|
}; |
| 342 |
|
// |
| 343 |
|
// |
| 344 |
|
for (Int_t ch=0; ch< L2->GetCaloLevel1()->istrip; ch++){ |
| 345 |
|
en = L2->GetCaloLevel1()->DecodeEstrip(ch,view,plane,strip); |
| 346 |
|
enstrip[view][plane][strip]=en; |
| 347 |
|
}; |
| 348 |
|
for (Int_t i=0;i<11;i++){ |
| 349 |
|
for(strip=0; strip<96; strip++) { |
| 350 |
|
if ( fRad < 0 ){ |
| 351 |
|
en_xep[i] += enstrip[1][2*i][strip]; |
| 352 |
|
en_yop[i] += enstrip[0][2*i][strip]; |
| 353 |
|
en_xop[i] += enstrip[1][2*i+1][strip]; |
| 354 |
|
en_yep[i] += enstrip[0][2*i+1][strip]; |
| 355 |
|
} else { |
| 356 |
|
if ( strip >= L2->GetCaloLevel2()->cibar[2*i][1]-1-fRad && strip <= L2->GetCaloLevel2()->cibar[2*i][1]-1+fRad ) en_xep[i] += enstrip[1][2*i][strip]; |
| 357 |
|
if ( strip >= L2->GetCaloLevel2()->cibar[2*i][0]-1-fRad && strip <= L2->GetCaloLevel2()->cibar[2*i][0]-1+fRad ) en_yop[i] += enstrip[0][2*i][strip]; |
| 358 |
|
if ( strip >= L2->GetCaloLevel2()->cibar[2*i+1][1]-1-fRad && strip <= L2->GetCaloLevel2()->cibar[2*i+1][1]-1+fRad ) en_xop[i] += enstrip[1][2*i+1][strip]; |
| 359 |
|
if ( strip >= L2->GetCaloLevel2()->cibar[2*i+1][0]-1-fRad && strip <= L2->GetCaloLevel2()->cibar[2*i+1][0]-1+fRad ) en_yep[i] += enstrip[0][2*i+1][strip]; |
| 360 |
|
}; |
| 361 |
|
}; |
| 362 |
|
energyxe += en_xep[i]; |
| 363 |
|
energyyo += en_yop[i]; |
| 364 |
|
energyxo += en_xop[i]; |
| 365 |
|
energyye += en_yep[i]; |
| 366 |
|
}; |
| 367 |
|
Float_t en_maxplane = 0.; |
| 368 |
|
Float_t max_en= 0.; |
| 369 |
|
// |
| 370 |
|
for (Int_t ipl =0; ipl < 11; ipl ++) { |
| 371 |
|
if(en_xop[ipl] > max_en) { |
| 372 |
|
max_en = en_xop[ipl]; |
| 373 |
|
fMax_planexo = ipl; |
| 374 |
|
}; |
| 375 |
|
}; |
| 376 |
|
// |
| 377 |
|
max_en = 0.; |
| 378 |
|
for (Int_t ipl =0; ipl < 11; ipl ++) { |
| 379 |
|
if(en_xep[ipl] > max_en) { |
| 380 |
|
max_en = en_xep[ipl]; |
| 381 |
|
fMax_planexe = ipl; |
| 382 |
|
}; |
| 383 |
|
}; |
| 384 |
|
// |
| 385 |
|
max_en = 0.; |
| 386 |
|
for (Int_t ipl =0; ipl < 11; ipl ++) { |
| 387 |
|
if(en_yop[ipl] > max_en) { |
| 388 |
|
max_en = en_yop[ipl]; |
| 389 |
|
fMax_planeyo = ipl; |
| 390 |
|
}; |
| 391 |
|
}; |
| 392 |
|
// |
| 393 |
|
max_en = 0.; |
| 394 |
|
for (Int_t ipl =0; ipl < 11; ipl ++) { |
| 395 |
|
if(en_yep[ipl] > max_en) { |
| 396 |
|
max_en = en_yep[ipl]; |
| 397 |
|
fMax_planeye = ipl; |
| 398 |
|
}; |
| 399 |
}; |
}; |
| 400 |
// |
// |
| 401 |
Float_t track_coordx[22][2]; |
Float_t track_coordx[22][2]; |
| 414 |
if ( debug ) printf(" p %i track_coordy[p][1] %f track_coordx[p][1] %f track_coordx[p][0] %f track_coordy[p][0] %f \n",p,track_coordy[p][1],track_coordx[p][1],track_coordx[p][0],track_coordy[p][0]); |
if ( debug ) printf(" p %i track_coordy[p][1] %f track_coordx[p][1] %f track_coordx[p][0] %f track_coordy[p][0] %f \n",p,track_coordy[p][1],track_coordx[p][1],track_coordx[p][0],track_coordy[p][0]); |
| 415 |
}; |
}; |
| 416 |
// |
// |
| 417 |
if ( debug ) printf(" acceptance fast %i ss %i tgx %f tgy %f\n",fast,ss,tgx_cl2,tgy_cl2); |
if ( debug ) printf(" acceptance ss %i tgx %f tgy %f\n",ss,tgx_cl2,tgy_cl2); |
| 418 |
// |
// |
| 419 |
if ( section.Contains("XO") ){ |
if ( section.Contains("XO") ){ |
| 420 |
for (Int_t i=0; i<11; i++) { |
for (Int_t i=0; i<11; i++) { |
| 448 |
(L2->GetCaloLevel2()->cbar[2*i+1][1]<=xo6 - fM1 )))) |
(L2->GetCaloLevel2()->cbar[2*i+1][1]<=xo6 - fM1 )))) |
| 449 |
){ |
){ |
| 450 |
fXosel = true; |
fXosel = true; |
| 451 |
|
fXoout = i; |
| 452 |
} else { |
} else { |
|
if ( fast ) return false; |
|
| 453 |
fXosel = false; |
fXosel = false; |
| 454 |
break; |
break; |
| 455 |
}; |
}; |
| 456 |
}; |
}; |
| 457 |
|
if ( !fXosel && fXoout >= fXomin && fXoout >= (Int_t)(fMax_planexo+fPl) ){ |
| 458 |
|
if ( debug ) printf(" XO: this event is only partially contained: fXoout %i fXomin %i fMax_planexo + fPl %i \n",fXoout,fXomin,(Int_t)(fMax_planexo+fPl)); |
| 459 |
|
fPartsel = true; |
| 460 |
|
fXosel = true; |
| 461 |
|
}; |
| 462 |
|
if ( fXosel ){ |
| 463 |
|
en_maxplane = 0.; |
| 464 |
|
for (Int_t iplm=0;iplm<=TMath::Min(10,(Int_t)(fMax_planexo+fPl)) ;iplm++) en_maxplane += en_xop[iplm]; |
| 465 |
|
fEnergyxo = en_maxplane/fConv_rxo; |
| 466 |
|
}; |
| 467 |
}; |
}; |
| 468 |
// |
// |
| 469 |
if ( section.Contains("XE") ){ |
if ( section.Contains("XE") ){ |
| 498 |
(L2->GetCaloLevel2()->cbar[2*i][1]<=xe6 - fM1 )))) |
(L2->GetCaloLevel2()->cbar[2*i][1]<=xe6 - fM1 )))) |
| 499 |
){ |
){ |
| 500 |
fXesel = true; |
fXesel = true; |
| 501 |
|
fXeout = i; |
| 502 |
} else { |
} else { |
|
if ( fast ) return false; |
|
| 503 |
fXesel = false; |
fXesel = false; |
| 504 |
break; |
break; |
| 505 |
}; |
}; |
| 506 |
}; |
}; |
| 507 |
|
if ( !fXesel && fXeout >= fXemin && fXeout >= (Int_t)(fMax_planexe+fPl) ){ |
| 508 |
|
if ( debug ) printf(" XE: this event is only partially contained: fXeout %i fXemin %i fMax_planexe + fPl %i \n",fXeout,fXemin,(Int_t)(fMax_planexe+fPl)); |
| 509 |
|
fPartsel = true; |
| 510 |
|
fXesel = true; |
| 511 |
|
}; |
| 512 |
|
if ( fXesel ){ |
| 513 |
|
en_maxplane = 0.; |
| 514 |
|
for (Int_t iplm=0;iplm<=TMath::Min(10,(Int_t)(fMax_planexe+fPl)) ;iplm++) en_maxplane += en_xep[iplm]; |
| 515 |
|
fEnergyxe = en_maxplane/fConv_rxe; |
| 516 |
|
}; |
| 517 |
}; |
}; |
| 518 |
// |
// |
| 519 |
if ( section.Contains("YE") ){ |
if ( section.Contains("YE") ){ |
| 548 |
(L2->GetCaloLevel2()->cbar[2*i+1][0]<=ye6 - fM1 )))) |
(L2->GetCaloLevel2()->cbar[2*i+1][0]<=ye6 - fM1 )))) |
| 549 |
){ |
){ |
| 550 |
fYesel = true; |
fYesel = true; |
| 551 |
|
fYeout = i; |
| 552 |
} else { |
} else { |
|
if ( fast ) return false; |
|
| 553 |
fYesel = false; |
fYesel = false; |
| 554 |
break; |
break; |
| 555 |
}; |
}; |
| 556 |
}; |
}; |
| 557 |
|
if ( !fYesel && fYeout >= fYemin && fYeout >= (Int_t)(fMax_planeye+fPl) ){ |
| 558 |
|
if ( debug ) printf(" YE: this event is only partially contained: fYeout %i fYemin %i fMax_planeye + fPl %i \n",fYeout,fYemin,(Int_t)(fMax_planeye+fPl)); |
| 559 |
|
fPartsel = true; |
| 560 |
|
fYesel = true; |
| 561 |
|
}; |
| 562 |
|
if ( fYesel ){ |
| 563 |
|
en_maxplane = 0.; |
| 564 |
|
for (Int_t iplm=0;iplm<=TMath::Min(10,(Int_t)(fMax_planeye+fPl)) ;iplm++) en_maxplane += en_yep[iplm]; |
| 565 |
|
fEnergyye = en_maxplane/fConv_rye; |
| 566 |
|
}; |
| 567 |
}; |
}; |
| 568 |
// |
// |
| 569 |
if ( section.Contains("YO") ){ |
if ( section.Contains("YO") ){ |
| 600 |
(L2->GetCaloLevel2()->cbar[2*i][0]<=yo6 - fM1 )))) |
(L2->GetCaloLevel2()->cbar[2*i][0]<=yo6 - fM1 )))) |
| 601 |
){ |
){ |
| 602 |
fYosel = true; |
fYosel = true; |
| 603 |
|
fYoout = i; |
| 604 |
} else { |
} else { |
|
if ( fast ) return false; |
|
| 605 |
fYosel = false; |
fYosel = false; |
| 606 |
break; |
break; |
| 607 |
}; |
}; |
| 608 |
}; |
}; |
| 609 |
|
if ( !fYosel && fYoout >= fYomin && fYoout >= (Int_t)(fMax_planeyo+fPl) ){ |
| 610 |
|
if ( debug ) printf(" YO: this event is only partially contained: fYoout %i fYomin %i fMax_planeyo + fPl %i \n",fYoout,fYomin,(Int_t)(fMax_planeyo+fPl)); |
| 611 |
|
fPartsel = true; |
| 612 |
|
fYosel = true; |
| 613 |
|
}; |
| 614 |
|
if ( fYosel ){ |
| 615 |
|
en_maxplane = 0.; |
| 616 |
|
for (Int_t iplm=0;iplm<=TMath::Min(10,(Int_t)(fMax_planeyo+fPl)) ;iplm++) en_maxplane += en_yop[iplm]; |
| 617 |
|
fEnergyyo = en_maxplane/fConv_ryo; |
| 618 |
|
}; |
| 619 |
}; |
}; |
| 620 |
// |
// |
| 621 |
fSel = ( fXesel || fYesel || fXosel || fYosel ); |
fSel = ( fXesel || fYesel || fXosel || fYosel ); |
| 622 |
fCount = (Float_t)((Int_t)fXesel+(Int_t)fXosel+(Int_t)fYesel+(Int_t)fYosel); |
fCount = (Float_t)((Int_t)fXesel+(Int_t)fXosel+(Int_t)fYesel+(Int_t)fYosel); |
| 623 |
if ( debug ) printf(" IsInside XE %i XO %i YE %i YO %i => SEL %i \n",fXesel,fXosel,fYesel,fYosel,fSel); |
if ( debug ) printf(" IsInside XE %i XO %i YE %i YO %i => SEL %i \n",fXesel,fXosel,fYesel,fYosel,fSel); |
| 624 |
|
fMax_plane = (Float_t)(fMax_planeyo+fMax_planeye+fMax_planexo+fMax_planexe)/fCount; |
| 625 |
|
fEnergy = (fEnergyxe+fEnergyyo+fEnergyye+fEnergyxo)/fCount; |
| 626 |
|
if ( debug ) printf(" fMax_plane %f conv_r %f en_maxplane %f encalo %f \n",fMax_plane,fConv_rxo,en_maxplane,fEnergy); |
| 627 |
// |
// |
| 628 |
return fSel; |
return fSel; |
| 629 |
// |
// |
| 662 |
// |
// |
| 663 |
if ( debug ) printf(" Processing event at OBT %u PKT %u time %u section %s\n",OBT,PKT,atime,section.Data()); |
if ( debug ) printf(" Processing event at OBT %u PKT %u time %u section %s\n",OBT,PKT,atime,section.Data()); |
| 664 |
// |
// |
| 665 |
Clear(); |
// this->Clear(); |
| 666 |
|
// |
| 667 |
|
if ( (fM1+0.122-0.244*(Float_t)fRad) < 0. ) printf("Error: (fM1+0.122-0.244*(Float_t)fRad) < 0. fM1 %f fRad %i %f \n",fM1,fRad,(fM1+0.122-0.244*(Float_t)fRad)); |
| 668 |
// |
// |
| 669 |
if ( fLong ){ |
if ( fLong ){ |
| 670 |
// use long fit to measure energy |
// use long fit to measure energy |
| 672 |
// |
// |
| 673 |
if ( this->IsInsideAcceptance(section) ){ |
if ( this->IsInsideAcceptance(section) ){ |
| 674 |
// |
// |
|
for (Int_t ch=0; ch< L2->GetCaloLevel1()->istrip; ch++){ |
|
|
en = L2->GetCaloLevel1()->DecodeEstrip(ch,view,plane,strip); |
|
|
enstrip[view][plane][strip]=en; |
|
|
}; |
|
|
for (Int_t i=0;i<11;i++){ |
|
|
for(strip=0; strip<96; strip++) { |
|
|
en_xep[i] += enstrip[1][2*i][strip]; |
|
|
en_yop[i] += enstrip[0][2*i][strip]; |
|
|
en_xop[i] += enstrip[1][2*i+1][strip]; |
|
|
en_yep[i] += enstrip[0][2*i+1][strip]; |
|
|
}; |
|
|
energyxe += en_xep[i]; |
|
|
energyyo += en_yop[i]; |
|
|
energyxo += en_xop[i]; |
|
|
energyye += en_yep[i]; |
|
|
}; |
|
|
fMax_plane = 0; |
|
|
Float_t en_maxplane = 0.; |
|
|
Float_t max_en= 0.; |
|
|
if ( fXosel ){ |
|
|
max_en = 0.; |
|
|
for (Int_t ipl =0; ipl < 11; ipl ++) { |
|
|
if(en_xop[ipl] > max_en) { |
|
|
max_en = en_xop[ipl]; |
|
|
fMax_plane = ipl; |
|
|
}; |
|
|
}; |
|
|
// |
|
|
for (Int_t iplm=0;iplm<=(fMax_plane+fPl) ;iplm++) en_maxplane += en_xop[iplm]; |
|
|
}; |
|
|
if ( fXesel ){ |
|
|
max_en = 0.; |
|
|
for (Int_t ipl =0; ipl < 11; ipl ++) { |
|
|
if(en_xep[ipl] > max_en) { |
|
|
max_en = en_xep[ipl]; |
|
|
fMax_plane = ipl; |
|
|
}; |
|
|
}; |
|
|
// |
|
|
for (Int_t iplm=0;iplm<=(fMax_plane+fPl) ;iplm++) en_maxplane += en_xep[iplm]; |
|
|
}; |
|
|
if ( fYosel ){ |
|
|
max_en = 0.; |
|
|
for (Int_t ipl =0; ipl < 11; ipl ++) { |
|
|
if(en_yop[ipl] > max_en) { |
|
|
max_en = en_yop[ipl]; |
|
|
fMax_plane = ipl; |
|
|
}; |
|
|
}; |
|
|
// |
|
|
for (Int_t iplm=0;iplm<=(fMax_plane+fPl) ;iplm++) en_maxplane += en_yop[iplm]; |
|
|
}; |
|
|
if ( fYesel ){ |
|
|
max_en = 0.; |
|
|
for (Int_t ipl =0; ipl < 11; ipl ++) { |
|
|
if(en_yep[ipl] > max_en) { |
|
|
max_en = en_yep[ipl]; |
|
|
fMax_plane = ipl; |
|
|
}; |
|
|
}; |
|
|
// |
|
|
for (Int_t iplm=0;iplm<=(fMax_plane+fPl) ;iplm++) en_maxplane += en_yep[iplm]; |
|
|
}; |
|
|
// |
|
|
fEnergy = en_maxplane/fCount/fConv_r; |
|
|
// |
|
|
if ( debug ) printf(" fMax_plane %i conv_r %f en_maxplane %f encalo %f \n",fMax_plane,fConv_r,en_maxplane,fEnergy); |
|
| 675 |
if ( debug ) printf(" XE %i XO %i YE %i YO %i \n",fXesel,fXosel,fYesel,fYosel); |
if ( debug ) printf(" XE %i XO %i YE %i YO %i \n",fXesel,fXosel,fYesel,fYosel); |
| 676 |
// |
// |
| 677 |
} else { |
} else { |