ATLAS Offline Software
IsolationSelectionTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3  */
4 
10 #include <TF2.h>
11 #include <TFile.h>
12 #include <TH3.h>
13 #include <TObjString.h>
14 #include <TROOT.h>
16 
18 
19 namespace CP {
20  IsolationSelectionTool::IsolationSelectionTool(const std::string& name) : asg::AsgTool(name) {}
21  const std::vector<std::unique_ptr<IsolationWP>>& IsolationSelectionTool::getMuonWPs() const { return m_muWPs; }
22  const std::vector<std::unique_ptr<IsolationWP>>& IsolationSelectionTool::getElectronWPs() const { return m_elWPs; }
23  const std::vector<std::unique_ptr<IsolationWP>>& IsolationSelectionTool::getPhotonWPs() const { return m_phWPs; }
24  const std::vector<std::unique_ptr<IsolationWP>>& IsolationSelectionTool::getObjWPs() const { return m_objWPs; }
26 
29  ATH_MSG_INFO("Initialising...");
30 
31  ATH_MSG_INFO("IsoDecSuffix: " << m_isoDecSuffix);
32 
33  if (!m_calibFileName.empty()) {
35 
36  ATH_MSG_INFO("Reading input file " << m_calibFileName << " from " << filename);
37  m_calibFile = std::make_unique<TFile>(filename.c_str(), "READ");
38 
39  TObjString* versionInfo{nullptr};
40  m_calibFile->GetObject("VersionInfo", versionInfo);
41  if (versionInfo)
42  ATH_MSG_INFO("VersionInfo:" << versionInfo->String());
43  else
44  ATH_MSG_WARNING("VersionInfo of input file (" << filename << ") is missing.");
45  }
46 
47  if (m_doInterpE || m_doInterpM) {
48  // special setting for electrons
49  // do not apply interpolation in crack vicinity for topoetcone
50  std::vector<std::pair<double, double>> rangeEtaNoInt;
51  std::pair<double, double> apair(1.26, 1.665);
52  rangeEtaNoInt.push_back(apair);
53  // do not apply interpolation between Z defined and J/Psi defined cuts (pT < > 15 GeV/c) for both calo and track iso
54  std::vector<std::pair<double, double>> rangePtNoInt;
55  apair.first = 12.5;
56  apair.second = 17.5;
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);
66  m_Interp->debug(false);
67  }
68 
70  if (m_phWPname != "Undefined") ATH_CHECK(addPhotonWP(m_phWPname));
71  if (m_elWPname != "Undefined") ATH_CHECK(addElectronWP(m_elWPname));
72  if (m_muWPname != "Undefined") ATH_CHECK(addMuonWP(m_muWPname));
73  for (const std::string& c : m_muWPvec) ATH_CHECK(addMuonWP(c));
74  for (const std::string& c : m_elWPvec) ATH_CHECK(addElectronWP(c));
75  for (const std::string& c : m_phWPvec) ATH_CHECK(addPhotonWP(c));
76 
77  m_calibFile.reset();
78  #ifndef XAOD_STANDALONE
79  ATH_CHECK(m_isoDecors.initialize());
80  #endif
81  return StatusCode::SUCCESS;
83  }
84 
85  void IsolationSelectionTool::addDependencies(const std::string& container, const IsolationWP& wp) {
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) {
89  m_isoDecors.emplace_back(container + "." + SG::AuxTypeRegistry::instance().getName(cond->accessor(acc).auxid()));
90  }
91  }
92  }
93 
95  if (ObjType == xAOD::Type::Electron) {
97  m_iparWPs = &m_elWPs;
98  } else if (ObjType == xAOD::Type::Muon) {
100  m_iparWPs = &m_muWPs;
101  } else if (ObjType == xAOD::Type::Photon) {
103  m_iparWPs = &m_phWPs;
104  } else {
105  return StatusCode::FAILURE;
106  }
107 
108  return StatusCode::SUCCESS;
109  }
110 
112  const std::string& expression, const xAOD::Iso::IsolationType isoCutRemap) {
113  if (!m_calibFile) {
114  ATH_MSG_ERROR("Calibration File (" << m_calibFileName << ") is missing.");
115  return StatusCode::FAILURE;
116  }
117 
118  std::string varname(xAOD::Iso::toCString(isoCutRemap));
119  std::string key = key_in + varname;
120 
121  TH3F* calibHisto{nullptr};
122  m_calibFile->GetObject(key.c_str(), calibHisto);
123  if (!calibHisto) {
124  ATH_MSG_FATAL(" Failed to load " << key << " from " << m_calibFile->GetName());
125  return StatusCode::FAILURE;
126  }
127  calibHisto->SetDirectory(nullptr);
128  std::unique_ptr<TH3F> histogram(calibHisto);
129  std::unique_ptr<IsolationConditionHist> ich =
130  std::make_unique<IsolationConditionHist>(varname, t, expression, std::move(histogram));
131  if ((m_doInterpM && key.find("Muon") != std::string::npos) || (m_doInterpE && key.find("Electron") != std::string::npos))
132  ich->setInterp(m_Interp);
133  wp->addCut(std::move(ich));
134 
135  return StatusCode::SUCCESS;
136  }
137 
139  const std::string& expression) {
140  return addCutToWP(wp, key, t, expression, t);
141  }
142 
143  StatusCode IsolationSelectionTool::addMuonWP(const std::string& muWPname) {
144  std::unique_ptr<IsolationWP> wp = std::make_unique<IsolationWP>(muWPname);
145  if (muWPname == "HighPtTrackOnly") {
146  wp->addCut(std::make_unique<IsolationConditionFormula>(
147  "ptcone20_Tight_1p25", xAOD::Iso::ptcone20_Nonprompt_All_MaxWeightTTVA_pt1000, "1.25E03", false, m_isoDecSuffix)); // units are MeV!
148  } else if (muWPname == "TightTrackOnly_FixedRad") {
149  wp->addCut(std::make_unique<IsolationConditionFormula>(
150  "MuonFixedCutHighMuTrackOnly_lowPt", xAOD::Iso::ptvarcone30_Nonprompt_All_MaxWeightTTVA_pt1000, "0.06*(x>50e3?1e9:x)", false, m_isoDecSuffix));
151  wp->addCut(std::make_unique<IsolationConditionFormula>(
152  "MuonFixedCutHighMuTrackOnly_highPt", xAOD::Iso::ptcone20_Nonprompt_All_MaxWeightTTVA_pt1000, "0.06*(x>50e3?x:1e9)", false, m_isoDecSuffix));
153  } else if (muWPname == "Tight_FixedRad") {
154  wp->addCut(std::make_unique<IsolationConditionFormula>(
155  "MuonFixedCutHighMuTight_track_lowPt", xAOD::Iso::ptvarcone30_Nonprompt_All_MaxWeightTTVA_pt1000, "0.04*(x>50e3?1e9:x)", false, m_isoDecSuffix));
156  wp->addCut(std::make_unique<IsolationConditionFormula>(
157  "MuonFixedCutHighMuTight_track_highPt", xAOD::Iso::ptcone20_Nonprompt_All_MaxWeightTTVA_pt1000, "0.04*(x>50e3?x:1e9)", false, m_isoDecSuffix));
158  wp->addCut(std::make_unique<IsolationConditionFormula>("MuonFixedCutHighMuTight_calo", xAOD::Iso::topoetcone20, "0.15*x", false, m_isoDecSuffix));
159  } else if (muWPname == "Loose_FixedRad") {
160  wp->addCut(std::make_unique<IsolationConditionFormula>(
161  "MuonFixedCutHighMuLoose_track_lowPt", xAOD::Iso::ptvarcone30_Nonprompt_All_MaxWeightTTVA_pt1000, "0.15*(x>50e3?1e9:x)", false, m_isoDecSuffix));
162  wp->addCut(std::make_unique<IsolationConditionFormula>(
163  "MuonFixedCutHighMuLoose_track_highPt", xAOD::Iso::ptcone20_Nonprompt_All_MaxWeightTTVA_pt1000, "0.15*(x>50e3?x:1e9)", false, m_isoDecSuffix));
164  wp->addCut(std::make_unique<IsolationConditionFormula>("MuonFixedCutHighMuLoose_calo", xAOD::Iso::topoetcone20, "0.30*x", false, m_isoDecSuffix));
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",
171  wp->addCut(std::make_unique<IsolationConditionFormula>("MuonFixedCutHighMuTight_calo", xAOD::Iso::topoetcone20, "0.15*x", false, m_isoDecSuffix));
172  } else if (muWPname == "Loose_VarRad") {
173  wp->addCut(std::make_unique<IsolationConditionFormula>("MuonFixedCutHighMuLoose_track",
175  wp->addCut(std::make_unique<IsolationConditionFormula>("MuonFixedCutHighMuLoose_calo", xAOD::Iso::topoetcone20, "0.30*x", false, m_isoDecSuffix));
176  } else if (muWPname == "PflowTight_FixedRad") {
177  std::vector<xAOD::Iso::IsolationType> isoTypesHighPt{xAOD::Iso::ptcone20_Nonprompt_All_MaxWeightTTVA_pt500,
179  std::vector<xAOD::Iso::IsolationType> isoTypesLowPt{xAOD::Iso::ptvarcone30_Nonprompt_All_MaxWeightTTVA_pt500,
181  wp->addCut(std::make_unique<IsolationConditionCombined>("MuonPFlowTightLowPt", isoTypesLowPt,
182  std::make_unique<TF2>("pflowTFunctionLowPt", "fabs(x)+0.4*(y>0?y:0)"),
183  "0.045*(x>50e3?1e9:x)", m_isoDecSuffix));
184  wp->addCut(std::make_unique<IsolationConditionCombined>("MuonPFlowTightHighPt", isoTypesHighPt,
185  std::make_unique<TF2>("pflowTFunctionHighPt", "fabs(x)+0.4*(y>0?y:0)"),
186  "0.045*(x>50e3?x:1e9)", m_isoDecSuffix));
187  } else if (muWPname == "PflowTight_VarRad") {
188  std::vector<xAOD::Iso::IsolationType> isoTypes{xAOD::Iso::ptvarcone30_Nonprompt_All_MaxWeightTTVA_pt500,
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") {
193  std::vector<xAOD::Iso::IsolationType> isoTypesHighPt{xAOD::Iso::ptcone20_Nonprompt_All_MaxWeightTTVA_pt500,
195  std::vector<xAOD::Iso::IsolationType> isoTypesLowPt{xAOD::Iso::ptvarcone30_Nonprompt_All_MaxWeightTTVA_pt500,
197  wp->addCut(std::make_unique<IsolationConditionCombined>("MuonPFlowLooseLowPt", isoTypesLowPt,
198  std::make_unique<TF2>("pflowLFunctionLowPt", "fabs(x)+0.4*(y>0?y:0)"),
199  "0.16*(x>50e3?1e9:x)", m_isoDecSuffix));
200  wp->addCut(std::make_unique<IsolationConditionCombined>("MuonPFlowLooseHighPt", isoTypesHighPt,
201  std::make_unique<TF2>("pflowLFunctionHighPt", "fabs(x)+0.4*(y>0?y:0)"),
202  "0.16*(x>50e3?x:1e9)", m_isoDecSuffix));
203  } else if (muWPname == "PflowLoose_VarRad") {
204  std::vector<xAOD::Iso::IsolationType> isoTypes{xAOD::Iso::ptvarcone30_Nonprompt_All_MaxWeightTTVA_pt500,
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));
208  } else if (muWPname == "R3PLITasPLIVefficiencyTight") {
209  const std::vector<std::string>& isoTypes = {"PLIT_TPLTmu_pmuxpromp", "PLIT_TPLTmu_pnpxall"};
210  const std::vector<double> boundaries = {5500.0, 10000.0, 15000.0, 20000.0, 25000.0, 32000.0, 43000.0, 60000.0, 95000.0};
211  const std::vector<std::vector<double>> parameters = {{3.75},
212  {2.4599999999999946, 0.0002400000000000006},
213  {2.6437499999999883, 0.00023250000000000085},
214  {5.576250000000033, 2.249999999999814e-05},
215  {7.061249999999798, -5.2499999999991085e-05},
216  {6.933482142856749, -4.553571428570058e-05},
217  {7.271590909090752, -5.5909090909086746e-05},
218  {5.105882352941061, -1.1764705882350721e-05},
219  {4.4250000000000025, -2.97364147850582e-20},
220  {4.425000000000001}};
221  const std::string cutFunction = createPieceWisePolinomialFunction(boundaries, parameters, true);
222  wp->addCut(std::make_unique<IsolationConditionCombined>("R3PLITasPLIVefficiencyTight", isoTypes,
223  std::make_unique<TF2>("muonPLIT", "TMath::Log(x / y)"),
224  cutFunction,
225  m_isoDecSuffix, true));
226  } else if (muWPname == "R3PLITasPLIVefficiencyVeryTight") {
227  const std::vector<std::string>& isoTypes = {"PLIT_TPLTmu_pmuxpromp", "PLIT_TPLTmu_pnpxall"};
228  const std::vector<double> boundaries = {5500.0, 10000.0, 15000.0, 20000.0, 25000.0, 32000.0, 43000.0, 60000.0, 95000.0};
229  const std::vector<std::vector<double>> parameters = {{4.050000000000001},
230  {2.5912499999999903, 0.0002625000000000011},
231  {2.8012499999999214, 0.00024750000000000623},
232  {5.677499999999787, 4.500000000001207e-05},
233  {6.2137499999998145, 2.2500000000008228e-05},
234  {7.09151785714283, -1.8749999999999094e-05},
235  {8.57727272727282, -6.545454545454794e-05},
236  {5.969852941176529, -1.0294117647059968e-05},
237  {5.528483606557319, -2.581967213113981e-06},
238  {5.324999999999999}};
239  const std::string cutFunction = createPieceWisePolinomialFunction(boundaries, parameters, true);
240  wp->addCut(std::make_unique<IsolationConditionCombined>("R3PLITasPLIVefficiencyVeryTight", isoTypes,
241  std::make_unique<TF2>("muonPLIT", "TMath::Log(x / y)"),
242  cutFunction,
243  m_isoDecSuffix, true));
244  } else if (muWPname == "R3PLITasPLIVrejectionTight") {
245  const std::vector<std::string>& isoTypes = {"PLIT_TPLTmu_pmuxpromp", "PLIT_TPLTmu_pnpxall"};
246  const std::vector<double> boundaries = {5500.0, 10000.0, 15000.0, 20000.0, 25000.0, 32000.0, 43000.0, 60000.0, 95000.0};
247  const std::vector<std::vector<double>> parameters = {{3.6750000000000007},
248  {2.4374999999999987, 0.00022500000000000008},
249  {2.572499999999916, 0.00022500000000000666},
250  {5.351249999999845, 2.2500000000008773e-05},
251  {7.113749999999581, -6.749999999998147e-05},
252  {7.213392857142764, -6.964285714285394e-05},
253  {7.4778409090906415, -7.977272727272016e-05},
254  {4.105790441176434, -1.3419117647058116e-05},
255  {3.590163934426209, -4.180327868852198e-06},
256  {3.1499999999999986}};
257  const std::string cutFunction = createPieceWisePolinomialFunction(boundaries, parameters, true);
258  wp->addCut(std::make_unique<IsolationConditionCombined>("R3PLITasPLIVrejectionTight", isoTypes,
259  std::make_unique<TF2>("muonPLIT", "TMath::Log(x / y)"),
260  cutFunction,
261  m_isoDecSuffix, true));
262  } else if (muWPname == "R3PLITasPLIVrejectionVeryTight") {
263  const std::vector<std::string>& isoTypes = {"PLIT_TPLTmu_pmuxpromp", "PLIT_TPLTmu_pnpxall"};
264  const std::vector<double> boundaries = {5500.0, 10000.0, 15000.0, 20000.0, 25000.0, 32000.0, 43000.0, 60000.0, 95000.0};
265  const std::vector<std::vector<double>> parameters = {{3.974999999999998},
266  {2.5875000000000035, 0.0002549999999999993},
267  {2.8687499999999373, 0.00023250000000000495},
268  {5.527499999999797, 4.500000000001146e-05},
269  {6.048749999999677, 2.2500000000014293e-05},
270  {7.019196428571157, -2.4107142857133378e-05},
271  {8.878977272727232, -8.38636363636353e-05},
272  {5.708823529411479, -1.76470588235239e-05},
273  {5.215573770491751, -7.131147540982918e-06},
274  {4.649999999999999}};
275  const std::string cutFunction = createPieceWisePolinomialFunction(boundaries, parameters, true);
276  wp->addCut(std::make_unique<IsolationConditionCombined>("R3PLITasPLIVrejectionVeryTight", isoTypes,
277  std::make_unique<TF2>("muonPLIT", "TMath::Log(x / y)"),
278  cutFunction,
279  m_isoDecSuffix, true));
280  } else if (muWPname == "R2PLITasPLIVefficiencyTight") {
281  const std::vector<std::string>& isoTypes = {"PLIT_TPLTmu_pmuxpromp", "PLIT_TPLTmu_pnpxall"};
282  const std::vector<double> boundaries = {5500.0, 10000.0, 15000.0, 20000.0, 25000.0, 32000.0, 43000.0, 60000.0, 95000.0};
283  const std::vector<std::vector<double>> parameters = {{3.974999999999998},
284  {2.789999999999986, 0.00021000000000000172},
285  {2.39249999999993, 0.00025500000000000555},
286  {5.737499999999933, 1.5000000000003797e-05},
287  {7.413749999999598, -6.749999999998225e-05},
288  {7.098214285714245, -5.3571428571427186e-05},
289  {6.934090909090853, -4.909090909090761e-05},
290  {5.253676470587868, -1.6176470588228218e-05},
291  {4.275000000000021, -3.17095862137587e-19},
292  {4.349999999999998}};
293  const std::string cutFunction = createPieceWisePolinomialFunction(boundaries, parameters, true);
294  wp->addCut(std::make_unique<IsolationConditionCombined>("R2PLITasPLIVefficiencyTight", isoTypes,
295  std::make_unique<TF2>("muonPLIT", "TMath::Log(x / y)"),
296  cutFunction,
297  m_isoDecSuffix, true));
298  } else if (muWPname == "R2PLITasPLIVefficiencyVeryTight") {
299  const std::vector<std::string>& isoTypes = {"PLIT_TPLTmu_pmuxpromp", "PLIT_TPLTmu_pnpxall"};
300  const std::vector<double> boundaries = {5500.0, 10000.0, 15000.0, 20000.0, 25000.0, 32000.0, 43000.0, 60000.0, 95000.0};
301  const std::vector<std::vector<double>> parameters = {{4.199999999999999},
302  {2.9625000000000026, 0.00022499999999999956},
303  {2.7674999999999454, 0.0002550000000000043},
304  {5.752499999999801, 4.500000000001117e-05},
305  {6.2887499999995, 2.2500000000022112e-05},
306  {7.265625000000208, -2.4107142857150163e-05},
307  {8.287500000000128, -5.863636363636705e-05},
308  {5.99329044117658, -1.194852941176682e-05},
309  {5.653893442622939, -5.5327868852457475e-06},
310  {5.25}};
311  const std::string cutFunction = createPieceWisePolinomialFunction(boundaries, parameters, true);
312  wp->addCut(std::make_unique<IsolationConditionCombined>("R2PLITasPLIVefficiencyVeryTight", isoTypes,
313  std::make_unique<TF2>("muonPLIT", "TMath::Log(x / y)"),
314  cutFunction,
315  m_isoDecSuffix, true));
316  } else if (muWPname == "R2PLITasPLIVrejectionTight") {
317  const std::vector<std::string>& isoTypes = {"PLIT_TPLTmu_pmuxpromp", "PLIT_TPLTmu_pnpxall"};
318  const std::vector<double> boundaries = {5500.0, 10000.0, 15000.0, 20000.0, 25000.0, 32000.0, 43000.0, 60000.0, 95000.0};
319  const std::vector<std::vector<double>> parameters = {{3.8999999999999986},
320  {2.853749999999994, 0.00018750000000000065},
321  {2.321250000000002, 0.0002474999999999998},
322  {5.426250000000083, 2.2499999999995095e-05},
323  {7.312499999999872, -7.499999999999437e-05},
324  {7.552232142857126, -8.303571428571374e-05},
325  {7.140340909090713, -7.022727272726753e-05},
326  {4.7727941176470186, -2.499999999999921e-05},
327  {3.679918032786865, -5.409836065573509e-06},
328  {3.0}};
329  const std::string cutFunction = createPieceWisePolinomialFunction(boundaries, parameters, true);
330  wp->addCut(std::make_unique<IsolationConditionCombined>("R2PLITasPLIVrejectionTight", isoTypes,
331  std::make_unique<TF2>("muonPLIT", "TMath::Log(x / y)"),
332  cutFunction,
333  m_isoDecSuffix, true));
334  } else if (muWPname == "R2PLITasPLIVrejectionVeryTight") {
335  const std::vector<std::string>& isoTypes = {"PLIT_TPLTmu_pmuxpromp", "PLIT_TPLTmu_pnpxall"};
336  const std::vector<double> boundaries = {5500.0, 10000.0, 15000.0, 20000.0, 25000.0, 32000.0, 43000.0, 60000.0, 95000.0};
337  const std::vector<std::vector<double>> parameters = {{4.199999999999999},
338  {2.9887499999999982, 0.0002175000000000001},
339  {2.9287500000000426, 0.0002324999999999965},
340  {5.602499999999976, 4.500000000000134e-05},
341  {6.262499999999722, 1.5000000000012243e-05},
342  {7.651339285714248, -4.5535714285712985e-05},
343  {8.947159090908924, -8.659090909090467e-05},
344  {5.994117647058617, -2.3529411764701903e-05},
345  {4.8565573770491985, -2.213114754098622e-06},
346  {4.349999999999998}};
347  const std::string cutFunction = createPieceWisePolinomialFunction(boundaries, parameters, true);
348  wp->addCut(std::make_unique<IsolationConditionCombined>("R2PLITasPLIVrejectionVeryTight", isoTypes,
349  std::make_unique<TF2>("muonPLIT", "TMath::Log(x / y)"),
350  cutFunction,
351  m_isoDecSuffix, true));
352  } else {
353  ATH_MSG_ERROR("Unknown muon isolation WP: " << muWPname);
354  return StatusCode::FAILURE;
355  }
356  m_muonAccept.addCut(wp->name(), wp->name());
357 #ifndef XAOD_STANDALONE
359 #endif
360  m_muWPs.push_back(std::move(wp));
361  return StatusCode::SUCCESS;
362  }
363 
364  StatusCode IsolationSelectionTool::addPhotonWP(const std::string& phWPname) {
365  std::unique_ptr<IsolationWP> wp = std::make_unique<IsolationWP>(phWPname);
366  if (phWPname == "TightCaloOnly") {
367  wp->addCut(std::make_unique<IsolationConditionFormula>("PhFixedCut_calo40", xAOD::Iso::topoetcone40, "0.022*x+2450", false, m_isoDecSuffix));
368  } else if (phWPname == "FixedCutTight") {
369  wp->addCut(std::make_unique<IsolationConditionFormula>("PhFixedCut_calo40", xAOD::Iso::topoetcone40, "0.022*x+2450", false, m_isoDecSuffix));
370  wp->addCut(std::make_unique<IsolationConditionFormula>("PhFixedCut_track20", xAOD::Iso::ptcone20, "0.05*x", false, m_isoDecSuffix));
371  } else if (phWPname == "FixedCutLoose") {
372  wp->addCut(std::make_unique<IsolationConditionFormula>("PhFixedCut_calo20", xAOD::Iso::topoetcone20, "0.065*x", false, m_isoDecSuffix));
373  wp->addCut(std::make_unique<IsolationConditionFormula>("PhFixedCut_track20", xAOD::Iso::ptcone20, "0.05*x", false, m_isoDecSuffix));
374  } else if (phWPname == "Tight") {
375  wp->addCut(std::make_unique<IsolationConditionFormula>("PhFixedCut_calo40", xAOD::Iso::topoetcone40, "0.022*x+2450", false, m_isoDecSuffix));
376  wp->addCut(std::make_unique<IsolationConditionFormula>("PhFixedCut_Tighttrack20",
378  } else if (phWPname == "Loose") {
379  wp->addCut(std::make_unique<IsolationConditionFormula>("PhFixedCut_calo20", xAOD::Iso::topoetcone20, "0.065*x", false, m_isoDecSuffix));
380  wp->addCut(std::make_unique<IsolationConditionFormula>("PhFixedCut_Tighttrack20",
382  } else {
383  ATH_MSG_ERROR("Unknown photon isolation WP: " << phWPname);
384  return StatusCode::FAILURE;
385  }
386 
387  m_photonAccept.addCut(wp->name(), wp->name());
388 #ifndef XAOD_STANDALONE
390 #endif
391  m_phWPs.push_back(std::move(wp));
392 
393  // Return gracefully:
394  return StatusCode::SUCCESS;
395  }
396 
397  StatusCode IsolationSelectionTool::addElectronWP(const std::string& elWPname) {
398  std::unique_ptr<IsolationWP> wp = std::make_unique<IsolationWP>(elWPname);
399 
400  if (elWPname == "HighPtCaloOnly") {
401  wp->addCut(std::make_unique<IsolationConditionFormula>("FCHighPtCaloOnly_calo", xAOD::Iso::topoetcone20,
402  "std::max(0.015*x,3.5E3)", false, m_isoDecSuffix)); // units are MeV!
403  } else if (elWPname == "Tight_VarRad") {
404  wp->addCut(std::make_unique<IsolationConditionFormula>(
406  wp->addCut(std::make_unique<IsolationConditionFormula>("ElecTight_calo", xAOD::Iso::topoetcone20, "0.06*x", false, m_isoDecSuffix));
407  } else if (elWPname == "Loose_VarRad") {
408  wp->addCut(std::make_unique<IsolationConditionFormula>(
410  wp->addCut(std::make_unique<IsolationConditionFormula>("ElecLoose_calo", xAOD::Iso::topoetcone20, "0.20*x", false, m_isoDecSuffix));
411  } else if (elWPname == "TightTrackOnly_VarRad") {
412  wp->addCut(std::make_unique<IsolationConditionFormula>(
414  } else if (elWPname == "TightTrackOnly_FixedRad") {
415  wp->addCut(std::make_unique<IsolationConditionFormula>(
416  "ElecTightTrackOnly_lowPt", xAOD::Iso::ptvarcone30_Nonprompt_All_MaxWeightTTVALooseCone_pt1000, "0.06*(x>50e3?1e9:x)", false, m_isoDecSuffix));
417  wp->addCut(std::make_unique<IsolationConditionFormula>(
418  "ElecTightTrackOnly_highPt", xAOD::Iso::ptcone20_Nonprompt_All_MaxWeightTTVALooseCone_pt1000, "0.06*(x>50e3?x:1e9)", false, m_isoDecSuffix));
419  } else if (elWPname == "PflowTight_FixedRad") {
420  std::vector<xAOD::Iso::IsolationType> isoTypesHighPt{xAOD::Iso::ptcone20_Nonprompt_All_MaxWeightTTVALooseCone_pt500,
422  std::vector<xAOD::Iso::IsolationType> isoTypesLowPt{xAOD::Iso::ptvarcone30_Nonprompt_All_MaxWeightTTVALooseCone_pt500,
424  wp->addCut(std::make_unique<IsolationConditionCombined>("ElecPFlowTightLowPt", isoTypesLowPt,
425  std::make_unique<TF2>("pflowTFunctionLowPt", "fabs(x)+0.4*(y>0?y:0)"),
426  "0.045*(x>50e3?1e9:x)", m_isoDecSuffix));
427  wp->addCut(std::make_unique<IsolationConditionCombined>("ElecPFlowTightHighPt", isoTypesHighPt,
428  std::make_unique<TF2>("pflowTFunctionHighPt", "fabs(x)+0.4*(y>0?y:0)"),
429  "0.045*(x>50e3?x:1e9)", m_isoDecSuffix));
430  } else if (elWPname == "PflowTight") {
431  std::vector<xAOD::Iso::IsolationType> isoTypes{xAOD::Iso::ptvarcone30_Nonprompt_All_MaxWeightTTVALooseCone_pt500,
433  wp->addCut(std::make_unique<IsolationConditionCombined>(
434  "ElecPFlowTight", isoTypes, std::make_unique<TF2>("pflowLFunction", "fabs(x)+0.4*(y>0?y:0)"), "0.045*x", m_isoDecSuffix));
435  } else if (elWPname == "PflowLoose_FixedRad") {
436  std::vector<xAOD::Iso::IsolationType> isoTypesHighPt{xAOD::Iso::ptcone20_Nonprompt_All_MaxWeightTTVALooseCone_pt500,
438  std::vector<xAOD::Iso::IsolationType> isoTypesLowPt{xAOD::Iso::ptvarcone30_Nonprompt_All_MaxWeightTTVALooseCone_pt500,
440  wp->addCut(std::make_unique<IsolationConditionCombined>("ElecPFlowLooseLowPt", isoTypesLowPt,
441  std::make_unique<TF2>("pflowLFunctionLowPt", "fabs(x)+0.4*(y>0?y:0)"),
442  "0.16*(x>50e3?1e9:x)", m_isoDecSuffix));
443  wp->addCut(std::make_unique<IsolationConditionCombined>("ElecPFlowLooseHighPt", isoTypesHighPt,
444  std::make_unique<TF2>("pflowLFunctionHighPt", "fabs(x)+0.4*(y>0?y:0)"),
445  "0.16*(x>50e3?x:1e9)", m_isoDecSuffix));
446  } else if (elWPname == "PflowLoose") {
447  std::vector<xAOD::Iso::IsolationType> isoTypes{xAOD::Iso::ptvarcone30_Nonprompt_All_MaxWeightTTVALooseCone_pt500,
449  wp->addCut(std::make_unique<IsolationConditionCombined>(
450  "ElecPFlowLoose", isoTypes, std::make_unique<TF2>("pflowLFunction", "fabs(x)+0.4*(y>0?y:0)"), "0.16*x", m_isoDecSuffix));
451  } else {
452  ATH_MSG_ERROR("Unknown electron isolation WP: " << elWPname);
453  return StatusCode::FAILURE;
454  }
455 
456  m_electronAccept.addCut(wp->name(), wp->name());
457 #ifndef XAOD_STANDALONE
459 #endif
460  m_elWPs.push_back(std::move(wp));
461 
462  // Return gracefully:
463  return StatusCode::SUCCESS;
464  }
465 
467  std::vector<std::pair<xAOD::Iso::IsolationType, std::string>>& cuts,
468  std::string key, IsoWPType type) {
469  std::vector<std::unique_ptr<IsolationWP>>* wps(nullptr);
470  asg::AcceptInfo* ac = nullptr;
471  if (ObjType == xAOD::Type::Electron) {
472  if (key == "") key = m_elWPKey;
473  wps = &m_elWPs;
474  ac = &m_electronAccept;
475  } else if (ObjType == xAOD::Type::Muon) {
476  if (key == "") key = m_muWPKey;
477  wps = &m_muWPs;
478  ac = &m_muonAccept;
479  } else if (ObjType == xAOD::Type::Photon) {
480  if (key == "") key = m_phWPKey;
481  wps = &m_phWPs;
482  ac = &m_photonAccept;
483  } else if (ObjType == xAOD::Type::Other) {
484  if (key == "") return StatusCode::FAILURE;
485  wps = &m_objWPs;
486  ac = &m_objAccept;
487  } else {
488  return StatusCode::FAILURE;
489  }
490 
491  std::unique_ptr<IsolationWP> wp = std::make_unique<IsolationWP>(WPname);
492  if (type == Efficiency) {
493  for (auto& c : cuts) ATH_CHECK(addCutToWP(wp.get(), key, c.first, c.second));
494  } else if (type == Cut) {
495  for (auto& c : cuts) wp->addCut(std::make_unique<IsolationConditionFormula>(xAOD::Iso::toCString(c.first), c.first, c.second));
496  } else {
497  ATH_MSG_ERROR("Unknown isolation WP type -- should not happen.");
498  return StatusCode::FAILURE;
499  }
500 
501  ac->addCut(wp->name(), wp->name());
502  wps->push_back(std::move(wp));
503  return StatusCode::SUCCESS;
504  }
505 
507  if (ObjType == xAOD::Type::Electron) {
508  return addElectronWP(WP);
509  } else if (ObjType == xAOD::Type::Muon) {
510  return addMuonWP(WP);
511  } else if (ObjType == xAOD::Type::Photon) {
512  return addPhotonWP(WP);
513  }
514 
515  return StatusCode::FAILURE;
516  }
517  StatusCode IsolationSelectionTool::addWP(std::unique_ptr<IsolationWP> wp, xAOD::Type::ObjectType ObjType) {
518  if (ObjType == xAOD::Type::Electron) {
519  m_electronAccept.addCut(wp->name(), wp->name());
520  m_elWPs.push_back(std::move(wp));
521  } else if (ObjType == xAOD::Type::Muon) {
522  m_muonAccept.addCut(wp->name(), wp->name());
523  m_muWPs.push_back(std::move(wp));
524 
525  } else if (ObjType == xAOD::Type::Photon) {
526  m_photonAccept.addCut(wp->name(), wp->name());
527  m_phWPs.push_back(std::move(wp));
528 
529  } else if (ObjType == xAOD::Type::Other) {
530  m_objAccept.addCut(wp->name(), wp->name());
531  m_objWPs.push_back(std::move(wp));
532  } else {
533  return StatusCode::FAILURE;
534  }
535 
536  return StatusCode::SUCCESS;
537  }
538  template <typename T>
539  void IsolationSelectionTool::evaluateWP(const T& x, const std::vector<std::unique_ptr<IsolationWP>>& WP, asg::AcceptData& accept) const {
540  accept.clear();
541  for (const std::unique_ptr<IsolationWP>& i : WP) {
542  if (i->accept(x)) accept.setCutResult(i->name(), true);
543  }
544  }
548  return accept;
549  }
550 
554  return accept;
555  }
556 
560  return accept;
561  }
562 
564  if (x.type() == xAOD::Type::Electron) {
567  return accept;
568  } else if (x.type() == xAOD::Type::Muon) {
571  return accept;
572  } else if (x.type() == xAOD::Type::Photon) {
575  return accept;
576  }
577 
578  else if (m_iparAcceptInfo && m_iparWPs) {
581  return accept;
582  }
583  ATH_MSG_ERROR("Someting here makes really no sense");
584  return asg::AcceptData(&m_objAccept);
585  }
586 
588  if (x.type == xAOD::Type::Electron) {
591  return accept;
592  } else if (x.type == xAOD::Type::Muon) {
595  return accept;
596  } else if (x.type == xAOD::Type::Photon) {
599  return accept;
600  } else {
603  return accept;
604  }
605  return asg::AcceptData(&m_objAccept);
606  }
607 
609 
611 
614 
615  std::string IsolationSelectionTool::createPieceWisePolinomialFunction(const std::vector<double>& boundaries, const std::vector<std::vector<double>>& parameters, bool isOpen) const {
616 
617  if (isOpen && boundaries.size() != parameters.size() - 1) {
618  ATH_MSG_ERROR("The number of region boundaries must be one less than the number of parameters for the piecewise polynomial function.");
619  return "";
620  } else if (!isOpen && boundaries.size() != parameters.size() + 1) {
621  ATH_MSG_ERROR("The number of region boundaries must be one more than the number of parameters for the piecewise polynomial function.");
622  return "";
623  }
624 
625  std::ostringstream oss;
626  oss << std::setprecision(16);
627 
628  // a lambda for the polynomial expression
629  // one could remove the zeroes in the parameters vector
630  auto polynomial = [](const std::vector<double>& params) {
631  std::ostringstream oss;
632  oss << std::setprecision(16);
633  oss << "(";
634  for (size_t i = 0; i < params.size(); ++i) {
635  if (i > 0) oss << " + ";
636  if (i == 0) {
637  oss << params[i]; // constant term
638  } else if (i == 1) {
639  oss << params[i] << " * x"; // linear term
640  } else {// higher order terms
641  oss << params[i] << " * pow(x, " << i << ")"; // higher order terms
642  }
643  }
644  oss << ")";
645  return oss.str();
646  };
647 
648  // Start the function definition, using concateation of ternary operators
649  // if isOpen==false, just nullify the function before the first and after the last boundary
650  // just create a copy of params, and insert 0.0 at the beginning and end if isOpen==false
651  std::vector<std::vector<double>> params = parameters;
652  if (!isOpen) {
653  params.insert(params.begin(), {0.0}); // add a zero vector at the beginning
654  params.push_back({0.0}); // add a zero vector at the end
655  }
656 
657  // now loop over the boundaries and parameters (we can ignore isOpen finally)
658  for (size_t i = 0; i < boundaries.size(); ++i) {
659  if (i == 0) oss << "(";
660  oss << "(x < " << boundaries[i] << ") ? " << polynomial(params[i]) << " : ";
661  }
662  oss << polynomial(params.back()) << ")"; // last segment, no ternary operator
663 
664  return oss.str();
665 
666  }
667 
668 } // namespace CP
CP::IsolationSelectionTool::m_elWPKey
Gaudi::Property< std::string > m_elWPKey
Definition: IsolationSelectionTool.h:84
CP::IsolationSelectionTool::createPieceWisePolinomialFunction
std::string createPieceWisePolinomialFunction(const std::vector< double > &boundaries, const std::vector< std::vector< double >> &parameters, bool isOpen=false) const
Definition: IsolationSelectionTool.cxx:615
xAOD::Iso::ptcone20_Nonprompt_All_MaxWeightTTVALooseCone_pt500
@ ptcone20_Nonprompt_All_MaxWeightTTVALooseCone_pt500
Ptcone http://arxiv.org/abs/1007.2221 for high mu.
Definition: IsolationType.h:109
CP::IsolationSelectionTool::m_isoDecors
SG::ReadDecorHandleKeyArray< xAOD::IParticleContainer > m_isoDecors
Definition: IsolationSelectionTool.h:118
CP::IsolationSelectionTool::m_photonAccept
asg::AcceptInfo m_photonAccept
AcceptInfo's.
Definition: IsolationSelectionTool.h:103
CP::IsolationSelectionTool::getMuonAcceptInfo
virtual const asg::AcceptInfo & getMuonAcceptInfo() const override
Definition: IsolationSelectionTool.cxx:612
CP::IsolationSelectionTool::getMuonWPs
virtual const std::vector< std::unique_ptr< IsolationWP > > & getMuonWPs() const override
Definition: IsolationSelectionTool.cxx:21
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
xAOD::Iso::topoetcone20
@ topoetcone20
Topo-cluster ET-sum.
Definition: IsolationType.h:48
xAOD::Electron
Electron_v1 Electron
Definition of the current "egamma version".
Definition: Event/xAOD/xAODEgamma/xAODEgamma/Electron.h:17
CP::IsolationSelectionTool::addWP
StatusCode addWP(const std::string &WP, xAOD::Type::ObjectType type)
Definition: IsolationSelectionTool.cxx:506
xAOD::Iso::neflowisol20
@ neflowisol20
Neutral eflow isolation.
Definition: IsolationType.h:64
asg::AsgTool::getName
const std::string & getName(const void *ptr) const
Get the name of an object that is / should be in the event store.
Definition: AsgTool.cxx:106
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
SG::AuxTypeRegistry::instance
static AuxTypeRegistry & instance()
Return the singleton registry instance.
Definition: AuxTypeRegistry.cxx:639
ObjectType
ObjectType
Definition: BaseObject.h:11
CP::IsolationSelectionTool::evaluateWP
void evaluateWP(const T &x, const std::vector< std::unique_ptr< IsolationWP >> &WP, asg::AcceptData &accept) const
Definition: IsolationSelectionTool.cxx:539
IsoCloseByCorrectionTest.WP
WP
Definition: IsoCloseByCorrectionTest.py:56
IsolationType.h
CutsMETMaker::accept
StatusCode accept(const xAOD::Muon *mu)
Definition: CutsMETMaker.cxx:18
CP::IsolationSelectionTool::getObjWPs
virtual const std::vector< std::unique_ptr< IsolationWP > > & getObjWPs() const override
Definition: IsolationSelectionTool.cxx:24
asg
Definition: DataHandleTestTool.h:28
CP::IsolationSelectionTool::m_electronAccept
asg::AcceptInfo m_electronAccept
Definition: IsolationSelectionTool.h:104
xAOD::Iso::ptcone20
@ ptcone20
Track isolation.
Definition: IsolationType.h:40
xAOD::Iso::ptcone20_Nonprompt_All_MaxWeightTTVA_pt500
@ ptcone20_Nonprompt_All_MaxWeightTTVA_pt500
Ptcone http://arxiv.org/abs/1007.2221 for high mu.
Definition: IsolationType.h:85
CP::IsolationSelectionTool::addCutToWP
StatusCode addCutToWP(IsolationWP *wp, const std::string &key_in, const xAOD::Iso::IsolationType t, const std::string &expression, const xAOD::Iso::IsolationType isoCutRemap)
Definition: IsolationSelectionTool.cxx:111
python.HION12.expression
string expression
Definition: HION12.py:55
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:41
IsolationConditionFormula.h
x
#define x
CP::IsolationSelectionTool::m_inMuonContainer
Gaudi::Property< std::string > m_inMuonContainer
Properties to declare the data dependencies to the avalanche scheduler.
Definition: IsolationSelectionTool.h:121
CP::IsolationSelectionTool::m_objWPs
std::vector< std::unique_ptr< IsolationWP > > m_objWPs
Definition: IsolationSelectionTool.h:100
CP
Select isolated Photons, Electrons and Muons.
Definition: Control/xAODRootAccess/xAODRootAccess/TEvent.h:49
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
xAOD::Muon_v1
Class describing a Muon.
Definition: Muon_v1.h:38
Cut
Definition: SUSYToolsAlg.cxx:65
CP::strObj
Definition: IsolationCondition.h:23
CP::IsolationSelectionTool::m_inElecContainer
Gaudi::Property< std::string > m_inElecContainer
Definition: IsolationSelectionTool.h:122
CP::IsolationSelectionTool::IsolationSelectionTool
IsolationSelectionTool(const std::string &name)
Create a proper constructor for Athena.
Definition: IsolationSelectionTool.cxx:20
CP::IsolationSelectionTool::m_elWPname
Gaudi::Property< std::string > m_elWPname
Definition: IsolationSelectionTool.h:77
CP::IsolationSelectionTool::Efficiency
@ Efficiency
Definition: IsolationSelectionTool.h:39
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
CP::IsolationSelectionTool::m_calibFileName
Gaudi::Property< std::string > m_calibFileName
input file
Definition: IsolationSelectionTool.h:93
asg::AcceptInfo
Definition: AcceptInfo.h:28
IsolationSelectionTool.h
CP::IsolationSelectionTool::m_elWPvec
Gaudi::Property< std::vector< std::string > > m_elWPvec
Definition: IsolationSelectionTool.h:80
CP::IsolationSelectionTool::m_phWPs
std::vector< std::unique_ptr< IsolationWP > > m_phWPs
Definition: IsolationSelectionTool.h:99
lumiFormat.i
int i
Definition: lumiFormat.py:85
CP::IsolationSelectionTool::getElectronAcceptInfo
virtual const asg::AcceptInfo & getElectronAcceptInfo() const override
Definition: IsolationSelectionTool.cxx:610
CP::IsolationSelectionTool::addMuonWP
StatusCode addMuonWP(const std::string &wpname)
Definition: IsolationSelectionTool.cxx:143
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
xAOD::Iso::IsolationType
IsolationType
Overall enumeration for isolation types in xAOD files.
Definition: IsolationType.h:26
CP::IsolationSelectionTool::m_isoDecSuffix
Gaudi::Property< std::string > m_isoDecSuffix
Definition: IsolationSelectionTool.h:88
CP::IsolationSelectionTool::m_muWPs
std::vector< std::unique_ptr< IsolationWP > > m_muWPs
internal use
Definition: IsolationSelectionTool.h:97
plotBeamSpotVert.cuts
string cuts
Definition: plotBeamSpotVert.py:92
xAOD::Iso::ptcone20_Nonprompt_All_MaxWeightTTVALooseCone_pt1000
@ ptcone20_Nonprompt_All_MaxWeightTTVALooseCone_pt1000
Definition: IsolationType.h:112
CP::IsolationSelectionTool::m_inPhotContainer
Gaudi::Property< std::string > m_inPhotContainer
Definition: IsolationSelectionTool.h:123
CP::IsolationSelectionTool::accept
virtual asg::AcceptData accept(const xAOD::Photon &x) const override
Declare the interface that the class provides.
Definition: IsolationSelectionTool.cxx:545
CP::IsolationSelectionTool::IsoWPType
IsoWPType
Function finalizing the tool.
Definition: IsolationSelectionTool.h:39
AthenaPoolTestRead.acc
acc
Definition: AthenaPoolTestRead.py:16
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CP::IsolationSelectionTool::addPhotonWP
StatusCode addPhotonWP(const std::string &wpname)
Definition: IsolationSelectionTool.cxx:364
CP::IsolationWP
Definition: IsolationWP.h:16
PlotSFuncertainty.wp
wp
Definition: PlotSFuncertainty.py:112
xAOD::Iso::ptvarcone30_Nonprompt_All_MaxWeightTTVALooseCone_pt1000
@ ptvarcone30_Nonprompt_All_MaxWeightTTVALooseCone_pt1000
Definition: IsolationType.h:101
CP::IsolationSelectionTool::m_objAccept
asg::AcceptInfo m_objAccept
Definition: IsolationSelectionTool.h:106
CP::IsolationSelectionTool::~IsolationSelectionTool
virtual ~IsolationSelectionTool()
Destructor.
CP::IsolationSelectionTool::m_phWPKey
Gaudi::Property< std::string > m_phWPKey
Definition: IsolationSelectionTool.h:86
CP::IsolationSelectionTool::m_phWPname
Gaudi::Property< std::string > m_phWPname
Definition: IsolationSelectionTool.h:78
PathResolver.h
CP::IsolationSelectionTool::m_muWPname
Gaudi::Property< std::string > m_muWPname
Definition: IsolationSelectionTool.h:76
CP::IsolationSelectionTool::getPhotonAcceptInfo
virtual const asg::AcceptInfo & getPhotonAcceptInfo() const override
Definition: IsolationSelectionTool.cxx:608
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
xAOD::Iso::ptvarcone30_Nonprompt_All_MaxWeightTTVALooseCone_pt500
@ ptvarcone30_Nonprompt_All_MaxWeightTTVALooseCone_pt500
Definition: IsolationType.h:98
CP::IsolationSelectionTool::m_doInterpM
Gaudi::Property< bool > m_doInterpM
Definition: IsolationSelectionTool.h:113
CP::IsolationSelectionTool::setIParticleCutsFrom
virtual StatusCode setIParticleCutsFrom(xAOD::Type::ObjectType ObjType) override
Definition: IsolationSelectionTool.cxx:94
IsolationConditionCombined.h
xAOD::Electron_v1
Definition: Electron_v1.h:34
CP::IsolationSelectionTool::m_calibFile
std::unique_ptr< TFile > m_calibFile
Definition: IsolationSelectionTool.h:94
CP::IsolationSelectionTool::m_muWPKey
Gaudi::Property< std::string > m_muWPKey
Definition: IsolationSelectionTool.h:83
xAOD::Photon
Photon_v1 Photon
Definition of the current "egamma version".
Definition: Event/xAOD/xAODEgamma/xAODEgamma/Photon.h:17
PathResolverFindCalibFile
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
Definition: PathResolver.cxx:283
Muon
struct TBPatternUnitContext Muon
CP::IsolationSelectionTool::addElectronWP
StatusCode addElectronWP(const std::string &wpname)
Definition: IsolationSelectionTool.cxx:397
LArG4AODNtuplePlotter.varname
def varname(hname)
Definition: LArG4AODNtuplePlotter.py:37
Interp3D::VetoInterp
Definition: Interp3D.h:15
asg::AcceptData::setCutResult
void setCutResult(const std::string &cutName, bool cutResult)
Set the result of a cut, based on the cut name (safer)
Definition: AcceptData.h:134
CP::IsolationSelectionTool::m_muonAccept
asg::AcceptInfo m_muonAccept
Definition: IsolationSelectionTool.h:105
xAOD::Photon_v1
Definition: Photon_v1.h:37
asg::AcceptData::clear
void clear()
Clear all bits.
Definition: AcceptData.h:54
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
CP::IsolationSelectionTool::getPhotonWPs
virtual const std::vector< std::unique_ptr< IsolationWP > > & getPhotonWPs() const override
Definition: IsolationSelectionTool.cxx:23
xAOD::Iso::ptvarcone30_Nonprompt_All_MaxWeightTTVA_pt1000
@ ptvarcone30_Nonprompt_All_MaxWeightTTVA_pt1000
Definition: IsolationType.h:77
CP::IsolationSelectionTool::initialize
virtual StatusCode initialize() override
Function initialising the tool.
Definition: IsolationSelectionTool.cxx:27
CP::IsolationSelectionTool::m_Interp
std::shared_ptr< Interp3D > m_Interp
Definition: IsolationSelectionTool.h:115
CaloCellTimeCorrFiller.filename
filename
Definition: CaloCellTimeCorrFiller.py:23
physics_parameters.parameters
parameters
Definition: physics_parameters.py:144
CP::IsolationSelectionTool::m_iparWPs
std::vector< std::unique_ptr< IsolationWP > > * m_iparWPs
Iparticle interface.
Definition: IsolationSelectionTool.h:109
CP::IsolationSelectionTool::addUserDefinedWP
StatusCode addUserDefinedWP(const std::string &WPname, xAOD::Type::ObjectType ObjType, std::vector< std::pair< xAOD::Iso::IsolationType, std::string >> &cuts, std::string key="", IsoWPType type=Efficiency)
Definition: IsolationSelectionTool.cxx:466
CP::IsolationSelectionTool::m_phWPvec
Gaudi::Property< std::vector< std::string > > m_phWPvec
Definition: IsolationSelectionTool.h:81
CP::IsolationSelectionTool::addDependencies
void addDependencies(const std::string &container, const IsolationWP &wp)
Definition: IsolationSelectionTool.cxx:85
veto
std::vector< std::string > veto
these patterns are anded
Definition: listroot.cxx:191
CP::IsolationSelectionTool::m_doInterpE
Gaudi::Property< bool > m_doInterpE
Definition: IsolationSelectionTool.h:114
xAOD::Iso::topoetcone40
@ topoetcone40
Definition: IsolationType.h:50
CP::IsolationSelectionTool::getObjAcceptInfo
virtual const asg::AcceptInfo & getObjAcceptInfo() const override
Definition: IsolationSelectionTool.cxx:613
PowhegControl_ttFCNC_NLO.params
params
Definition: PowhegControl_ttFCNC_NLO.py:226
IsolationConditionHist.h
asg::AcceptData
Definition: AcceptData.h:30
CP::IsolationSelectionTool::m_muWPvec
Gaudi::Property< std::vector< std::string > > m_muWPvec
Definition: IsolationSelectionTool.h:79
python.compressB64.c
def c
Definition: compressB64.py:93
Interp3D.h
xAOD::Iso::ptvarcone30_Nonprompt_All_MaxWeightTTVA_pt500
@ ptvarcone30_Nonprompt_All_MaxWeightTTVA_pt500
Definition: IsolationType.h:74
xAOD::Iso::ptcone20_Nonprompt_All_MaxWeightTTVA_pt1000
@ ptcone20_Nonprompt_All_MaxWeightTTVA_pt1000
Definition: IsolationType.h:88
histogram
std::string histogram
Definition: chains.cxx:52
CP::IsolationSelectionTool::m_elWPs
std::vector< std::unique_ptr< IsolationWP > > m_elWPs
Definition: IsolationSelectionTool.h:98
CP::IsolationSelectionTool::m_iparAcceptInfo
asg::AcceptInfo * m_iparAcceptInfo
Definition: IsolationSelectionTool.h:110
CP::IsolationSelectionTool::getElectronWPs
virtual const std::vector< std::unique_ptr< IsolationWP > > & getElectronWPs() const override
Definition: IsolationSelectionTool.cxx:22
asg::AcceptInfo::addCut
int addCut(const std::string &cutName, const std::string &cutDescription)
Add a cut; returning the cut position.
Definition: AcceptInfo.h:53
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37