47{
48 ATH_MSG_INFO(
"Initializing the jet smearing correction tool");
49
51 {
53 return StatusCode::FAILURE;
54 }
56 {
58 return StatusCode::FAILURE;
59 }
60
61
65
66
67 TString smearType =
m_config->GetValue(
"SmearType",
"");
68 if (smearType == "")
69 {
70 ATH_MSG_FATAL(
"No jet smearing type was specified. Aborting.");
71 return StatusCode::FAILURE;
72 }
73 else if (!smearType.CompareTo("pt",TString::kIgnoreCase))
75 else if (!smearType.CompareTo("mass",TString::kIgnoreCase))
77 else if (!smearType.CompareTo("FourVec",TString::kIgnoreCase))
79 else
80 {
81 ATH_MSG_FATAL(
"Unrecognized jet smearing type: " << smearType.Data());
82 return StatusCode::FAILURE;
83 }
84
85
86 TString histType =
m_config->GetValue(
"SmearingCorrectionHistType",
"");
87 if (histType == "")
88 {
89 ATH_MSG_FATAL(
"No jet smearing histogram parametrization was specified. Aborting.");
90 return StatusCode::FAILURE;
91 }
92 else if (!histType.CompareTo("pt",TString::kIgnoreCase))
94 else if (!histType.CompareTo("PtEta",TString::kIgnoreCase))
96 else if (!histType.CompareTo("PtAbsEta",TString::kIgnoreCase))
98 else
99 {
100 ATH_MSG_FATAL(
"Unrecognized jet smearing histogram parametrization: " << histType.Data());
101 return StatusCode::FAILURE;
102 }
103
104
105 TString interpType =
m_config->GetValue(
"SmearingCorrectionInterpType",
"");
106 if (interpType == "")
107 {
108 ATH_MSG_FATAL(
"No jet smearing histogram interpolation type was specified. Aborting.");
109 return StatusCode::FAILURE;
110 }
111 else if (!interpType.CompareTo("full",TString::kIgnoreCase))
113 else if (!interpType.CompareTo("none",TString::kIgnoreCase))
115 else if (!interpType.CompareTo("onlyx",TString::kIgnoreCase))
117 else if (!interpType.CompareTo("onlyy",TString::kIgnoreCase))
119 else
120 {
121 ATH_MSG_FATAL(
"Unrecognized jet smearing interpolation type: " << interpType.Data());
122 return StatusCode::FAILURE;
123 }
124
125
126 TString smearingFile =
m_config->GetValue(
"SmearingCorrectionFile",
"");
127 if (smearingFile == "")
128 {
129 ATH_MSG_FATAL(
"No jet smearing correction file specified. Aborting.");
130 return StatusCode::FAILURE;
131 }
132
133
134 TString smearingHistNameMC =
m_config->GetValue(
"SmearingHistNameResolutionMC",
"");
135 if (smearingHistNameMC == "")
136 {
137 ATH_MSG_FATAL(
"No MC jet smearing histogram name specified. Aborting.");
138 return StatusCode::FAILURE;
139 }
140 TString smearingHistNameData =
m_config->GetValue(
"SmearingHistNameResolutionData",
"");
141 if (smearingHistNameData == "")
142 {
143 ATH_MSG_FATAL(
"No data jet smearing histogram name specified. Aborting.");
144 return StatusCode::FAILURE;
145 }
146
147
149 {
150 smearingFile.Remove(0,33);
151 smearingFile.Insert(0,"JetCalibTools/");
152 }
153 else
155
157 std::unique_ptr<TFile>
inputFile(TFile::Open(fileName));
159 {
160 ATH_MSG_FATAL(
"Cannot open jet smearing correction file: " << fileName);
161 return StatusCode::FAILURE;
162 }
163
164
167 {
168 ATH_MSG_FATAL(
"Failed to get specified histogram from the file: " << smearingHistNameMC.Data());
169 return StatusCode::FAILURE;
170 }
172
175 {
176 ATH_MSG_FATAL(
"Failed to get specified histogram from the file: " << smearingHistNameData.Data());
177 return StatusCode::FAILURE;
178 }
180
181
183
184
185
187 {
190 {
192 return StatusCode::FAILURE;
193 }
195 {
197 return StatusCode::FAILURE;
198 }
199 break;
200
204 {
206 return StatusCode::FAILURE;
207 }
209 {
211 return StatusCode::FAILURE;
212 }
213 break;
214
215 default:
216 ATH_MSG_FATAL(
"Read the histogram, but the parametrization is UNKNOWN");
217 return StatusCode::FAILURE;
218 }
219
220
222 {
224 return StatusCode::FAILURE;
226 return StatusCode::FAILURE;
227 }
228
229 return StatusCode::SUCCESS;
230}
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
std::string m_jetStartScale
StatusCode cacheProjections(TH1 *fullHistogram, std::vector< std::unique_ptr< TH1 > > &cacheLocation, const std::string &type)