Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
TauDecayModeNNClassifier.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // local include(s)
7 
8 // helper function include(s)
10 
11 // standard library include(s)
12 #include <array>
13 #include <functional>
14 #include <algorithm>
15 #include <fstream>
16 
17 using PFOPtr = const xAOD::PFO *;
18 using TrkPtr = const xAOD::TauTrack *;
22 using ValueMap = std::map<std::string, double>;
23 using VectorMap = std::map<std::string, std::vector<double>>;
24 using InputMap = std::map<std::string, ValueMap>;
25 using InputSequenceMap = std::map<std::string, VectorMap>;
26 
29 {
30  declareProperty("OutputName", m_outputName = "NNDecayMode");
31  declareProperty("ProbPrefix", m_probPrefix = "NNDecayModeProb_");
32  declareProperty("WeightFile", m_weightFile = "");
33  declareProperty("MaxTauTracks", m_maxTauTracks = 3);
34  declareProperty("MaxNeutralPFOs", m_maxNeutralPFOs = 8);
35  declareProperty("MaxShotPFOs", m_maxShotPFOs = 6);
36  declareProperty("MaxConvTracks", m_maxConvTracks = 4);
37  declareProperty("NeutralPFOPtCut", m_neutralPFOPtCut = 1.5);
38  declareProperty("EnsureTrackConsistency", m_ensureTrackConsistency = true);
39  declareProperty("DecorateProb", m_decorateProb = true);
40 }
41 
43 {
44 }
45 
47 {
48  ATH_MSG_INFO("Initializing TauDecayModeNNClassifier");
49 
50  // find input JSON file
51  std::string weightFile = find_file(m_weightFile);
52  if (weightFile.empty())
53  {
54  ATH_MSG_ERROR("Could not find network weights: " << m_weightFile);
55  return StatusCode::FAILURE;
56  }
57  ATH_MSG_INFO("Loaded network configuration from: " << weightFile);
58 
59  // load lwt graph configuration
60  std::ifstream inputFile(weightFile);
61  lwt::GraphConfig lwtGraphConfig;
62  try
63  {
64  lwtGraphConfig = lwt::parse_json_graph(inputFile);
65  }
66  catch (const std::logic_error &e)
67  {
68  ATH_MSG_ERROR("Error parsing network config: " << e.what());
69  return StatusCode::FAILURE;
70  }
71 
72  // configure neural network
73  try
74  {
75  m_lwtGraph = std::make_unique<lwt::LightweightGraph>(lwtGraphConfig, lwtGraphConfig.outputs.cbegin()->first);
76  }
77  catch (const lwt::NNConfigurationException &e)
78  {
79  ATH_MSG_ERROR("Error configuring network: " << e.what());
80  return StatusCode::FAILURE;
81  }
82 
83  return StatusCode::SUCCESS;
84 }
85 
87 {
88  // inputs
89  // ------
90  // m_inputMap will not hold any information,
91  // but it is required by the lwtnn API.
92  //
93  InputMap inputMapDummy;
94  InputSequenceMap inputSeqMap;
95  std::set<std::string> branches = {"TauTrack", "NeutralPFO", "ShotPFO", "ConvTrack"};
96  DMHelper::initMapKeys(inputSeqMap, branches);
97 
98  ATH_CHECK(getInputs(xTau, inputSeqMap));
99 
100  // output
101  // ------
103 
104  // inference
105  // ---------
106  try
107  {
108  outputs = m_lwtGraph->compute(inputMapDummy, inputSeqMap);
109  }
110  catch (const std::exception &e)
111  {
112  ATH_MSG_ERROR("Error evaluating the network: " << e.what());
113  return StatusCode::FAILURE;
114  }
115 
116  // Results
117  // -------
118  // Decay modes are "1p0n", "1p1n", "1pXn", "3p0n", "3pXn",
119  // here they are encoded as 0, 1, 2, 3, 4
120  //
121  std::array<float, DMVar::nClasses> probs;
122  // the prefix to match to output name in the json weight file
123  std::string prefix = "c_";
124  for (std::size_t i = 0; i < probs.size(); ++i)
125  {
126  probs[i] = outputs.at(prefix + DMVar::sModeNames[i]);
127  }
128 
129  // Determine decay mode from classification results
130  // If requested: ensures consistency between reconstructed number of tracks and decay mode
131  // For non 1 / 3-track taus, classification is performed by maximum mode probability
132  //
133  std::array<float, DMVar::nClasses>::const_iterator itMax;
134  if (m_ensureTrackConsistency && xTau.nTracks() == 1)
135  {
136  // maximum probability of "1p0n", "1p1n", "1pXn"
137  itMax = std::max_element(probs.cbegin(), probs.cbegin() + 3);
138  }
139  else if (m_ensureTrackConsistency && xTau.nTracks() == 3)
140  {
141  // maximum probability of "3p0n", "3pXn"
142  itMax = std::max_element(probs.cbegin() + 3, probs.cend());
143  }
144  else
145  {
146  // maximum probability of all
147  itMax = std::max_element(probs.cbegin(), probs.cend());
148  }
149 
150  const SG::Accessor<int> accDecayMode(m_outputName);
151  accDecayMode(xTau) = std::distance(probs.cbegin(), itMax);
152 
153  if (m_decorateProb)
154  {
155  for (std::size_t i = 0; i < probs.size(); ++i)
156  {
157  const std::string probName = m_probPrefix + DMVar::sModeNames[i];
158  const SG::Accessor<float> accProb(probName);
159  accProb(xTau) = probs[i];
160  }
161  }
162 
163  return StatusCode::SUCCESS;
164 }
165 
167 {
168  std::vector<TrkPtr> vTauTracks;
169  std::vector<PFOPtr> vNeutralPFOs;
170  std::vector<PFOPtr> vShotPFOs;
171  std::vector<TrkPtr> vConvTracks;
172 
173  // set objects
174  // -----------
175 
176  // classified tau tracks
178 
179  // neutral PFOs
180  for (std::size_t i = 0; i < xTau.nNeutralPFOs(); ++i)
181  {
182  const auto pfo = xTau.neutralPFO(i);
183  // Apply pt threshold
184  if (pfo->pt() < m_neutralPFOPtCut * 1e3)
185  continue;
186  vNeutralPFOs.push_back(pfo);
187  }
188 
189  // shot PFOs
190  for (std::size_t i = 0; i < xTau.nShotPFOs(); ++i)
191  {
192  const auto pfo = xTau.shotPFO(i);
193  // skip PFOs without photons
194  int nPhotons{-1};
195  try
196  {
197  nPhotons = DMVar::pfoAttr<int>(pfo, PFOAttributes::tauShots_nPhotons);
198  }
199  catch (const std::exception &e)
200  {
201  ATH_MSG_ERROR("Error retrieving tauShots_nPhotons: " << e.what());
202  return StatusCode::FAILURE;
203  }
204  if (nPhotons < 1)
205  continue;
206  vShotPFOs.push_back(pfo);
207  }
208 
209  // classified conversion tracks
211 
212  DMHelper::sortAndKeep<TrkPtr>(vTauTracks, m_maxTauTracks);
213  DMHelper::sortAndKeep<PFOPtr>(vNeutralPFOs, m_maxNeutralPFOs);
214  DMHelper::sortAndKeep<PFOPtr>(vShotPFOs, m_maxShotPFOs);
215  DMHelper::sortAndKeep<TrkPtr>(vConvTracks, m_maxConvTracks);
216 
217  // set variables
218  // -------------
219 
220  // tau variables
221  const TLorentzVector &tau_p4 = xTau.p4(xAOD::TauJetParameters::TauCalibType::IntermediateAxis);
222 
223  // pair: (1st) the value, (2nd) successfully retrieved
224  std::pair<float, bool> tau_etaTrkECal{0., false};
225  std::pair<float, bool> tau_phiTrkECal{0., false};
226  if (xTau.nTracks() > 0)
227  {
228  TrkPtr trk = xTau.track(0);
229  if (!trk->detail(xAOD::TauJetParameters::CaloSamplingPhiEM, tau_phiTrkECal.first))
230  {
231  ATH_MSG_WARNING("Failed to retrieve extrapolated track phi in ECal");
232  }
233  else
234  {
235  tau_phiTrkECal.second = true;
236  }
237  if (!trk->detail(xAOD::TauJetParameters::CaloSamplingEtaEM, tau_etaTrkECal.first))
238  {
239  ATH_MSG_WARNING("Failed to retrieve extrapolated track eta in ECal");
240  }
241  else
242  {
243  tau_etaTrkECal.second = true;
244  }
245  }
246 
247  // a function to set the common 4-momentum variables, this is needed for all later
248  auto setCommonP4Vars = [&tau_p4, &tau_etaTrkECal, &tau_phiTrkECal](VectorMap &in_seq_map, const TLorentzVector &obj_p4) {
249  in_seq_map["dphiECal"].push_back(DMVar::deltaPhiECal(obj_p4, tau_phiTrkECal));
250  in_seq_map["detaECal"].push_back(DMVar::deltaEtaECal(obj_p4, tau_etaTrkECal));
251  in_seq_map["dphi"].push_back(DMVar::deltaPhi(obj_p4, tau_p4));
252  in_seq_map["deta"].push_back(DMVar::deltaEta(obj_p4, tau_p4));
253  in_seq_map["pt_log"].push_back(DMHelper::Log10Robust(obj_p4.Pt()));
254  in_seq_map["jetpt_log"].push_back(DMHelper::Log10Robust(tau_p4.Pt()));
255  };
256 
257  // a function to set the track impact parameter variables
258  auto setTrackIPVars = [](VectorMap &in_seq_map, const TrkPtr &trk) {
259  in_seq_map["d0TJVA"].push_back(trk->d0TJVA());
260  in_seq_map["d0SigTJVA"].push_back(trk->d0SigTJVA());
261  in_seq_map["z0sinthetaTJVA"].push_back(trk->z0sinthetaTJVA());
262  in_seq_map["z0sinthetaSigTJVA"].push_back(trk->z0sinthetaSigTJVA());
263  };
264 
265  // a function to set the neutral pfo variables
266  auto setNeutralPFOVars = [](VectorMap &in_seq_map, const PFOPtr &pfo) {
267  // get the attributes of a given PFO object
268  auto getAttr = std::bind(DMVar::pfoAttr<float>, pfo, std::placeholders::_1);
269  auto getAttrInt = std::bind(DMVar::pfoAttr<int>, pfo, std::placeholders::_1);
270 
271  in_seq_map["FIRST_ETA"].push_back(getAttr(PFOAttributes::cellBased_FIRST_ETA));
272  in_seq_map["SECOND_R_log"].push_back(DMHelper::Log10Robust(getAttr(PFOAttributes::cellBased_SECOND_R), 1e-3f));
273  in_seq_map["DELTA_THETA"].push_back(getAttr(PFOAttributes::cellBased_DELTA_THETA));
274  in_seq_map["CENTER_LAMBDA_log"].push_back(DMHelper::Log10Robust(getAttr(PFOAttributes::cellBased_CENTER_LAMBDA), 1e-3f));
275  in_seq_map["LONGITUDINAL"].push_back(getAttr(PFOAttributes::cellBased_LONGITUDINAL));
276  in_seq_map["ENG_FRAC_CORE"].push_back(getAttr(PFOAttributes::cellBased_ENG_FRAC_CORE));
277  in_seq_map["SECOND_ENG_DENS_log"].push_back(DMHelper::Log10Robust(getAttr(PFOAttributes::cellBased_SECOND_ENG_DENS), 1e-6f));
278  in_seq_map["NPosECells_EM1"].push_back(getAttrInt(PFOAttributes::cellBased_NPosECells_EM1));
279  in_seq_map["NPosECells_EM2"].push_back(getAttrInt(PFOAttributes::cellBased_NPosECells_EM2));
280  in_seq_map["energy_EM1"].push_back(getAttr(PFOAttributes::cellBased_energy_EM1));
281  in_seq_map["energy_EM2"].push_back(getAttr(PFOAttributes::cellBased_energy_EM2));
282  in_seq_map["EM1CoreFrac"].push_back(getAttr(PFOAttributes::cellBased_EM1CoreFrac));
283  in_seq_map["firstEtaWRTClusterPosition_EM1"].push_back(getAttr(PFOAttributes::cellBased_firstEtaWRTClusterPosition_EM1));
284  in_seq_map["firstEtaWRTClusterPosition_EM2"].push_back(getAttr(PFOAttributes::cellBased_firstEtaWRTClusterPosition_EM2));
285  in_seq_map["secondEtaWRTClusterPosition_EM1_log"].push_back(DMHelper::Log10Robust(getAttr(PFOAttributes::cellBased_secondEtaWRTClusterPosition_EM1), 1e-6f));
286  in_seq_map["secondEtaWRTClusterPosition_EM2_log"].push_back(DMHelper::Log10Robust(getAttr(PFOAttributes::cellBased_secondEtaWRTClusterPosition_EM2), 1e-6f));
287  };
288 
289  // set tau tracks variables
290  VectorMap &chrg_map = inputSeqMap.at("TauTrack");
293  for (const auto &trk : vTauTracks)
294  {
295  setCommonP4Vars(chrg_map, trk->p4());
296  setTrackIPVars(chrg_map, trk);
297  }
298 
299  // set Neutral PFOs variables
300  VectorMap &neut_map = inputSeqMap.at("NeutralPFO");
303  for (const auto &pfo : vNeutralPFOs)
304  {
305  setCommonP4Vars(neut_map, pfo->p4());
306  try
307  {
308  setNeutralPFOVars(neut_map, pfo);
309  }
310  catch (const std::exception &e)
311  {
312  ATH_MSG_ERROR("Error setting neutral PFO variables: " << e.what());
313  return StatusCode::FAILURE;
314  }
315  }
316 
317  // set Shot PFOs variables
318  VectorMap &shot_map = inputSeqMap.at("ShotPFO");
320  for (const auto &pfo : vShotPFOs)
321  {
322  setCommonP4Vars(shot_map, pfo->p4());
323  }
324 
325  // set Conversion tracks variables
326  VectorMap &conv_map = inputSeqMap.at("ConvTrack");
329  for (const auto &trk : vConvTracks)
330  {
331  setCommonP4Vars(conv_map, trk->p4());
332  setTrackIPVars(conv_map, trk);
333  }
334 
335  return StatusCode::SUCCESS;
336 }
337 
338 // Helper functions
339 namespace tauRecTools
340 {
341  const std::set<std::string> TauDecayModeNNVariable::sCommonP4Vars = {
342  "dphiECal", "detaECal", "dphi", "deta", "pt_log", "jetpt_log"};
343 
344  const std::set<std::string> TauDecayModeNNVariable::sTrackIPVars = {
345  "d0TJVA", "d0SigTJVA", "z0sinthetaTJVA", "z0sinthetaSigTJVA"};
346 
347  const std::set<std::string> TauDecayModeNNVariable::sNeutralPFOVars = {
348  "FIRST_ETA", "SECOND_R_log", "DELTA_THETA", "CENTER_LAMBDA_log", "LONGITUDINAL", "ENG_FRAC_CORE",
349  "SECOND_ENG_DENS_log", "NPosECells_EM1", "NPosECells_EM2", "energy_EM1", "energy_EM2", "EM1CoreFrac",
350  "firstEtaWRTClusterPosition_EM1", "firstEtaWRTClusterPosition_EM2",
351  "secondEtaWRTClusterPosition_EM1_log", "secondEtaWRTClusterPosition_EM2_log"};
352 
353  const std::array<std::string, TauDecayModeNNVariable::nClasses> TauDecayModeNNVariable::sModeNames = {
354  "1p0n", "1p1n", "1pXn", "3p0n", "3pXn"};
355 
356  float TauDecayModeNNVariable::deltaPhi(const TLorentzVector &p4, const TLorentzVector &p4_tau)
357  {
358  return p4_tau.DeltaPhi(p4);
359  }
360 
361  float TauDecayModeNNVariable::deltaEta(const TLorentzVector &p4, const TLorentzVector &p4_tau)
362  {
363  return p4.Eta() - p4_tau.Eta();
364  }
365 
366  float TauDecayModeNNVariable::deltaPhiECal(const TLorentzVector &p4, const std::pair<float, bool> &tau_phiTrkECal)
367  {
368  // if not retrieved, then set to 0. (mean value)
369  return tau_phiTrkECal.second ? TVector2::Phi_mpi_pi(p4.Phi() - tau_phiTrkECal.first) : 0.0f;
370  }
371 
372  float TauDecayModeNNVariable::deltaEtaECal(const TLorentzVector &p4, const std::pair<float, bool> &tau_etaTrkECal)
373  {
374  // if not retrieved, then set to 0. (mean value)
375  return tau_etaTrkECal.second ? p4.Eta() - tau_etaTrkECal.first : 0.0f;
376  }
377 
378  template <typename T>
380  {
381  T val{static_cast<T>(0)};
382  if (!pfo->attribute(attr, val))
383  {
384  throw std::runtime_error("Can not retrieve PFO attribute! enum = " + std::to_string(static_cast<unsigned>(attr)));
385  }
386  return val;
387  }
388 
390  {
391  float clus0pt = pfo->cluster(0)->pt();
392  return clus0pt > 0.0f ? (clus0pt - pfo->pt()) / clus0pt : 0.0f;
393  }
394 
395  float TauDecayModeNNVariable::energyFracEM2(const PFOPtr pfo, float energy_em2)
396  {
397  float clus0e = pfo->cluster(0)->e();
398  return clus0e > 0.0f ? energy_em2 / clus0e : 0.0f;
399  }
400 
401  float TauDecayModeNNHelper::Log10Robust(const float val, const float min_val)
402  {
403  return TMath::Log10(std::max(val, min_val));
404  }
405 
406  template <typename T>
407  void TauDecayModeNNHelper::sortAndKeep(std::vector<T> &vec, const std::size_t n_obj)
408  {
409  auto cmp_pt = [](const T lhs, const T rhs) { return lhs->pt() > rhs->pt(); };
410  std::sort(vec.begin(), vec.end(), cmp_pt);
411  if (vec.size() > n_obj)
412  {
413  vec.erase(vec.begin() + n_obj, vec.end());
414  }
415  }
416 
417  template <typename T>
418  void TauDecayModeNNHelper::initMapKeys(std::map<std::string, T> &empty_map,
419  const std::set<std::string> &keys)
420  {
421  // T can be any type
422  for (const auto &key : keys)
423  {
424  empty_map[key];
425  }
426  }
427 } // namespace tauRecTools
InputSequenceMap
std::map< std::string, VectorMap > InputSequenceMap
Definition: TauDecayModeNNClassifier.cxx:25
tauRecTools::TauDecayModeNNVariable::deltaEtaECal
static float deltaEtaECal(const TLorentzVector &p4, const std::pair< float, bool > &tau_etaTrkECal)
Definition: TauDecayModeNNClassifier.cxx:372
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
TauDecayModeNNClassifier::m_maxConvTracks
std::size_t m_maxConvTracks
Definition: TauDecayModeNNClassifier.h:51
xAOD::PFODetails::cellBased_firstEtaWRTClusterPosition_EM2
@ cellBased_firstEtaWRTClusterPosition_EM2
Definition: Event/xAOD/xAODPFlow/xAODPFlow/PFODefs.h:137
TauDecayModeNNClassifier::getInputs
virtual StatusCode getInputs(const xAOD::TauJet &xTau, std::map< std::string, std::map< std::string, std::vector< double >>> &inputSeqMap) const
retrieve the input variables from a TauJet
Definition: TauDecayModeNNClassifier.cxx:166
xAOD::PFODetails::cellBased_NPosECells_EM1
@ cellBased_NPosECells_EM1
Definition: Event/xAOD/xAODPFlow/xAODPFlow/PFODefs.h:134
xAOD::PFO_v1::pt
virtual double pt() const
The transverse momentum ( ) of the particle.
Definition: PFO_v1.cxx:52
xAOD::PFODetails::cellBased_SECOND_R
@ cellBased_SECOND_R
Definition: Event/xAOD/xAODPFlow/xAODPFlow/PFODefs.h:119
xAOD::TauJetParameters::IntermediateAxis
@ IntermediateAxis
Definition: TauDefs.h:338
xAOD::TauJet_v3::nNeutralPFOs
size_t nNeutralPFOs() const
Get the number of neutral PFO particles associated with this tau.
Definition: TauJet_v3.cxx:849
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
SG::Accessor< int >
xAOD::PFODetails::PFOAttributes
PFOAttributes
Definition: Event/xAOD/xAODPFlow/xAODPFlow/PFODefs.h:28
tauRecTools::TauDecayModeNNVariable::pfoAttr
static T pfoAttr(const xAOD::PFO *pfo, const xAOD::PFODetails::PFOAttributes &attr)
retrieve the PFO attributes
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
xAOD::TauJetParameters::CaloSamplingPhiEM
@ CaloSamplingPhiEM
Definition: TauDefs.h:422
xAOD::PFO_v1::attribute
bool attribute(PFODetails::PFOAttributes AttributeType, T &anAttribute) const
get a PFO Variable via enum
tauRecTools::TauDecayModeNNVariable::deltaEta
static float deltaEta(const TLorentzVector &p4, const TLorentzVector &p4_tau)
Definition: TauDecayModeNNClassifier.cxx:361
xAOD::TauJet_v3::nTracks
size_t nTracks(TauJetParameters::TauTrackFlag flag=TauJetParameters::TauTrackFlag::classifiedCharged) const
Definition: TauJet_v3.cxx:526
xAOD::TauJetParameters::classifiedCharged
@ classifiedCharged
Definition: TauDefs.h:406
TauRecToolBase
The base class for all tau tools.
Definition: TauRecToolBase.h:21
tauRecTools::TauDecayModeNNVariable::deltaPhi
static float deltaPhi(const TLorentzVector &p4, const TLorentzVector &p4_tau)
Definition: TauDecayModeNNClassifier.cxx:356
TauDecayModeNNClassifier::m_probPrefix
std::string m_probPrefix
Definition: TauDecayModeNNClassifier.h:46
tauRecTools::TauDecayModeNNVariable::sNeutralPFOVars
static const std::set< std::string > sNeutralPFOVars
Definition: TauDecayModeNNClassifier.h:81
TauDecayModeNNClassifier::~TauDecayModeNNClassifier
virtual ~TauDecayModeNNClassifier()
Definition: TauDecayModeNNClassifier.cxx:42
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:9
xAOD::PFODetails::cellBased_secondEtaWRTClusterPosition_EM1
@ cellBased_secondEtaWRTClusterPosition_EM1
Definition: Event/xAOD/xAODPFlow/xAODPFlow/PFODefs.h:138
Phi_mpi_pi
__HOSTDEV__ double Phi_mpi_pi(double)
Definition: GeoRegion.cxx:7
InputMap
std::map< std::string, ValueMap > InputMap
Definition: TauDecayModeNNClassifier.cxx:24
xAOD::PFODetails::cellBased_DELTA_THETA
@ cellBased_DELTA_THETA
Definition: Event/xAOD/xAODPFlow/xAODPFlow/PFODefs.h:122
TauDecayModeNNClassifier::TauDecayModeNNClassifier
TauDecayModeNNClassifier(const std::string &name="TauDecayModeNNClassifier")
Definition: TauDecayModeNNClassifier.cxx:27
tauRecTools::TauDecayModeNNVariable
A closely related class that calculates the input variables.
Definition: TauDecayModeNNClassifier.h:75
xAOD::TauTrack_v1::detail
bool detail(TauJetParameters::TrackDetail detail, float &value) const
Definition: TauTrack_v1.cxx:166
TauDecayModeNNClassifier::m_maxShotPFOs
std::size_t m_maxShotPFOs
Definition: TauDecayModeNNClassifier.h:50
xAOD::PFODetails::cellBased_firstEtaWRTClusterPosition_EM1
@ cellBased_firstEtaWRTClusterPosition_EM1
Definition: Event/xAOD/xAODPFlow/xAODPFlow/PFODefs.h:136
xAOD::PFODetails::tauShots_nPhotons
@ tauShots_nPhotons
Definition: Event/xAOD/xAODPFlow/xAODPFlow/PFODefs.h:162
runLayerRecalibration.branches
list branches
Definition: runLayerRecalibration.py:98
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
CheckAppliedSFs.e3
e3
Definition: CheckAppliedSFs.py:264
tauRecTools::TauDecayModeNNHelper
A closely related class that provides helper functions.
Definition: TauDecayModeNNClassifier.h:105
CaloCondBlobAlgs_fillNoiseFromASCII.inputFile
string inputFile
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:17
lumiFormat.i
int i
Definition: lumiFormat.py:85
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
tauRecTools::TauDecayModeNNHelper::sortAndKeep
static void sortAndKeep(std::vector< T > &vec, const std::size_t n_obj)
sort the objects and only keep the leading N objects in the vector
Definition: TauDecayModeNNClassifier.cxx:407
TauDecayModeNNClassifier::m_weightFile
std::string m_weightFile
Definition: TauDecayModeNNClassifier.h:47
xAOD::PFODetails::cellBased_secondEtaWRTClusterPosition_EM2
@ cellBased_secondEtaWRTClusterPosition_EM2
Definition: Event/xAOD/xAODPFlow/xAODPFlow/PFODefs.h:139
xAOD::TauJet_v3
Class describing a tau jet.
Definition: TauJet_v3.h:41
calibdata.exception
exception
Definition: calibdata.py:496
TauDecayModeNNClassifier::m_ensureTrackConsistency
bool m_ensureTrackConsistency
Definition: TauDecayModeNNClassifier.h:53
checkCorrelInHIST.prefix
dictionary prefix
Definition: checkCorrelInHIST.py:391
xAOD::TauJet_v3::track
const TauTrack * track(size_t i, TauJetParameters::TauTrackFlag flag=TauJetParameters::TauTrackFlag::classifiedCharged, int *container_index=0) const
Get the pointer to a given tauTrack associated with this tau /*container index needed by trackNonCons...
Definition: TauJet_v3.cxx:450
tauRecTools::TauDecayModeNNVariable::sTrackIPVars
static const std::set< std::string > sTrackIPVars
Definition: TauDecayModeNNClassifier.h:80
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
hist_file_dump.f
f
Definition: hist_file_dump.py:141
xAOD::PFODetails::cellBased_FIRST_ETA
@ cellBased_FIRST_ETA
These variables belong to the cell-based particle flow algorithm.
Definition: Event/xAOD/xAODPFlow/xAODPFlow/PFODefs.h:118
tauRecTools::TauDecayModeNNHelper::initMapKeys
static void initMapKeys(std::map< std::string, T > &empty_map, const std::set< std::string > &keys)
initialise the map with a set of defined keys
Definition: TauDecayModeNNClassifier.cxx:418
python.CreateTierZeroArgdict.outputs
outputs
Definition: CreateTierZeroArgdict.py:189
xAOD::TauJetParameters::classifiedConversion
@ classifiedConversion
Definition: TauDefs.h:408
xAOD::CaloCluster_v1::pt
virtual double pt() const
The transverse momentum ( ) of the particle (negative for negative-energy clusters)
Definition: CaloCluster_v1.cxx:247
PathResolver.h
xAOD::PFODetails::cellBased_energy_EM2
@ cellBased_energy_EM2
Definition: Event/xAOD/xAODPFlow/xAODPFlow/PFODefs.h:141
xAOD::PFODetails::cellBased_energy_EM1
@ cellBased_energy_EM1
Definition: Event/xAOD/xAODPFlow/xAODPFlow/PFODefs.h:140
xAOD::PFO_v1
Class describing a particle flow object.
Definition: PFO_v1.h:35
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
TauDecayModeNNClassifier::m_maxTauTracks
std::size_t m_maxTauTracks
Definition: TauDecayModeNNClassifier.h:48
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
TauRecToolBase::find_file
std::string find_file(const std::string &fname) const
Definition: TauRecToolBase.cxx:19
xAOD::PFODetails::cellBased_ENG_FRAC_CORE
@ cellBased_ENG_FRAC_CORE
Definition: Event/xAOD/xAODPFlow/xAODPFlow/PFODefs.h:128
xAOD::PFODetails::cellBased_EM1CoreFrac
@ cellBased_EM1CoreFrac
Definition: Event/xAOD/xAODPFlow/xAODPFlow/PFODefs.h:130
VectorMap
std::map< std::string, std::vector< double > > VectorMap
Definition: TauDecayModeNNClassifier.cxx:23
lwtDev::parse_json_graph
GraphConfig parse_json_graph(std::istream &json)
Definition: parse_json.cxx:71
xAOD::PFODetails::cellBased_SECOND_ENG_DENS
@ cellBased_SECOND_ENG_DENS
Definition: Event/xAOD/xAODPFlow/xAODPFlow/PFODefs.h:129
xAOD::PFODetails::cellBased_NPosECells_EM2
@ cellBased_NPosECells_EM2
Definition: Event/xAOD/xAODPFlow/xAODPFlow/PFODefs.h:135
tauRecTools::TauDecayModeNNVariable::ptSubRatio
static float ptSubRatio(const xAOD::PFO *pfo)
Definition: TauDecayModeNNClassifier.cxx:389
TauDecayModeNNClassifier::m_decorateProb
bool m_decorateProb
Definition: TauDecayModeNNClassifier.h:54
TauDecayModeNNClassifier::m_lwtGraph
std::unique_ptr< const lwt::LightweightGraph > m_lwtGraph
lwtnn graph
Definition: TauDecayModeNNClassifier.h:66
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
xAOD::PFODetails::cellBased_CENTER_LAMBDA
@ cellBased_CENTER_LAMBDA
Definition: Event/xAOD/xAODPFlow/xAODPFlow/PFODefs.h:123
xAOD::TauTrack_v1
Definition: TauTrack_v1.h:27
tauRecTools::TauDecayModeNNVariable::sCommonP4Vars
static const std::set< std::string > sCommonP4Vars
Definition: TauDecayModeNNClassifier.h:79
xAOD::PFODetails::cellBased_LONGITUDINAL
@ cellBased_LONGITUDINAL
Definition: Event/xAOD/xAODPFlow/xAODPFlow/PFODefs.h:125
TauDecayModeNNClassifier::m_neutralPFOPtCut
float m_neutralPFOPtCut
Definition: TauDecayModeNNClassifier.h:52
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
xAOD::TauJet_v3::p4
virtual FourMom_t p4() const
The full 4-momentum of the particle.
Definition: TauJet_v3.cxx:97
TauDecayModeNNClassifier::m_outputName
std::string m_outputName
properties of the tool
Definition: TauDecayModeNNClassifier.h:45
TauDecayModeNNClassifier::execute
virtual StatusCode execute(xAOD::TauJet &xTau) const override
Execute - called for each tau candidate.
Definition: TauDecayModeNNClassifier.cxx:86
xAOD::PFO_v1::cluster
const CaloCluster * cluster(unsigned int index) const
Retrieve a const pointer to a CaloCluster.
Definition: PFO_v1.cxx:669
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
tauRecTools
Implementation of a TrackClassifier based on an RNN.
Definition: BDTHelper.cxx:12
xAOD::TauJetParameters::CaloSamplingEtaEM
@ CaloSamplingEtaEM
Definition: TauDefs.h:420
xAOD::TauJet_v3::shotPFO
const PFO * shotPFO(size_t i) const
Get the pointer to a given shot PFO associated with this tau.
TauDecayModeNNClassifier.h
TauDecayModeNNClassifier::m_maxNeutralPFOs
std::size_t m_maxNeutralPFOs
Definition: TauDecayModeNNClassifier.h:49
Amg::distance
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
Definition: GeoPrimitivesHelpers.h:54
ValueMap
std::map< std::string, double > ValueMap
Definition: TauDecayModeNNClassifier.cxx:22
xAOD::TauJet_v3::neutralPFO
const PFO * neutralPFO(size_t i) const
Get the pointer to a given neutral PFO associated with this tau.
TauDecayModeNNClassifier::initialize
virtual StatusCode initialize() override
Tool initializer.
Definition: TauDecayModeNNClassifier.cxx:46
xAOD::TauJet_v3::tracks
std::vector< const TauTrack * > tracks(TauJetParameters::TauTrackFlag flag=TauJetParameters::TauTrackFlag::classifiedCharged) const
Get the v<const pointer> to a given tauTrack collection associated with this tau.
Definition: TauJet_v3.cxx:493
tauRecTools::TauDecayModeNNHelper::Log10Robust
static float Log10Robust(const float val, const float min_val=0.)
Definition: TauDecayModeNNClassifier.cxx:401
xAOD::CaloCluster_v1::e
virtual double e() const
The total energy of the particle.
Definition: CaloCluster_v1.cxx:265
tauRecTools::TauDecayModeNNVariable::energyFracEM2
static float energyFracEM2(const xAOD::PFO *pfo, float energy_em2)
Definition: TauDecayModeNNClassifier.cxx:395
xAOD::TauJet_v3::nShotPFOs
size_t nShotPFOs() const
Get the number of shot PFO particles associated with this tau.
Definition: TauJet_v3.cxx:788
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
tauRecTools::TauDecayModeNNVariable::deltaPhiECal
static float deltaPhiECal(const TLorentzVector &p4, const std::pair< float, bool > &tau_phiTrkECal)
Definition: TauDecayModeNNClassifier.cxx:366
tauRecTools::TauDecayModeNNVariable::sModeNames
static const std::array< std::string, nClasses > sModeNames
Definition: TauDecayModeNNClassifier.h:82