9 base_class(
type, name, parent),
40 if(runIndex<=0)
return 1;
50 if(runIndex<=0)
return 0;
61 ATH_MSG_DEBUG(
"Using unit weights and doing no eta-phi correction.");
65 unsigned int run_number=ctx.eventID().run_number();
76 ATH_MSG_DEBUG(
"Using run " << run_number <<
" generic calibration for eta-phi correction.");
83 ATH_MSG_WARNING(
"No calibration for " << run_number <<
" is avaliable and no generic run numbers were set. Doing no eta-phi correction.");
87 std::string str_defaultRunNumbers=
"";
90 str_defaultRunNumbers+=std::to_string(run_number)+
", ";
92 str_defaultRunNumbers.resize(str_defaultRunNumbers.length()-2);
94 ATH_MSG_WARNING(
"No calibration for " << run_number <<
" is avaliable; no generic calibration for runs "<<str_defaultRunNumbers<<
". Doing no eta-phi correction.");
111 TFile* f=TFile::Open(full_path.c_str());
115 return StatusCode::FAILURE;
118 m_h3W=(TH3F*)f->GetObjectChecked(
"h3_w",
"TH3F");
121 ATH_MSG_FATAL(
"Cannot find TH3F m_h3W in config file " << full_path );
122 return StatusCode::FAILURE;
125 m_h3Eta=(TH3F*)f->GetObjectChecked(
"h3_eta",
"TH3F");
128 ATH_MSG_FATAL(
"Cannot find TH3F m_h3Eta in config file " << full_path );
129 return StatusCode::FAILURE;
132 m_h3Phi=(TH3F*)f->GetObjectChecked(
"h3_phi",
"TH3F");
135 ATH_MSG_FATAL(
"Cannot find TH3F m_h3Phi in config file " << full_path );
136 return StatusCode::FAILURE;
139 m_h3Mag=(TH3F*)f->GetObjectChecked(
"h3_R",
"TH3F");
142 ATH_MSG_FATAL(
"Cannot find TH3F m_h3Mag in config file " << full_path );
143 return StatusCode::FAILURE;
146 m_h3W->SetDirectory(0);
153 ATH_MSG_DEBUG(
"ApplyCorrection is set to true, now loading h3_eta_phi_response, h3_eta_phi_offset, and h1_run_index.");
158 ATH_MSG_FATAL(
"Cannot find TH3F h3_eta_phi_response in config file " << full_path );
159 return StatusCode::FAILURE;
165 ATH_MSG_FATAL(
"Cannot find TH3F h3_eta_phi_offset in config file " << full_path );
166 return StatusCode::FAILURE;
170 TH1I* h1_run_index=(TH1I*)f->GetObjectChecked(
"h1_run_index",
"TH1I");
171 if(h1_run_index==
nullptr)
173 ATH_MSG_FATAL(
"Cannot find TH3F h1_run_index in config file " << full_path );
174 return StatusCode::FAILURE;
176 for(
int xbin=1; xbin<=h1_run_index->GetNbinsX(); xbin++) {
177 m_runMap.emplace_hint(
m_runMap.end(),std::make_pair(h1_run_index->GetBinContent(xbin),xbin));
182 ATH_MSG_DEBUG(
"ApplyCorrection is set to false, not loading h3_eta_phi_response, h3_eta_phi_offset, and h1_run_index.");
186 return StatusCode::SUCCESS;
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_MSG_WARNING(x)
std::string PathResolverFindCalibFile(const std::string &logical_file_name)