ATLAS Offline Software
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
TruthClassificationTool Class Referenceabstract

a tool to classify particles based on their type and origin More...

#include <TruthClassificationTool.h>

Inheritance diagram for TruthClassificationTool:
Collaboration diagram for TruthClassificationTool:

Public Member Functions

 TruthClassificationTool (const std::string &type)
 
virtual StatusCode classify (const xAOD::IParticle &particle, unsigned int &classification) const override
 classify and return unsigned int More...
 
virtual StatusCode classify (const xAOD::IParticle &particle, Truth::Type &classification) const override
 classify and return Truth::Type More...
 
virtual void print () const =0
 Print the state of the tool. More...
 
virtual StatusCode initialize ()
 Dummy implementation of the initialisation function. More...
 
virtual void print () const
 Print the state of the tool. More...
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

StatusCode classifyElectron (const xAOD::IParticle &electron, Truth::Type &classification) const
 electron classification helper More...
 
StatusCode classifyMuon (const xAOD::IParticle &muon, Truth::Type &classification) const
 muon classification helper More...
 
bool isPromptElectron (const xAOD::IParticle &electron, bool isTruthParticle, const xAOD::TruthParticle *truthParticle) const
 a helper to check if an electron is prompt More...
 
bool isChargeFlipElectron (const xAOD::IParticle &electron, bool isTruthParticle, const xAOD::TruthParticle *truthParticle) const
 a helper to check if an electron has an incorrectly reconstructed charge More...
 
bool isChargeFlipMuon (const xAOD::IParticle &muon, bool isTruthParticle, const xAOD::TruthParticle *truthParticle) const
 a helper to check if a muon has an incorrectly reconstructed charge More...
 
bool hasBHadronOrigin (int origin) const
 a helper to check if the origin is a b-hadron More...
 
bool hasCHadronOrigin (int origin) const
 a helper to check if the origin is a c-hadron More...
 
bool hasLightHadronOrigin (int origin) const
 a helper to check if the origin is a light hadron More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

bool m_separateChargeFlipElectrons = false
 separately store charge-flip electrons/muons More...
 
bool m_separateChargeFlipMuons = false
 
bool m_useTruthParticleDecorations {false}
 use truth particle decorations More...
 
const SG::AuxElement::ConstAccessor< int > m_truthType {"truthType"}
 
const SG::AuxElement::ConstAccessor< int > m_truthOrigin {"truthOrigin"}
 
const SG::AuxElement::ConstAccessor< int > m_truthPdgId {"truthPdgId"}
 
const SG::AuxElement::ConstAccessor< unsigned int > m_classifierParticleType {"classifierParticleType"}
 
const SG::AuxElement::ConstAccessor< unsigned int > m_classifierParticleOrigin {"classifierParticleOrigin"}
 
const SG::AuxElement::ConstAccessor< int > m_firstMotherTruthType {"firstEgMotherTruthType"}
 
const SG::AuxElement::ConstAccessor< int > m_firstMotherTruthOrigin {"firstEgMotherTruthOrigin"}
 
const SG::AuxElement::ConstAccessor< int > m_firstMotherPdgId {"firstEgMotherPdgId"}
 
const SG::AuxElement::ConstAccessor< int > m_lastMotherTruthType {"lastEgMotherTruthType"}
 
const SG::AuxElement::ConstAccessor< int > m_lastMotherTruthOrigin {"lastEgMotherTruthOrigin"}
 
const SG::AuxElement::ConstAccessor< int > m_lastMotherPdgId {"lastEgMotherPdgId"}
 
const SG::AuxElement::ConstAccessor< int > m_fallbackTruthType {"TruthClassifierFallback_truthType"}
 
const SG::AuxElement::ConstAccessor< int > m_fallbackTruthOrigin {"TruthClassifierFallback_truthOrigin"}
 
const SG::AuxElement::ConstAccessor< float > m_fallbackDR {"TruthClassifierFallback_dR"}
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

a tool to classify particles based on their type and origin

Definition at line 18 of file TruthClassificationTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ TruthClassificationTool()

TruthClassificationTool::TruthClassificationTool ( const std::string &  type)
explicit

Definition at line 24 of file TruthClassificationTool.cxx.

26 {
27  declareProperty ("separateChargeFlipElectrons", m_separateChargeFlipElectrons, "separate prompt charge-flipped electrons");
28  declareProperty ("separateChargeFlipMuons", m_separateChargeFlipMuons, "separate prompt charge-flipped muons");
29  declareProperty ("useTruthParticleDecorations", m_useTruthParticleDecorations, "use truth particle decorations");
30 }

Member Function Documentation

◆ classify() [1/2]

StatusCode TruthClassificationTool::classify ( const xAOD::IParticle particle,
Truth::Type classification 
) const
overridevirtual

classify and return Truth::Type

Implements ITruthClassificationTool.

Definition at line 43 of file TruthClassificationTool.cxx.

45 {
46  const xAOD::TruthParticle *truthParticle = dynamic_cast<const xAOD::TruthParticle *> (&particle);
47  if (dynamic_cast<const xAOD::Electron *> (&particle) || (truthParticle != nullptr && MC::isElectron(truthParticle)))
48  {
49  ANA_CHECK(classifyElectron(particle, classification));
50  }
51  else if (dynamic_cast<const xAOD::Muon *> (&particle) || (truthParticle != nullptr && MC::isMuon(truthParticle)))
52  {
53  ANA_CHECK(classifyMuon(particle, classification));
54  }
55  else
56  {
57  ANA_MSG_ERROR("Only electrons and muons are supported.");
58  return StatusCode::FAILURE;
59  }
60 
61  return StatusCode::SUCCESS;
62 }

◆ classify() [2/2]

StatusCode TruthClassificationTool::classify ( const xAOD::IParticle particle,
unsigned int &  classification 
) const
overridevirtual

classify and return unsigned int

Implements ITruthClassificationTool.

Definition at line 33 of file TruthClassificationTool.cxx.

35 {
38  classification = static_cast<int>(type);
39  return StatusCode::SUCCESS;
40 }

◆ classifyElectron()

StatusCode TruthClassificationTool::classifyElectron ( const xAOD::IParticle electron,
Truth::Type classification 
) const
private

electron classification helper

Definition at line 65 of file TruthClassificationTool.cxx.

67 {
68 
69 
70  // Check if xAOD::TruthParticle or if not if it has the TruthParticleLink
71  const xAOD::TruthParticle *truthParticle = dynamic_cast<const xAOD::TruthParticle *> (&electron);
72  bool isTruthParticle{};
73  if (truthParticle == nullptr)
74  {
75  // need to find the truth particle
77  }
78  else
79  {
80  isTruthParticle = true;
81  }
82 
83  if (!m_truthPdgId.isAvailable(electron) && !isTruthParticle)
84  {
85  ANA_MSG_ERROR("Electron does not have the 'truthPdgId' decoration.");
86  return StatusCode::FAILURE;
87  }
88 
89  if (!m_firstMotherTruthType.isAvailable(electron)
90  || !m_firstMotherTruthOrigin.isAvailable(electron)
91  || !m_firstMotherPdgId.isAvailable(electron))
92  {
93  ANA_MSG_ERROR("Electron does not have one or more 'firstEgMother' decorations.");
94  return StatusCode::FAILURE;
95  }
96 
97  int type = isTruthParticle ? m_classifierParticleType(electron) : m_truthType(electron);
98  int origin = isTruthParticle ? m_classifierParticleOrigin(electron) : m_truthOrigin(electron);
99  int pdgId = isTruthParticle ? truthParticle->pdgId() : m_truthPdgId(electron);
100  if (m_useTruthParticleDecorations && !isTruthParticle)
101  {
102  type = m_classifierParticleType(*truthParticle);
103  origin = m_classifierParticleOrigin(*truthParticle);
104  }
105 
106  int firstMotherType = m_firstMotherTruthType(electron);
107  int firstMotherOrigin = m_firstMotherTruthOrigin(electron);
108  int firstMotherPdgId = m_firstMotherPdgId(electron);
109  // not in the smart slimming list, thus only in few derivations
110  int lastMotherType = m_lastMotherTruthType.isAvailable(electron) ? m_lastMotherTruthType(electron) : -1;
111  int lastMotherOrigin = m_lastMotherTruthOrigin.isAvailable(electron) ? m_lastMotherTruthOrigin(electron) : -1;
112  int lastMotherPdgId = m_lastMotherPdgId.isAvailable(electron) ? m_lastMotherPdgId(electron) : -1;
113  // fallback recorations
114  int fallbackType{-1};
115  if (m_fallbackTruthType.isAvailable(electron) && m_fallbackDR.isAvailable(electron))
116  {
117  fallbackType = m_fallbackDR(electron) < 0.05 ? m_fallbackTruthType(electron) : -1;
118  }
119 
120  // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
121  // Prompt Photon Conversions
122  // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
123 
124  // gamma -> e+ e-
127  && firstMotherType == MCTruthPartClassifier::IsoPhoton && firstMotherOrigin == MCTruthPartClassifier::PromptPhot)
128  {
129  classification = Truth::Type::PromptPhotonConversion;
130  return StatusCode::SUCCESS;
131  }
132 
133  // H -> gamma gamma, gamma -> e+ e-
135  && firstMotherType == MCTruthPartClassifier::IsoPhoton && firstMotherOrigin == MCTruthPartClassifier::Higgs)
136  {
137  classification = Truth::Type::PromptPhotonConversion;
138  return StatusCode::SUCCESS;
139  }
140 
141  // bkg electrons from bkg photons
143  && firstMotherType == MCTruthPartClassifier::UnknownPhoton && firstMotherOrigin == MCTruthPartClassifier::NonDefined)
144  {
145  classification = Truth::Type::PromptPhotonConversion;
146  return StatusCode::SUCCESS;
147  }
148 
149  // bkg photon from UndrPhot; (Here there is a generator level photon (not gen electron ) that later converts)
152  && firstMotherType == MCTruthPartClassifier::BkgPhoton && firstMotherOrigin == MCTruthPartClassifier::UndrPhot)
153  {
154  classification = Truth::Type::PromptPhotonConversion;
155  return StatusCode::SUCCESS;
156  }
157 
158  // type = 16 and origin = 38 (again, this is a photon)
160  {
161  classification = Truth::Type::PromptPhotonConversion;
162  return StatusCode::SUCCESS;
163  }
164 
165  // Is an isolated photon
166  if (type == MCTruthPartClassifier::IsoPhoton && pdgId == 22)
167  {
168  classification = Truth::Type::PromptPhotonConversion;
169  return StatusCode::SUCCESS;
170  }
171 
172  // electrons from ElMagProc
173  // when FSR, a better classification can be made with the fall back vars
175  && firstMotherType == MCTruthPartClassifier::UnknownPhoton && firstMotherOrigin == MCTruthPartClassifier::NonDefined)
176  {
177  classification = Truth::Type::PromptPhotonConversion;
178  return StatusCode::SUCCESS;
179  }
181  && firstMotherType == MCTruthPartClassifier::NonIsoPhoton && firstMotherOrigin == MCTruthPartClassifier::FSRPhot)
182  {
183  classification = Truth::Type::PromptPhotonConversion;
184  return StatusCode::SUCCESS;
185  }
186 
187  // TODO: Message from Otilia: """
188  // but it's not clear if these electrons are really
189  // "fakes" or they should go in the real category (we don't know from where
190  // this photon is coming...). I would say more truth studies should be done.
191  // """
192  // Hence the warning message...
194  && firstMotherType == MCTruthPartClassifier::Unknown && firstMotherOrigin == MCTruthPartClassifier::ZBoson)
195  {
196  ANA_MSG_WARNING("Electron identified as from a PromptPhotonConversion, "
197  "but this type of electron needs further study!");
198  classification = Truth::Type::PromptPhotonConversion;
199  return StatusCode::SUCCESS;
200  }
201 
202  // when always a photon (last mum is a photon, even if the truth PDG is 11 and first mum PDG is 11 ):
203  // very likely these are internal conversions; last_mum_pdgId == 22 important as the cases with last_mum_pdgId == 11 were found to be quite often close to a true electron
205  && origin == MCTruthPartClassifier::PhotonConv && firstMotherOrigin == MCTruthPartClassifier::PhotonConv
206  && std::abs(firstMotherPdgId) == 11 && std::abs(pdgId) == 11)
207  { // electron
208  if(lastMotherType == -1 || (lastMotherType == MCTruthPartClassifier::GenParticle && (lastMotherPdgId == 22 || std::abs(lastMotherPdgId) == 11)))
209  {
210  // lastMotherType == -1 ==> when the last mother info is not stored in the derivations
211  classification = Truth::Type::PromptPhotonConversion;
212  return StatusCode::SUCCESS;
213  }
214  }
215 
216 
217  // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
218  // Is muon reco as electron or ele radiated by muons
219  // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
220 
222  && (origin == MCTruthPartClassifier::Mu || firstMotherOrigin == MCTruthPartClassifier::Mu))
223  {
224  classification = Truth::Type::ElectronFromMuon;
225  return StatusCode::SUCCESS;
226  }
227 
229  {
230  classification = Truth::Type::ElectronFromMuon;
231  return StatusCode::SUCCESS;
232  }
233 
235  classification = Truth::Type::ElectronFromMuon;
236  return StatusCode::SUCCESS;
237  }
238 
239 
240  // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
241  // Tau decays
242  // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
243 
244  // Non-isolated electron/photon from tau decay
246  && origin == MCTruthPartClassifier::TauLep)
247  {
248  classification = Truth::Type::TauDecay;
249  return StatusCode::SUCCESS;
250  }
251 
252  // tau -> tau gamma, gamma -> e+ e-, etc
253  if ((firstMotherType == MCTruthPartClassifier::NonIsoElectron || firstMotherType == MCTruthPartClassifier::NonIsoPhoton)
254  && firstMotherOrigin == MCTruthPartClassifier::TauLep)
255  {
256  classification = Truth::Type::TauDecay;
257  return StatusCode::SUCCESS;
258  }
259 
260 
261  // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
262  // Light hadron sources
263  // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
264 
266  {
267  classification = Truth::Type::LightFlavorDecay;
268  return StatusCode::SUCCESS;
269  }
270 
271  if (firstMotherType == MCTruthPartClassifier::BkgElectron)
272  {
274  && (hasLightHadronOrigin(origin) || hasLightHadronOrigin(firstMotherOrigin)))
275  {
276  classification = Truth::Type::LightFlavorDecay;
277  return StatusCode::SUCCESS;
278  }
279  }
280 
282  {
283  if (origin == MCTruthPartClassifier::DalitzDec || firstMotherOrigin == MCTruthPartClassifier::DalitzDec) {
284  classification = Truth::Type::LightFlavorDecay;
285  return StatusCode::SUCCESS;
286  }
287  if (hasLightHadronOrigin(origin) || hasLightHadronOrigin(firstMotherOrigin)) {
288  classification = Truth::Type::LightFlavorDecay;
289  return StatusCode::SUCCESS;
290  }
291  }
292 
294  && (hasLightHadronOrigin(origin) || hasLightHadronOrigin(firstMotherOrigin)))
295  {
296  classification = Truth::Type::LightFlavorDecay;
297  return StatusCode::SUCCESS;
298  }
299 
300 
301  // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
302  // From B hadron
303  // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
304 
305  if (hasBHadronOrigin(origin) || hasBHadronOrigin(firstMotherOrigin))
306  {
307  classification = Truth::Type::BHadronDecay;
308  return StatusCode::SUCCESS;
309  }
310 
311  // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
312  // From C hadron
313  // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
314 
315  if (type != MCTruthPartClassifier::IsoElectron && (hasCHadronOrigin(origin) || hasCHadronOrigin(firstMotherOrigin)))
316  {
317  classification = Truth::Type::CHadronDecay;
318  return StatusCode::SUCCESS;
319  }
320 
321 
322  // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
323  // Prompt / Isolated electrons
324  // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
325 
326  if (isPromptElectron(electron, isTruthParticle, truthParticle))
327  {
328  if (m_separateChargeFlipElectrons && isChargeFlipElectron(electron, isTruthParticle, truthParticle))
329  {
330  classification = Truth::Type::ChargeFlipIsoElectron;
331  return StatusCode::SUCCESS;
332  }
333 
334  classification = Truth::Type::IsoElectron;
335  return StatusCode::SUCCESS;
336  }
337 
338 
339  // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
340  // Unknown & known Unknown
341  // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
342 
343  // TODO: See if we want this or not. Now we check if this is something we are
344  // able to classify or not. Note that this might be a bit dangerous because
345  // the reasons for not having origin and status codes might be complex. The
346  // main idea is to weed out things we don't have a hope of classifying due to
347  // missing or unknown information.
348  static const SG::ConstAccessor<int> statusAcc("status");
349  bool stable = (truthParticle != nullptr && statusAcc.isAvailable(*truthParticle)) ? MC::isStable(truthParticle) : false;
350 
351 
352  if (origin == MCTruthPartClassifier::NonDefined && firstMotherOrigin == MCTruthPartClassifier::NonDefined)
353  {
354  if (!stable)
355  {
356  if ((type == MCTruthPartClassifier::Unknown || type == MCTruthPartClassifier::UnknownPhoton) && firstMotherType == MCTruthPartClassifier::Unknown)
357  {
358  classification = Truth::Type::KnownUnknown;
359  return StatusCode::SUCCESS;
360  }
361  } else {
362  if ((type == MCTruthPartClassifier::Unknown && firstMotherType == MCTruthPartClassifier::Unknown)
364  {
365  classification = Truth::Type::KnownUnknown;
366  return StatusCode::SUCCESS;
367  }
368 
370  {
371  classification = Truth::Type::KnownUnknown;
372  return StatusCode::SUCCESS;
373  }
374  }
375  }
376 
377  // non-iso photons with no info available to classify
379  && firstMotherType == 0 && firstMotherOrigin == 0 && firstMotherPdgId == 0)
380  {
381  if (lastMotherType == -1 || (lastMotherType == 0 && lastMotherOrigin == 0 && lastMotherPdgId == 0))
382  { // last_firstMotherType == -1 ==> when the last_mum info is not stored in the derivations
383  classification = Truth::Type::KnownUnknown;
384  return StatusCode::SUCCESS;
385  }
386  }
387 
388  ANA_MSG_WARNING("Electron type unknown: type = " << type << ", origin = " << origin);
389 
390  // debug printout
391  if (truthParticle != nullptr)
392  {
393  const xAOD::TruthParticle *parent = truthParticle;
394  ATH_MSG_DEBUG("Unknown particle decay chain:");
395  std::string out = "\t";
396  while (parent != nullptr)
397  {
398  out.append(std::to_string(parent->pdgId()));
399  parent = parent->parent();
400  if (parent) out.append(" -> ");
401  }
403  }
404 
405  classification = Truth::Type::Unknown;
406  return StatusCode::SUCCESS;
407 }

◆ classifyMuon()

StatusCode TruthClassificationTool::classifyMuon ( const xAOD::IParticle muon,
Truth::Type classification 
) const
private

muon classification helper

Definition at line 410 of file TruthClassificationTool.cxx.

412 {
413 
414 
415  // Check if xAOD::TruthParticle or if not if it has the TruthParticleLink
416  const xAOD::TruthParticle *truthParticle
417  = dynamic_cast<const xAOD::TruthParticle *> (&muon);
418  bool isTruthParticle{};
419  if (truthParticle == nullptr)
420  {
421  // need to find the truth particle
423  }
424  else
425  {
426  isTruthParticle = true;
427  }
428 
429  int type = isTruthParticle ? m_classifierParticleType(muon) : m_truthType(muon);
430  int origin = isTruthParticle ? m_classifierParticleOrigin(muon) : m_truthOrigin(muon);
431  if (m_useTruthParticleDecorations && !isTruthParticle && truthParticle != nullptr)
432  {
433  type = m_classifierParticleType(*truthParticle);
434  origin = m_classifierParticleOrigin(*truthParticle);
435  }
436 
437  // fallback recorations
438  int fallbackType{-1};
439  if (m_fallbackTruthType.isAvailable(muon) && m_fallbackDR.isAvailable(muon))
440  {
441  fallbackType = m_fallbackDR(muon) < 0.05 ? m_fallbackTruthType(muon) : -1;
442  }
443 
444  // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
445  // muons from taus
446  // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
447 
449  {
450  classification = Truth::Type::TauDecay;
451  return StatusCode::SUCCESS;
452  }
453 
454 
455  // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
456  // Light hadron sources
457  // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
458 
460  {
461  classification = Truth::Type::LightFlavorDecay;
462  return StatusCode::SUCCESS;
463  }
464 
466  {
467  classification = Truth::Type::LightFlavorDecay;
468  return StatusCode::SUCCESS;
469  }
470 
471 
472  // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
473  // From B hadron
474  // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
475 
476  if (hasBHadronOrigin(origin))
477  {
478  classification = Truth::Type::BHadronDecay;
479  return StatusCode::SUCCESS;
480  }
481 
482  // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
483  // From C hadron
484  // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
485 
487  {
488  classification = Truth::Type::CHadronDecay;
489  return StatusCode::SUCCESS;
490  }
491  // TODO:: There is a comment in the example code about J/psi but there is a
492  // separate origin code for that: `MCTruthPartClassifier::JPsi == 28.` --> this might not be in all samples/generators?
493 
494 
495  // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
496  // prompt muons
497  // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
498  // Check if the type of muon is IsoMuon(6) and whether the origin
499  // of the muon is from a prompt source
500  static const std::set<int> promptOrigin({
501  MCTruthPartClassifier::SingleMuon, // Single muon (origin = 2) from muon twiki
509  MCTruthPartClassifier::CCbarMeson, // PromptQuarkoniumDecay
512  });
513  if (type == MCTruthPartClassifier::IsoMuon && isInSet(origin, promptOrigin))
514  {
515  //separate charge-flip muons
516  if (m_separateChargeFlipMuons && isChargeFlipMuon(muon, isTruthParticle, truthParticle))
517  {
518  classification = Truth::Type::ChargeFlipMuon;
519  return StatusCode::SUCCESS;
520  }
521  classification = Truth::Type::PromptMuon;
522  return StatusCode::SUCCESS;
523  }
524 
525 
526  // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
527  // Known Unknown
528  // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
529 
531  {
532  classification = Truth::Type::KnownUnknown;
533  return StatusCode::SUCCESS;
534  }
535 
536  static const SG::ConstAccessor<int> statusAcc("status");
537  bool stable = (truthParticle != nullptr && statusAcc.isAvailable(*truthParticle)) ? MC::isStable(truthParticle) : false;
538 
539  if (!stable) {
540  if (type == MCTruthPartClassifier::Unknown && origin == MCTruthPartClassifier::NonDefined)
541  { // Data
542  classification = Truth::Type::KnownUnknown;
543  return StatusCode::SUCCESS;
544  }
545  if (type == -99999 && origin == -99999)
546  { // MC - no status = 1 truth particle associated with the primary track
547  classification = Truth::Type::KnownUnknown;
548  return StatusCode::SUCCESS;
549  }
550  }
551 
552  // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
553  // NonMuonlike
554  // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
555  // Check if the type of muon is related to electrons, ie IsoElectron (2) or NonIsoElectron (3) or BkgElectron (4)
556  if (type == MCTruthPartClassifier::IsoElectron || type == MCTruthPartClassifier::BkgElectron || type == MCTruthPartClassifier::NonIsoElectron)
557  {
558  classification = Truth::Type::NonMuonlike;
559  return StatusCode::SUCCESS;
560  }
561 
562  // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
563  // TauLike, BHadLike, CHadLike
564  // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
565  // Check if the matched parent of truth muon fall into these 3 xxxLike
566  // Only truth muon with one matched parent is considered
567  // If parent is tau, the muons is TauLike
568  // If parent is bhadron/b quark, the muons is BHadLike
569  // If parent is chadron/c quark, the muons is CHadLike
570  if (type == MCTruthPartClassifier::Unknown && origin == MCTruthPartClassifier::NonDefined){
571  if( truthParticle != nullptr && truthParticle->nParents() == 1 && truthParticle->parent(0) != nullptr){
572  const xAOD::TruthParticle *parent = truthParticle->parent(0);
573  int parent_pdgid = parent->pdgId();
574  if(parent->isTau()){
575  classification = Truth::Type::TauDecayLike;
576  ATH_MSG_WARNING("Muon type taudecaylike: type = " << type << ", origin = " << origin << ", parent = " << parent_pdgid) ;
577  return StatusCode::SUCCESS;
578  }
579  if(parent->isBottomHadron() || parent->hasBottom()){
580  classification = Truth::Type::BHadronDecayLike;
581  ATH_MSG_WARNING("Muon type bhadrondecaylike: type = " << type << ", origin = " << origin << ", parent = " << parent_pdgid) ;
582  return StatusCode::SUCCESS;
583  }
584  if(parent->isCharmHadron() || parent->hasCharm()){
585  if( (parent_pdgid / 1000) % 10 != 0 || (parent_pdgid / 100) % 10 != 4 || (parent_pdgid / 10) % 10 != 4){ // to exclude ccbarmeson
586  classification = Truth::Type::CHadronDecayLike;
587  ATH_MSG_WARNING("Muon type chadrondecaylike: type = " << type << ", origin = " << origin << ", parent = " << parent_pdgid) ;
588  return StatusCode::SUCCESS;
589  }
590  }
591  }
592  }
593 
594  // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
595  // Unknown
596  // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
597  classification = Truth::Type::Unknown;
598  ATH_MSG_WARNING("Muon type unknown: type = " << type << ", origin = " << origin) ;
599 
600  return StatusCode::SUCCESS;
602 }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ getKey()

SG::sgkey_t asg::AsgTool::getKey ( const void *  ptr) const
inherited

Get the (hashed) key of an object that is in the event store.

This is a bit of a special one. StoreGateSvc and xAOD::TEvent both provide ways for getting the SG::sgkey_t key for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.

In order to allow tools to efficiently perform this operation, they can use this helper function.

See also
asg::AsgTool::getName
Parameters
ptrThe bare pointer to the object that the event store should know about
Returns
The hashed key of the object in the store. If not found, an invalid (zero) key.

Definition at line 119 of file AsgTool.cxx.

119  {
120 
121 #ifdef XAOD_STANDALONE
122  // In case we use @c xAOD::TEvent, we have a direct function call
123  // for this.
124  return evtStore()->event()->getKey( ptr );
125 #else
126  const SG::DataProxy* proxy = evtStore()->proxy( ptr );
127  return ( proxy == nullptr ? 0 : proxy->sgkey() );
128 #endif // XAOD_STANDALONE
129  }

◆ getName()

const std::string & asg::AsgTool::getName ( const void *  ptr) const
inherited

Get the name of an object that is / should be in the event store.

This is a bit of a special one. StoreGateSvc and xAOD::TEvent both provide ways for getting the std::string name for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.

In order to allow tools to efficiently perform this operation, they can use this helper function.

See also
asg::AsgTool::getKey
Parameters
ptrThe bare pointer to the object that the event store should know about
Returns
The string name of the object in the store. If not found, an empty string.

Definition at line 106 of file AsgTool.cxx.

106  {
107 
108 #ifdef XAOD_STANDALONE
109  // In case we use @c xAOD::TEvent, we have a direct function call
110  // for this.
111  return evtStore()->event()->getName( ptr );
112 #else
113  const SG::DataProxy* proxy = evtStore()->proxy( ptr );
114  static const std::string dummy = "";
115  return ( proxy == nullptr ? dummy : proxy->name() );
116 #endif // XAOD_STANDALONE
117  }

◆ getProperty()

template<class T >
const T* asg::AsgTool::getProperty ( const std::string &  name) const
inherited

Get one of the tool's properties.

◆ hasBHadronOrigin()

bool TruthClassificationTool::hasBHadronOrigin ( int  origin) const
private

a helper to check if the origin is a b-hadron

Definition at line 731 of file TruthClassificationTool.cxx.

732 {
733  static const std::set<int> b_hadrons({
737  });
738  return isInSet(origin, b_hadrons);
739 }

◆ hasCHadronOrigin()

bool TruthClassificationTool::hasCHadronOrigin ( int  origin) const
private

a helper to check if the origin is a c-hadron

Definition at line 742 of file TruthClassificationTool.cxx.

742  {
743  static const std::set<int> c_hadrons({
747  });
748  return isInSet(origin, c_hadrons);
749 }

◆ hasLightHadronOrigin()

bool TruthClassificationTool::hasLightHadronOrigin ( int  origin) const
private

a helper to check if the origin is a light hadron

Definition at line 752 of file TruthClassificationTool.cxx.

752  {
753  static const std::set<int> light_source({
761  });
762  return isInSet(origin, light_source);
763 }

◆ initialize()

virtual StatusCode asg::AsgTool::initialize ( )
inlinevirtualinherited

Dummy implementation of the initialisation function.

It's here to allow the dual-use tools to skip defining an initialisation function. Since many are doing so...

Reimplemented in SimpleMuonTriggerScaleFactors, Trig::TrigMuonMatching, CP::MuonTriggerScaleFactors, IHIEventShapeMapTool, ST::SUSYObjDef_xAOD, InDetSecVtxTruthMatchTool, JetGrooming::RecSoftDrop, met::METMaker, AsgForwardElectronIsEMSelector, JetGrooming::JetTrimming, ORUtils::BaseOverlapTool, PMGTools::PMGSherpa22VJetsWeightTool, AsgElectronEfficiencyCorrectionTool, CP::ElectronChargeEfficiencyCorrectionTool, AsgForwardElectronLikelihoodTool, CorrectPFOTool, CP::IsolationCorrectionTool, TauAnalysisTools::TauTruthMatchingTool, EGammaAmbiguityTool, InDetVertexTruthMatchTool, AthOnnx::OnnxRuntimeSessionToolCPU, AthOnnx::OnnxRuntimeSessionToolCUDA, PuppiWeightTool, CP::EgammaCalibrationAndSmearingTool, CP::FFJetSmearingTool, JetBalancePFlowJvtTool, JetIsolationTool, JetForwardPFlowJvtTool, MCTruthClassifier, InDet::InDetHardScatterSelectionTool, dRMatchingTool, xAOD::BPhysBlindingTool, JetVertexTaggerTool, tauRecTools::TrackRNN, LVL1::L1CaloOfflineTriggerTowerTools, TauAnalysisTools::TauSelectionTool, JetRecTool, met::METAssociationTool, CP::TrackVertexAssociationTool, met::METAssociator, xAOD::TrackIsolationTool, InDet::InDetTrackSelectionTool, egammaMVACalibTool, TrigConf::xAODConfigTool, JetCleaningTool, met::METCaloRegionsTool, ZDC::ZdcLEDAnalysisTool, ZDC::RpdSubtractCentroidTool, CP::MuonCalibTool, LVL1::L1CaloCells2TriggerTowers, IDTPM::TrackAnalysisInfoWriteTool, JetVertexFractionTool, LVL1BS::PpmByteStreamReadV1V2Tool, JetClusterer, JetForwardJvtToolBDT, CP::AsgFlagSelectionTool, TauTrackFinder, TauAnalysisTools::DiTauSelectionTool, JetClustererByVertex, BookkeeperTool, JetBadChanCorrTool, xAOD::BPhysTrackVertexMapTool, JetModifiedMassDrop, xAOD::CaloIsolationTool, EnhancedBiasWeighter, InDet::InDetUsedInFitTrackDecoratorTool, CP::AsgPtEtaSelectionTool, TauAnalysisTools::BuildTruthTaus, tauRecTools::TauTrackRNNClassifier, InDet::InDetSecVtxTrackSelectionTool, AthONNX::JSSMLTool, JetForwardJvtTool, JetPileupTag::JetVertexNNTagger, CP::EgammaIsGoodOQSelectionTool, CP::IsolationCloseByCorrectionTool, ElectronPhotonVariableCorrectionBase, CP::MuonCalibIntScaleSmearTool, JetFinder, AsgElectronIsEMSelector, CP::MuonCalibIntHighpTSmearTool, CP::MuonCalibIntSagittaTool, met::METBuilderTool, CP::AsgMaskSelectionTool, ECUtils::EventCleaningTool, TauAnalysisTools::TauTruthTrackMatchingTool, met::METSoftTermsTool, LVL1::L1CaloLArTowerEnergy, HiggsTruthCategoryTool, IDTPM::TrackRoiSelectionTool, TauAnalysisTools::CommonDiTauEfficiencyTool, HIJetConstituentSubtractionTool, JetTrackSumMomentsTool, JetGrooming::SoftDrop, JetTrackMomentsTool, met::METTruthTool, PMGTools::PMGSherpaVjetsSysTool, JetQGTaggerVariableTool, ClusterMatching::CaloClusterMatchingTool, AsgPhotonEfficiencyCorrectionTool, FlavorTagDiscriminants::MultifoldGNNTool, InDet::JetTrackFilterTool, DiTauRecTools::DiTauDiscriminantTool, asg::DataHandleTestTool, xAODMaker::FileMetaDataTool, InDet::InclusiveTrackFilterTool, InDet::InDetTrackTruthFilterTool, HIJetClusterSubtractorTool, CP::MVATrackVertexAssociationTool, IDTPM::RoiSelectionTool, IDTPM::VertexRoiSelectionTool, CP::BaseFakeBkgTool, ElectronPhotonVariableCorrectionTool, JetCalibrationTool, JetCaloQualityTool, JetOriginCorrectionTool, IDTPM::TrackObjectSelectionTool, InDet::InDetTrackBiasingTool, HIJetClusterIndexAssociationTool, TauWPDecorator, TrigGlobalEfficiencyCorrectionTool, ZdcRecChannelToolV2, InDetGNNHardScatterSelection::GNNTool, CP::BaseLinearFakeBkgTool, FlavorTagDiscriminants::GNNTool, CP::MuonSelectionTool, TauAnalysisTools::CommonDiTauSmearingTool, JSSTaggerBase, CP::LhoodMM_tools, AsgElectronLikelihoodTool, DiTauRecTools::DiTauIDVarCalculator, CP::JetQGTagger, Pileup1DResidualCalibStep, LVL1::L1CaloFcal23Cells2RxMappingTool, IDTPM::TrackQualitySelectionTool, IDTPM::VertexQualitySelectionTool, ORUtils::OverlapRemovalTool, Ringer::AsgRingerSelectorTool, InDet::InDetTrackSmearingTool, CP::JetJvtEfficiency, JetCopier, JetGrooming::JetGroomer, met::METPhotonAssociator, JetECPSFractionTool, JetPtAssociationTool, met::METElectronAssociator, met::METTauAssociator, PMGTools::PMGDecayProductsSelectionTool, WeightToolBase, HIJetDRAssociationTool, JetClusterMomentsTool, met::METJetAssocTool, TauVertexFinder, IDTPM::JsonPlotsDefReadTool, TauAnalysisTools::DiTauSmearingTool, BJetCorrectionTool, JetDRTrackAssocTool, JetReclusterer, TauDecayModeNNClassifier, BDTVertexWeightCalculator, asg::UnitTestTool1, ZDC::ZdcAnalysisTool, IDTPM::DeltaRMatchingToolBase< T, R >, AsgElectronSelectorTool, GSCCalibStep, EtaMassJESCalibStep, JetReclusteringTool, met::METMuonAssociator, TauPi0CreateROI, TauShotFinder, IDTPM::DeltaRMatchingToolBase< xAOD::TrackParticle, xAOD::TruthParticle >, IDTPM::DeltaRMatchingToolBase< xAOD::TruthParticle, xAOD::TrackParticle >, IDTPM::DeltaRMatchingToolBase< xAOD::TrackParticle >, ZdcRecChannelToolLucrod, PMGTools::PMGTruthWeightTool, JetCalibTool, SmearingCalibStep, JetVoronoiMomentsTool, Trig::MatchFromCompositeTool, asg::UnitTestTool3, IDTPM::TruthTrackMatchingTool, CP::ApplyFakeFactor, AsgElectronChargeIDSelectorTool, HIJetMaxOverMeanTool, PanTau::Tool_FeatureExtractor, TauElectronVetoVariables, ZDC::ZdcTrigValidTool, IDTPM::TruthQualitySelectionTool, CP::IsolationSelectionTool, WeightsAgregator, EL::UnitTestTool, FlavorTagDiscriminants::TrackClassifier, JetLArHVTool, IDTPM::EFTrackMatchingTool, IDTPM::OfflineTrackQualitySelectionTool, IDTPM::TrackTruthMatchingTool, HI::HIPileupTool, BTaggingSelectionTool, InDet::InDetTrackTruthOriginTool, JetHelper::VarTool, FlavorTagDiscriminants::DL2Tool, PileupAreaCalibStep, EnergyCorrelatorGeneralizedRatiosTool, EnergyCorrelatorGeneralizedTool, EnergyCorrelatorRatiosTool, EnergyCorrelatorTool, TauEleOverlapChecker, TauJetRNNEvaluator, asg::UnitTestTool2, JetTruthLabelingTool, ZDC::ZdcRecTool, HIJetConstituentModifierTool, TauCalibrateLC, TauGNNEvaluator, TauPi0ScoreCalculator, TauRecToolBase, Trig::TrigEgammaEmulationPrecisionElectronHypoTool, asg::UnitTestTool1A, PDFWeight, HIEventShapeJetIteration, HIJetSignificanceTool, CP::JetQGTaggerBDT, JetWidthTool, TauVertexVariables, Trig::TrigEgammaEmulationPrecisionPhotonHypoTool, Trig::TrigEgammaMatchingTool, Trig::R3IParticleRetrievalTool, JetPileupLabelingTool, JetFromPseudojet, JetTruthParticleSelectorTool, Trig::TrigEgammaEmulationBaseHypoTool, AthOnnx::OnnxRuntimeInferenceTool, ZDC::RPDAnalysisTool, CP::ApplyE2YFakeRate, ParticleScaleFactorTool, TauAnalysisTools::TauHFVetoTool, InDet::InDetTrackSystematicsTool, JetCaloQualityToolFE, Trig::MatchingTool, Trig::R3MatchingTool, JetParticleAssociation, JetHelper::HistoInput2D, Trig::TrigEgammaEmulationChain, Trig::TrigEgammaEmulationFastCaloHypoTool, xAODtoHepMCTool, HIEventShapeMapTool, HI::HIVertexSelectionTool, TauVertexedClusterDecorator, Trig::IParticleRetrievalTool, HI::HIEventSelectionTool, FlavorTagDiscriminants::HbbTagTool, JetConstituentFrac, JetGroomMRatio, Validator, JetHelper::HistoInput1D, JetHelper::TextInputMCJES, ExtendTrackToLayerTool, Trig::TypedScoringTool, TrackTruthSelectionTool, HIUEModulatorTool, JSSWTopTaggerANN, CP::JvtEfficiencyToolBase, JetEMScaleMomTool, MvaTESVariableDecorator, TauAODMuonRemovalTool, TauCombinedTES, CP::AsymptMatrixTool, ParticleJetDeltaRLabelTool, HIEventShapeSummaryTool, FlavorTagDiscriminants::BTagAugmenterTool, FlavorTagDiscriminants::VRJetOverlapDecoratorTool, JSSTaggerUtils, JetCaloEnergies, ParticleJetGhostLabelTool, FlavorTagDiscriminants::BTagMuonAugmenterTool, BTaggingEfficiencyJsonTool, MBTSTimeFilterTool, JSSWTopTaggerDNN, SmoothedTopTagger, MvaTESEvaluator, BoostedJetTaggerTool, CP::IsolationLowPtPLVTool, Trig::DRScoringTool, Trig::EgammaDRScoringTool, BTaggingSelectionJsonTool, SmoothedWZTagger, CP::FJvtEfficiencyTool, CP::JvtSelectionToolBase, CP::NNJvtSelectionTool, AthAsgExUnittestTool, CP::JvtSelectionTool, CP::FJvtSelectionTool, CP::JvtEfficiencyTool, CP::NNJvtEfficiencyTool, BookkeeperDumperTool, TrigFastCalibWithRings, BTaggingEfficiencyTool, BTaggingTruthTaggingTool, MissingCellListTool, JetVoronoiDiagramHelpers::Diagram, FastJetInterfaceTool, CP::PhotonVertexSelectionTool, met::METSystematicsTool, Trig::TrigEgammaEmulationToolMT, JetAttributeRatioSelector, BTaggingEigenVectorRecompositionTool, Trig::TrigDecisionTool, CP::PhotonPointingTool, met::METRecoTool, CP::PileupReweightingTool, LVL1::L1CaloxAODOfflineTriggerTowerTools, LVL1::TrigT1CaloMonErrorToolV1, met::METTrackFilterTool, LVL1::TrigT1CaloMonErrorTool, SoftKillerWeightTool, EventDensityTool, met::METSignificance, JetUncertaintiesTool, CP::JetTileCorrectionTool, xAODMaker::TriggerMenuMetaDataTool, D3PD::D3PDMCTruthClassifier, JetConstituentModSequence, HistoGroupBase, AsgPhotonIsEMSelector, JetAttributeSelector, TrackVertexAssociationTool, met::METRefinerTool, TauAnalysisTools::CommonSmearingTool, PanTau::Tool_DetailsArranger, LVL1::L1CaloMonitoringCaloTool, LVL1::L1CaloTTIdTools, JetInputElRemovalTool, GoodRunsListSelectionTool, TauAnalysisTools::CommonEfficiencyTool, PanTau::PanTauProcessor, xAODMaker::TruthMetaDataTool, EventShapeCopier, met::METJetTool, ZdcByteStreamReadV1V2Tool, FSR::FsrPhotonTool, Trig::StaticBunchCrossingTool, ZMassConstraint::ConstraintFit, TauAnalysisTools::TauEfficiencyCorrectionsTool, PanTau::Tool_DecayModeDeterminator, PanTau::Tool_ModeDiscriminator, CP::ElectronLRTOverlapRemovalTool, HIClusterSubtraction, JetAttributeHisto, JetPseudojetCopier, met::METEgammaAssociator, Trig::xAODBunchCrossingTool, TauAnalysisTools::DiTauEfficiencyCorrectionsTool, TauAnalysisTools::DiTauTruthMatchingTool, TauAnalysisTools::TauSmearingTool, met::METTruthAssociator, PanTau::Tool_InformationStore, HistoDefinitionTool, PanTau::Tool_InputConverter, DiTauMassTools::MissingMassTool, JetBottomUpSoftDrop, JetRecursiveSoftDrop, PMGTools::PMGCrossSectionTool, JetSoftDrop, TrigEgammaMatchingToolMT, JetConstituentsRetriever, VoronoiWeightTool, JetCaloCellQualityTool, JetContainerHistoFiller, ChargedHadronSubtractionTool, met::METRegionsTool, met::METSoftAssociator, PanTau::Tool_TauConstituentGetter, ConstituentSubtractorTool, JetHistoBase, JetSelectorAttributeRunII, JetSplitter, CaloClusterConstituentsOrigin, CP::MuonLRTOverlapRemovalTool, HistosForJetSelection, JetPruner, JetToolRunner, JetUsedInFitTrackDecoratorTool, JetTrimmer, NSubjettinessRatiosTool, CP::MuonEfficiencyScaleFactors, JetConstitFourMomTool, NSubjettinessTool, ZdcDataAccessV2, JetPseudojetRetriever, LVL1BS::TrigT1CaloDataAccessV2, PanTau::Tool_TauConstituentSelector, CopyTruthParticles, ClusterAtEMScaleTool, CP::IsolationHelper, HIEfficiencyResponseHistos, AsgDeadHVCellRemovalTool, EfficiencyResponseHistos, ConstitTimeCutTool, JetSelectorAttribute, HIJetUEMonitoring, JetSubStructureMomentToolsBase, AsgHelloTool, CopyTruthJetParticles, LeadingJetsRelations, and JetEventSelector.

Definition at line 133 of file AsgTool.h.

133 { return StatusCode::SUCCESS; }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ isChargeFlipElectron()

bool TruthClassificationTool::isChargeFlipElectron ( const xAOD::IParticle electron,
bool  isTruthParticle,
const xAOD::TruthParticle truthParticle 
) const
private

a helper to check if an electron has an incorrectly reconstructed charge

Definition at line 652 of file TruthClassificationTool.cxx.

655 {
656 
657 
658  int type = isTruthParticle ? m_classifierParticleType(electron) : m_truthType(electron);
659  int origin = isTruthParticle ? m_classifierParticleOrigin(electron) : m_truthOrigin(electron);
660  int pdgId = isTruthParticle && truthParticle ? truthParticle->pdgId() : m_truthPdgId(electron);
661  if (m_useTruthParticleDecorations && !isTruthParticle && truthParticle != nullptr)
662  {
663  type = m_classifierParticleType(*truthParticle);
664  origin = m_classifierParticleOrigin(*truthParticle);
665  }
666 
667  int firstMotherType = m_firstMotherTruthType(electron);
668  int firstMotherOrigin = m_firstMotherTruthOrigin(electron);
669  int firstMotherPdgId = m_firstMotherPdgId(electron);
670 
671  // not consider FSR photons from electrons (the photon has no charge)
672  if (origin == MCTruthPartClassifier::FSRPhot && type == MCTruthPartClassifier::NonIsoPhoton && std::abs(pdgId) == 11)
673  {
674  return false;
675  }
677  && firstMotherType == MCTruthPartClassifier::NonIsoPhoton && firstMotherOrigin == MCTruthPartClassifier::FSRPhot
678  && std::abs(pdgId) == 11)
679  {
680  return false;
681  }
682 
683  // bkg electrons with no additional info to help us classify them FSR -- not in the charge flip category
685  && firstMotherType == MCTruthPartClassifier::BkgElectron && firstMotherOrigin == MCTruthPartClassifier::PhotonConv
686  && std::abs(pdgId) == 11)
687  {
688  return false;
689  }
690 
691  if (isTruthParticle)
692  {
693  if (truthParticle->charge() != 0)
694  {
695  return (firstMotherPdgId * truthParticle->charge()) > 0;
696  }
697  }
698  else
699  {
700  const xAOD::Electron &xAODElectron = *dynamic_cast<const xAOD::Electron *> (&electron);
701  if (xAODElectron.charge() != 0)
702  {
703  return (firstMotherPdgId * xAODElectron.charge()) > 0;
704  }
705  }
706 
707  return (firstMotherPdgId * (-pdgId)) > 0;
708 }

◆ isChargeFlipMuon()

bool TruthClassificationTool::isChargeFlipMuon ( const xAOD::IParticle muon,
bool  isTruthParticle,
const xAOD::TruthParticle truthParticle 
) const
private

a helper to check if a muon has an incorrectly reconstructed charge

Definition at line 711 of file TruthClassificationTool.cxx.

714 {
715  if (isTruthParticle)
716  {
717  return false;
718  }
719 
720  if (truthParticle != nullptr && xAOD::P4Helpers::isInDeltaR(*truthParticle, muon, 0.025))
721  {
722  const xAOD::Muon &xAODMuon = *dynamic_cast<const xAOD::Muon *> (&muon);
723  return (truthParticle->charge() * xAODMuon.charge()) < 0;
724  }
725 
726  ANA_MSG_DEBUG("Cannot find associated truth-particle... assuming muon has correct charge");
727  return false;
728 }

◆ isPromptElectron()

bool TruthClassificationTool::isPromptElectron ( const xAOD::IParticle electron,
bool  isTruthParticle,
const xAOD::TruthParticle truthParticle 
) const
private

a helper to check if an electron is prompt

Definition at line 604 of file TruthClassificationTool.cxx.

607 {
608 
609 
610  int type = isTruthParticle ? m_classifierParticleType(electron) : m_truthType(electron);
611  int origin = isTruthParticle ? m_classifierParticleOrigin(electron) : m_truthOrigin(electron);
612  if (m_useTruthParticleDecorations && !isTruthParticle && truthParticle != nullptr)
613  {
614  type = m_classifierParticleType(*truthParticle);
615  origin = m_classifierParticleOrigin(*truthParticle);
616  }
617 
618  // Electron is IsoElectron - return true
619  if (type == MCTruthPartClassifier::IsoElectron)
620  {
621  return true;
622  }
623 
624  int pdgId = isTruthParticle ? truthParticle->pdgId() : m_truthPdgId(electron);
625  int firstMotherType = m_firstMotherTruthType(electron);
626  int firstMotherOrigin = m_firstMotherTruthOrigin(electron);
627 
628  // Adding these cases from ElectronEfficiencyHelpers
629  if (firstMotherType == MCTruthPartClassifier::IsoElectron && std::abs(m_firstMotherPdgId(electron)) == 11)
630  {
631  return true;
632  }
633 
634  // FSR photons from electrons
635  if (origin == MCTruthPartClassifier::FSRPhot && type == MCTruthPartClassifier::NonIsoPhoton && std::abs(pdgId) == 11)
636  {
637  return true;
638  }
639 
641  && firstMotherType == MCTruthPartClassifier::NonIsoPhoton && firstMotherOrigin == MCTruthPartClassifier::FSRPhot
642  && std::abs(pdgId) == 11)
643  {
644  return true;
645  }
646 
647  // If we reach here then it is not a prompt electron
648  return false;
649 }

◆ msg() [1/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msg_level_name()

const std::string & asg::AsgTool::msg_level_name ( ) const
inherited

A deprecated function for getting the message level's name.

Instead of using this, weirdly named function, user code should get the string name of the current minimum message level (in case they really need it...), with:

MSG::name( msg().level() )

This function's name doesn't follow the ATLAS coding rules, and as such will be removed in the not too distant future.

Returns
The string name of the current minimum message level that's printed

Definition at line 101 of file AsgTool.cxx.

101  {
102 
103  return MSG::name( msg().level() );
104  }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ print() [1/2]

void asg::AsgTool::print ( ) const
virtualinherited

◆ print() [2/2]

virtual void asg::IAsgTool::print ( ) const
pure virtualinherited

◆ renounce()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ m_classifierParticleOrigin

const SG::AuxElement::ConstAccessor<unsigned int> TruthClassificationTool::m_classifierParticleOrigin {"classifierParticleOrigin"}
private

Definition at line 54 of file TruthClassificationTool.h.

◆ m_classifierParticleType

const SG::AuxElement::ConstAccessor<unsigned int> TruthClassificationTool::m_classifierParticleType {"classifierParticleType"}
private

Definition at line 53 of file TruthClassificationTool.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_fallbackDR

const SG::AuxElement::ConstAccessor<float> TruthClassificationTool::m_fallbackDR {"TruthClassifierFallback_dR"}
private

Definition at line 63 of file TruthClassificationTool.h.

◆ m_fallbackTruthOrigin

const SG::AuxElement::ConstAccessor<int> TruthClassificationTool::m_fallbackTruthOrigin {"TruthClassifierFallback_truthOrigin"}
private

Definition at line 62 of file TruthClassificationTool.h.

◆ m_fallbackTruthType

const SG::AuxElement::ConstAccessor<int> TruthClassificationTool::m_fallbackTruthType {"TruthClassifierFallback_truthType"}
private

Definition at line 61 of file TruthClassificationTool.h.

◆ m_firstMotherPdgId

const SG::AuxElement::ConstAccessor<int> TruthClassificationTool::m_firstMotherPdgId {"firstEgMotherPdgId"}
private

Definition at line 57 of file TruthClassificationTool.h.

◆ m_firstMotherTruthOrigin

const SG::AuxElement::ConstAccessor<int> TruthClassificationTool::m_firstMotherTruthOrigin {"firstEgMotherTruthOrigin"}
private

Definition at line 56 of file TruthClassificationTool.h.

◆ m_firstMotherTruthType

const SG::AuxElement::ConstAccessor<int> TruthClassificationTool::m_firstMotherTruthType {"firstEgMotherTruthType"}
private

Definition at line 55 of file TruthClassificationTool.h.

◆ m_lastMotherPdgId

const SG::AuxElement::ConstAccessor<int> TruthClassificationTool::m_lastMotherPdgId {"lastEgMotherPdgId"}
private

Definition at line 60 of file TruthClassificationTool.h.

◆ m_lastMotherTruthOrigin

const SG::AuxElement::ConstAccessor<int> TruthClassificationTool::m_lastMotherTruthOrigin {"lastEgMotherTruthOrigin"}
private

Definition at line 59 of file TruthClassificationTool.h.

◆ m_lastMotherTruthType

const SG::AuxElement::ConstAccessor<int> TruthClassificationTool::m_lastMotherTruthType {"lastEgMotherTruthType"}
private

Definition at line 58 of file TruthClassificationTool.h.

◆ m_separateChargeFlipElectrons

bool TruthClassificationTool::m_separateChargeFlipElectrons = false
private

separately store charge-flip electrons/muons

Definition at line 43 of file TruthClassificationTool.h.

◆ m_separateChargeFlipMuons

bool TruthClassificationTool::m_separateChargeFlipMuons = false
private

Definition at line 44 of file TruthClassificationTool.h.

◆ m_truthOrigin

const SG::AuxElement::ConstAccessor<int> TruthClassificationTool::m_truthOrigin {"truthOrigin"}
private

Definition at line 51 of file TruthClassificationTool.h.

◆ m_truthPdgId

const SG::AuxElement::ConstAccessor<int> TruthClassificationTool::m_truthPdgId {"truthPdgId"}
private

Definition at line 52 of file TruthClassificationTool.h.

◆ m_truthType

const SG::AuxElement::ConstAccessor<int> TruthClassificationTool::m_truthType {"truthType"}
private

Definition at line 50 of file TruthClassificationTool.h.

◆ m_useTruthParticleDecorations

bool TruthClassificationTool::m_useTruthParticleDecorations {false}
private

use truth particle decorations

Definition at line 47 of file TruthClassificationTool.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
TruthClassificationTool::classifyElectron
StatusCode classifyElectron(const xAOD::IParticle &electron, Truth::Type &classification) const
electron classification helper
Definition: TruthClassificationTool.cxx:65
xAOD::TruthParticle_v1::parent
const TruthParticle_v1 * parent(size_t i=0) const
Retrieve the i-th mother (TruthParticle) of this TruthParticle.
Definition: TruthParticle_v1.cxx:131
xAOD::muon
@ muon
Definition: TrackingPrimitives.h:195
IsoPhoton
@ IsoPhoton
Definition: TruthClasses.h:23
Truth::Type::IsoElectron
@ IsoElectron
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition: AsgTool.h:47
xAOD::Electron_v1::charge
float charge() const
Obtain the charge of the object.
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
TauLep
@ TauLep
Definition: TruthClasses.h:63
StrangeMeson
@ StrangeMeson
Definition: TruthClasses.h:80
StateLessPT_NewConfig.proxy
proxy
Definition: StateLessPT_NewConfig.py:392
xAOD::IParticle::isAvailable
XAOD_AUXDATA_DEPRECATED bool isAvailable(const std::string &name, const std::string &clsname="") const
Check if a user property is available for reading or not.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:135
Mu
@ Mu
Definition: TruthClasses.h:62
TruthClassificationTool::isChargeFlipElectron
bool isChargeFlipElectron(const xAOD::IParticle &electron, bool isTruthParticle, const xAOD::TruthParticle *truthParticle) const
a helper to check if an electron has an incorrectly reconstructed charge
Definition: TruthClassificationTool.cxx:652
BBbarMeson
@ BBbarMeson
Definition: TruthClasses.h:85
BottomMeson
@ BottomMeson
Definition: TruthClasses.h:82
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
Truth::Type::LightFlavorDecay
@ LightFlavorDecay
TruthClassificationTool::m_firstMotherTruthOrigin
const SG::AuxElement::ConstAccessor< int > m_firstMotherTruthOrigin
Definition: TruthClassificationTool.h:56
TruthClassificationTool::hasCHadronOrigin
bool hasCHadronOrigin(int origin) const
a helper to check if the origin is a c-hadron
Definition: TruthClassificationTool.cxx:742
NonIsoPhoton
@ NonIsoPhoton
Definition: TruthClasses.h:24
PionDecay
@ PionDecay
Definition: TruthClasses.h:90
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
TruthClassificationTool::isPromptElectron
bool isPromptElectron(const xAOD::IParticle &electron, bool isTruthParticle, const xAOD::TruthParticle *truthParticle) const
a helper to check if an electron is prompt
Definition: TruthClassificationTool.cxx:604
ElMagProc
@ ElMagProc
Definition: TruthClasses.h:61
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
Truth::Type::TauDecayLike
@ TauDecayLike
BkgPhoton
@ BkgPhoton
Definition: TruthClasses.h:25
ANA_MSG_ERROR
#define ANA_MSG_ERROR(xmsg)
Macro printing error messages.
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:294
PhotonConv
@ PhotonConv
Definition: TruthClasses.h:59
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:324
PromptPhot
@ PromptPhot
Definition: TruthClasses.h:93
SG::ConstAccessor< int >
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
UnknownMuon
@ UnknownMuon
Definition: TruthClasses.h:14
dbg::ptr
void * ptr(T *p)
Definition: SGImplSvc.cxx:74
ZBoson
@ ZBoson
Definition: TruthClasses.h:67
TruthClassificationTool::m_useTruthParticleDecorations
bool m_useTruthParticleDecorations
use truth particle decorations
Definition: TruthClassificationTool.h:47
Hadron
@ Hadron
Definition: TruthClasses.h:26
TruthClassificationTool::m_lastMotherTruthType
const SG::AuxElement::ConstAccessor< int > m_lastMotherTruthType
Definition: TruthClassificationTool.h:58
TruthClassificationTool::m_separateChargeFlipElectrons
bool m_separateChargeFlipElectrons
separately store charge-flip electrons/muons
Definition: TruthClassificationTool.h:43
Truth::Type::CHadronDecay
@ CHadronDecay
BkgMuon
@ BkgMuon
Definition: TruthClasses.h:17
xAOD::Muon_v1
Class describing a Muon.
Definition: Muon_v1.h:38
Truth::Type::BHadronDecayLike
@ BHadronDecayLike
WBoson
@ WBoson
Definition: TruthClasses.h:66
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
FSRPhot
@ FSRPhot
Definition: TruthClasses.h:96
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
xAOD::Muon_v1::charge
float charge() const
CCbarMeson
@ CCbarMeson
Definition: TruthClasses.h:83
NonDefined
@ NonDefined
Definition: TruthClasses.h:52
HiggsMSSM
@ HiggsMSSM
Definition: TruthClasses.h:69
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
xAOD::TruthParticle_v1::nParents
size_t nParents() const
Number of parents of this particle.
Definition: TruthParticle_v1.cxx:122
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
TruthClassificationTool::m_truthOrigin
const SG::AuxElement::ConstAccessor< int > m_truthOrigin
Definition: TruthClassificationTool.h:51
CharmedBaryon
@ CharmedBaryon
Definition: TruthClasses.h:88
AthCommonDataStore
Definition: AthCommonDataStore.h:52
TruthClassificationTool::m_classifierParticleType
const SG::AuxElement::ConstAccessor< unsigned int > m_classifierParticleType
Definition: TruthClassificationTool.h:53
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
Truth::Type::TauDecay
@ TauDecay
TruthClassificationTool::hasLightHadronOrigin
bool hasLightHadronOrigin(int origin) const
a helper to check if the origin is a light hadron
Definition: TruthClassificationTool.cxx:752
Truth::Type::Unknown
@ Unknown
Truth::Type::ChargeFlipIsoElectron
@ ChargeFlipIsoElectron
UnknownElectron
@ UnknownElectron
Definition: TruthClasses.h:10
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
PiZero
@ PiZero
Definition: TruthClasses.h:98
xAOD::EgammaHelpers::isElectron
bool isElectron(const xAOD::Egamma *eg)
is the object an electron (not Fwd)
Definition: EgammaxAODHelpers.cxx:12
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:37
StrangeBaryon
@ StrangeBaryon
Definition: TruthClasses.h:87
LightMeson
@ LightMeson
Definition: TruthClasses.h:79
ANA_MSG_WARNING
#define ANA_MSG_WARNING(xmsg)
Macro printing warning messages.
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:292
test_pyathena.parent
parent
Definition: test_pyathena.py:15
DiBoson
@ DiBoson
Definition: TruthClasses.h:99
MCTruthPartClassifier::stable
@ stable
Definition: TruthClassifiers.h:148
TruthClassificationTool::classifyMuon
StatusCode classifyMuon(const xAOD::IParticle &muon, Truth::Type &classification) const
muon classification helper
Definition: TruthClassificationTool.cxx:410
python.xAODType.dummy
dummy
Definition: xAODType.py:4
MSG::name
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
Definition: MsgLevel.cxx:19
CharmedMeson
@ CharmedMeson
Definition: TruthClasses.h:81
TruthClassificationTool::m_firstMotherTruthType
const SG::AuxElement::ConstAccessor< int > m_firstMotherTruthType
Definition: TruthClassificationTool.h:55
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
IsoMuon
@ IsoMuon
Definition: TruthClasses.h:15
NonIsoMuon
@ NonIsoMuon
Definition: TruthClasses.h:16
Truth::Type::PromptPhotonConversion
@ PromptPhotonConversion
TruthClassificationTool::m_fallbackTruthType
const SG::AuxElement::ConstAccessor< int > m_fallbackTruthType
Definition: TruthClassificationTool.h:61
Truth::Type::BHadronDecay
@ BHadronDecay
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
Truth::Type::NonMuonlike
@ NonMuonlike
Truth::Type::KnownUnknown
@ KnownUnknown
Truth::Type::ElectronFromMuon
@ ElectronFromMuon
TruthClassificationTool::hasBHadronOrigin
bool hasBHadronOrigin(int origin) const
a helper to check if the origin is a b-hadron
Definition: TruthClassificationTool.cxx:731
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
TruthClassificationTool::m_firstMotherPdgId
const SG::AuxElement::ConstAccessor< int > m_firstMotherPdgId
Definition: TruthClassificationTool.h:57
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
TruthClassificationTool::m_lastMotherTruthOrigin
const SG::AuxElement::ConstAccessor< int > m_lastMotherTruthOrigin
Definition: TruthClassificationTool.h:59
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
xAOD::TruthHelpers::getTruthParticle
const xAOD::TruthParticle * getTruthParticle(const xAOD::IParticle &p)
Return the truthParticle associated to the given IParticle (if any)
Definition: xAODTruthHelpers.cxx:25
SUSY
@ SUSY
Definition: TruthClasses.h:77
HeavyBoson
@ HeavyBoson
Definition: TruthClasses.h:70
TruthClassificationTool::m_classifierParticleOrigin
const SG::AuxElement::ConstAccessor< unsigned int > m_classifierParticleOrigin
Definition: TruthClassificationTool.h:54
UndrPhot
@ UndrPhot
Definition: TruthClasses.h:94
xAOD::Electron_v1
Definition: Electron_v1.h:34
BottomBaryon
@ BottomBaryon
Definition: TruthClasses.h:89
LightBaryon
@ LightBaryon
Definition: TruthClasses.h:86
TruthClassificationTool::m_fallbackDR
const SG::AuxElement::ConstAccessor< float > m_fallbackDR
Definition: TruthClassificationTool.h:63
MC::isStable
bool isStable(const T &p)
Identify if the particle is stable, i.e. has not decayed.
Definition: HepMCHelpers.h:45
a
TList * a
Definition: liststreamerinfos.cxx:10
h
Truth::Type::CHadronDecayLike
@ CHadronDecayLike
TruthClassificationTool::isChargeFlipMuon
bool isChargeFlipMuon(const xAOD::IParticle &muon, bool isTruthParticle, const xAOD::TruthParticle *truthParticle) const
a helper to check if a muon has an incorrectly reconstructed charge
Definition: TruthClassificationTool.cxx:711
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
Higgs
@ Higgs
Definition: TruthClasses.h:68
xAOD::EgammaParameters::electron
@ electron
Definition: EgammaEnums.h:18
TruthClassificationTool::m_separateChargeFlipMuons
bool m_separateChargeFlipMuons
Definition: TruthClassificationTool.h:44
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
TruthClassificationTool::m_truthPdgId
const SG::AuxElement::ConstAccessor< int > m_truthPdgId
Definition: TruthClassificationTool.h:52
SingleMuon
@ SingleMuon
Definition: TruthClasses.h:55
TruthClassificationTool::m_lastMotherPdgId
const SG::AuxElement::ConstAccessor< int > m_lastMotherPdgId
Definition: TruthClassificationTool.h:60
TruthClassificationTool::classify
virtual StatusCode classify(const xAOD::IParticle &particle, unsigned int &classification) const override
classify and return unsigned int
Definition: TruthClassificationTool.cxx:33
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
DalitzDec
@ DalitzDec
Definition: TruthClasses.h:60
top
@ top
Definition: TruthClasses.h:64
TruthClassificationTool::m_truthType
const SG::AuxElement::ConstAccessor< int > m_truthType
Definition: TruthClassificationTool.h:50
xAOD::P4Helpers::isInDeltaR
bool isInDeltaR(const xAOD::IParticle &p1, const xAOD::IParticle &p2, double dR, bool useRapidity=true)
Check if 2 xAOD::IParticle are in a cone.
Definition: xAODP4Helpers.h:174
KaonDecay
@ KaonDecay
Definition: TruthClasses.h:91
xAOD::TruthParticle_v1::pdgId
int pdgId() const
PDG ID code.
SG::DataProxy
Definition: DataProxy.h:45
Truth::Type::ChargeFlipMuon
@ ChargeFlipMuon
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
NonIsoElectron
@ NonIsoElectron
Definition: TruthClasses.h:12
BkgElectron
@ BkgElectron
Definition: TruthClasses.h:13
xAOD::TruthParticle_v1::charge
double charge() const
Physical charge.
Truth::Type::PromptMuon
@ PromptMuon
UnknownPhoton
@ UnknownPhoton
Definition: TruthClasses.h:22
fitman.k
k
Definition: fitman.py:528
Truth::Type
Type
truth classification type enum
Definition: ITruthClassificationTool.h:19
GenParticle
@ GenParticle
Definition: TruthClasses.h:30
isMuon
bool isMuon(const T &p)
Definition: AtlasPID.h:170
ANA_MSG_DEBUG
#define ANA_MSG_DEBUG(xmsg)
Macro printing debug messages.
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:288