| 45 |
delete clong; |
delete clong; |
| 46 |
clong = new CaloLong(L2); |
clong = new CaloLong(L2); |
| 47 |
clong->SplitInto(0,22); |
clong->SplitInto(0,22); |
| 48 |
|
// clong->HeavyTail(true); |
| 49 |
|
clong->HeavyTail(false); |
| 50 |
}; |
}; |
| 51 |
if ( cp ) delete cp; |
if ( cp ) delete cp; |
| 52 |
cp = NULL; |
cp = NULL; |
| 63 |
// cp->ForceCaloFit(); |
// cp->ForceCaloFit(); |
| 64 |
// cp->SetDebug(true); |
// cp->SetDebug(true); |
| 65 |
// cp->Process(); |
// cp->Process(); |
| 66 |
if ( clong ) clong->SetCaloLevel2Pointer(cp->GetLevel2Pointer()); |
if ( clong ) clong->SetCaloLevel2Pointer(cp->GetCaloLevel2Pointer()); |
| 67 |
} |
} |
| 68 |
|
|
| 69 |
|
|
| 72 |
fLong = true; |
fLong = true; |
| 73 |
if ( !clong ){ |
if ( !clong ){ |
| 74 |
clong = new CaloLong(L2); |
clong = new CaloLong(L2); |
| 75 |
if ( cp ) clong->SetCaloLevel2Pointer(cp->GetLevel2Pointer()); |
if ( cp ) clong->SetCaloLevel2Pointer(cp->GetCaloLevel2Pointer()); |
| 76 |
clong->SplitInto(0,22); |
clong->SplitInto(0,22); |
| 77 |
|
// clong->HeavyTail(true); |
| 78 |
|
clong->HeavyTail(false); |
| 79 |
}; |
}; |
| 80 |
// |
// |
| 81 |
} |
} |
| 95 |
asntr = "start"; |
asntr = "start"; |
| 96 |
// |
// |
| 97 |
debug = false; |
debug = false; |
| 98 |
|
usepl18x = false; |
| 99 |
// |
// |
| 100 |
indep = false; |
indep = false; |
| 101 |
// |
// |
| 123 |
fYomin = 1000; |
fYomin = 1000; |
| 124 |
fYemin = 1000; |
fYemin = 1000; |
| 125 |
// |
// |
| 126 |
|
this->UseCaloPreSampler(); // use it by default, to go back to "standard" mode use CaloEnergy::UseLevel2(). |
| 127 |
|
// |
| 128 |
} |
} |
| 129 |
void CaloEnergy::DefineGeometry(){ |
void CaloEnergy::DefineGeometry(){ |
| 130 |
// |
// |
| 279 |
entot[0] = 0.; |
entot[0] = 0.; |
| 280 |
entot[1] = 0.; |
entot[1] = 0.; |
| 281 |
// |
// |
| 282 |
|
X0pl = 0.76; |
| 283 |
|
// |
| 284 |
} |
} |
| 285 |
|
|
| 286 |
void CaloEnergy::Print(){ |
void CaloEnergy::Print(){ |
| 337 |
printf(" fYEen_maxplane:........ %f \n",fYEen_maxplane); |
printf(" fYEen_maxplane:........ %f \n",fYEen_maxplane); |
| 338 |
printf(" fYOen_maxplane:........ %f \n",fYOen_maxplane); |
printf(" fYOen_maxplane:........ %f \n",fYOen_maxplane); |
| 339 |
printf(" x0max :.............. %f \n",x0max); |
printf(" x0max :.............. %f \n",x0max); |
| 340 |
|
printf(" X0pl :.............. %f \n",X0pl); |
| 341 |
printf(" debug :.............. %i \n",debug); |
printf(" debug :.............. %i \n",debug); |
| 342 |
|
|
| 343 |
printf("========================================================================\n"); |
printf("========================================================================\n"); |
| 531 |
// |
// |
| 532 |
for (Int_t ch=0; ch< L2->GetCaloLevel1()->istrip; ch++){ |
for (Int_t ch=0; ch< L2->GetCaloLevel1()->istrip; ch++){ |
| 533 |
en = L2->GetCaloLevel1()->DecodeEstrip(ch,view,plane,strip); |
en = L2->GetCaloLevel1()->DecodeEstrip(ch,view,plane,strip); |
| 534 |
|
// |
| 535 |
|
if ( !usepl18x && view==0 && plane==18 ) en = 0.; |
| 536 |
|
// |
| 537 |
enstrip[view][plane][strip]=en; |
enstrip[view][plane][strip]=en; |
| 538 |
}; |
}; |
| 539 |
// |
// |
| 540 |
if ( debug && ((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)); |
if ( debug && ((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)); |
| 541 |
// |
// |
| 542 |
|
// inclination factor (stolen from Daniele's code) |
| 543 |
|
// |
| 544 |
|
Float_t ytgx = 0; |
| 545 |
|
Float_t ytgy = 0; |
| 546 |
|
ytgx = 0.76 * cl2->tanx[0]; |
| 547 |
|
ytgy = 0.76 * cl2->tany[0]; |
| 548 |
|
X0pl = sqrt( pow(0.76,2.) + pow(ytgx,2.) + pow(ytgy,2.) ); |
| 549 |
|
// |
| 550 |
// sum energy plane by plane for each sections |
// sum energy plane by plane for each sections |
| 551 |
// |
// |
| 552 |
Float_t fen_xep[11]; |
Float_t fen_xep[11]; |
| 662 |
// |
// |
| 663 |
if ( x0max > 0. ){ |
if ( x0max > 0. ){ |
| 664 |
if ( debug ) printf(" CALCULATE MAX PLANE GIVEN X0 ASSUMING PERPENDICULAR TRACK \n"); |
if ( debug ) printf(" CALCULATE MAX PLANE GIVEN X0 ASSUMING PERPENDICULAR TRACK \n"); |
| 665 |
Int_t wpl = (Int_t)roundf(x0max/0.76); |
// Int_t wpl = (Int_t)roundf(x0max/0.76); |
| 666 |
|
Int_t wpl = (Int_t)roundf(x0max/X0pl); |
| 667 |
Bool_t isY = false; |
Bool_t isY = false; |
| 668 |
if ( ((x0max/0.76)-(Float_t)wpl) > 0. ) isY = true; |
// if ( ((x0max/0.76)-(Float_t)wpl) > 0. ) isY = true; |
| 669 |
|
if ( ((x0max/X0pl)-(Float_t)wpl) > 0. ) isY = true; |
| 670 |
xomax_en = 0.; |
xomax_en = 0.; |
| 671 |
yemax_en = 0.; |
yemax_en = 0.; |
| 672 |
xemax_en = 0.; |
xemax_en = 0.; |
| 707 |
if ( section.Contains("YO") ) yomax_en = 10.; |
if ( section.Contains("YO") ) yomax_en = 10.; |
| 708 |
}; |
}; |
| 709 |
}; |
}; |
| 710 |
if ( debug ) printf(" x0max %f x0max/0.76 %f wpl %i isY %i yomax_en %f xemax_en %f yemax_en %f xomax_en %f fMaxplane %i %i %i %i\n",x0max,(x0max/0.76),wpl,isY,yomax_en,xemax_en,yemax_en,xomax_en,fMax_planeyo,fMax_planexe,fMax_planeye,fMax_planexo); |
// if ( debug ) printf(" x0max %f x0max/0.76 %f wpl %i isY %i yomax_en %f xemax_en %f yemax_en %f xomax_en %f fMaxplane %i %i %i %i\n",x0max,(x0max/0.76),wpl,isY,yomax_en,xemax_en,yemax_en,xomax_en,fMax_planeyo,fMax_planexe,fMax_planeye,fMax_planexo); |
| 711 |
|
if ( debug ) printf(" x0max %f x0max/X0pl %f X0pl %f wpl %i isY %i yomax_en %f xemax_en %f yemax_en %f xomax_en %f fMaxplane %i %i %i %i\n",x0max,(x0max/X0pl),X0pl,wpl,isY,yomax_en,xemax_en,yemax_en,xomax_en,fMax_planeyo,fMax_planexe,fMax_planeye,fMax_planexo); |
| 712 |
}; |
}; |
| 713 |
// |
// |
| 714 |
Int_t nPl = fPl; |
Int_t nPl = fPl; |
| 1140 |
// |
// |
| 1141 |
// check if the cylinder of integration can go out of the sensor given the frame which has been set (if we use all the calorimeter fRad is < 0 and the printout is suppressed) |
// check if the cylinder of integration can go out of the sensor given the frame which has been set (if we use all the calorimeter fRad is < 0 and the printout is suppressed) |
| 1142 |
// |
// |
| 1143 |
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)); |
if ( (fM1+0.122-0.244*(Float_t)fRad) < 0.001 ) 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)); |
| 1144 |
// |
// |
| 1145 |
if ( fLong ){ |
if ( fLong ){ |
| 1146 |
if ( debug ) printf(" ==================================================================> LONGITUDINAL FIT! \n"); |
if ( debug ) printf(" ==================================================================> LONGITUDINAL FIT! \n"); |