27 #include "CLHEP/Units/SystemOfUnits.h"
71 the_aeta = std::abs (adj_eta);
73 the_aeta = std::abs (eta);
75 const float etamax =
m_etamax (myctx);
76 if (the_aeta >= etamax)
return;
81 if (the_aeta < eta_start_crack)
83 else if (the_aeta > eta_end_crack)
95 ATH_MSG_DEBUG(
"************************************************************************************************" <<
endmsg);
98 ATH_MSG_DEBUG(
"************************************************************************************************" <<
endmsg);
100 unsigned int shape[] = {2};
102 interp_barriers[0] = eta_start_crack;
103 interp_barriers[1] = eta_end_crack;
105 int ibin = (
static_cast<int> (the_aeta / etamax * 100)) ;
107 int ibin_frontCorr = ibin;
109 if (the_aeta>2.35) ibin_frontCorr = (
static_cast<int> (2.35 / etamax * 100)) ;
123 ATH_MSG_DEBUG(
"Check etas -------------------------------------------------------------------"<<
endmsg);
124 ATH_MSG_DEBUG(
"Eta --> " << the_aeta <<
" Bin --> " << ibin <<
" Cluster eta = " << cluster->
eta() <<
endmsg);
125 ATH_MSG_DEBUG(
"ETA = " << std::abs (adj_eta) <<
" ADJ_ETA = " << std::abs (eta)<<
endmsg);
127 ATH_MSG_DEBUG(
"Check calibration coefficients -----------------------------------------------"<<
endmsg);
131 <<
" " << ooc[2] <<
" " << ooc[3] <<
endmsg);
133 <<
" " << lleak[2] <<
" " << lleak[3] <<
endmsg);
135 <<froffset[1] <<
" " << froffset[2] <<
" " << froffset[3] <<
endmsg);
136 ATH_MSG_DEBUG(
"Front Slope : " << frslope[0] <<
" " << frslope[1]
137 <<
" " << frslope[2] <<
" " << frslope[3] <<
endmsg);
139 <<
" " << sec[2] <<
" " << sec[3] <<
endmsg);
160 if (shower_lbary == 0)
return;
162 if (shower_lbary < 5. || shower_lbary > 25.) {
170 double eacc_base = 0;
171 for (
int sampling=1; sampling<4; sampling++) {
172 eacc_base += cluster->
eSample(samps[si][sampling]);
173 ATH_MSG_DEBUG(
"Barrel/endcap = " << si <<
" Sampling = " << sampling <<
" Energy -->> " << cluster->
eSample(samps[si][sampling]) <<
endmsg);
175 double eps_base = cluster->
eSample (samps[si][0]);
177 ATH_MSG_DEBUG(
"E accordion base --->>>> " << eacc_base <<
" Eps base " << eps_base <<
endmsg);
183 double depth_max = 20. + (eacc_base+eps_base)*(3./
TeV) ;
185 ATH_MSG_DEBUG(
"Bary max for this event ---->> " << depth_max
188 if ( shower_lbary > depth_max ) {
202 acc[1] +
acc[2] * shower_lbary +
acc[3] * shower_lbary * shower_lbary ;
204 double e_out_perc = 0;
205 if (the_aeta < eta_start_crack) {
206 e_out_perc = ooc[1] + ooc[2] * shower_lbary + ooc[3] * shower_lbary * shower_lbary ;
208 else if (the_aeta > eta_end_crack) {
209 e_out_perc = ooc[1] + ooc[2] * shower_lbary + ooc[3] / shower_lbary ;
212 double e_acc_reco=acc_corr*(eacc_base )*(1+(e_out_perc)*0.01);
218 double e_leak_perc = 0;
226 e_leak_perc = lleak[3] + lleak[1] * shower_lbary + lleak[2] *
exp(shower_lbary);
228 if (e_leak_perc < 0 ) e_leak_perc = 0.;
229 if (e_leak_perc > 100.) e_leak_perc = 100.;
230 double e_leak_reco = e_leak_perc * (e_acc_reco)*0.01;
238 double raw_energy=e_acc_reco*1
e-3;
239 double e_front_reco = eps_base;
241 if (raw_energy <= 1) {
245 else if (the_aeta < 1.8) {
247 if (the_aeta < eta_start_crack) {
248 double WpsOff = froffset[1] + froffset[2] * raw_energy +
249 froffset[3] * raw_energy * raw_energy;
250 double WpsSlo = frslope[1] *
pow(
log(raw_energy),
251 static_cast<double>(frslope[2])) +
252 frslope[3] *sqrt( raw_energy );
253 e_front_reco=WpsOff + WpsSlo*(eps_base );
256 ATH_MSG_DEBUG(
" froffset coeff " << froffset[1] <<
" " << froffset[2] <<
" " << froffset[3] <<
endmsg);
257 ATH_MSG_DEBUG(
" frslope coeff " << frslope[1] <<
" " << frslope[2] <<
" " << frslope[3] <<
endmsg);
263 if (raw_energy<20.) raw_energy=20.;
265 double WpsOff = froffset[1] + froffset[2] * raw_energy +
266 froffset[3] * sqrt(raw_energy);
267 double WpsSlo = frslope[1] + frslope[2] *
log(raw_energy) +
268 frslope[3] * sqrt(raw_energy);
269 double WpsSlo2 = sec[1] + sec[2] * raw_energy -
270 sec[3] / (raw_energy * raw_energy) ;
271 e_front_reco=WpsOff + WpsSlo*(eps_base) + WpsSlo2*(eps_base)*(eps_base);
272 if (e_front_reco<0.) e_front_reco= eps_base;
276 << froffset[2] <<
" " << froffset[3] <<
" " << WpsOff <<
endmsg);
278 << frslope[2] <<
" " << frslope[3] <<
" " << WpsSlo <<
endmsg);
280 << sec[2] <<
" " << sec[3] <<
" " << WpsSlo2 <<
endmsg);
281 ATH_MSG_DEBUG(
" WpsOff, WpsSlo, WpsSlo2 " << WpsOff <<
" " << WpsSlo <<
" " << WpsSlo2 <<
endmsg);
289 double p1 = froffset[1] + froffset[2] * raw_energy +
290 froffset[3]* raw_energy * raw_energy ;
291 double p2 = frslope[1] + frslope[2] * raw_energy +
292 frslope[3] * raw_energy * raw_energy ;
293 double p3 = sec[1] + sec[2] * raw_energy +
294 sec[3] * raw_energy * raw_energy ;
297 << froffset[2] <<
" " << froffset[3] <<
endmsg);
299 << frslope[2] <<
" " << frslope[3] <<
endmsg);
301 << sec[2] <<
" " << sec[3] <<
endmsg);
303 e_front_reco= (
p1 +
p2 * shower_lbary +
p3 * shower_lbary * shower_lbary);
304 if (e_front_reco<0.) e_front_reco=eps_base;
311 double e_calo_reco =e_front_reco + e_leak_reco + e_acc_reco;
313 ATH_MSG_DEBUG(
"CaloSwCalibrationHits::Final reco energy ---------------------- " << e_calo_reco <<
endmsg);
314 ATH_MSG_DEBUG(
"CaloSwCalibrationHits::Front ---------------------- " << e_front_reco <<
endmsg);
315 ATH_MSG_DEBUG(
"CaloSwCalibrationHits::Accordion ------------------ " << e_acc_reco <<
endmsg);
316 ATH_MSG_DEBUG(
"CaloSwCalibrationHits::out of cone ---------------- " << acc_corr*(eacc_base )*(e_out_perc)*0.01 <<
endmsg);
317 ATH_MSG_DEBUG(
"CaloSwCalibrationHits::Leakage -------------------- " << e_leak_reco <<
endmsg);
338 cluster->setEnergy (samps[si][0], e_front_reco );
342 for (
int sampling=1; sampling<=2; sampling++){
343 cluster->setEnergy (samps[si][sampling], cluster->
eSample(samps[si][sampling]) * acc_corr );
348 cluster->setEnergy (samps[si][3], cluster->
eSample (samps[si][3]) * acc_corr + e_leak_reco);
353 for (
int nl = 0 ; nl< 4 ; nl++) e_temp += cluster->
eSample (samps [si][nl]);
355 ATH_MSG_DEBUG(
"---------- Sum of the sampling energy --- >> " << e_temp <<
" EcaloReco = " << e_calo_reco <<
endmsg);
357 cluster->
setE (e_calo_reco);
359 ATH_MSG_DEBUG(
"CaloSwCalibHitsCalibration::Energy after correction --> " << cluster->
e() <<
endmsg);