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, V, H > &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, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &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...
 
Gaudi::Property< bool > m_UPCmode
 Allow electron from photon in 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 AthCommonReentrantAlgorithm< Gaudi::Algorithm >::cardinality
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 75 of file AthCommonReentrantAlgorithm.cxx.

64 {
65  return 0;
66 }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > &  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, V, H > &  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, V, H > &  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, V, H > &  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, V, H > &  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 & AthCommonReentrantAlgorithm< Gaudi::Algorithm >::extraOutputDeps
overridevirtualinherited

Return the list of extra output dependencies.

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

Definition at line 94 of file AthCommonReentrantAlgorithm.cxx.

90 {
91  // If we didn't find any symlinks to add, just return the collection
92  // from the base class. Otherwise, return the extended collection.
93  if (!m_extendedExtraObjects.empty()) {
95  }
96  return BaseAlg::extraOutputDeps();
97 }

◆ filterPassed()

virtual bool AthCommonReentrantAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext &  ctx) const
inlinevirtualinherited

Definition at line 96 of file AthCommonReentrantAlgorithm.h.

96  {
97  return execState( ctx ).filterPassed();
98  }

◆ 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 243 of file egammaTruthAssociationAlg.cxx.

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

◆ 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 289 of file egammaTruthAssociationAlg.cxx.

292 {
293  if (!keys.empty()) {
294  ATH_MSG_FATAL("The WriteDecorHandle should not be configured directly.");
295  return StatusCode::FAILURE;
296  }
297 
298  keys.emplace_back(name + ".truthParticleLink");
299  keys.emplace_back(name + ".truthType");
300  keys.emplace_back(name + ".truthOrigin");
301  ATH_CHECK(keys.initialize());
302  return StatusCode::SUCCESS;
303 }

◆ 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 AthCommonReentrantAlgorithm< Gaudi::Algorithm >::isClonable
overridevirtualinherited

Specify if the algorithm is clonable.

Reentrant algorithms are clonable.

Definition at line 68 of file AthCommonReentrantAlgorithm.cxx.

52 {
53  // Reentrant algorithms are clonable.
54  return true;
55 }

◆ 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 photons are kept
220  if (type.first == MCTruthPartClassifier::IsoElectron ||
222  return true;
223  }
224 
225  //In UPC mode (e.g \gamma \gamma -> e e )
226  // keep (non-Geant see above) electrons from photons (Bkg)
227  if (m_UPCmode &&
229  return true;
230  }
231 
232  // FSR photon
235  truth->pt() > m_minPtFSR) {
236  return true;
237  }
238 
239  return false;
240 }

◆ 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 355 of file egammaTruthAssociationAlg.cxx.

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

◆ 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 317 of file egammaTruthAssociationAlg.cxx.

320 {
321  MCTruthInfo_t info{};
322  MCTruthPartClassifier::Info mcinfo(ctx);
323  auto ret = m_mcTruthClassifier->particleTruthClassifier(particle, &mcinfo);
324  info.genPart = mcinfo.genPart;
325  info.first = ret.first;
326  info.second = ret.second;
327  return info;
328 }

◆ 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 AthCommonReentrantAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool  state,
const EventContext &  ctx 
) const
inlinevirtualinherited

Definition at line 100 of file AthCommonReentrantAlgorithm.h.

100  {
101  execState( ctx ).setFilterPassed( state );
102  }

◆ sysExecute()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::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 85 of file AthCommonReentrantAlgorithm.cxx.

77 {
78  return BaseAlg::sysExecute (ctx);
79 }

◆ sysInitialize()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::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 61 of file AthCommonReentrantAlgorithm.cxx.

107  {
109 
110  if (sc.isFailure()) {
111  return sc;
112  }
113 
114  ServiceHandle<ICondSvc> cs("CondSvc",name());
115  for (auto h : outputHandles()) {
116  if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
117  // do this inside the loop so we don't create the CondSvc until needed
118  if ( cs.retrieve().isFailure() ) {
119  ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
120  return StatusCode::SUCCESS;
121  }
122  if (cs->regHandle(this,*h).isFailure()) {
123  sc = StatusCode::FAILURE;
124  ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
125  << " with CondSvc");
126  }
127  }
128  }
129  return sc;
130 }

◆ 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 AthCommonReentrantAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

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

Empty if no symlinks were found.

Definition at line 114 of file AthCommonReentrantAlgorithm.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 269 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_UPCmode

Gaudi::Property<bool> egammaTruthAssociationAlg::m_UPCmode
private
Initial value:
{
this,
"UPCmode",
false,
"Allow electron from photon in egamma truth particle container"
}

Allow electron from photon in egamma truth particle container.

Definition at line 260 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:
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:79
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:317
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:243
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:67
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:355
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
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
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
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:74
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
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
AthCommonReentrantAlgorithm::extraOutputDeps
virtual const DataObjIDColl & extraOutputDeps() const override
Return the list of extra output dependencies.
Definition: AthCommonReentrantAlgorithm.cxx:89
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
AthCommonDataStore
Definition: AthCommonDataStore.h:52
egammaTruthAssociationAlg::m_truthParticleContainerKey
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthParticleContainerKey
Name of the truth particle container.
Definition: egammaTruthAssociationAlg.h:227
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:354
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
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition: AthCommonDataStore.h:145
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:37
AthCommonReentrantAlgorithm::sysExecute
virtual StatusCode sysExecute(const EventContext &ctx) override
Execute an algorithm.
Definition: AthCommonReentrantAlgorithm.cxx:76
HepMC::uniqueID
int uniqueID(const T &p)
Definition: MagicNumbers.h:116
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:269
xAOD::TruthParticle_v1::decayVtxLink
const ElementLink< TruthVertexContainer > & decayVtxLink() const
The decay vertex link of this particle.
egammaTruthAssociationAlg::m_UPCmode
Gaudi::Property< bool > m_UPCmode
Allow electron from photon in egamma truth particle container.
Definition: egammaTruthAssociationAlg.h:260
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:289
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:240
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
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:73
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
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:629
xAOD::TruthParticle_v1::pt
virtual double pt() const override final
The transverse momentum ( ) of the particle.
Definition: TruthParticle_v1.cxx:161
AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthCommonReentrantAlgorithm.cxx:107
TruthLink_t
ElementLink< xAOD::TruthParticleContainer > TruthLink_t
Definition: egammaTruthAssociationAlg.cxx:52
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:801
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.
AthCommonReentrantAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
Definition: AthCommonReentrantAlgorithm.h:114
MCTruthPartClassifier::Info
Definition: IMCTruthClassifier.h:49
python.ParticleTypeUtil.info
def info
Definition: ParticleTypeUtil.py:87
BkgElectron
@ BkgElectron
Definition: TruthClasses.h:13
xAOD::TruthParticle_v1::m
virtual double m() const override final
The mass of the particle.
fitman.k
k
Definition: fitman.py:528
python.SystemOfUnits.L
float L
Definition: SystemOfUnits.py:92
ServiceHandle< ICondSvc >