188 float h_eta_min = -5.0;
196 double *xbins =
new double[n_logener_bins+1];
197 const double inv_n_logener_bins = 1. /
static_cast<double> (n_logener_bins);
198 for(
int i_bin=0; i_bin<=n_logener_bins; i_bin++) {
212 sprintf(hname,
"hp_engTag_vs_eta_tag%d_ener%d",i_tag, i_ener);
213 TProfile *hp =
new TProfile(hname, hname, h_nch_eta, h_eta_min, h_eta_max);
214 hp->GetXaxis()->SetTitle(
"#eta");
215 hp->GetYaxis()->SetTitle(
"E_{class}/E_{tot}");
223 for(
int i_eta=0; i_eta<
m_netabin; i_eta++) {
224 sprintf(hname,
"hp_engTag_vs_ebeam_tag%d_eta%d",i_tag, i_eta);
225 TProfile *hp =
new TProfile(hname, hname, n_logener_bins, xbins);
226 hp->GetXaxis()->SetTitle(
"E_{#pi}, MeV");
227 hp->GetYaxis()->SetTitle(
"E_{class}/E_{tot}");
247 double ylow(0), yup(0);
252 sprintf(hname,
"hp_engRecOverTruth_vs_eta_coll%d_norm%d_ener%d",i_coll, i_norm, i_ener);
253 TProfile *hp =
new TProfile(hname, hname, h_nch_eta, h_eta_min, h_eta_max, ylow, yup);
254 hp->GetXaxis()->SetTitle(
"#eta");
256 hp->GetYaxis()->SetTitle(
"E_{reco}/E_{#pi}");
258 hp->GetYaxis()->SetTitle(
"E_{reco}/E_{calib}");
270 for(
int i_eta=0; i_eta<
m_netabin; i_eta++) {
271 double ylow(0), yup(0);
276 sprintf(hname,
"hp_m_engRecOverTruth_vs_ebeam_coll%d_norm%d_eta%d",i_coll, i_norm, i_eta);
277 TProfile *hp =
new TProfile(hname, hname, n_logener_bins, xbins, ylow, yup);
278 hp->GetXaxis()->SetTitle(
"E_{#pi}, MeV");
280 hp->GetYaxis()->SetTitle(
"E_{reco}/E_{#pi}");
282 hp->GetYaxis()->SetTitle(
"E_{reco}/E_{calib}");
300 for(
int i_eta=0; i_eta<
m_netabin; i_eta++){
301 sprintf(hname,
"hp_engRecSpect_coll%d_ener%d_eta%d",i_coll, i_ener, i_eta);
302 TH1F *h1 =
new TH1F(hname, hname, 110, -0.2, 2.0);
303 h1->GetXaxis()->SetTitle(
"E_{reco}/E_{#pi}");
312 for(
int i_eta=0; i_eta<
m_netabin; i_eta++){
313 sprintf(hname,
"hp_engPionSpect_ener%d_eta%d",i_ener, i_eta);
316 TH1F *h1 =
new TH1F(hname, hname, 20, x1, x2);
317 h1->GetXaxis()->SetTitle(
"E_{#pi}, MeV");
331 for(
int i_eta=0; i_eta<
m_netabin; i_eta++){
332 sprintf(hname,
"hp_engNoiseClusSpect_coll%d_eta%d",i_coll, i_eta);
333 TH1F *h1 =
new TH1F(hname, hname, 100, -2000., 2000.);
334 h1->GetXaxis()->SetTitle(
"E_{clus}, MeV");
341 sprintf(hname,
"hp_engNoiseClus_vs_eta_coll%d",i_coll);
342 TProfile *hp =
new TProfile(hname, hname, h_nch_eta, h_eta_min, h_eta_max);
343 hp->GetXaxis()->SetTitle(
"#eta");
344 hp->GetYaxis()->SetTitle(
"E_{clus}, MeV");
360 sprintf(hname,
"hp_clusMoment_vs_eta_mom%d_sum%d_ener%d",i_mom, i_sum, i_ener);
361 TProfile *hp =
new TProfile(hname, hname, h_nch_eta, h_eta_min, h_eta_max);
362 hp->GetXaxis()->SetTitle(
"#eta");
363 hp->GetYaxis()->SetTitle(
"Mom_{cls}/Mom_{sum}");
375 for(
int i_eta=0; i_eta<
m_netabin; i_eta++){
376 sprintf(hname,
"hp_clusMoment_vs_ebeam_mom%d_sum%d_eta%d",i_mom, i_sum, i_eta);
377 TProfile *hp =
new TProfile(hname, hname, n_logener_bins, xbins);
378 hp->GetXaxis()->SetTitle(
"E_{#pi}");
379 hp->GetYaxis()->SetTitle(
"Mom_{cls}/Mom_{sum}");
394 for(
int i_eff=0; i_eff<2; i_eff++){
397 sprintf(hname,
"hp_m_RecoEfficiency_eff%d_ener%d", i_eff, i_ener);
398 TH1F *h1 =
new TH1F(hname, hname, h_nch_eta, h_eta_min, h_eta_max);
399 h1->GetXaxis()->SetTitle(
"#eta");
400 h1->GetYaxis()->SetTitle(
"Efficiency");
405 for(
int i_eff=0; i_eff<2; i_eff++){
407 for(
int i_eta=0; i_eta<
m_netabin; i_eta++){
408 sprintf(hname,
"hp_m_RecoEfficiency_eff%d_eta%d", i_eff, i_eta);
409 TH1F *h1 =
new TH1F(hname, hname, n_logener_bins, xbins);
410 h1->GetXaxis()->SetTitle(
"E_{#pi}, MeV");
411 h1->GetYaxis()->SetTitle(
"Efficiency");
426 sprintf(hname,
"hp_SumCalibHitOverEbeam_vs_eta_ener%d", i_ener);
427 TProfile *hp =
new TProfile(hname, hname, h_nch_eta, h_eta_min, h_eta_max);
428 hp->GetXaxis()->SetTitle(
"#eta");
429 hp->GetYaxis()->SetTitle(
"#sum E_{calib}/E_{#pi}");
431 sprintf(hname,
"hp_DefaultCalculatorOverEbeam_vs_eta_ener%d", i_ener);
432 hp =
new TProfile(hname, hname, h_nch_eta, h_eta_min, h_eta_max);
433 hp->GetXaxis()->SetTitle(
"#eta");
434 hp->GetYaxis()->SetTitle(
"#sum E_{DefCalc}/E_{#pi}");
436 sprintf(hname,
"hp_SumCalibHitAssignedOverEbeam_vs_eta_ener%d", i_ener);
437 hp =
new TProfile(hname, hname, h_nch_eta, h_eta_min, h_eta_max);
438 hp->GetXaxis()->SetTitle(
"#eta");
439 hp->GetYaxis()->SetTitle(
"#sum E_{assigned}/E_{#pi}");
441 sprintf(hname,
"hp_SumCalibHitAssignedOverEbeam_vs_etaphi_ener%d", i_ener);
442 TProfile2D *hp2 =
new TProfile2D(hname, hname, 25, h_eta_min, h_eta_max, 25, -
M_PI,
M_PI);
443 hp2->GetXaxis()->SetTitle(
"#eta");
444 hp2->GetYaxis()->SetTitle(
"#phi");
445 hp2->GetZaxis()->SetTitle(
"#sum E_{assigned}/E_{#pi}");
473 return StatusCode::SUCCESS;
663 if( truthEvent->
at(0)->particles_empty() ){
665 return StatusCode::FAILURE;
668 for (
auto p: *truthEvent->
at(0)) {
671 std::abs(p->pdg_id()) ==
MC::PI0) {
678 ATH_MSG_ERROR(
"No final stable pion in McEventCollection" );
679 return StatusCode::FAILURE;
681 m_mc_eta = gen->momentum().pseudoRapidity();
693 if(clusColl->empty()) {
695 return StatusCode::SUCCESS;
700 bool PionWasReconstructed =
false;
701 float engClusCalibThs = 1.0*
MeV;
702 HepLorentzVector hlv_pion(1,0,0,1);
709 double mx_dens, mx_center_lambda;
711 mx_center_lambda = 0;
715 HepLorentzVector hlv_cls(1,0,0,1);
716 hlv_cls.setREtaPhi(1./cosh(theCluster->eta()), theCluster->eta(), theCluster->phi());
717 double r = hlv_pion.angle(hlv_cls.vect());
719 && mx_calib_tot > engClusCalibThs
720 && theCluster->size() > 1
722 && mx_center_lambda != 0.0 ) {
723 PionWasReconstructed =
true;
727 if(PionWasReconstructed){
752 return StatusCode::SUCCESS;
763 const EventContext& ctx)
768 std::vector<const xAOD::CaloClusterContainer *> clusCollVector;
771 clusCollVector.push_back(pColl.
cptr());
774 HepLorentzVector hlv_pion(1,0,0,1);
777 std::vector<double > engClusSum;
779 std::vector<double > engClusSumPresOnly;
782 double engClusSumCalib(0);
783 double engClusSumCalibPresOnly(0);
784 double engClusSumTrueOOC(0);
785 double engClusSumTrueDM(0);
786 std::vector<double> engClusSumCalibTagged;
790 unsigned int iClus = -1;
797 double mx_calib_emb0 = 0;
798 double mx_calib_eme0 = 0;
799 double mx_calib_tileg3 = 0;
803 ATH_MSG_ERROR(
"One of the moment ENG_CALIB_EMB0, ENG_CALIB_EME0, ENG_CALIB_TILEG3 is absent" );
805 double mx_calib_out = 0;
806 double mx_calib_dead_tot = 0;
809 ATH_MSG_ERROR(
"One of the moment ENG_CALIB_OUT_L, ENG_CALIB_DEAD_TOT is absent" );
812 double mx_dens, mx_center_lambda;
814 mx_center_lambda = 0;
818 bool clusIsGood(
true);
825 HepLorentzVector hlv_cls(1,0,0,1);
826 hlv_cls.setREtaPhi(1./cosh(theCluster->eta()), theCluster->eta(), theCluster->phi());
827 double r = hlv_pion.angle(hlv_cls.vect());
832 theCluster = clusCollVector[
kTOPO]->at(iClus);
836 engClusSumCalibTagged[
kTAGEM] += mx_calib_tot;
838 engClusSumCalibTagged[
kTAGHAD] += mx_calib_tot;
840 engClusSumCalibTagged[
kTAGUNK] += mx_calib_tot;
847 engClusSumCalib += mx_calib_tot;
848 engClusSumCalibPresOnly += (mx_calib_emb0+mx_calib_eme0+mx_calib_tileg3);
849 engClusSumTrueOOC += mx_calib_out;
850 engClusSumTrueDM += mx_calib_dead_tot;
852 theCluster = clusCollVector[i_coll]->at(iClus);
853 engClusSum[i_coll] += theCluster->e();
854 engClusSumPresOnly[i_coll] += (theCluster->eSample(CaloSampling::PreSamplerB)+theCluster->eSample(CaloSampling::PreSamplerE)+theCluster->eSample(CaloSampling::TileGap3));
862 theCluster = clusCollVector[i_coll]->at(iClus);
871 if(nGoodClus == 0)
return 0;
880 double enom = engClusSum[i_coll];
881 if(i_coll !=
kTOPO) {
882 enom = enom - engClusSumPresOnly[i_coll];
890 double edenom = engClusSumCalib - engClusSumCalibPresOnly;
892 edenom += engClusSumTrueOOC;
893 }
else if(i_coll ==
kTOPO){
894 edenom += (engClusSumTrueOOC + engClusSumTrueDM);
902 enom = engClusSum[i_coll] - engClusSumPresOnly[i_coll];
905 enom = engClusSumCalib - engClusSumCalibPresOnly + engClusSumRecoOOC;
906 }
else if(i_coll ==
kTOPO){
908 enom = (engClusSumCalib - engClusSumCalibPresOnly) + engClusSumTrueOOC + engClusSumRecoDM;
921 if(engClusSumCalib!=0.0) {
922 const double inv_engClusSumCalib = 1. / engClusSumCalib;
935 double enom = engClusSum[i_coll];
936 if(i_coll !=
kTOPO) {
937 enom = enom - engClusSumPresOnly[i_coll];
952 const EventContext& ctx)
954 ATH_MSG_DEBUG(
"GetLCSinglePionsPerf::fill_moments got cont. size: "<<clusColl.
size());
958 std::vector<const CaloCalibrationHitContainer *> v_cchc;
961 v_cchc.push_back(cchc.
cptr());
964 std::vector<const CaloCalibrationHitContainer *> v_dmcchc;
967 v_dmcchc.push_back(cchc.
cptr());
971 double engCalibTot = 0.0;
972 std::vector<double > engCalibTotSmp;
973 engCalibTotSmp.resize(CaloSampling::Unknown, 0.0);
979 ATH_MSG_WARNING(
"Error! Bad identifier " << myId <<
" in container '" << cchc->Name() <<
"',"
980 <<
" AtlasDetectorID says '" <<
m_id_helper->show_to_string(myId) <<
"'");
984 ATH_MSG_WARNING(
"Error! Bad identifier (nor lar or tile) " << myId <<
" in container '" << cchc->Name() <<
"',"
985 <<
" AtlasDetectorID says '" <<
m_id_helper->show_to_string(myId) <<
"'");
990 engCalibTot += hit->energyTotal();
991 engCalibTotSmp[nsmp] += hit->energyTotal();
996 double engCalibDeadTot = 0.0;
997 std::vector<double > engCalibDeadTotInArea;
1004 ATH_MSG_ERROR(
"GetLCSinglePionsPerf::fill_moments() -> Error! Bad dead material identifier " << myId <<
" in container '" << dmcchc->Name() <<
"',"
1005 <<
" AtlasDetectorID says '" <<
m_id_helper->show_to_string(myId) <<
"'");
1009 ATH_MSG_ERROR(
"GetLCSinglePionsPerf::fill_moments() -> Error! Bad dead material identifier (nor lar_dm or tile_dm) " << myId <<
" in container '" << dmcchc->Name() <<
"',"
1010 <<
" AtlasDetectorID says '" <<
m_id_helper->show_to_string(myId) <<
"'");
1013 engCalibDeadTot += hit->energyTotal();
1018 ATH_MSG_ERROR(
"GetLCSinglePionsPerf::fill_moments() -> Error! Absent DM description element!");
1022 engCalibDeadTotInArea[nDmArea] += hit->energyTotal();
1033 double engClusSumCalib(0);
1034 double engClusSumCalibPresOnly(0);
1035 std::vector<std::vector<double > > clsMoments;
1036 clsMoments.resize(clusColl.
size());
1037 std::vector<double > clsMomentsSum;
1041 unsigned int iClus = -1;
1048 if( theCluster->retrieveMoment((*im).second, mx) ) {
1049 clsMoments[iClus][iMoment] = mx;
1051 ATH_MSG_ERROR(
"GetLCSinglePionsPerf::fill_moments() -> Error! Can't retrieve moment " << (*im).first <<
" " << (*im).second);
1053 clsMomentsSum[iMoment] += clsMoments[iClus][iMoment];
1057 engClusSumCalib += mx;
1059 ATH_MSG_ERROR(
"GetLCSinglePionsPerf::fill_moments() -> Error! Can't retrieve moment xAOD::CaloCluster::ENG_CALIB_TOT ");
1061 double mx_calib_emb0, mx_calib_eme0, mx_calib_tileg3;
1065 ATH_MSG_WARNING(
"One of the moment ENG_CALIB_EMB0, ENG_CALIB_EME0, ENG_CALIB_TILEG3 is absent");
1067 engClusSumCalibPresOnly += (mx_calib_emb0+mx_calib_eme0+mx_calib_tileg3);
1071 double engCalibDeadTotWithPres = engCalibDeadTot + engClusSumCalibPresOnly;
1076 + engCalibTotSmp[CaloSampling::PreSamplerB];
1081 + engCalibTotSmp[CaloSampling::TileGap3];
1085 + engCalibTotSmp[CaloSampling::PreSamplerE];
1094 double eng_calib_dead_unclass = engCalibDeadTotWithPres - eng_calib_dead_emb0 - eng_calib_dead_tile0
1095 - eng_calib_dead_tileg3 - eng_calib_dead_eme0 - eng_calib_dead_hec0 - eng_calib_dead_fcal
1096 - eng_calib_dead_leakage;
1102 switch ( (*im).second ) {
1104 xnorm = clsMomentsSum[iMoment];
1107 xnorm = engCalibTot - engClusSumCalib;
1110 xnorm = engCalibTot - engClusSumCalib;
1113 xnorm = engCalibTot - engClusSumCalib;
1116 xnorm = engCalibDeadTotWithPres;
1119 xnorm = eng_calib_dead_emb0;
1122 xnorm = eng_calib_dead_tile0;
1125 xnorm = eng_calib_dead_tileg3;
1128 xnorm = eng_calib_dead_eme0;
1131 xnorm = eng_calib_dead_hec0;
1134 xnorm = eng_calib_dead_fcal;
1137 xnorm = eng_calib_dead_leakage;
1140 xnorm = eng_calib_dead_unclass;
1143 ATH_MSG_ERROR(
"GetLCSinglePionsPerf::fill_moments() -> Error! Not implemented for " << (*im).first <<
" " << (*im).second);
1148 const double inv_xnorm = 1. / xnorm;
1149 for(
unsigned int i_cls=0; i_cls<clusColl.
size(); i_cls++){
1175 const EventContext& ctx)
1180 std::vector<const CaloCalibrationHitContainer *> v_cchc;
1183 v_cchc.push_back(cchc.
cptr());
1186 std::vector<const CaloCalibrationHitContainer *> v_dmcchc;
1189 v_dmcchc.push_back(cchc.
cptr());
1193 double engCalibTot = 0.0;
1199 ATH_MSG_ERROR(
"Error! Bad identifier " << myId <<
" in container '" << cchc->Name() <<
"',"
1200 <<
" AtlasDetectorID says '" <<
m_id_helper->show_to_string(myId) <<
"'");
1204 ATH_MSG_ERROR(
"Error! Bad identifier (nor lar or tile) " << myId <<
" in container '" << cchc->Name() <<
"',"
1205 <<
" AtlasDetectorID says '" <<
m_id_helper->show_to_string(myId) <<
"'");
1208 engCalibTot += hit->energyTotal();
1213 double engCalibDeadTot = 0.0;
1214 double engDefaultCalculator = 0.0;
1220 ATH_MSG_ERROR(
"GetLCSinglePionsPerf::fill_moments() -> Error! Bad dead material identifier " << myId <<
" in container '" << dmcchc->Name() <<
"',"
1221 <<
" AtlasDetectorID says '" <<
m_id_helper->show_to_string(myId) <<
"'");
1225 ATH_MSG_ERROR(
"GetLCSinglePionsPerf::fill_moments() -> Error! Bad dead material identifier (nor lar_dm or tile_dm) " << myId <<
" in container '" << dmcchc->Name() <<
"',"
1226 <<
" AtlasDetectorID says '" <<
m_id_helper->show_to_string(myId) <<
"'");
1229 engCalibDeadTot += hit->energyTotal();
1234 ATH_MSG_ERROR(
"GetLCSinglePionsPerf::fill_moments() -> Error! Absent DM description element!");
1244 double engCalibAssigned = 0.0;
1245 double engClusSumCalibPresOnly = 0.0;
1247 double mx_calib_tot, mx_calib_ooc, mx_calib_dm;
1262 engCalibAssigned += (mx_calib_tot + mx_calib_ooc + mx_calib_dm);
1264 double mx_calib_emb0, mx_calib_eme0, mx_calib_tileg3;
1268 ATH_MSG_WARNING(
"One of the moment ENG_CALIB_EMB0, ENG_CALIB_EME0, ENG_CALIB_TILEG3 is absent");
1270 engClusSumCalibPresOnly += (mx_calib_emb0+mx_calib_eme0+mx_calib_tileg3);
1275 engCalibAssigned -= engClusSumCalibPresOnly;