13 #include <TObjString.h>
39 TObjString* versionInfo{
nullptr};
50 std::vector<std::pair<double, double>> rangeEtaNoInt;
51 std::pair<double, double> apair(1.26, 1.665);
52 rangeEtaNoInt.push_back(apair);
54 std::vector<std::pair<double, double>> rangePtNoInt;
57 rangePtNoInt.push_back(apair);
58 std::map<std::string, Interp3D::VetoInterp> amap;
60 veto.xRange = rangePtNoInt;
61 veto.yRange = std::vector<std::pair<double, double>>();
62 amap.insert(std::make_pair(std::string(
"el_cutValues_ptvarcone20"),
veto));
63 veto.yRange = rangeEtaNoInt;
64 amap.insert(std::make_pair(std::string(
"el_cutValues_topoetcone20"),
veto));
65 m_Interp = std::make_unique<Interp3D>(amap);
78 #ifndef XAOD_STANDALONE
81 return StatusCode::SUCCESS;
86 if (container.empty())
return;
87 for (
const std::unique_ptr<IsolationCondition>& cond :
wp.conditions()) {
88 for (
unsigned int acc = 0;
acc < cond->num_types(); ++
acc) {
105 return StatusCode::FAILURE;
108 return StatusCode::SUCCESS;
115 return StatusCode::FAILURE;
118 std::string
varname(xAOD::Iso::toCString(isoCutRemap));
121 TH3F* calibHisto{
nullptr};
125 return StatusCode::FAILURE;
127 calibHisto->SetDirectory(
nullptr);
128 std::unique_ptr<TH3F>
histogram(calibHisto);
129 std::unique_ptr<IsolationConditionHist> ich =
133 wp->addCut(std::move(ich));
135 return StatusCode::SUCCESS;
144 std::unique_ptr<IsolationWP>
wp = std::make_unique<IsolationWP>(muWPname);
145 if (muWPname ==
"HighPtTrackOnly") {
146 wp->addCut(std::make_unique<IsolationConditionFormula>(
148 }
else if (muWPname ==
"TightTrackOnly_FixedRad") {
149 wp->addCut(std::make_unique<IsolationConditionFormula>(
151 wp->addCut(std::make_unique<IsolationConditionFormula>(
153 }
else if (muWPname ==
"Tight_FixedRad") {
154 wp->addCut(std::make_unique<IsolationConditionFormula>(
156 wp->addCut(std::make_unique<IsolationConditionFormula>(
159 }
else if (muWPname ==
"Loose_FixedRad") {
160 wp->addCut(std::make_unique<IsolationConditionFormula>(
162 wp->addCut(std::make_unique<IsolationConditionFormula>(
165 }
else if (muWPname ==
"TightTrackOnly_VarRad") {
166 wp->addCut(std::make_unique<IsolationConditionFormula>(
"MuonFixedCutHighMuTrackOnly",
168 }
else if (muWPname ==
"Tight_VarRad") {
169 wp->addCut(std::make_unique<IsolationConditionFormula>(
"MuonFixedCutHighMuTight_track",
172 }
else if (muWPname ==
"Loose_VarRad") {
173 wp->addCut(std::make_unique<IsolationConditionFormula>(
"MuonFixedCutHighMuLoose_track",
176 }
else if (muWPname ==
"PflowTight_FixedRad") {
181 wp->addCut(std::make_unique<IsolationConditionCombined>(
"MuonPFlowTightLowPt", isoTypesLowPt,
182 std::make_unique<TF2>(
"pflowTFunctionLowPt",
"fabs(x)+0.4*(y>0?y:0)"),
184 wp->addCut(std::make_unique<IsolationConditionCombined>(
"MuonPFlowTightHighPt", isoTypesHighPt,
185 std::make_unique<TF2>(
"pflowTFunctionHighPt",
"fabs(x)+0.4*(y>0?y:0)"),
187 }
else if (muWPname ==
"PflowTight_VarRad") {
190 wp->addCut(std::make_unique<IsolationConditionCombined>(
191 "MuonPFlowTight", isoTypes, std::make_unique<TF2>(
"pflowTFunction",
"fabs(x)+0.4*(y>0?y:0)"),
"0.045*x",
m_isoDecSuffix));
192 }
else if (muWPname ==
"PflowLoose_FixedRad") {
197 wp->addCut(std::make_unique<IsolationConditionCombined>(
"MuonPFlowLooseLowPt", isoTypesLowPt,
198 std::make_unique<TF2>(
"pflowLFunctionLowPt",
"fabs(x)+0.4*(y>0?y:0)"),
200 wp->addCut(std::make_unique<IsolationConditionCombined>(
"MuonPFlowLooseHighPt", isoTypesHighPt,
201 std::make_unique<TF2>(
"pflowLFunctionHighPt",
"fabs(x)+0.4*(y>0?y:0)"),
203 }
else if (muWPname ==
"PflowLoose_VarRad") {
206 wp->addCut(std::make_unique<IsolationConditionCombined>(
207 "MuonPFlowLoose", isoTypes, std::make_unique<TF2>(
"pflowTFunction",
"fabs(x)+0.4*(y>0?y:0)"),
"0.16*x",
m_isoDecSuffix));
210 return StatusCode::FAILURE;
213 #ifndef XAOD_STANDALONE
217 return StatusCode::SUCCESS;
221 std::unique_ptr<IsolationWP>
wp = std::make_unique<IsolationWP>(phWPname);
222 if (phWPname ==
"TightCaloOnly") {
224 }
else if (phWPname ==
"FixedCutTight") {
227 }
else if (phWPname ==
"FixedCutLoose") {
230 }
else if (phWPname ==
"Tight") {
232 wp->addCut(std::make_unique<IsolationConditionFormula>(
"PhFixedCut_Tighttrack20",
234 }
else if (phWPname ==
"Loose") {
236 wp->addCut(std::make_unique<IsolationConditionFormula>(
"PhFixedCut_Tighttrack20",
240 return StatusCode::FAILURE;
244 #ifndef XAOD_STANDALONE
250 return StatusCode::SUCCESS;
254 std::unique_ptr<IsolationWP>
wp = std::make_unique<IsolationWP>(elWPname);
256 if (elWPname ==
"HighPtCaloOnly") {
259 }
else if (elWPname ==
"Tight_VarRad") {
260 wp->addCut(std::make_unique<IsolationConditionFormula>(
263 }
else if (elWPname ==
"Loose_VarRad") {
264 wp->addCut(std::make_unique<IsolationConditionFormula>(
267 }
else if (elWPname ==
"TightTrackOnly_VarRad") {
268 wp->addCut(std::make_unique<IsolationConditionFormula>(
270 }
else if (elWPname ==
"TightTrackOnly_FixedRad") {
271 wp->addCut(std::make_unique<IsolationConditionFormula>(
273 wp->addCut(std::make_unique<IsolationConditionFormula>(
275 }
else if (elWPname ==
"PflowTight_FixedRad") {
280 wp->addCut(std::make_unique<IsolationConditionCombined>(
"ElecPFlowTightLowPt", isoTypesLowPt,
281 std::make_unique<TF2>(
"pflowTFunctionLowPt",
"fabs(x)+0.4*(y>0?y:0)"),
283 wp->addCut(std::make_unique<IsolationConditionCombined>(
"ElecPFlowTightHighPt", isoTypesHighPt,
284 std::make_unique<TF2>(
"pflowTFunctionHighPt",
"fabs(x)+0.4*(y>0?y:0)"),
286 }
else if (elWPname ==
"PflowTight") {
289 wp->addCut(std::make_unique<IsolationConditionCombined>(
290 "ElecPFlowTight", isoTypes, std::make_unique<TF2>(
"pflowLFunction",
"fabs(x)+0.4*(y>0?y:0)"),
"0.045*x",
m_isoDecSuffix));
291 }
else if (elWPname ==
"PflowLoose_FixedRad") {
296 wp->addCut(std::make_unique<IsolationConditionCombined>(
"ElecPFlowLooseLowPt", isoTypesLowPt,
297 std::make_unique<TF2>(
"pflowLFunctionLowPt",
"fabs(x)+0.4*(y>0?y:0)"),
299 wp->addCut(std::make_unique<IsolationConditionCombined>(
"ElecPFlowLooseHighPt", isoTypesHighPt,
300 std::make_unique<TF2>(
"pflowLFunctionHighPt",
"fabs(x)+0.4*(y>0?y:0)"),
302 }
else if (elWPname ==
"PflowLoose") {
305 wp->addCut(std::make_unique<IsolationConditionCombined>(
306 "ElecPFlowLoose", isoTypes, std::make_unique<TF2>(
"pflowLFunction",
"fabs(x)+0.4*(y>0?y:0)"),
"0.16*x",
m_isoDecSuffix));
308 ATH_MSG_ERROR(
"Unknown electron isolation WP: " << elWPname);
309 return StatusCode::FAILURE;
313 #ifndef XAOD_STANDALONE
319 return StatusCode::SUCCESS;
323 std::vector<std::pair<xAOD::Iso::IsolationType, std::string>>&
cuts,
325 std::vector<std::unique_ptr<IsolationWP>>* wps(
nullptr);
339 }
else if (ObjType == xAOD::Type::Other) {
340 if (
key ==
"")
return StatusCode::FAILURE;
344 return StatusCode::FAILURE;
347 std::unique_ptr<IsolationWP>
wp = std::make_unique<IsolationWP>(WPname);
351 for (
auto&
c :
cuts)
wp->addCut(std::make_unique<IsolationConditionFormula>(xAOD::Iso::toCString(
c.first),
c.first,
c.second));
353 ATH_MSG_ERROR(
"Unknown isolation WP type -- should not happen.");
354 return StatusCode::FAILURE;
358 wps->push_back(std::move(
wp));
359 return StatusCode::SUCCESS;
371 return StatusCode::FAILURE;
385 }
else if (ObjType == xAOD::Type::Other) {
389 return StatusCode::FAILURE;
392 return StatusCode::SUCCESS;
394 template <
typename T>
397 for (
const std::unique_ptr<IsolationWP>&
i :
WP) {