ATLAS Offline Software
Classes | Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
egammaTruthAssociationAlg Class Reference

#include <egammaTruthAssociationAlg.h>

Inheritance diagram for egammaTruthAssociationAlg:
Collaboration diagram for egammaTruthAssociationAlg:

Classes

struct  MCTruthInfo_t
 
struct  writeDecorHandles
 helper class to contain write decoration handles More...
 

Public Member Functions

 egammaTruthAssociationAlg (const std::string &name, ISvcLocator *pSvcLocator)
 constructor More...
 
virtual ~egammaTruthAssociationAlg ()=default
 destructor More...
 
virtual StatusCode initialize () override final
 initialize method More...
 
virtual StatusCode finalize () override final
 finalize method More...
 
virtual StatusCode execute (const EventContext &ctx) const override final
 execute on container More...
 
virtual StatusCode sysInitialize () override
 Override sysInitialize. More...
 
virtual bool isClonable () const override
 Specify if the algorithm is clonable. More...
 
virtual unsigned int cardinality () const override
 Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant. More...
 
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm. More...
 
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies. More...
 
virtual bool filterPassed (const EventContext &ctx) const
 
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 
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

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

template<class T >
StatusCode initializeDecorKeys (SG::WriteDecorHandleKeyArray< T > &keys, const std::string &name)
 A function that initializes the decor handles, but also checks the naming convention. More...
 
template<class T , class L >
StatusCode match (const EventContext &ctx, const xAOD::TruthParticleContainer &truthParticles, const SG::WriteDecorHandleKeyArray< T > &hkeys, const SG::AuxElement::Accessor< L > &linkAccess, xAOD::TruthParticleContainer *egammaTruthContainer) const
 Loop over elements in the reco container, decorate them with truth info and decorate the truth particles with links to the reco ones (reco<typeName>Link) More...
 
template<class T >
MCTruthInfo_t particleTruthClassifier (const EventContext &ctx, const T *) const
 return the result of MCTruthClassifier::particleTruthClassifier or do a second pass for electrons based on the cluster to find true photons More...
 
void getNewTruthParticle (const EventContext &ctx, xAOD::TruthParticleContainer &egammaTruthContainer, const xAOD::TruthParticle *truth, const xAOD::TruthParticleContainer *oldContainer) const
 Create a copy a truth particle, add it to the new getNewTruthParticle container and decorate it with a link to the original particle. More...
 
bool isPromptEgammaParticle (const EventContext &ctx, const xAOD::TruthParticle *truth) const
 Return true if the truth particle is a prompt electron or photon. 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

Gaudi::Property< bool > m_doEgammaTruthContainer
 Create egamma truth container? More...
 
Gaudi::Property< bool > m_matchElectrons
 Match electrons? More...
 
Gaudi::Property< bool > m_matchPhotons
 Match photons? More...
 
Gaudi::Property< bool > m_matchForwardElectrons
 Match fwd electrons? More...
 
Gaudi::Property< bool > m_matchClusters
 Match clusters? More...
 
SG::WriteDecorHandleKeyArray< xAOD::CaloClusterContainerm_clusterDecKeys
 The egamma cluster decor handle key array. More...
 
Gaudi::Property< std::string > m_clusterDecName
 The egamma cluster name property used to initialize the WriteDecorHandleKeyArray. More...
 
SG::WriteDecorHandleKeyArray< xAOD::ElectronContainerm_electronDecKeys
 The electron container decor handle key array. More...
 
Gaudi::Property< std::string > m_electronDecName
 The electron container name property used to initialize the WriteDecorHandleKeyArray. More...
 
SG::WriteDecorHandleKeyArray< xAOD::ElectronContainerm_fwdElectronDecKeys
 The fwd electron container decor handle key array. More...
 
Gaudi::Property< std::string > m_fwdElectronDecName
 The fwd electron name property used to initialize the WriteDecorHandleKeyArray. More...
 
SG::WriteDecorHandleKeyArray< xAOD::PhotonContainerm_photonDecKeys
 The photon container decor handle key array. More...
 
Gaudi::Property< std::string > m_photonDecName
 The photon container name property used to initialize the WriteDecorHandleKeyArray. More...
 
SG::ReadHandleKey< xAOD::TruthEventContainerm_truthEventContainerKey
 Name of the truth event container. More...
 
SG::ReadHandleKey< xAOD::TruthParticleContainerm_truthParticleContainerKey
 Name of the truth particle container. More...
 
SG::WriteHandleKey< xAOD::TruthParticleContainerm_egammaTruthParticleContainerKey
 Name of the output egamma truth container. More...
 
Gaudi::Property< float > m_minPt
 Minimum Pt to enter egamma truth particle container. More...
 
Gaudi::Property< float > m_minPtFSR
 Minimum Pt for FSR to enter egamma truth particle container. More...
 
ToolHandle< IMCTruthClassifierm_mcTruthClassifier
 MCTruthClassifier. More...
 
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks. More...
 
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

Decorate egamma objects with truth information Creates egammaTruthParticles collection with links to reco objects

Author
B. Lenzi J. Mitrevski C. Anastopoulos

Definition at line 40 of file egammaTruthAssociationAlg.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ egammaTruthAssociationAlg()

egammaTruthAssociationAlg::egammaTruthAssociationAlg ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

constructor

Definition at line 57 of file egammaTruthAssociationAlg.cxx.

59  : AthReentrantAlgorithm(name, pSvcLocator)
60 {}

◆ ~egammaTruthAssociationAlg()

virtual egammaTruthAssociationAlg::~egammaTruthAssociationAlg ( )
virtualdefault

destructor

Member Function Documentation

◆ cardinality()

unsigned int AthReentrantAlgorithm::cardinality ( ) const
overridevirtualinherited

Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.

Override this to return 0 for reentrant algorithms.

Override this to return 0 for reentrant algorithms.

Definition at line 55 of file AthReentrantAlgorithm.cxx.

56 {
57  return 0;
58 }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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; }

◆ execute()

StatusCode egammaTruthAssociationAlg::execute ( const EventContext &  ctx) const
finaloverridevirtual

execute on container

Definition at line 112 of file egammaTruthAssociationAlg.cxx.

113 {
114 
116 
118 
119  egammaTruthContainer = SG::WriteHandle<xAOD::TruthParticleContainer>(
121  ATH_CHECK(egammaTruthContainer.record(
122  std::make_unique<xAOD::TruthParticleContainer>(),
123  std::make_unique<xAOD::TruthParticleAuxContainer>()));
124 
125  // Add a copy of electrons and photons to the truth egamma container
128 
129  // only for serial running. Can remove check later
130  if (!truthEvtContainer.isValid() || truthEvtContainer->empty()) {
131  ATH_MSG_WARNING("Could not retrieve "
132  << m_truthEventContainerKey.key()
133  << " or container empty, returning");
134  return StatusCode::SUCCESS;
135  }
136 
137  for (const auto& truthParticleLink :
138  truthEvtContainer->front()->truthParticleLinks()) {
139  if (!truthParticleLink.isValid())
140  continue;
141  const xAOD::TruthParticle* truthParticle = *truthParticleLink;
142  if (!isPromptEgammaParticle(ctx, truthParticle))
143  continue;
145  *egammaTruthContainer,
146  truthParticle,
147  truthParticleLink.getDataPtr());
148  }
149  }
150  // Decorate containers with truth info, including links to truth particles
151  // Decorate the truth particles with links to the reco ones
152 
153  // note that in multithreading this must be valid; can't just fail with
154  // success.
157 
158  // accessors
159  static const SG::AuxElement::Accessor<ClusterLink_t> accClusLink(
160  "recoClusterLink");
161  static const SG::AuxElement::Accessor<ElectronLink_t> accElLink(
162  "recoElectronLink");
163  static const SG::AuxElement::Accessor<PhotonLink_t> accPhLink(
164  "recoPhotonLink");
165 
166  if (m_matchElectrons) {
167  ATH_MSG_DEBUG("About to match electrons");
168  ATH_CHECK(match(ctx,
169  *truthParticles,
171  accElLink,
172  egammaTruthContainer.ptr()));
173  }
174 
175  if (m_matchPhotons) {
176  ATH_MSG_DEBUG("About to match photons");
177  ATH_CHECK(match(ctx,
178  *truthParticles,
180  accPhLink,
181  egammaTruthContainer.ptr()));
182  }
183 
184  if (m_matchClusters) {
185  ATH_MSG_DEBUG("About to match clusters");
186  ATH_CHECK(match(ctx,
187  *truthParticles,
189  accClusLink,
190  egammaTruthContainer.ptr()));
191  }
192 
194  ATH_MSG_DEBUG("About to match fwd electrons");
195  ATH_CHECK(match(ctx,
196  *truthParticles,
198  accElLink,
199  egammaTruthContainer.ptr()));
200  }
201 
202  return StatusCode::SUCCESS;
203 }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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

◆ extraOutputDeps()

const DataObjIDColl & AthReentrantAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 79 of file AthReentrantAlgorithm.cxx.

80 {
81  // If we didn't find any symlinks to add, just return the collection
82  // from the base class. Otherwise, return the extended collection.
83  if (!m_extendedExtraObjects.empty()) {
85  }
86  return Algorithm::extraOutputDeps();
87 }

◆ filterPassed()

virtual bool AthReentrantAlgorithm::filterPassed ( const EventContext &  ctx) const
inlinevirtualinherited

Definition at line 135 of file AthReentrantAlgorithm.h.

135  {
136  return execState( ctx ).filterPassed();
137  }

◆ finalize()

StatusCode egammaTruthAssociationAlg::finalize ( )
finaloverridevirtual

finalize method

Definition at line 106 of file egammaTruthAssociationAlg.cxx.

107 {
108  return StatusCode::SUCCESS;
109 }

◆ getNewTruthParticle()

void egammaTruthAssociationAlg::getNewTruthParticle ( const EventContext &  ctx,
xAOD::TruthParticleContainer egammaTruthContainer,
const xAOD::TruthParticle truth,
const xAOD::TruthParticleContainer oldContainer 
) const
private

Create a copy a truth particle, add it to the new getNewTruthParticle container and decorate it with a link to the original particle.

Definition at line 236 of file egammaTruthAssociationAlg.cxx.

241 {
242  auto *truthParticle = egammaTruthContainer.push_back(std::make_unique<xAOD::TruthParticle>());
243  truthParticle->setPdgId(truth->pdgId());
244  truthParticle->setBarcode(HepMC::barcode(truth)); // FIXME barcode-based
245  truthParticle->setStatus(truth->status());
246  truthParticle->setPx(truth->px());
247  truthParticle->setPy(truth->py());
248  truthParticle->setPz(truth->pz());
249  truthParticle->setE(truth->e());
250  truthParticle->setM(truth->m());
251  truthParticle->setProdVtxLink(truth->prodVtxLink());
252  truthParticle->setDecayVtxLink(truth->decayVtxLink());
253 
254  static const SG::AuxElement::Accessor<ClusterLink_t> accClusLink(
255  "recoClusterLink");
256  static const SG::AuxElement::Accessor<ElectronLink_t> accElLink(
257  "recoElectronLink");
258  static const SG::AuxElement::Accessor<PhotonLink_t> accPhLink(
259  "recoPhotonLink");
260  static const SG::AuxElement::Accessor<TruthLink_t> accTruthLink(
261  "truthParticleLink");
262  static const SG::AuxElement::Accessor<int> accType("truthType");
263  static const SG::AuxElement::Accessor<int> accOrigin("truthOrigin");
264 
265  if (m_matchClusters) {
266  accClusLink(*truthParticle) = ClusterLink_t();
267  }
268  accElLink(*truthParticle) = ElectronLink_t();
269  accPhLink(*truthParticle) = PhotonLink_t();
270  accTruthLink(*truthParticle) = TruthLink_t(truth, *oldContainer, ctx);
271  accTruthLink(*truthParticle).toPersistent();
272  // MCTruthClassifier info
273  MCTruthPartClassifier::Info mcinfo(ctx);
274  auto info = m_mcTruthClassifier->particleTruthClassifier(truth, &mcinfo);
275  accType(*truthParticle) = static_cast<int>(info.first);
276  accOrigin(*truthParticle) = static_cast<int>(info.second);
277 }

◆ initialize()

StatusCode egammaTruthAssociationAlg::initialize ( )
finaloverridevirtual

initialize method

Definition at line 63 of file egammaTruthAssociationAlg.cxx.

64 {
65 
66  ATH_MSG_DEBUG("Initializing " << name() << "...");
67 
68  // initialize the data handles
70  ATH_CHECK(
73 
74  // Now the standard decoration handles
75  if (m_matchElectrons) {
77  } else {
78  m_electronDecKeys.clear();
79  }
80 
81  if (m_matchPhotons) {
83  } else {
84  m_photonDecKeys.clear();
85  }
86 
87  if (m_matchClusters) {
89  } else {
90  m_clusterDecKeys.clear();
91  }
92 
95  } else {
96  m_fwdElectronDecKeys.clear();
97  }
98 
99  CHECK(m_mcTruthClassifier.retrieve());
100  ATH_MSG_DEBUG("Retrieved tool " << m_mcTruthClassifier);
101  ATH_MSG_DEBUG("Initialization successful");
102  return StatusCode::SUCCESS;
103 }

◆ initializeDecorKeys()

template<class T >
StatusCode egammaTruthAssociationAlg::initializeDecorKeys ( SG::WriteDecorHandleKeyArray< T > &  keys,
const std::string &  name 
)
private

A function that initializes the decor handles, but also checks the naming convention.

Definition at line 282 of file egammaTruthAssociationAlg.cxx.

285 {
286  if (!keys.empty()) {
287  ATH_MSG_FATAL("The WriteDecorHandle should not be configured directly.");
288  return StatusCode::FAILURE;
289  }
290 
291  keys.emplace_back(name + ".truthParticleLink");
292  keys.emplace_back(name + ".truthType");
293  keys.emplace_back(name + ".truthOrigin");
294  ATH_CHECK(keys.initialize());
295  return StatusCode::SUCCESS;
296 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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.

◆ isClonable()

bool AthReentrantAlgorithm::isClonable ( ) const
overridevirtualinherited

◆ isPromptEgammaParticle()

bool egammaTruthAssociationAlg::isPromptEgammaParticle ( const EventContext &  ctx,
const xAOD::TruthParticle truth 
) const
private

Return true if the truth particle is a prompt electron or photon.

Definition at line 206 of file egammaTruthAssociationAlg.cxx.

209 {
210 
211  if ((truth->pdgId() != 22 && abs(truth->pdgId()) != 11) ||
212  MC::isDecayed(truth) || !MC::isPhysical(truth) ||
213  HepMC::is_simulation_particle(truth) || truth->pt() < m_minPt) {
214  return false;
215  }
216  MCTruthPartClassifier::Info mcinfo(ctx);
217  auto type = m_mcTruthClassifier->particleTruthClassifier(truth, &mcinfo);
218 
219  // Isolated electron or photon
220  if (type.first == MCTruthPartClassifier::IsoElectron ||
222  return true;
223  }
224 
225  // FSR photon
228  truth->pt() > m_minPtFSR) {
229  return true;
230  }
231 
232  return false;
233 }

◆ match()

template<class T , class L >
StatusCode egammaTruthAssociationAlg::match ( const EventContext &  ctx,
const xAOD::TruthParticleContainer truthParticles,
const SG::WriteDecorHandleKeyArray< T > &  hkeys,
const SG::AuxElement::Accessor< L > &  linkAccess,
xAOD::TruthParticleContainer egammaTruthContainer 
) const
private

Loop over elements in the reco container, decorate them with truth info and decorate the truth particles with links to the reco ones (reco<typeName>Link)

Definition at line 348 of file egammaTruthAssociationAlg.cxx.

354 {
355 
356  writeDecorHandles<T> decoHandles(hkeys, ctx);
357 
358 
359  for (auto particle : *decoHandles.readHandle()) {
360 
361  MCTruthInfo_t info =
363 
364  const xAOD::TruthParticle* truthParticle = info.genPart;
365  if (truthParticle) {
367  truthParticle, truthParticles, ctx);
369  "Decorating object with link to truth, index = " << link.index());
370  decoHandles.el(*particle) = link;
371  } else {
373  }
374  decoHandles.el(*particle).toPersistent();
375  ATH_MSG_DEBUG("truthType = " << info.first
376  << " truthOrigin = " << info.second);
377  decoHandles.type(*particle) = static_cast<int>(info.first);
378  decoHandles.origin(*particle) = static_cast<int>(info.second);
379 
380  // Decorate the corresponding truth particle with the link to the reco
382  if (!egammaTruthContainer) {
383  ATH_MSG_ERROR("The egammaTruthContainer needs to be valid");
384  return StatusCode::FAILURE;
385  }
386  const xAOD::TruthParticle* truth =
388  if (truth) {
389  xAOD::TruthParticle* truthEgamma =
390  getEgammaTruthParticle(truth, *egammaTruthContainer);
391  if (truthEgamma) {
392  // we found a truthEgamma object we should annotate if this is the
393  // best link
394  bool annotateLink = true; // by default we annotate
395  const auto link = linkAccess(*truthEgamma); // what already exists
396  if (link.isValid()) {
397  auto oldPart = *link;
398  if (oldPart && truthEgamma->e() > 0 &&
399  std::abs(oldPart->e() / truthEgamma->e() - 1) <
400  std::abs(particle->e() / truthEgamma->e() - 1)) {
401  ATH_MSG_DEBUG(truthEgamma
402  << ": "
403  << " already set to a better matched particle: "
404  << particle);
405  annotateLink = false;
406  }
407  }
408 
409  if (annotateLink) {
410  L link(particle, *decoHandles.readHandle(), ctx);
411  linkAccess(*truthEgamma) = link;
412  linkAccess(*truthEgamma).toPersistent();
413  }
414  }
415  }
416  }
417  }
418  return StatusCode::SUCCESS;
419 }

◆ msg() [1/2]

MsgStream& AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

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

Definition at line 27 of file AthCommonMsg.h.

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

◆ msgLvl()

bool AthCommonMsg< Gaudi::Algorithm >::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< Gaudi::Algorithm > >::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.

◆ particleTruthClassifier()

template<class T >
egammaTruthAssociationAlg::MCTruthInfo_t egammaTruthAssociationAlg::particleTruthClassifier ( const EventContext &  ctx,
const T *  particle 
) const
private

return the result of MCTruthClassifier::particleTruthClassifier or do a second pass for electrons based on the cluster to find true photons

Definition at line 310 of file egammaTruthAssociationAlg.cxx.

313 {
314  MCTruthInfo_t info{};
315  MCTruthPartClassifier::Info mcinfo(ctx);
316  auto ret = m_mcTruthClassifier->particleTruthClassifier(particle, &mcinfo);
317  info.genPart = mcinfo.genPart;
318  info.first = ret.first;
319  info.second = ret.second;
320  return info;
321 }

◆ 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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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  }

◆ setFilterPassed()

virtual void AthReentrantAlgorithm::setFilterPassed ( bool  state,
const EventContext &  ctx 
) const
inlinevirtualinherited

Definition at line 139 of file AthReentrantAlgorithm.h.

139  {
140  execState( ctx ).setFilterPassed( state );
141  }

◆ sysExecute()

StatusCode AthReentrantAlgorithm::sysExecute ( const EventContext &  ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Definition at line 67 of file AthReentrantAlgorithm.cxx.

68 {
69  return Gaudi::Algorithm::sysExecute (ctx);
70 }

◆ sysInitialize()

StatusCode AthReentrantAlgorithm::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in InputMakerBase, and HypoBase.

Definition at line 96 of file AthReentrantAlgorithm.cxx.

96  {
98 
99  if (sc.isFailure()) {
100  return sc;
101  }
102 
103  ServiceHandle<ICondSvc> cs("CondSvc",name());
104  for (auto h : outputHandles()) {
105  if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
106  // do this inside the loop so we don't create the CondSvc until needed
107  if ( cs.retrieve().isFailure() ) {
108  ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
109  return StatusCode::SUCCESS;
110  }
111  if (cs->regHandle(this,*h).isFailure()) {
112  sc = StatusCode::FAILURE;
113  ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
114  << " with CondSvc");
115  }
116  }
117  }
118  return sc;
119 }

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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_clusterDecKeys

SG::WriteDecorHandleKeyArray<xAOD::CaloClusterContainer> egammaTruthAssociationAlg::m_clusterDecKeys
private
Initial value:
{
this,
"DoNotSet_ClusterContainerName",
{},
"Do not set; configuration via the string property"
}

The egamma cluster decor handle key array.

Definition at line 151 of file egammaTruthAssociationAlg.h.

◆ m_clusterDecName

Gaudi::Property<std::string> egammaTruthAssociationAlg::m_clusterDecName
private
Initial value:
{
this,
"ClusterContainerName",
"",
"Name of the egamma cluster container"
}

The egamma cluster name property used to initialize the WriteDecorHandleKeyArray.

Definition at line 160 of file egammaTruthAssociationAlg.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_doEgammaTruthContainer

Gaudi::Property<bool> egammaTruthAssociationAlg::m_doEgammaTruthContainer
private
Initial value:
{
this,
"CreateEgammaTruthContainer",
true,
"Create egammaTruthContainer?"
}

Create egamma truth container?

Definition at line 119 of file egammaTruthAssociationAlg.h.

◆ m_egammaTruthParticleContainerKey

SG::WriteHandleKey<xAOD::TruthParticleContainer> egammaTruthAssociationAlg::m_egammaTruthParticleContainerKey
private
Initial value:
{
this,
"EgammaTruthContainerName",
"",
"Name of the output egamma truth particle container"
}

Name of the output egamma truth container.

Definition at line 236 of file egammaTruthAssociationAlg.h.

◆ m_electronDecKeys

SG::WriteDecorHandleKeyArray<xAOD::ElectronContainer> egammaTruthAssociationAlg::m_electronDecKeys
private
Initial value:
{
this,
"DoNotSet_ElectronContainerName",
{},
"Do not set; configuration via the string property"
}

The electron container decor handle key array.

Definition at line 168 of file egammaTruthAssociationAlg.h.

◆ m_electronDecName

Gaudi::Property<std::string> egammaTruthAssociationAlg::m_electronDecName
private
Initial value:
{
this,
"ElectronContainerName",
"",
"Name of the input electron container"
}

The electron container name property used to initialize the WriteDecorHandleKeyArray.

Definition at line 177 of file egammaTruthAssociationAlg.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthReentrantAlgorithm::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 153 of file AthReentrantAlgorithm.h.

◆ m_fwdElectronDecKeys

SG::WriteDecorHandleKeyArray<xAOD::ElectronContainer> egammaTruthAssociationAlg::m_fwdElectronDecKeys
private
Initial value:
{
this,
"DoNotSet_FwdElectronContainerName",
{},
"Do not set; configuration via the string property"
}

The fwd electron container decor handle key array.

Definition at line 185 of file egammaTruthAssociationAlg.h.

◆ m_fwdElectronDecName

Gaudi::Property<std::string> egammaTruthAssociationAlg::m_fwdElectronDecName
private
Initial value:
{
this,
"FwdElectronContainerName",
"",
"Name of the input fwd electron container"
}

The fwd electron name property used to initialize the WriteDecorHandleKeyArray.

Definition at line 194 of file egammaTruthAssociationAlg.h.

◆ m_matchClusters

Gaudi::Property<bool> egammaTruthAssociationAlg::m_matchClusters
private
Initial value:
{ this,
"MatchClusters",
false,
"Match clusters?" }

Match clusters?

Definition at line 145 of file egammaTruthAssociationAlg.h.

◆ m_matchElectrons

Gaudi::Property<bool> egammaTruthAssociationAlg::m_matchElectrons
private
Initial value:
{ this,
"MatchElectrons",
true,
"Match (central) electrons?" }

Match electrons?

Definition at line 127 of file egammaTruthAssociationAlg.h.

◆ m_matchForwardElectrons

Gaudi::Property<bool> egammaTruthAssociationAlg::m_matchForwardElectrons
private
Initial value:
{ this,
"MatchForwardElectrons",
true,
"Match forward electrons?" }

Match fwd electrons?

Definition at line 139 of file egammaTruthAssociationAlg.h.

◆ m_matchPhotons

Gaudi::Property<bool> egammaTruthAssociationAlg::m_matchPhotons
private
Initial value:
{ this,
"MatchPhotons",
true,
"Match photons?" }

Match photons?

Definition at line 133 of file egammaTruthAssociationAlg.h.

◆ m_mcTruthClassifier

ToolHandle<IMCTruthClassifier> egammaTruthAssociationAlg::m_mcTruthClassifier
private
Initial value:
{
this,
"MCTruthClassifier",
"EMMCTruthClassifier",
"Handle of MCTruthClassifier"
}

MCTruthClassifier.

Definition at line 260 of file egammaTruthAssociationAlg.h.

◆ m_minPt

Gaudi::Property<float> egammaTruthAssociationAlg::m_minPt
private
Initial value:
{
this,
"MinPtEgammaTruth",
10,
"Minimum Pt to enter egamma truth particle container"
}

Minimum Pt to enter egamma truth particle container.

Definition at line 244 of file egammaTruthAssociationAlg.h.

◆ m_minPtFSR

Gaudi::Property<float> egammaTruthAssociationAlg::m_minPtFSR
private
Initial value:
{
this,
"MinPtEgammaTruthFSR",
1e3,
"Minimum Pt for FSR to enter egamma truth particle container"
}

Minimum Pt for FSR to enter egamma truth particle container.

Definition at line 252 of file egammaTruthAssociationAlg.h.

◆ m_photonDecKeys

SG::WriteDecorHandleKeyArray<xAOD::PhotonContainer> egammaTruthAssociationAlg::m_photonDecKeys
private
Initial value:
{
this,
"DoNotSet_PhotonContainerName",
{},
"Do not set; configuration via the string property"
}

The photon container decor handle key array.

Definition at line 202 of file egammaTruthAssociationAlg.h.

◆ m_photonDecName

Gaudi::Property<std::string> egammaTruthAssociationAlg::m_photonDecName
private
Initial value:
{
this,
"PhotonContainerName",
"",
"Name of the input photon container"
}

The photon container name property used to initialize the WriteDecorHandleKeyArray.

Definition at line 211 of file egammaTruthAssociationAlg.h.

◆ m_truthEventContainerKey

SG::ReadHandleKey<xAOD::TruthEventContainer> egammaTruthAssociationAlg::m_truthEventContainerKey
private
Initial value:
{
this,
"TruthEventContainerName",
"",
"Name of the truth event container"
}

Name of the truth event container.

Definition at line 219 of file egammaTruthAssociationAlg.h.

◆ m_truthParticleContainerKey

SG::ReadHandleKey<xAOD::TruthParticleContainer> egammaTruthAssociationAlg::m_truthParticleContainerKey
private
Initial value:
{
this,
"TruthParticleContainerName",
"",
"Name of the truth particle container"
}

Name of the truth particle container.

Definition at line 227 of file egammaTruthAssociationAlg.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
grepfile.info
info
Definition: grepfile.py:38
IsoPhoton
@ IsoPhoton
Definition: TruthClasses.h:23
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
egammaTruthAssociationAlg::particleTruthClassifier
MCTruthInfo_t particleTruthClassifier(const EventContext &ctx, const T *) const
return the result of MCTruthClassifier::particleTruthClassifier or do a second pass for electrons bas...
Definition: egammaTruthAssociationAlg.cxx:310
ElectronLink_t
ElementLink< xAOD::ElectronContainer > ElectronLink_t
Definition: egammaTruthAssociationAlg.cxx:54
egammaTruthAssociationAlg::m_egammaTruthParticleContainerKey
SG::WriteHandleKey< xAOD::TruthParticleContainer > m_egammaTruthParticleContainerKey
Name of the output egamma truth container.
Definition: egammaTruthAssociationAlg.h:236
xAOD::TruthParticle_v1::pz
float pz() const
The z component of the particle's momentum.
SG::Accessor
Helper class to provide type-safe access to aux data.
Definition: Control/AthContainers/AthContainers/Accessor.h:68
NonIsoPhoton
@ NonIsoPhoton
Definition: TruthClasses.h:24
egammaTruthAssociationAlg::getNewTruthParticle
void getNewTruthParticle(const EventContext &ctx, xAOD::TruthParticleContainer &egammaTruthContainer, const xAOD::TruthParticle *truth, const xAOD::TruthParticleContainer *oldContainer) const
Create a copy a truth particle, add it to the new getNewTruthParticle container and decorate it with ...
Definition: egammaTruthAssociationAlg.cxx:236
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
PhotonLink_t
ElementLink< xAOD::PhotonContainer > PhotonLink_t
Definition: egammaTruthAssociationAlg.cxx:55
egammaTruthAssociationAlg::m_matchClusters
Gaudi::Property< bool > m_matchClusters
Match clusters?
Definition: egammaTruthAssociationAlg.h:145
AthCommonDataStore::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 > renounce(T &h)
Definition: AthCommonDataStore.h:380
xAOD::TruthParticle_v1::px
float px() const
The x component of the particle's momentum.
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
egammaTruthAssociationAlg::match
StatusCode match(const EventContext &ctx, const xAOD::TruthParticleContainer &truthParticles, const SG::WriteDecorHandleKeyArray< T > &hkeys, const SG::AuxElement::Accessor< L > &linkAccess, xAOD::TruthParticleContainer *egammaTruthContainer) const
Loop over elements in the reco container, decorate them with truth info and decorate the truth partic...
Definition: egammaTruthAssociationAlg.cxx:348
egammaTruthAssociationAlg::m_minPtFSR
Gaudi::Property< float > m_minPtFSR
Minimum Pt for FSR to enter egamma truth particle container.
Definition: egammaTruthAssociationAlg.h:252
egammaTruthAssociationAlg::m_matchPhotons
Gaudi::Property< bool > m_matchPhotons
Match photons?
Definition: egammaTruthAssociationAlg.h:133
xAOD::TruthParticle_v1::py
float py() const
The y component of the particle's momentum.
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
egammaTruthAssociationAlg::m_electronDecKeys
SG::WriteDecorHandleKeyArray< xAOD::ElectronContainer > m_electronDecKeys
The electron container decor handle key array.
Definition: egammaTruthAssociationAlg.h:168
egammaTruthAssociationAlg::m_truthEventContainerKey
SG::ReadHandleKey< xAOD::TruthEventContainer > m_truthEventContainerKey
Name of the truth event container.
Definition: egammaTruthAssociationAlg.h:219
egammaTruthAssociationAlg::m_matchElectrons
Gaudi::Property< bool > m_matchElectrons
Match electrons?
Definition: egammaTruthAssociationAlg.h:127
egammaTruthAssociationAlg::m_fwdElectronDecKeys
SG::WriteDecorHandleKeyArray< xAOD::ElectronContainer > m_fwdElectronDecKeys
The fwd electron container decor handle key array.
Definition: egammaTruthAssociationAlg.h:185
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
FSRPhot
@ FSRPhot
Definition: TruthClasses.h:96
egammaTruthAssociationAlg::m_fwdElectronDecName
Gaudi::Property< std::string > m_fwdElectronDecName
The fwd electron name property used to initialize the WriteDecorHandleKeyArray.
Definition: egammaTruthAssociationAlg.h:194
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
egammaTruthAssociationAlg::m_clusterDecName
Gaudi::Property< std::string > m_clusterDecName
The egamma cluster name property used to initialize the WriteDecorHandleKeyArray.
Definition: egammaTruthAssociationAlg.h:160
MC::isPhysical
bool isPhysical(const T &p)
Identify if the particle is physical, i.e. is stable or decayed.
Definition: HepMCHelpers.h:51
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AthCommonDataStore
Definition: AthCommonDataStore.h:52
egammaTruthAssociationAlg::m_truthParticleContainerKey
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthParticleContainerKey
Name of the truth particle container.
Definition: egammaTruthAssociationAlg.h:227
AthReentrantAlgorithm::AthReentrantAlgorithm
AthReentrantAlgorithm()
Default constructor:
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
CheckAppliedSFs.e3
e3
Definition: CheckAppliedSFs.py:264
xAOD::TruthParticle_v1::e
virtual double e() const override final
The total energy of the particle.
xAOD::TruthParticle_v1::prodVtxLink
const ElementLink< TruthVertexContainer > & prodVtxLink() const
The production vertex link of this particle.
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
HepMC::is_simulation_particle
bool is_simulation_particle(const T &p)
Method to establish if a particle (or barcode) was created during the simulation (TODO update to be s...
Definition: MagicNumbers.h:355
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
SG::WriteHandle::ptr
pointer_type ptr()
Dereference the pointer.
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
HepMC::barcode
int barcode(const T *p)
Definition: Barcode.h:16
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:37
ClusterLink_t
ElementLink< xAOD::CaloClusterContainer > ClusterLink_t
Definition: egammaTruthAssociationAlg.cxx:53
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
egammaTruthAssociationAlg::m_mcTruthClassifier
ToolHandle< IMCTruthClassifier > m_mcTruthClassifier
MCTruthClassifier.
Definition: egammaTruthAssociationAlg.h:260
xAOD::TruthParticle_v1::decayVtxLink
const ElementLink< TruthVertexContainer > & decayVtxLink() const
The decay vertex link of this particle.
AthReentrantAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
Definition: AthReentrantAlgorithm.h:153
egammaTruthAssociationAlg::m_doEgammaTruthContainer
Gaudi::Property< bool > m_doEgammaTruthContainer
Create egamma truth container?
Definition: egammaTruthAssociationAlg.h:119
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
egammaTruthAssociationAlg::m_electronDecName
Gaudi::Property< std::string > m_electronDecName
The electron container name property used to initialize the WriteDecorHandleKeyArray.
Definition: egammaTruthAssociationAlg.h:177
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
egammaTruthAssociationAlg::initializeDecorKeys
StatusCode initializeDecorKeys(SG::WriteDecorHandleKeyArray< T > &keys, const std::string &name)
A function that initializes the decor handles, but also checks the naming convention.
Definition: egammaTruthAssociationAlg.cxx:282
egammaTruthAssociationAlg::m_matchForwardElectrons
Gaudi::Property< bool > m_matchForwardElectrons
Match fwd electrons?
Definition: egammaTruthAssociationAlg.h:139
egammaTruthAssociationAlg::m_minPt
Gaudi::Property< float > m_minPt
Minimum Pt to enter egamma truth particle container.
Definition: egammaTruthAssociationAlg.h:244
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
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
egammaTruthAssociationAlg::m_photonDecKeys
SG::WriteDecorHandleKeyArray< xAOD::PhotonContainer > m_photonDecKeys
The photon container decor handle key array.
Definition: egammaTruthAssociationAlg.h:202
AthReentrantAlgorithm::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthReentrantAlgorithm.cxx:96
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
egammaTruthAssociationAlg::m_clusterDecKeys
SG::WriteDecorHandleKeyArray< xAOD::CaloClusterContainer > m_clusterDecKeys
The egamma cluster decor handle key array.
Definition: egammaTruthAssociationAlg.h:151
egammaTruthAssociationAlg::isPromptEgammaParticle
bool isPromptEgammaParticle(const EventContext &ctx, const xAOD::TruthParticle *truth) const
Return true if the truth particle is a prompt electron or photon.
Definition: egammaTruthAssociationAlg.cxx:206
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
xAOD::TruthParticle_v1::status
int status() const
Status code.
a
TList * a
Definition: liststreamerinfos.cxx:10
h
SG::WriteHandle::record
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
MC::isDecayed
bool isDecayed(const T &p)
Identify if the particle decayed.
Definition: HepMCHelpers.h:42
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
xAOD::TruthParticle_v1::pt
virtual double pt() const override final
The transverse momentum ( ) of the particle.
Definition: TruthParticle_v1.cxx:166
TruthLink_t
ElementLink< xAOD::TruthParticleContainer > TruthLink_t
Definition: egammaTruthAssociationAlg.cxx:52
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
egammaTruthAssociationAlg::m_photonDecName
Gaudi::Property< std::string > m_photonDecName
The photon container name property used to initialize the WriteDecorHandleKeyArray.
Definition: egammaTruthAssociationAlg.h:211
xAOD::TruthParticle_v1::pdgId
int pdgId() const
PDG ID code.
MCTruthPartClassifier::Info
Definition: IMCTruthClassifier.h:49
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::TruthParticle_v1::m
virtual double m() const override final
The mass of the particle.
fitman.k
k
Definition: fitman.py:528
ServiceHandle< ICondSvc >