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

#include <TauTruthMatchingTool.h>

Inheritance diagram for TauAnalysisTools::TauTruthMatchingTool:
Collaboration diagram for TauAnalysisTools::TauTruthMatchingTool:

Public Member Functions

virtual TLorentzVector getTruthTauP4Vis (const xAOD::TauJet &xTau) override final
 
virtual TLorentzVector getTruthTauP4Vis (const xAOD::TruthParticle &xTruthTau) const override final
 
virtual TLorentzVector getTruthTauP4Invis (const xAOD::TauJet &xTau) override final
 
virtual TLorentzVector getTruthTauP4Invis (const xAOD::TruthParticle &xTruthTau) const override final
 
virtual TauAnalysisTools::TruthMatchedParticleType getTruthParticleType (const xAOD::TauJet &xTau) override final
 
virtual int getNTauDecayParticles (const xAOD::TauJet &xTau, int iPdgId, bool bCompareAbsoluteValues=false) override final
 
virtual int getNTauDecayParticles (const xAOD::TruthParticle &xTruthTau, int iPdgId, bool bCompareAbsoluteValues=false) const override final
 
virtual xAOD::TauJetParameters::DecayMode getDecayMode (const xAOD::TauJet &xTau) override final
 
virtual xAOD::TauJetParameters::DecayMode getDecayMode (const xAOD::TruthParticle &xTruthTau) const override final
 
virtual void print () const =0
 Print the state of the tool. More...
 
virtual void print () const
 Print the state of the tool. More...
 
virtual StatusCode sysInitialize ()
 Function initialising the tool in the correct way in Athena. 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 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

StatusCode retrieveTruthTaus (TruthTausEvent &truthTausEvent) const
 
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...
 

Protected Attributes

TruthTausEvent m_truthTausEvent
 
bool m_bTruthTauAvailable
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

virtual StatusCode initialize () override final
 
virtual std::unique_ptr< ITruthTausEventgetEvent () const override final
 
virtual const xAOD::TruthParticlegetTruth (const xAOD::TauJet &xTau) override final
 
virtual const xAOD::TruthParticlegetTruth (const xAOD::TauJet &xTau, ITruthTausEvent &truthTausEVent) const override final
 
virtual std::vector< const xAOD::TruthParticle * > getTruth (const std::vector< const xAOD::TauJet * > &vTaus) override final
 
StatusCode findTruthTau (const xAOD::TauJet &xTau, TruthTausEvent &truthTausEvent) const
 
StatusCode checkTruthMatch (const xAOD::TauJet &xTau, const xAOD::TruthParticleContainer &xTauContainer, const TruthTausEvent &truthTausEvent) const
 
virtual void setTruthMatchingMode () override
 
virtual StatusCode retrieveTruthTaus () override
 
virtual StatusCode retrieveTruthTaus (ITruthTausEvent &truthTausEvent) const override
 
StatusCode buildTruthTausFromTruthParticles (TruthTausEvent &truthTausEvent) const
 
StatusCode examineTruthTau (const xAOD::TruthParticle &xTruthParticle) const
 
StatusCode examineTruthTauDecay (const xAOD::TruthParticle &xTruthParticle, TauTruthInfo &truthInfo) const
 
void printDecay (const xAOD::TruthParticle &xTruthParticle, int depth=0) const
 
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

double m_dMaxDeltaR
 
CxxUtils::CachedValue< bool > m_bIsTruthMatchedAvailable
 
CxxUtils::CachedValue< bool > m_bIsTruthParticleLinkAvailable
 
SG::AuxElement::ConstAccessor< double > m_accPtVis
 
SG::AuxElement::ConstAccessor< double > m_accEtaVis
 
SG::AuxElement::ConstAccessor< double > m_accPhiVis
 
SG::AuxElement::ConstAccessor< double > m_accMVis
 
SG::ReadHandleKey< xAOD::TruthParticleContainerm_truthTauInputContainer { this, "TruthTauContainerName", "TruthTaus", "Truth tau input container name (truth matching mode)" }
 
SG::ReadHandleKey< xAOD::TruthParticleContainerm_truthParticleContainer { this, "TruthParticleContainerName", "TruthParticles", "Truth particles input container name" }
 
SG::ReadHandleKey< xAOD::TruthParticleContainerm_truthElectronContainer { this, "TruthElectronContainerName", "TruthElectrons", "Truth electrons input container name" }
 
SG::ReadHandleKey< xAOD::TruthParticleContainerm_truthMuonContainer { this, "TruthMuonContainerName", "TruthMuons", "Truth muons input container name" }
 
SG::ReadHandleKey< xAOD::JetContainerm_truthJetContainer { this, "TruthJetContainerName", "AntiKt4TruthDressedWZJets", "Truth jets input container name" }
 
SG::WriteHandleKey< xAOD::TruthParticleContainerm_truthTauOutputContainer { this, "NewTruthTauContainerName", "TruthTaus", "Truth tau output container name" }
 
bool m_truthMatchingMode = false
 
bool m_bWriteInvisibleFourMomentum
 
bool m_bWriteVisibleChargedFourMomentum
 
bool m_bWriteVisibleNeutralFourMomentum
 
bool m_bWriteDecayModeVector
 
bool m_bWriteVertices
 
asg::AnaToolHandle< IMCTruthClassifierm_tMCTruthClassifier
 
MetaStore_t m_inputMetaStore
 Object accessing the input metadata store. More...
 
MetaStore_t m_outputMetaStore
 Object accessing the output metadata store. More...
 
bool m_beginInputFileCalled
 Flag helping to discover when the tool misses the opening of the first input file. More...
 
bool m_useIncidents
 
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
 

Callback functions helping in metadata reading/writing

void setUseIncidents (const bool flag)
 
virtual void handle (const Incident &inc)
 Function receiving incidents from IncidentSvc/TEvent. More...
 
virtual StatusCode beginInputFile ()
 Function called when a new input file is opened. More...
 
virtual StatusCode endInputFile ()
 Function called when the currently open input file got completely processed. More...
 
virtual StatusCode beginEvent ()
 Function called when a new events is loaded. More...
 
virtual StatusCode metaDataStop ()
 Function called when the tool should write out its metadata. More...
 

Detailed Description

Definition at line 22 of file TauTruthMatchingTool.h.

Member Typedef Documentation

◆ MetaStore_t

Type of the metadata store object in Athena.

Definition at line 66 of file AsgMetadataTool.h.

◆ MetaStorePtr_t

Type of the metadata store pointer in standalone mode.

Definition at line 68 of file AsgMetadataTool.h.

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Member Function Documentation

◆ beginEvent()

StatusCode asg::AsgMetadataTool::beginEvent ( )
protectedvirtualinherited

Function called when a new events is loaded.

Dummy implementation that can be overridden by the derived tool.

Reimplemented in AsgElectronEfficiencyCorrectionTool, TrigConf::xAODConfigTool, TauAnalysisTools::TauSelectionTool, TauAnalysisTools::DiTauSelectionTool, TauAnalysisTools::CommonSmearingTool, TauAnalysisTools::DiTauEfficiencyCorrectionsTool, Trig::TrigDecisionTool, TauAnalysisTools::TauEfficiencyCorrectionsTool, Trig::TrigConfBunchCrossingTool, xAODMaker::TriggerMenuMetaDataTool, and Trig::xAODBunchCrossingTool.

Definition at line 196 of file AsgMetadataTool.cxx.

196  {
197 
198  // Return gracefully:
199  return StatusCode::SUCCESS;
200  }

◆ beginInputFile()

StatusCode asg::AsgMetadataTool::beginInputFile ( )
protectedvirtualinherited

Function called when a new input file is opened.

Dummy implementation that can be overridden by the derived tool.

Reimplemented in AsgElectronEfficiencyCorrectionTool, TrigConf::xAODConfigTool, PMGTools::PMGTruthWeightTool, BookkeeperTool, HFORSelectionTool, xAODMaker::FileMetaDataTool, BookkeeperDumperTool, Trig::TrigDecisionTool, xAODMaker::TriggerMenuMetaDataTool, xAODMaker::TruthMetaDataTool, Trig::xAODBunchCrossingTool, TauAnalysisTools::TauEfficiencyCorrectionsTool, and TauAnalysisTools::TauSmearingTool.

Definition at line 180 of file AsgMetadataTool.cxx.

180  {
181 
182  // Return gracefully:
183  return StatusCode::SUCCESS;
184  }

◆ buildTruthTausFromTruthParticles()

StatusCode BuildTruthTaus::buildTruthTausFromTruthParticles ( TruthTausEvent &  truthTausEvent) const
privateinherited

Definition at line 155 of file BuildTruthTaus.cxx.

156 {
157  for (auto xTruthParticle : *truthTausEvent.m_xTruthParticleContainer)
158  {
159  if ( xTruthParticle->isTau() )
160  {
161  xAOD::TruthParticle* xTruthTau = new xAOD::TruthParticle();
162  xTruthTau->makePrivateStore( *xTruthParticle );
163 
164  if ( examineTruthTau(*xTruthTau).isFailure() )
165  {
166  delete xTruthTau;
167  continue;
168  }
169 
170  // Run classification
171  std::pair<MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOrigin> pClassification = m_tMCTruthClassifier->particleTruthClassifier(xTruthTau);
172  static const SG::AuxElement::Accessor<unsigned int> decClassifierParticleType("classifierParticleType");
173  static const SG::AuxElement::Accessor<unsigned int> decClassifierParticleOrigin("classifierParticleOrigin");
174  decClassifierParticleType(*xTruthTau) = pClassification.first;
175  decClassifierParticleOrigin(*xTruthTau) = pClassification.second;
176 
177  // create link to the original TruthParticle
178  ElementLink < xAOD::TruthParticleContainer > lTruthParticleLink(xTruthParticle, *truthTausEvent.m_xTruthParticleContainer);
179  static const SG::AuxElement::Accessor<ElementLink< xAOD::TruthParticleContainer > > accOriginalTruthParticle("originalTruthParticle");
180  accOriginalTruthParticle(*xTruthTau) = lTruthParticleLink;
181 
182  truthTausEvent.m_xTruthTauContainer->push_back(xTruthTau);
183  }
184  }
185  return StatusCode::SUCCESS;
186 }

◆ checkTruthMatch()

StatusCode TauTruthMatchingTool::checkTruthMatch ( const xAOD::TauJet xTau,
const xAOD::TruthParticleContainer xTauContainer,
const TruthTausEvent &  truthTausEvent 
) const
private

Definition at line 329 of file TauTruthMatchingTool.cxx.

330 {
331  const xAOD::TruthParticle* xTruthMatch = nullptr;
332  const xAOD::Jet* xTruthJetMatch = nullptr;
333  TruthMatchedParticleType eTruthMatchedParticleType = Unknown;
334  static const SG::Decorator<char> decIsTruthMatched("IsTruthMatched");
335  static const SG::Decorator< ElementLink< xAOD::JetContainer > > decTruthJetLink("truthJetLink");
336 
337  for (auto xTruthTauIt : xTruthTauContainer)
338  {
339  TLorentzVector vTruthVisTLV;
340  vTruthVisTLV.SetPtEtaPhiM(m_accPtVis(*xTruthTauIt),
341  m_accEtaVis(*xTruthTauIt),
342  m_accPhiVis(*xTruthTauIt),
343  m_accMVis(*xTruthTauIt));
344  if (xTau.p4().DeltaR(vTruthVisTLV) <= m_dMaxDeltaR)
345  {
346  static const SG::ConstAccessor<char> accIsHadronicTau("IsHadronicTau");
347  if ((bool)accIsHadronicTau(*xTruthTauIt))
348  eTruthMatchedParticleType = TruthHadronicTau;
349  else
350  eTruthMatchedParticleType = TruthLeptonicTau;
351 
352  xTruthMatch = xTruthTauIt;
353  break;
354  }
355  }
356 
357  double dPtMax = 0.;
358  if (!xTruthMatch and truthTausEvent.m_xTruthMuonContainerConst)
359  {
360  dPtMax = 0.;
361  for (auto xTruthMuonIt : *truthTausEvent.m_xTruthMuonContainerConst)
362  {
363  if (xTau.p4().DeltaR(xTruthMuonIt->p4()) <= m_dMaxDeltaR)
364  {
365  if (xTruthMuonIt->pt()<dPtMax)
366  continue;
367  eTruthMatchedParticleType = TruthMuon;
368  xTruthMatch = xTruthMuonIt;
369  dPtMax = xTruthMuonIt->pt();
370  }
371  }
372  }
373 
374  if (!xTruthMatch and truthTausEvent.m_xTruthElectronContainerConst)
375  {
376  dPtMax = 0.;
377  for (auto xTruthElectronIt : *truthTausEvent.m_xTruthElectronContainerConst)
378  {
379  if (xTau.p4().DeltaR(xTruthElectronIt->p4()) <= m_dMaxDeltaR)
380  {
381  if (xTruthElectronIt->pt()<dPtMax)
382  continue;
383  eTruthMatchedParticleType = TruthElectron;
384  xTruthMatch = xTruthElectronIt;
385  dPtMax = xTruthElectronIt->pt();
386  }
387  }
388  }
389 
390  if (truthTausEvent.m_xTruthJetContainerConst)
391  {
392  dPtMax = 0.;
393  for (auto xTruthJetIt : *truthTausEvent.m_xTruthJetContainerConst)
394  {
395  if (xTau.p4().DeltaR(xTruthJetIt->p4()) <= m_dMaxDeltaR)
396  {
397  if (xTruthJetIt->pt()<dPtMax)
398  continue;
399  xTruthJetMatch = xTruthJetIt;
400  dPtMax = xTruthJetIt->pt();
401  }
402  }
403  }
404 
405  if (xTruthMatch)
406  decIsTruthMatched(xTau) = (char)true;
407  else
408  decIsTruthMatched(xTau) = (char)false;
409 
410  if (xTruthJetMatch)
411  {
412  ElementLink < xAOD::JetContainer > lTruthParticleLink(xTruthJetMatch, *truthTausEvent.m_xTruthJetContainerConst);
413  decTruthJetLink(xTau) = lTruthParticleLink;
414  }
415  else
416  {
417  ElementLink < xAOD::JetContainer > lTruthParticleLink;
418  decTruthJetLink(xTau) = lTruthParticleLink;
419  }
420 
421  // create link to the original TruthParticle
422  static const SG::Decorator< ElementLink< xAOD::TruthParticleContainer > > decTruthParticleLink("truthParticleLink");
423 
424  if (xTruthMatch)
425  {
426  if (eTruthMatchedParticleType == TruthHadronicTau or eTruthMatchedParticleType == TruthLeptonicTau)
427  {
428  ElementLink < xAOD::TruthParticleContainer > lTruthParticleLink(xTruthMatch, xTruthTauContainer);
429  decTruthParticleLink(xTau) = lTruthParticleLink;
430  }
431  else if (eTruthMatchedParticleType == TruthMuon)
432  {
433  ElementLink < xAOD::TruthParticleContainer > lTruthParticleLink(xTruthMatch, *truthTausEvent.m_xTruthMuonContainerConst);
434  decTruthParticleLink(xTau) = lTruthParticleLink;
435  }
436  else if (eTruthMatchedParticleType == TruthElectron)
437  {
438  ElementLink < xAOD::TruthParticleContainer > lTruthParticleLink(xTruthMatch, *truthTausEvent.m_xTruthElectronContainerConst);
439  decTruthParticleLink(xTau) = lTruthParticleLink;
440  }
441  }
442  else
443  {
445  decTruthParticleLink(xTau) = lTruthParticleLink;
446  }
447 
448  return StatusCode::SUCCESS;
449 }

◆ 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; }

◆ endInputFile()

StatusCode asg::AsgMetadataTool::endInputFile ( )
protectedvirtualinherited

Function called when the currently open input file got completely processed.

Dummy implementation that can be overridden by the derived tool.

Reimplemented in BookkeeperTool, HFORSelectionTool, xAODMaker::FileMetaDataTool, BookkeeperDumperTool, xAODMaker::TriggerMenuMetaDataTool, and xAODMaker::TruthMetaDataTool.

Definition at line 188 of file AsgMetadataTool.cxx.

188  {
189 
190  // Return gracefully:
191  return StatusCode::SUCCESS;
192  }

◆ 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; }

◆ examineTruthTau()

StatusCode BuildTruthTaus::examineTruthTau ( const xAOD::TruthParticle xTruthParticle) const
privateinherited

Definition at line 189 of file BuildTruthTaus.cxx.

190 {
191  // skip this tau if it has no decay vertex, should not happen
192  if ( !xTruthParticle.hasDecayVtx() )
193  return StatusCode::FAILURE;
194 
195  ATH_MSG_VERBOSE("looking for charged daughters of a truth tau");
196 
197  TauTruthInfo truthInfo;
198 
199  const xAOD::TruthVertex* xDecayVertex = xTruthParticle.decayVtx();
200  if (xDecayVertex == nullptr)
201  return StatusCode::FAILURE;
202  for ( size_t iOutgoingParticle = 0; iOutgoingParticle < xDecayVertex->nOutgoingParticles(); ++iOutgoingParticle )
203  {
204  const xAOD::TruthParticle* xTruthDaughter = xDecayVertex->outgoingParticle(iOutgoingParticle);
205  if (xTruthDaughter == nullptr)
206  {
207  ATH_MSG_ERROR("Truth daughter of tau decay was not found in "<< m_truthParticleContainer.key() <<" container. Please ensure that this container has the full tau decay information or produce the TruthTaus container in AtlasDerivation.");
208  return StatusCode::FAILURE;
209  }
210 
211  // if tau decays into tau this is not a proper tau decay
212  if ( xTruthDaughter->isTau() )
213  {
214  ATH_MSG_VERBOSE("Tau decays into a tau itself -> skip this decay");
215  return StatusCode::FAILURE;
216  }
217  }
218 
219  examineTruthTauDecay(xTruthParticle, truthInfo).ignore();
220 
221  if (truthInfo.m_bIsHadronicTau)
222  ATH_MSG_VERBOSE(truthInfo.m_iNChargedDaughters << " prong hadronic truth tau was found with uniqueID "<<HepMC::uniqueID(xTruthParticle));
223  else
224  ATH_MSG_VERBOSE(truthInfo.m_iNChargedDaughters << " prong leptonic truth tau was found with uniqueID "<<HepMC::uniqueID(xTruthParticle));
225  if ( truthInfo.m_iNChargedDaughters%2 == 0 )
226  {
227  ATH_MSG_WARNING("found tau with even multiplicity: " << truthInfo.m_iNChargedDaughters);
228  printDecay(xTruthParticle);
229  }
230 
231  static const SG::AuxElement::Decorator<double> decPtVis("pt_vis");
232  static const SG::AuxElement::Decorator<double> decEtaVis("eta_vis");
233  static const SG::AuxElement::Decorator<double> decPhiVis("phi_vis");
234  static const SG::AuxElement::Decorator<double> decMVis("m_vis");
235 
236  static const SG::AuxElement::Decorator<size_t> decNumCharged("numCharged");
237  static const SG::AuxElement::Decorator<size_t> decNumChargedPion("numChargedPion");
238  static const SG::AuxElement::Decorator<size_t> decNumNeutral("numNeutral");
239  static const SG::AuxElement::Decorator<size_t> decNumNeutralPion("numNeutralPion");
240 
241  decPtVis(xTruthParticle) = truthInfo.m_vTruthVisTLV.Pt();
242  decEtaVis(xTruthParticle) = truthInfo.m_vTruthVisTLV.Eta();
243  decPhiVis(xTruthParticle) = truthInfo.m_vTruthVisTLV.Phi();
244  decMVis(xTruthParticle) = truthInfo.m_vTruthVisTLV.M();
245 
246  decNumCharged(xTruthParticle) = truthInfo.m_iNChargedDaughters;
247  decNumChargedPion(xTruthParticle) = truthInfo.m_iNChargedPions;
248  decNumNeutral(xTruthParticle) = truthInfo.m_iNNeutralPions+truthInfo.m_iNNeutralOthers;
249  decNumNeutralPion(xTruthParticle) = truthInfo.m_iNNeutralPions;
250 
251  static const SG::AuxElement::Decorator<char> decIsHadronicTau("IsHadronicTau");
252  decIsHadronicTau(xTruthParticle) = (char)truthInfo.m_bIsHadronicTau;
253 
255  {
256  TLorentzVector vTruthInvisTLV = xTruthParticle.p4() - truthInfo.m_vTruthVisTLV;
257  static const SG::AuxElement::Decorator<double> decPtInvis("pt_invis");
258  static const SG::AuxElement::Decorator<double> decEtaInvis("eta_invis");
259  static const SG::AuxElement::Decorator<double> decPhiInvis("phi_invis");
260  static const SG::AuxElement::Decorator<double> decMInvis("m_invis");
261  decPtInvis(xTruthParticle) = vTruthInvisTLV.Pt();
262  decEtaInvis(xTruthParticle) = vTruthInvisTLV.Eta();
263  decPhiInvis(xTruthParticle) = vTruthInvisTLV.Phi();
264  decMInvis(xTruthParticle) = vTruthInvisTLV.M();
265  }
266 
268  {
269  static const SG::AuxElement::Decorator<double> decPtVisCharged("pt_vis_charged");
270  static const SG::AuxElement::Decorator<double> decEtaVisCharged("eta_vis_charged");
271  static const SG::AuxElement::Decorator<double> decPhiVisCharged("phi_vis_charged");
272  static const SG::AuxElement::Decorator<double> decMVisCharged("m_vis_charged");
273  decPtVisCharged(xTruthParticle) = truthInfo.m_vTruthVisTLVCharged.Pt();
274  decEtaVisCharged(xTruthParticle) = truthInfo.m_vTruthVisTLVCharged.Eta();
275  decPhiVisCharged(xTruthParticle) = truthInfo.m_vTruthVisTLVCharged.Phi();
276  decMVisCharged(xTruthParticle) = truthInfo.m_vTruthVisTLVCharged.M();
277  }
278 
280  {
281  static const SG::AuxElement::Decorator<double> decPtVisNeutral("pt_vis_neutral");
282  static const SG::AuxElement::Decorator<double> decEtaVisNeutral("eta_vis_neutral");
283  static const SG::AuxElement::Decorator<double> decPhiVisNeutral("phi_vis_neutral");
284  static const SG::AuxElement::Decorator<double> decMVisNeutral("m_vis_neutral");
285  decPtVisNeutral(xTruthParticle) = truthInfo.m_vTruthVisTLVNeutral.Pt();
286  decEtaVisNeutral(xTruthParticle) = truthInfo.m_vTruthVisTLVNeutral.Eta();
287  decPhiVisNeutral(xTruthParticle) = truthInfo.m_vTruthVisTLVNeutral.Phi();
288  decMVisNeutral(xTruthParticle) = truthInfo.m_vTruthVisTLVNeutral.M();
289  }
290 
292  {
293  static const SG::AuxElement::Decorator<std::vector<int> > decDecayModeVector("DecayModeVector");
294  decDecayModeVector(xTruthParticle) = truthInfo.m_vDecayMode;
295  }
296 
297  if ( m_bWriteVertices )
298  {
299  // tau decay vertex
300  static const SG::AuxElement::Decorator<double> decDecayVertexX("decay_vertex_x");
301  static const SG::AuxElement::Decorator<double> decDecayVertexY("decay_vertex_y");
302  static const SG::AuxElement::Decorator<double> decDecayVertexZ("decay_vertex_z");
303 
304  decDecayVertexX(xTruthParticle) = truthInfo.m_vDecayVertex.X();
305  decDecayVertexY(xTruthParticle) = truthInfo.m_vDecayVertex.Y();
306  decDecayVertexZ(xTruthParticle) = truthInfo.m_vDecayVertex.Z();
307 
308  // tau production vertex
309  static const SG::AuxElement::Decorator<double> decProdVertexX("prod_vertex_x");
310  static const SG::AuxElement::Decorator<double> decProdVertexY("prod_vertex_y");
311  static const SG::AuxElement::Decorator<double> decProdVertexZ("prod_vertex_z");
312 
313  decProdVertexX(xTruthParticle) = truthInfo.m_vProdVertex.X();
314  decProdVertexY(xTruthParticle) = truthInfo.m_vProdVertex.Y();
315  decProdVertexZ(xTruthParticle) = truthInfo.m_vProdVertex.Z();
316  }
317 
318  return StatusCode::SUCCESS;
319 }

◆ examineTruthTauDecay()

StatusCode BuildTruthTaus::examineTruthTauDecay ( const xAOD::TruthParticle xTruthParticle,
TauTruthInfo truthInfo 
) const
privateinherited

Definition at line 322 of file BuildTruthTaus.cxx.

324 {
325  // get vertex and check if it exists
326  const xAOD::TruthVertex* xDecayVertex = xTruthParticle.decayVtx();
327  if (!xDecayVertex)
328  return StatusCode::SUCCESS;
329 
330  truthInfo.m_vDecayVertex.SetXYZ(xDecayVertex->x(),xDecayVertex->y(),xDecayVertex->z());
331 
332  if (xTruthParticle.hasProdVtx() ) {
333  const xAOD::TruthVertex* xProdVertex = xTruthParticle.prodVtx();
334  truthInfo.m_vProdVertex.SetXYZ(xProdVertex->x(),xProdVertex->y(),xProdVertex->z());
335  } else {
336  truthInfo.m_vProdVertex.SetXYZ(-1234,-1234,-1234);
337  }
338 
339  for ( size_t iOutgoingParticle = 0; iOutgoingParticle < xDecayVertex->nOutgoingParticles(); ++iOutgoingParticle )
340  {
341  const xAOD::TruthParticle* xTruthDaughter = xDecayVertex->outgoingParticle(iOutgoingParticle);
342  if (xTruthDaughter == nullptr)
343  {
344  ATH_MSG_ERROR("Truth daughter of tau decay was not found in "<< m_truthParticleContainer.key() <<" container. Please ensure that this container has the full tau decay information or produce the TruthTaus container in AtlasDerivation.");
345  return StatusCode::FAILURE;
346  }
347 
348  int iAbsPdgId = xTruthDaughter->absPdgId();
349  int iPdgId = xTruthDaughter->pdgId();
350 
351  // look at decay of unstable particles
352  if (MC::isDecayed(xTruthDaughter) || xTruthDaughter->status() == HepMC::HERWIG7INTERMEDIATESTATUS || xTruthDaughter->status() == HepMC::SPECIALSTATUS)
353  {
354  if ( iAbsPdgId != 111 && iAbsPdgId != 311 && iAbsPdgId != 310 && iAbsPdgId != 130 )
355  {
356  examineTruthTauDecay(*xTruthDaughter, truthInfo).ignore();
357  continue;
358  }
359  }
360 
361  // only process stable particles
362  if (!MC::isStable(xTruthDaughter) && !MC::isDecayed(xTruthDaughter))
363  continue;
364 
365  // add pdgID to vector for decay mode classification
366  truthInfo.m_vDecayMode.push_back(iPdgId);
367 
368  // if tau decays leptonically, indicated by an electron/muon neutrino then
369  // it is not a hadronic decay
370  if ( xTruthDaughter->isHadron() )
371  truthInfo.m_bIsHadronicTau = true;
372 
373  // ignore neutrinos for further progress
374  if ( xTruthDaughter->isNeutrino() )
375  {
376  ATH_MSG_VERBOSE("found neutrino decay particle with PdgId "<<iPdgId);
377  continue;
378  }
379 
380  // add momentum of non-neutrino particle to visible momentum
381  truthInfo.m_vTruthVisTLV += xTruthDaughter->p4();
383  if ( xTruthDaughter->isCharged() )
384  truthInfo.m_vTruthVisTLVCharged += xTruthDaughter->p4();
386  if ( xTruthDaughter->isNeutral() )
387  truthInfo.m_vTruthVisTLVNeutral += xTruthDaughter->p4();
388 
389  // only count charged decay particles
390  if ( xTruthDaughter->isCharged() )
391  {
392  ATH_MSG_VERBOSE("found charged decay particle with PdgId "<<iPdgId);
393  truthInfo.m_iNChargedDaughters++;
394  // count charged pions
395  if (iAbsPdgId==211) truthInfo.m_iNChargedPions++;
396  else truthInfo.m_iNChargedOthers++;
397  }
398  else
399  {
400  ATH_MSG_VERBOSE("found neutral decay particle with PdgId "<<iPdgId);
401  // count neutral pions
402  if (iAbsPdgId==111) truthInfo.m_iNNeutralPions++;
403  else truthInfo.m_iNNeutralOthers++;
404  }
405  }
406  return StatusCode::SUCCESS;
407 }

◆ 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

◆ findTruthTau()

StatusCode TauTruthMatchingTool::findTruthTau ( const xAOD::TauJet xTau,
TruthTausEvent &  truthTausEvent 
) const
private

Definition at line 299 of file TauTruthMatchingTool.cxx.

301 {
302  // check if decorations were already added to the first passed tau
304  static const SG::ConstAccessor<char> accIsTruthMatched("IsTruthMatched");
305  m_bIsTruthMatchedAvailable.set (accIsTruthMatched.isAvailable(xTau));
306  }
307  // check if decorations were already added to the first passed tau
310  accTruthParticleLink("truthParticleLink");
311  m_bIsTruthParticleLinkAvailable.set (accTruthParticleLink.isAvailable(xTau));
312  }
313 
315  return StatusCode::SUCCESS;
316  }
317 
318  // only search for truth taus once
319 
320  // need to be reviewed
321 
323  return checkTruthMatch(xTau, *truthTausEvent.m_xTruthTauContainerConst, truthTausEvent);
324  else
325  return checkTruthMatch(xTau, *truthTausEvent.m_xTruthTauContainer, truthTausEvent);
326 }

◆ getDecayMode() [1/2]

xAOD::TauJetParameters::DecayMode TauTruthMatchingTool::getDecayMode ( const xAOD::TauJet xTau)
finaloverridevirtual

Implements TauAnalysisTools::ITauTruthMatchingTool.

Definition at line 244 of file TauTruthMatchingTool.cxx.

245 {
246  const xAOD::TruthParticle* xTruthTau = getTruth(xTau);
247  if (xTruthTau == nullptr)
248  {
249  ATH_MSG_DEBUG("no truth particle was found, return Mode_Error");
251  }
252  static const SG::ConstAccessor<size_t> accNumCharged("numCharged");
253  if (!accNumCharged.isAvailable(*xTruthTau))
254  {
255  ATH_MSG_INFO("found truth particle is not a truth tau, return Mode_Error");
257  }
258  return getDecayMode(*xTruthTau);
259 }

◆ getDecayMode() [2/2]

xAOD::TauJetParameters::DecayMode TauTruthMatchingTool::getDecayMode ( const xAOD::TruthParticle xTruthTau) const
finaloverridevirtual

Implements TauAnalysisTools::ITauTruthMatchingTool.

Definition at line 262 of file TauTruthMatchingTool.cxx.

263 {
264  static const SG::ConstAccessor<size_t> accNumCharged("numCharged");
265  if (!accNumCharged.isAvailable(xTruthTau))
266  {
267  ATH_MSG_WARNING("passed truth particle is not a truth tau, return Mode_Error");
269  }
270 
271  int iCharged = getNTauDecayParticles(xTruthTau,MC::PIPLUS, true) + getNTauDecayParticles(xTruthTau,MC::KPLUS, true);
272  int iNeutral = getNTauDecayParticles(xTruthTau,MC::PI0, true);
273  if (iCharged == 1)
274  {
275  if (iNeutral == 0) return xAOD::TauJetParameters::DecayMode::Mode_1p0n;
276  if (iNeutral == 1) return xAOD::TauJetParameters::DecayMode::Mode_1p1n;
277  if (iNeutral >= 2) return xAOD::TauJetParameters::DecayMode::Mode_1pXn;
278  }
279  else if (iCharged == 3)
280  {
281  if (iNeutral == 0) return xAOD::TauJetParameters::DecayMode::Mode_3p0n;
282  if (iNeutral >= 1) return xAOD::TauJetParameters::DecayMode::Mode_3pXn;
283  }
284 
285  if (iCharged == 2 or iCharged == 4 or iCharged == 5)
287  if (iCharged == 0 or iCharged >=6)
289 
290  // if you got here, something should have gone wrong
292 }

◆ getEvent()

std::unique_ptr< TauTruthMatchingTool::ITruthTausEvent > TauTruthMatchingTool::getEvent ( ) const
finaloverrideprivatevirtual

Implements TauAnalysisTools::ITauTruthMatchingTool.

Definition at line 49 of file TauTruthMatchingTool.cxx.

50 {
51  auto truthTausEvent = std::make_unique<TruthTausEvent>();
52  if (retrieveTruthTaus(*truthTausEvent).isFailure()) {
53  truthTausEvent.reset();
54  }
55  return truthTausEvent;
56 }

◆ 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  }

◆ getNTauDecayParticles() [1/2]

int TauTruthMatchingTool::getNTauDecayParticles ( const xAOD::TauJet xTau,
int  iPdgId,
bool  bCompareAbsoluteValues = false 
)
finaloverridevirtual

Implements TauAnalysisTools::ITauTruthMatchingTool.

Definition at line 203 of file TauTruthMatchingTool.cxx.

204 {
205  const xAOD::TruthParticle* xTruthTau = getTruth(xTau);
206  if (xTruthTau == nullptr)
207  {
208  ATH_MSG_DEBUG("no truth particle was found, return 0");
209  return 0;
210  }
211  static const SG::ConstAccessor<std::vector<int> > accDecayModeVector("DecayModeVector");
212  if (!accDecayModeVector.isAvailable(*xTruthTau))
213  {
214  ATH_MSG_INFO("found truth particle is not a truth tau, return 0");
215  return 0;
216  }
217  return getNTauDecayParticles(*xTruthTau,iPdgId, bCompareAbsoluteValues);
218 }

◆ getNTauDecayParticles() [2/2]

int TauTruthMatchingTool::getNTauDecayParticles ( const xAOD::TruthParticle xTruthTau,
int  iPdgId,
bool  bCompareAbsoluteValues = false 
) const
finaloverridevirtual

Implements TauAnalysisTools::ITauTruthMatchingTool.

Definition at line 221 of file TauTruthMatchingTool.cxx.

222 {
223  int iNum = 0;
224  static const SG::ConstAccessor<std::vector<int> > accDecayModeVector("DecayModeVector");
225  if (!accDecayModeVector.isAvailable(xTruthTau))
226  {
227  ATH_MSG_WARNING("passed truth particle is not a truth tau, return 0");
228  return 0;
229  }
230 
231  for(auto iPdgId2 : accDecayModeVector(xTruthTau))
232  if (!bCompareAbsoluteValues)
233  {
234  if (iPdgId2 == iPdgId) iNum++;
235  }
236  else
237  {
238  if (std::abs(iPdgId2) == std::abs(iPdgId)) iNum++;
239  }
240  return iNum;
241 }

◆ getProperty()

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

Get one of the tool's properties.

◆ getTruth() [1/3]

std::vector< const xAOD::TruthParticle * > TauTruthMatchingTool::getTruth ( const std::vector< const xAOD::TauJet * > &  vTaus)
finaloverrideprivatevirtual

Implements TauAnalysisTools::ITauTruthMatchingTool.

Definition at line 108 of file TauTruthMatchingTool.cxx.

109 {
110  std::vector<const xAOD::TruthParticle*> vTruths;
111  for (auto xTau : vTaus)
112  vTruths.push_back(getTruth(*xTau));
113  return vTruths;
114 }

◆ getTruth() [2/3]

const xAOD::TruthParticle * TauTruthMatchingTool::getTruth ( const xAOD::TauJet xTau)
finaloverrideprivatevirtual

Implements TauAnalysisTools::ITauTruthMatchingTool.

Definition at line 59 of file TauTruthMatchingTool.cxx.

60 {
61  return getTruth (xTau, m_truthTausEvent);
62 }

◆ getTruth() [3/3]

const xAOD::TruthParticle * TauTruthMatchingTool::getTruth ( const xAOD::TauJet xTau,
ITruthTausEvent truthTausEVent 
) const
finaloverrideprivatevirtual

Implements TauAnalysisTools::ITauTruthMatchingTool.

Definition at line 65 of file TauTruthMatchingTool.cxx.

67 {
68  TruthTausEvent& truthTausEvent = dynamic_cast<TruthTausEvent&> (itruthTausEvent);
69 
70  if (retrieveTruthTaus(truthTausEvent).isFailure())
71  return nullptr;
72 
73  if (findTruthTau(xTau, truthTausEvent).isFailure())
74  ATH_MSG_WARNING("There was a failure in finding the matched truth tau");
75 
76  static const SG::ConstAccessor<char> accIsTruthMatched("IsTruthMatched");
77  static const SG::ConstAccessor< ElementLink< xAOD::TruthParticleContainer > > accTruthParticleLink("truthParticleLink");
78 
79  // derivations may drop IsTruthMatched, redecorate using truthParticleLink (this assumes links to truth leptons are preserved, i.e. TruthTaus, TruthElectron, TruthMuon)
81  ATH_MSG_DEBUG("TauJetContainer has truthParticleLink available while IsTruthMatched not available. Re-evaluate IsTruthMatched");
82  static const SG::Decorator<char> decIsTruthMatched("IsTruthMatched");
83  if (accTruthParticleLink(xTau)) {
84  decIsTruthMatched(xTau) = (char)true;
85  } else {
86  decIsTruthMatched(xTau) = (char)false;
87  }
88  }
89 
90  // if matched to a truth particle return its pointer, else return a null pointer
91  if ((bool)accIsTruthMatched(xTau))
92  {
93  if (accTruthParticleLink(xTau).isValid())
94  {
95  return *accTruthParticleLink(xTau);
96  }
97  else
98  {
99  ATH_MSG_WARNING("ElementLink to TruthParticle is not valid.");
100  return nullptr;
101  }
102  }
103 
104  return nullptr;
105 }

◆ getTruthParticleType()

TauAnalysisTools::TruthMatchedParticleType TauTruthMatchingTool::getTruthParticleType ( const xAOD::TauJet xTau)
finaloverridevirtual

Implements TauAnalysisTools::ITauTruthMatchingTool.

Definition at line 197 of file TauTruthMatchingTool.cxx.

198 {
200 }

◆ getTruthTauP4Invis() [1/2]

TLorentzVector TauTruthMatchingTool::getTruthTauP4Invis ( const xAOD::TauJet xTau)
finaloverridevirtual

Implements TauAnalysisTools::ITauTruthMatchingTool.

Definition at line 155 of file TauTruthMatchingTool.cxx.

156 {
157  const xAOD::TruthParticle* xTruthTau = getTruth(xTau);
158  TLorentzVector vTLV;
159  if (xTruthTau == nullptr)
160  {
161  ATH_MSG_INFO("no truth particle was found, returning TLorentzVector with all values equal to 0");
162  return vTLV;
163  }
164 
165  static const SG::ConstAccessor<double> accPtInvis("pt_invis");
166  static const SG::ConstAccessor<double> accEtaInvis("eta_invis");
167  static const SG::ConstAccessor<double> accPhiInvis("phi_invis");
168  static const SG::ConstAccessor<double> accMInvis("m_invis");
169  vTLV.SetPtEtaPhiM(
170  accPtInvis(*xTruthTau),
171  accEtaInvis(*xTruthTau),
172  accPhiInvis(*xTruthTau),
173  accMInvis(*xTruthTau));
174  return vTLV;
175 }

◆ getTruthTauP4Invis() [2/2]

TLorentzVector TauTruthMatchingTool::getTruthTauP4Invis ( const xAOD::TruthParticle xTruthTau) const
finaloverridevirtual

Implements TauAnalysisTools::ITauTruthMatchingTool.

Definition at line 178 of file TauTruthMatchingTool.cxx.

179 {
180  TLorentzVector vTLV;
181 
182  static const SG::ConstAccessor<double> accPtInvis("pt_invis");
183  static const SG::ConstAccessor<double> accEtaInvis("eta_invis");
184  static const SG::ConstAccessor<double> accPhiInvis("phi_invis");
185  static const SG::ConstAccessor<double> accMInvis("m_invis");
186 
187  if (!accPtInvis.isAvailable(xTruthTau))
188  return vTLV;
189  vTLV.SetPtEtaPhiM(
190  accPtInvis(xTruthTau),
191  accEtaInvis(xTruthTau),
192  accPhiInvis(xTruthTau),
193  accMInvis(xTruthTau));
194  return vTLV;
195 }

◆ getTruthTauP4Vis() [1/2]

TLorentzVector TauTruthMatchingTool::getTruthTauP4Vis ( const xAOD::TauJet xTau)
finaloverridevirtual

Implements TauAnalysisTools::ITauTruthMatchingTool.

Definition at line 121 of file TauTruthMatchingTool.cxx.

122 {
123  const xAOD::TruthParticle* xTruthTau = getTruth(xTau);
124  TLorentzVector vTLV;
125  if (xTruthTau == nullptr)
126  {
127  ATH_MSG_INFO("no truth particle was found, returning TLorentzVector with all values equal to 0");
128  return vTLV;
129  }
130 
131  vTLV.SetPtEtaPhiM(
132  m_accPtVis(*xTruthTau),
133  m_accEtaVis(*xTruthTau),
134  m_accPhiVis(*xTruthTau),
135  m_accMVis(*xTruthTau));
136  return vTLV;
137 }

◆ getTruthTauP4Vis() [2/2]

TLorentzVector TauTruthMatchingTool::getTruthTauP4Vis ( const xAOD::TruthParticle xTruthTau) const
finaloverridevirtual

Implements TauAnalysisTools::ITauTruthMatchingTool.

Definition at line 140 of file TauTruthMatchingTool.cxx.

141 {
142  TLorentzVector vTLV;
143  static const SG::ConstAccessor<double> acc ("pt_vis");
144  if (!acc.isAvailable(xTruthTau))
145  return vTLV;
146  vTLV.SetPtEtaPhiM(
147  m_accPtVis(xTruthTau),
148  m_accEtaVis(xTruthTau),
149  m_accPhiVis(xTruthTau),
150  m_accMVis(xTruthTau));
151  return vTLV;
152 }

◆ handle()

void asg::AsgMetadataTool::handle ( const Incident &  inc)
protectedvirtualinherited

Function receiving incidents from IncidentSvc/TEvent.

Reimplemented in Trig::TrigDecisionTool.

Definition at line 130 of file AsgMetadataTool.cxx.

130  {
131 
132  // Tell the user what's happening:
133  ATH_MSG_VERBOSE( "Callback received with incident: " << inc.type() );
134 
135  // Call the appropriate member function:
136  if( inc.type() == IncidentType::BeginInputFile ) {
137  m_beginInputFileCalled = true;
138  if( beginInputFile().isFailure() ) {
139  ATH_MSG_FATAL( "Failed to call beginInputFile()" );
140  throw std::runtime_error( "Couldn't call beginInputFile()" );
141  }
142  } else if( inc.type() == IncidentType::EndInputFile ) {
143  if( endInputFile().isFailure() ) {
144  ATH_MSG_FATAL( "Failed to call endInputFile()" );
145  throw std::runtime_error( "Couldn't call endInputFile()" );
146  }
147  } else if( inc.type() == IncidentType::BeginEvent ) {
148  // If the tool didn't catch the begin input file incident for the
149  // first input file of the job, then call the appropriate function
150  // now.
151  if( ! m_beginInputFileCalled ) {
152  m_beginInputFileCalled = true;
153  if( beginInputFile().isFailure() ) {
154  ATH_MSG_FATAL( "Failed to call beginInputFile()" );
155  throw std::runtime_error( "Couldn't call beginInputFile()" );
156  }
157  }
158  if( beginEvent().isFailure() ) {
159  ATH_MSG_FATAL( "Failed to call beginEvent()" );
160  throw std::runtime_error( "Couldn't call beginEvent()" );
161  }
162 
163  #ifdef XAOD_STANDALONE
164  } else if( inc.type() == IncidentType::MetaDataStop ) {
165  if( metaDataStop().isFailure() ) {
166  ATH_MSG_FATAL( "Failed to call metaDataStop()" );
167  throw std::runtime_error( "Couldn't call metaDataStop()" );
168  }
169 
170  #endif // XAOD_STANDALONE
171  } else {
172  ATH_MSG_WARNING( "Unknown incident type received in AsgMetaDataTool: " << inc.type() );
173  }
174 
175  return;
176  }

◆ initialize()

StatusCode TauTruthMatchingTool::initialize ( )
finaloverrideprivatevirtual

Reimplemented from TauAnalysisTools::BuildTruthTaus.

Definition at line 33 of file TauTruthMatchingTool.cxx.

34 {
35  ATH_MSG_INFO( "Initializing TauTruthMatchingTool" );
36 
37  // configure BuildTruthTaus in truth matching mode, not truth tau building mode
38  TauTruthMatchingTool::BuildTruthTaus::setTruthMatchingMode();
39 
41  {
42  ATH_MSG_FATAL("Failed initializing BuildTruthTaus");
43  return StatusCode::FAILURE;
44  }
45  return StatusCode::SUCCESS;
46 }

◆ 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.

◆ inputMetaStore()

AsgMetadataTool::MetaStorePtr_t asg::AsgMetadataTool::inputMetaStore ( ) const
inherited

Accessor for the input metadata store.

Definition at line 88 of file AsgMetadataTool.cxx.

88  {
89 
90 #ifdef XAOD_STANDALONE
91  return &m_inputMetaStore;
92 #else // XAOD_STANDALONE
93  return m_inputMetaStore;
94 #endif // XAOD_STANDALONE
95  }

◆ metaDataStop()

StatusCode asg::AsgMetadataTool::metaDataStop ( )
protectedvirtualinherited

Function called when the tool should write out its metadata.

Dummy implementation that can be overridden by the derived tool.

Reimplemented in xAODMaker::FileMetaDataTool, BookkeeperTool, BookkeeperDumperTool, xAODMaker::TriggerMenuMetaDataTool, and xAODMaker::TruthMetaDataTool.

Definition at line 204 of file AsgMetadataTool.cxx.

204  {
205 
206  // Return gracefully:
207  return StatusCode::SUCCESS;
208  }

◆ 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.

◆ outputMetaStore()

AsgMetadataTool::MetaStorePtr_t asg::AsgMetadataTool::outputMetaStore ( ) const
inherited

Accessor for the output metadata store.

Definition at line 97 of file AsgMetadataTool.cxx.

97  {
98 
99 #ifdef XAOD_STANDALONE
100  return &m_outputMetaStore;
101 #else // XAOD_STANDALONE
102  return m_outputMetaStore;
103 #endif // XAOD_STANDALONE
104  }

◆ print() [1/2]

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

◆ print() [2/2]

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

◆ printDecay()

void BuildTruthTaus::printDecay ( const xAOD::TruthParticle xTruthParticle,
int  depth = 0 
) const
privateinherited

Definition at line 409 of file BuildTruthTaus.cxx.

410 {
411  // loop over all decay particles, print their kinematic and other properties
412 
413  const xAOD::TruthVertex* xDecayVertex = xTruthParticle.decayVtx();
414  if (xDecayVertex == nullptr)
415  return;
416 
417  for ( size_t iOutgoingParticle = 0; iOutgoingParticle < xDecayVertex->nOutgoingParticles(); ++iOutgoingParticle )
418  {
419  const xAOD::TruthParticle* xTruthDaughter = xDecayVertex->outgoingParticle(iOutgoingParticle);
420  if (xTruthDaughter == nullptr)
421  {
422  ATH_MSG_WARNING("Truth daughter of tau decay was not found in "<< m_truthParticleContainer.key() <<" container. Please ensure that this container has the full tau decay information or produce the TruthTaus container in AtlasDerivation.");
423  return;
424  }
425  ATH_MSG_WARNING("depth "<<depth
426  <<" e "<<xTruthDaughter->e()
427  <<" eta "<<xTruthDaughter->p4().Eta()
428  <<" phi "<<xTruthDaughter->p4().Phi()
429  <<" pdgid "<<xTruthDaughter->pdgId()
430  <<" status "<<xTruthDaughter->status()
431  <<" uniqueID "<<HepMC::uniqueID(xTruthDaughter));
432  printDecay(*xTruthDaughter, depth+1);
433  }
434 }

◆ 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  }

◆ retrieveTruthTaus() [1/3]

StatusCode BuildTruthTaus::retrieveTruthTaus ( )
overrideprivatevirtualinherited

Implements TauAnalysisTools::IBuildTruthTaus.

Definition at line 68 of file BuildTruthTaus.cxx.

69 {
71 }

◆ retrieveTruthTaus() [2/3]

StatusCode BuildTruthTaus::retrieveTruthTaus ( ITruthTausEvent truthTausEvent) const
overrideprivatevirtualinherited

Implements TauAnalysisTools::IBuildTruthTaus.

Definition at line 74 of file BuildTruthTaus.cxx.

75 {
76  return retrieveTruthTaus (dynamic_cast<TruthTausEvent&> (truthTausEvent));
77 }

◆ retrieveTruthTaus() [3/3]

StatusCode BuildTruthTaus::retrieveTruthTaus ( TruthTausEvent &  truthTausEvent) const
protectedinherited

Definition at line 80 of file BuildTruthTaus.cxx.

81 {
82  const EventContext& ctx = Gaudi::Hive::currentContext();
83 
86  if (!truthElectronsHandle.isValid()) {
87  ATH_MSG_ERROR ("Could not retrieve " << truthElectronsHandle.key());
88  return StatusCode::FAILURE;
89  }
90  truthTausEvent.m_xTruthElectronContainerConst = truthElectronsHandle.cptr();
91  }
92  else {
93  ATH_MSG_WARNING("Truth electron container is not available, won't perform matching to truth electrons");
94  }
95 
96  if (!m_truthMuonContainer.empty()) {
98  if (!truthMuonsHandle.isValid()) {
99  ATH_MSG_ERROR ("Could not retrieve " << truthMuonsHandle.key());
100  return StatusCode::FAILURE;
101  }
102  truthTausEvent.m_xTruthMuonContainerConst = truthMuonsHandle.cptr();
103  }
104  else {
105  ATH_MSG_WARNING("Truth muon container is not available, won't perform matching to truth muons");
106  }
107 
108  if (!m_truthJetContainer.empty()) {
110  if (!truthJetsHandle.isValid()) {
111  ATH_MSG_ERROR ("Could not retrieve " << truthJetsHandle.key());
112  return StatusCode::FAILURE;
113  }
114  truthTausEvent.m_xTruthJetContainerConst = truthJetsHandle.cptr();
115  }
116  else {
117  ATH_MSG_WARNING("Truth jet container is not available, won't perform matching to truth jets");
118  }
119 
120  // if TruthTaus container exists, retrieve it, else build it from TruthParticles
121  if (m_truthMatchingMode) {
123  if (!truthTausHandle.isValid()) {
124  ATH_MSG_ERROR ("Could not retrieve " << truthTausHandle.key());
125  return StatusCode::FAILURE;
126  }
127  truthTausEvent.m_xTruthTauContainerConst = truthTausHandle.cptr();
128  }
129  else {
131  if (!truthParticlesHandle.isValid()) {
132  ATH_MSG_ERROR ("Could not retrieve " << truthParticlesHandle.key());
133  return StatusCode::FAILURE;
134  }
135  truthTausEvent.m_xTruthParticleContainer = truthParticlesHandle.cptr();
136 
137  auto truthTausOutput = std::make_unique<xAOD::TruthParticleContainer>();
138  auto truthTausOutputAux = std::make_unique<xAOD::TruthParticleAuxContainer>();
139  truthTausOutput->setStore(truthTausOutputAux.get());
140  truthTausEvent.m_xTruthTauContainer = truthTausOutput.get();
141 
142  ATH_CHECK( buildTruthTausFromTruthParticles(truthTausEvent) );
143 
144  auto writeHandle = SG::makeHandle(m_truthTauOutputContainer, ctx);
145  ATH_CHECK(writeHandle.record(std::move(truthTausOutput), std::move(truthTausOutputAux)));
146  }
147 
148  return StatusCode::SUCCESS;
149 }

◆ setTruthMatchingMode()

virtual void TauAnalysisTools::BuildTruthTaus::setTruthMatchingMode ( )
inlineoverrideprivatevirtualinherited

Implements TauAnalysisTools::IBuildTruthTaus.

Definition at line 60 of file BuildTruthTaus.h.

60  {
61  m_truthMatchingMode = true;
62  };

◆ setUseIncidents()

void asg::AsgMetadataTool::setUseIncidents ( const bool  flag)
inlineprotectedinherited

Definition at line 132 of file AsgMetadataTool.h.

133  {
135  }

◆ sysInitialize()

StatusCode asg::AsgMetadataTool::sysInitialize ( )
virtualinherited

Function initialising the tool in the correct way in Athena.

This function is used to set up the callbacks from IncidentSvc in Athena at the right time during initialisation, without the user having to do anything special in his/her code.

Reimplemented from AthCommonDataStore< AthCommonMsg< AlgTool > >.

Definition at line 110 of file AsgMetadataTool.cxx.

110  {
111 
112 #ifndef XAOD_STANDALONE
113  if (m_useIncidents) {
114  // Connect to the IncidentSvc:
115  ServiceHandle< IIncidentSvc > incSvc( "IncidentSvc", name() );
116  ATH_CHECK( incSvc.retrieve() );
117 
118  // Set up the right callbacks: don't rethrow exceptions, any failure and we should end
119  incSvc->addListener( this, IncidentType::BeginEvent, 0, false );
120  }
121  // Let the base class do its thing:
122  ATH_CHECK( AlgTool::sysInitialize() );
123 
124 #endif // not XAOD_STANDALONE
125 
126  // Return gracefully:
127  return StatusCode::SUCCESS;
128  }

◆ 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_accEtaVis

SG::AuxElement::ConstAccessor<double> TauAnalysisTools::TauTruthMatchingTool::m_accEtaVis
private

Definition at line 85 of file TauTruthMatchingTool.h.

◆ m_accMVis

SG::AuxElement::ConstAccessor<double> TauAnalysisTools::TauTruthMatchingTool::m_accMVis
private

Definition at line 87 of file TauTruthMatchingTool.h.

◆ m_accPhiVis

SG::AuxElement::ConstAccessor<double> TauAnalysisTools::TauTruthMatchingTool::m_accPhiVis
private

Definition at line 86 of file TauTruthMatchingTool.h.

◆ m_accPtVis

SG::AuxElement::ConstAccessor<double> TauAnalysisTools::TauTruthMatchingTool::m_accPtVis
private

Definition at line 84 of file TauTruthMatchingTool.h.

◆ m_beginInputFileCalled

bool asg::AsgMetadataTool::m_beginInputFileCalled
privateinherited

Flag helping to discover when the tool misses the opening of the first input file.

Definition at line 126 of file AsgMetadataTool.h.

◆ m_bIsTruthMatchedAvailable

CxxUtils::CachedValue<bool> TauAnalysisTools::TauTruthMatchingTool::m_bIsTruthMatchedAvailable
private

Definition at line 79 of file TauTruthMatchingTool.h.

◆ m_bIsTruthParticleLinkAvailable

CxxUtils::CachedValue<bool> TauAnalysisTools::TauTruthMatchingTool::m_bIsTruthParticleLinkAvailable
private

Definition at line 80 of file TauTruthMatchingTool.h.

◆ m_bTruthTauAvailable

bool TauAnalysisTools::BuildTruthTaus::m_bTruthTauAvailable
protectedinherited

Definition at line 108 of file BuildTruthTaus.h.

◆ m_bWriteDecayModeVector

bool TauAnalysisTools::BuildTruthTaus::m_bWriteDecayModeVector
privateinherited

Definition at line 125 of file BuildTruthTaus.h.

◆ m_bWriteInvisibleFourMomentum

bool TauAnalysisTools::BuildTruthTaus::m_bWriteInvisibleFourMomentum
privateinherited

Definition at line 122 of file BuildTruthTaus.h.

◆ m_bWriteVertices

bool TauAnalysisTools::BuildTruthTaus::m_bWriteVertices
privateinherited

Definition at line 126 of file BuildTruthTaus.h.

◆ m_bWriteVisibleChargedFourMomentum

bool TauAnalysisTools::BuildTruthTaus::m_bWriteVisibleChargedFourMomentum
privateinherited

Definition at line 123 of file BuildTruthTaus.h.

◆ m_bWriteVisibleNeutralFourMomentum

bool TauAnalysisTools::BuildTruthTaus::m_bWriteVisibleNeutralFourMomentum
privateinherited

Definition at line 124 of file BuildTruthTaus.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_dMaxDeltaR

double TauAnalysisTools::TauTruthMatchingTool::m_dMaxDeltaR
private

Definition at line 77 of file TauTruthMatchingTool.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_inputMetaStore

MetaStore_t asg::AsgMetadataTool::m_inputMetaStore
privateinherited

Object accessing the input metadata store.

Definition at line 119 of file AsgMetadataTool.h.

◆ m_outputMetaStore

MetaStore_t asg::AsgMetadataTool::m_outputMetaStore
privateinherited

Object accessing the output metadata store.

Definition at line 121 of file AsgMetadataTool.h.

◆ m_tMCTruthClassifier

asg::AnaToolHandle<IMCTruthClassifier> TauAnalysisTools::BuildTruthTaus::m_tMCTruthClassifier
privateinherited

Definition at line 128 of file BuildTruthTaus.h.

◆ m_truthElectronContainer

SG::ReadHandleKey<xAOD::TruthParticleContainer> TauAnalysisTools::BuildTruthTaus::m_truthElectronContainer { this, "TruthElectronContainerName", "TruthElectrons", "Truth electrons input container name" }
privateinherited

Definition at line 115 of file BuildTruthTaus.h.

◆ m_truthJetContainer

SG::ReadHandleKey<xAOD::JetContainer> TauAnalysisTools::BuildTruthTaus::m_truthJetContainer { this, "TruthJetContainerName", "AntiKt4TruthDressedWZJets", "Truth jets input container name" }
privateinherited

Definition at line 117 of file BuildTruthTaus.h.

◆ m_truthMatchingMode

bool TauAnalysisTools::BuildTruthTaus::m_truthMatchingMode = false
privateinherited

Definition at line 121 of file BuildTruthTaus.h.

◆ m_truthMuonContainer

SG::ReadHandleKey<xAOD::TruthParticleContainer> TauAnalysisTools::BuildTruthTaus::m_truthMuonContainer { this, "TruthMuonContainerName", "TruthMuons", "Truth muons input container name" }
privateinherited

Definition at line 116 of file BuildTruthTaus.h.

◆ m_truthParticleContainer

SG::ReadHandleKey<xAOD::TruthParticleContainer> TauAnalysisTools::BuildTruthTaus::m_truthParticleContainer { this, "TruthParticleContainerName", "TruthParticles", "Truth particles input container name" }
privateinherited

Definition at line 114 of file BuildTruthTaus.h.

◆ m_truthTauInputContainer

SG::ReadHandleKey<xAOD::TruthParticleContainer> TauAnalysisTools::BuildTruthTaus::m_truthTauInputContainer { this, "TruthTauContainerName", "TruthTaus", "Truth tau input container name (truth matching mode)" }
privateinherited

Definition at line 113 of file BuildTruthTaus.h.

◆ m_truthTauOutputContainer

SG::WriteHandleKey<xAOD::TruthParticleContainer> TauAnalysisTools::BuildTruthTaus::m_truthTauOutputContainer { this, "NewTruthTauContainerName", "TruthTaus", "Truth tau output container name" }
privateinherited

Definition at line 119 of file BuildTruthTaus.h.

◆ m_truthTausEvent

TruthTausEvent TauAnalysisTools::BuildTruthTaus::m_truthTausEvent
protectedinherited

Definition at line 105 of file BuildTruthTaus.h.

◆ m_useIncidents

bool asg::AsgMetadataTool::m_useIncidents
privateinherited

Definition at line 128 of file AsgMetadataTool.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:
TauAnalysisTools::BuildTruthTaus::examineTruthTau
StatusCode examineTruthTau(const xAOD::TruthParticle &xTruthParticle) const
Definition: BuildTruthTaus.cxx:189
xAOD::TruthVertex_v1::nOutgoingParticles
size_t nOutgoingParticles() const
Get the number of outgoing particles.
xAOD::TauJetParameters::Mode_1p0n
@ Mode_1p0n
Definition: TauDefs.h:386
TauAnalysisTools::TruthElectron
@ TruthElectron
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:100
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
egammaParameters::depth
@ depth
pointing depth of the shower as calculated in egammaqgcld
Definition: egammaParamDefs.h:276
xAOD::TauJetParameters::Mode_1p1n
@ Mode_1p1n
Definition: TauDefs.h:387
xAOD::TruthParticle_v1::absPdgId
int absPdgId() const
Absolute PDG ID code (often useful)
CxxUtils::CachedValue::ptr
const T * ptr() const
Return a pointer to the cached value.
asg::AsgMetadataTool::beginEvent
virtual StatusCode beginEvent()
Function called when a new events is loaded.
Definition: AsgMetadataTool.cxx:196
StateLessPT_NewConfig.proxy
proxy
Definition: StateLessPT_NewConfig.py:392
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
TauAnalysisTools::BuildTruthTaus::m_truthElectronContainer
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthElectronContainer
Definition: BuildTruthTaus.h:115
TauAnalysisTools::BuildTruthTaus::m_tMCTruthClassifier
asg::AnaToolHandle< IMCTruthClassifier > m_tMCTruthClassifier
Definition: BuildTruthTaus.h:128
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
TauAnalysisTools::BuildTruthTaus::m_bWriteDecayModeVector
bool m_bWriteDecayModeVector
Definition: BuildTruthTaus.h:125
TauAnalysisTools::TauTruthMatchingTool::m_accEtaVis
SG::AuxElement::ConstAccessor< double > m_accEtaVis
Definition: TauTruthMatchingTool.h:85
TauAnalysisTools::BuildTruthTaus::printDecay
void printDecay(const xAOD::TruthParticle &xTruthParticle, int depth=0) const
Definition: BuildTruthTaus.cxx:409
SG::Accessor
Helper class to provide type-safe access to aux data.
Definition: Control/AthContainers/AthContainers/Accessor.h:66
TauAnalysisTools::BuildTruthTaus::m_bWriteVisibleNeutralFourMomentum
bool m_bWriteVisibleNeutralFourMomentum
Definition: BuildTruthTaus.h:124
TauAnalysisTools::TruthHadronicTau
@ TruthHadronicTau
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:97
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
CxxUtils::CachedValue::isValid
bool isValid() const
Test to see if the value is valid.
initialize
void initialize()
Definition: run_EoverP.cxx:894
TauAnalysisTools::BuildTruthTaus::retrieveTruthTaus
virtual StatusCode retrieveTruthTaus() override
Definition: BuildTruthTaus.cxx:68
xAOD::char
char
Definition: TrigDecision_v1.cxx:38
TauAnalysisTools::TauTruthMatchingTool::checkTruthMatch
StatusCode checkTruthMatch(const xAOD::TauJet &xTau, const xAOD::TruthParticleContainer &xTauContainer, const TruthTausEvent &truthTausEvent) const
Definition: TauTruthMatchingTool.cxx:329
TauAnalysisTools::BuildTruthTaus::m_bWriteVisibleChargedFourMomentum
bool m_bWriteVisibleChargedFourMomentum
Definition: BuildTruthTaus.h:123
TauAnalysisTools::BuildTruthTaus::m_truthTauOutputContainer
SG::WriteHandleKey< xAOD::TruthParticleContainer > m_truthTauOutputContainer
Definition: BuildTruthTaus.h:119
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
TauAnalysisTools::BuildTruthTaus::m_bWriteInvisibleFourMomentum
bool m_bWriteInvisibleFourMomentum
Definition: BuildTruthTaus.h:122
TauAnalysisTools::BuildTruthTaus::m_truthMatchingMode
bool m_truthMatchingMode
Definition: BuildTruthTaus.h:121
asg::AsgMetadataTool::m_beginInputFileCalled
bool m_beginInputFileCalled
Flag helping to discover when the tool misses the opening of the first input file.
Definition: AsgMetadataTool.h:126
SG::ConstAccessor< char >
asg::AsgMetadataTool::endInputFile
virtual StatusCode endInputFile()
Function called when the currently open input file got completely processed.
Definition: AsgMetadataTool.cxx:188
asg::AsgMetadataTool::m_outputMetaStore
MetaStore_t m_outputMetaStore
Object accessing the output metadata store.
Definition: AsgMetadataTool.h:121
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
TauAnalysisTools::Unknown
@ Unknown
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:96
SG::VarHandleKey::empty
bool empty() const
Test if the key is blank.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:150
xAOD::TruthVertex_v1::y
float y() const
Vertex y displacement.
TauAnalysisTools::TruthLeptonicTau
@ TruthLeptonicTau
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:98
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
xAOD::TauJetParameters::Mode_1pXn
@ Mode_1pXn
Definition: TauDefs.h:388
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
TauAnalysisTools::BuildTruthTaus::m_bWriteVertices
bool m_bWriteVertices
Definition: BuildTruthTaus.h:126
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition: ReadCondHandle.h:269
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::hasDecayVtx
bool hasDecayVtx() const
Check for a decay vertex on this particle.
TauAnalysisTools::TauTruthMatchingTool::m_bIsTruthParticleLinkAvailable
CxxUtils::CachedValue< bool > m_bIsTruthParticleLinkAvailable
Definition: TauTruthMatchingTool.h:80
HepMC::SPECIALSTATUS
constexpr int SPECIALSTATUS
Constant that the meaning of which is currently lost, to be recovered...
Definition: MagicNumbers.h:41
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
xAOD::TruthParticle_v1::e
virtual double e() const override final
The total energy of the particle.
SG::Decorator< char >
TauAnalysisTools::TauTruthMatchingTool::m_accMVis
SG::AuxElement::ConstAccessor< double > m_accMVis
Definition: TauTruthMatchingTool.h:87
TauAnalysisTools::TauTruthMatchingTool::m_dMaxDeltaR
double m_dMaxDeltaR
Definition: TauTruthMatchingTool.h:77
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TauAnalysisTools::BuildTruthTaus::m_bTruthTauAvailable
bool m_bTruthTauAvailable
Definition: BuildTruthTaus.h:108
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:41
asg::AsgMetadataTool::beginInputFile
virtual StatusCode beginInputFile()
Function called when a new input file is opened.
Definition: AsgMetadataTool.cxx:180
master.flag
bool flag
Definition: master.py:29
xAOD::TruthParticle
TruthParticle_v1 TruthParticle
Typedef to implementation.
Definition: Event/xAOD/xAODTruth/xAODTruth/TruthParticle.h:15
xAOD::TruthParticle_v1::hasProdVtx
bool hasProdVtx() const
Check for a production vertex on this particle.
Definition: TruthParticle_v1.cxx:74
HepMC::uniqueID
int uniqueID(const T &p)
Definition: MagicNumbers.h:113
asg::AsgMetadataTool::metaDataStop
virtual StatusCode metaDataStop()
Function called when the tool should write out its metadata.
Definition: AsgMetadataTool.cxx:204
TauAnalysisTools::TauTruthMatchingTool::findTruthTau
StatusCode findTruthTau(const xAOD::TauJet &xTau, TruthTausEvent &truthTausEvent) const
Definition: TauTruthMatchingTool.cxx:299
AthenaPoolTestRead.acc
acc
Definition: AthenaPoolTestRead.py:16
python.xAODType.dummy
dummy
Definition: xAODType.py:4
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
MSG::name
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
Definition: MsgLevel.cxx:19
xAOD::TruthParticle_v1::isTau
bool isTau() const
Whether the particle is a tau (or antitau)
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
TauAnalysisTools::BuildTruthTaus::buildTruthTausFromTruthParticles
StatusCode buildTruthTausFromTruthParticles(TruthTausEvent &truthTausEvent) const
Definition: BuildTruthTaus.cxx:155
xAOD::TruthParticle_v1::isCharged
bool isCharged() const
Whether the particle is electrically charged.
xAOD::TauJetParameters::Mode_3p0n
@ Mode_3p0n
Definition: TauDefs.h:389
TauAnalysisTools::TruthMuon
@ TruthMuon
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:99
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
xAOD::TruthParticle_v1::decayVtx
const TruthVertex_v1 * decayVtx() const
The decay vertex of this particle.
xAOD::TruthParticle_v1::prodVtx
const TruthVertex_v1 * prodVtx() const
The production vertex of this particle.
Definition: TruthParticle_v1.cxx:80
xAOD::TruthVertex_v1
Class describing a truth vertex in the MC record.
Definition: TruthVertex_v1.h:41
TauAnalysisTools::BuildTruthTaus::m_truthTausEvent
TruthTausEvent m_truthTausEvent
Definition: BuildTruthTaus.h:105
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
asg::AsgMetadataTool::m_inputMetaStore
MetaStore_t m_inputMetaStore
Object accessing the input metadata store.
Definition: AsgMetadataTool.h:119
TauAnalysisTools::TruthMatchedParticleType
TruthMatchedParticleType
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:95
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
TauAnalysisTools::BuildTruthTaus::m_truthTauInputContainer
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthTauInputContainer
Definition: BuildTruthTaus.h:113
SG::AuxElement::makePrivateStore
void makePrivateStore()
Create a new (empty) private store for this object.
Definition: AuxElement.cxx:172
CxxUtils::CachedValue::set
void set(const T &val) const
Set the value, assuming it is currently invalid.
xAOD::TruthVertex_v1::x
float x() const
Vertex x displacement.
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
TauAnalysisTools::BuildTruthTaus::m_truthJetContainer
SG::ReadHandleKey< xAOD::JetContainer > m_truthJetContainer
Definition: BuildTruthTaus.h:117
xAOD::TruthParticle_v1::status
int status() const
Status code.
MC::isStable
bool isStable(const T &p)
Definition: HepMCHelpers.h:30
IMCTruthClassifier::particleTruthClassifier
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOrigin > particleTruthClassifier(const xAOD::TruthParticle *, MCTruthPartClassifier::Info *info=nullptr) const =0
a
TList * a
Definition: liststreamerinfos.cxx:10
h
TauAnalysisTools::BuildTruthTaus::m_truthMuonContainer
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthMuonContainer
Definition: BuildTruthTaus.h:116
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
MC::isDecayed
bool isDecayed(const T &p)
Definition: HepMCHelpers.h:29
xAOD::TauJet_v3::p4
virtual FourMom_t p4() const
The full 4-momentum of the particle.
Definition: TauJet_v3.cxx:97
xAOD::TruthVertex_v1::z
float z() const
Vertex longitudinal distance along the beam line form the origin.
TauAnalysisTools::getTruthParticleType
TruthMatchedParticleType getTruthParticleType(const xAOD::TauJet &xTau)
return TauJet match type
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:572
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
if
if(febId1==febId2)
Definition: LArRodBlockPhysicsV0.cxx:569
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
TauAnalysisTools::TauTruthMatchingTool::getDecayMode
virtual xAOD::TauJetParameters::DecayMode getDecayMode(const xAOD::TauJet &xTau) override final
Definition: TauTruthMatchingTool.cxx:244
HepMC::HERWIG7INTERMEDIATESTATUS
constexpr int HERWIG7INTERMEDIATESTATUS
Definition: MagicNumbers.h:44
xAOD::TauJetParameters::Mode_3pXn
@ Mode_3pXn
Definition: TauDefs.h:390
TauAnalysisTools::TauTruthMatchingTool::m_accPhiVis
SG::AuxElement::ConstAccessor< double > m_accPhiVis
Definition: TauTruthMatchingTool.h:86
xAOD::TruthParticle_v1::pt
virtual double pt() const override final
The transverse momentum ( ) of the particle.
Definition: TruthParticle_v1.cxx:166
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
TauAnalysisTools::TauTruthMatchingTool::getTruth
virtual const xAOD::TruthParticle * getTruth(const xAOD::TauJet &xTau) override final
Definition: TauTruthMatchingTool.cxx:59
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
xAOD::TruthParticle_v1::isNeutrino
bool isNeutrino() const
Whether the particle is a neutrino (or antineutrino)
xAOD::TauJetParameters::Mode_Error
@ Mode_Error
Definition: TauDefs.h:393
TauAnalysisTools::BuildTruthTaus::m_truthParticleContainer
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthParticleContainer
Definition: BuildTruthTaus.h:114
xAOD::TruthParticle_v1::p4
virtual FourMom_t p4() const override final
The full 4-momentum of the particle.
Definition: TruthParticle_v1.cxx:196
xAOD::TruthParticle_v1::pdgId
int pdgId() const
PDG ID code.
SG::DataProxy
Definition: DataProxy.h:44
xAOD::TauJetParameters::Mode_NotSet
@ Mode_NotSet
Definition: TauDefs.h:392
xAOD::Jet_v1::pt
virtual double pt() const
The transverse momentum ( ) of the particle.
Definition: Jet_v1.cxx:44
TauAnalysisTools::TauTruthMatchingTool::m_bIsTruthMatchedAvailable
CxxUtils::CachedValue< bool > m_bIsTruthMatchedAvailable
Definition: TauTruthMatchingTool.h:79
TauAnalysisTools::BuildTruthTaus::examineTruthTauDecay
StatusCode examineTruthTauDecay(const xAOD::TruthParticle &xTruthParticle, TauTruthInfo &truthInfo) const
Definition: BuildTruthTaus.cxx:322
xAOD::TruthParticle_v1::isNeutral
bool isNeutral() const
Whether the particle is electrically neutral.
TauAnalysisTools::TauTruthMatchingTool::getNTauDecayParticles
virtual int getNTauDecayParticles(const xAOD::TauJet &xTau, int iPdgId, bool bCompareAbsoluteValues=false) override final
Definition: TauTruthMatchingTool.cxx:203
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
xAOD::TruthVertex_v1::outgoingParticle
const TruthParticle_v1 * outgoingParticle(size_t index) const
Get one of the outgoing particles.
Definition: TruthVertex_v1.cxx:121
xAOD::TauJetParameters::Mode_Other
@ Mode_Other
Definition: TauDefs.h:391
fitman.k
k
Definition: fitman.py:528
xAOD::TruthParticle_v1::isHadron
bool isHadron() const
Whether the particle is a hadron.
ServiceHandle< IIncidentSvc >
TauAnalysisTools::TauTruthMatchingTool::m_accPtVis
SG::AuxElement::ConstAccessor< double > m_accPtVis
Definition: TauTruthMatchingTool.h:84
asg::AsgMetadataTool::m_useIncidents
bool m_useIncidents
Definition: AsgMetadataTool.h:128