ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
D3PD::PhotonTruthTool Class Reference

#include <PhotonTruthTool.h>

Inheritance diagram for D3PD::PhotonTruthTool:
Collaboration diagram for D3PD::PhotonTruthTool:

Public Member Functions

 PhotonTruthTool (const std::string &type, const std::string &name, const IInterface *parent)
 Standard Gaudi tool constructor. More...
 
virtual StatusCode initialize ()
 Standard Gaudi initialize method. More...
 
virtual StatusCode queryInterface (const InterfaceID &riid, void **ppvIf)
 Standard Gaudi queryInterface method. More...
 
const xAOD::TruthParticletoTruthParticle (const xAOD::Photon &g) const
 Go from a photon to a matching TruthParticle. More...
 
bool getMCConv (const xAOD::TruthParticle *truePart, float &RconvMC, float &ZconvMC) const
 Check a truth particle for a conversion. More...
 
bool isPromptPhotonMC (const xAOD::TruthParticle *truePart) const
 Test for a prompt photon. More...
 
bool isPromptParticleMC (const xAOD::TruthParticle *truePart) const
 Test for a prompt particle. More...
 
bool isQuarkBremMC (const xAOD::TruthParticle *truePart) const
 Test for a brem. More...
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Static Public Member Functions

static const InterfaceID & interfaceID ()
 Gaudi interface definition. More...
 

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

bool isFinalStatePhotonMC (const xAOD::TruthParticle *truePart) const
 Test for a final-state photon. More...
 
bool isFinalState (const xAOD::TruthParticle *truePart) const
 Test for a final-state particle. More...
 
const xAOD::TruthParticlegetMother (const xAOD::TruthParticle *p) const
 Get the (first) mother particle of p. More...
 
const xAOD::TruthVertexgetMotherVert (const xAOD::TruthParticle *p) const
 Get the mother vertex for p. More...
 
std::vector< const xAOD::TruthParticle * > getMothers (const xAOD::TruthParticle *p) const
 Return list of mother particles of p. 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

ToolHandle< IMCTruthClassifierm_classifier
 Property: classifier tool. More...
 
float m_zTruthConv
 Property: Conversion vertex z cut. More...
 
float m_rTruthConv
 Property: Conversion vertex r cut. More...
 
bool m_useG4Particles
 Property. 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

Definition at line 38 of file PhotonTruthTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ PhotonTruthTool()

D3PD::PhotonTruthTool::PhotonTruthTool ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Standard Gaudi tool constructor.

Parameters
typeThe name of the tool type.
nameThe tool name.
parentThe tool's Gaudi parent.

Definition at line 30 of file PhotonTruthTool.cxx.

33  : AthAlgTool (type, name, parent),
34  m_classifier ("MCTruthClassifier")
35 {
36  declareProperty ("Classifier", m_classifier, "Classifier tool instance.");
37  declareProperty ("ZTruthConv", m_zTruthConv = 50e3);
38  declareProperty ("RTruthConv", m_rTruthConv = 800);
39  declareProperty ("UseG4Particles", m_useG4Particles = false);
40 }

Member Function Documentation

◆ declareGaudiProperty() [1/4]

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

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

Definition at line 170 of file AthCommonDataStore.h.

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

◆ declareGaudiProperty() [2/4]

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

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

Definition at line 156 of file AthCommonDataStore.h.

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

◆ declareGaudiProperty() [3/4]

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

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

Definition at line 184 of file AthCommonDataStore.h.

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

◆ declareGaudiProperty() [4/4]

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

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

Definition at line 199 of file AthCommonDataStore.h.

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

◆ declareProperty() [1/6]

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

Declare a new Gaudi property.

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

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

Definition at line 245 of file AthCommonDataStore.h.

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

◆ declareProperty() [2/6]

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

Declare a new Gaudi property.

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

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

Definition at line 221 of file AthCommonDataStore.h.

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

◆ declareProperty() [3/6]

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

Definition at line 259 of file AthCommonDataStore.h.

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

◆ declareProperty() [4/6]

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

Declare a new Gaudi property.

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

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

Definition at line 333 of file AthCommonDataStore.h.

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

◆ declareProperty() [5/6]

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

Declare a new Gaudi property.

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

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

Definition at line 352 of file AthCommonDataStore.h.

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

◆ declareProperty() [6/6]

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

Definition at line 145 of file AthCommonDataStore.h.

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

◆ detStore()

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

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

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

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

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

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

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

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

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ extraDeps_update_handler()

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

Add StoreName to extra input/output deps as needed.

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

◆ getMCConv()

bool D3PD::PhotonTruthTool::getMCConv ( const xAOD::TruthParticle truePart,
float &  RconvMC,
float &  ZconvMC 
) const

Check a truth particle for a conversion.

Parameters
truePartThe particle to check.
[out]RconvMCRadius of the conversion.
[out]ZconvMCZ of the conversion.
Returns
True if this is a conversion; otherwise false.

Definition at line 92 of file PhotonTruthTool.cxx.

95 {
96  RconvMC = +9.999e+10 ;
97  ZconvMC = +9.999e+10 ;
98  if (!truePart) return false;
99 
100  const xAOD::TruthVertex* v = truePart->decayVtx();
101  if (!v || v->nOutgoingParticles() < 2)
102  return false;
103 
104  int pdgId = truePart->pdgId();
105 
106  RconvMC = v->perp();
107  ZconvMC = v->z();
108 
109  bool OKint = ( RconvMC < m_rTruthConv ) && ( fabs(ZconvMC) < m_zTruthConv );
110 
111  if ( pdgId == 22 ) { // photon
112  if ( v->nOutgoingParticles() == 2 ) {
113  int pdgChild[2] = {0};
114  for ( unsigned u=0; u<2 ; ++u) {
115  const xAOD::TruthParticle* p = v->outgoingParticle(u);
116  if (p)
117  pdgChild[u] = p->pdgId();
118  }
119  if ( pdgChild[0]+pdgChild[1]==0 && pdgChild[0]*pdgChild[1]==-121 ) {
120  // gamma -> e+e-
121  return OKint ;
122  }
123  }
124  }
125  else if ( std::abs(pdgId) == 11 ) { // e+/e-
126  v = truePart->prodVtx();
127  if ( v->nIncomingParticles()==1 && v->nOutgoingParticles()==2 ) {
128  int pdgBrother[2] = {0};
129  for ( unsigned u=0 ; u<2 ; ++u ) {
130  const xAOD::TruthParticle* p = v->outgoingParticle(u);
131  if (p)
132  pdgBrother[u] = p->pdgId();
133  }
134  if ( pdgBrother[0]+pdgBrother[1]==(22+pdgId) &&
135  pdgBrother[0]*pdgBrother[1]==(22*pdgId) )
136  {
137  // e(+/-) -> e(+/-)gamma
138  return OKint ;
139  }
140  }
141  }
142  return false ;
143 }

◆ getMother()

const xAOD::TruthParticle * D3PD::PhotonTruthTool::getMother ( const xAOD::TruthParticle p) const
private

Get the (first) mother particle of p.

Definition at line 269 of file PhotonTruthTool.cxx.

270 {
271  const xAOD::TruthVertex* v = getMotherVert (p);
272 
273  if (!v || v->nIncomingParticles() == 0)
274  return 0;
275 
276  return v->incomingParticle(0);
277 }

◆ getMothers()

std::vector< const xAOD::TruthParticle * > D3PD::PhotonTruthTool::getMothers ( const xAOD::TruthParticle p) const
private

Return list of mother particles of p.

Definition at line 284 of file PhotonTruthTool.cxx.

285 {
286  std::vector<const xAOD::TruthParticle*> out;
287  const xAOD::TruthVertex* v = getMotherVert (p);
288 
289  if (v) {
290  int n = v->nIncomingParticles();
291  out.reserve (n);
292  for (int i = 0; i < n; i++)
293  out.push_back (v->incomingParticle(i));
294  }
295 
296  return out;
297 }

◆ getMotherVert()

const xAOD::TruthVertex * D3PD::PhotonTruthTool::getMotherVert ( const xAOD::TruthParticle p) const
private

Get the mother vertex for p.

Definition at line 249 of file PhotonTruthTool.cxx.

250 {
251  const xAOD::TruthVertex* v = p->prodVtx();
252 
253  // if mother is a duplicate, try climbing up the tree by one step...
254  while (v && v->nIncomingParticles() == 1 &&
255  v->incomingParticle(0)->pdgId() == p->pdgId())
256  {
257  p = v->incomingParticle(0);
258  v = p->prodVtx();
259  }
260 
261  return v;
262 }

◆ initialize()

StatusCode D3PD::PhotonTruthTool::initialize ( )
virtual

Standard Gaudi initialize method.

Definition at line 46 of file PhotonTruthTool.cxx.

47 {
49  CHECK( m_classifier.retrieve() );
50  return StatusCode::SUCCESS;
51 }

◆ inputHandles()

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

Return this algorithm's input handles.

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

◆ interfaceID()

static const InterfaceID& D3PD::PhotonTruthTool::interfaceID ( )
inlinestatic

Gaudi interface definition.

Definition at line 43 of file PhotonTruthTool.h.

43 { return IID_PhotonTruthTool; }

◆ isFinalState()

bool D3PD::PhotonTruthTool::isFinalState ( const xAOD::TruthParticle truePart) const
private

Test for a final-state particle.

Definition at line 221 of file PhotonTruthTool.cxx.

222 {
223  if ( truePart == nullptr ) return false;
224  if ( !MC::isStable(truePart)) return false;
225  if ( !m_useG4Particles ) return ( !HepMC::is_simulation_particle(truePart) );
226  // if it is a photon, keep it regardless of its Geant interaction
227  if ( MC::isPhoton(truePart) ) return true ;
228  // reject Geant electron from conversion
229  if ( MC::isElectron(truePart) && HepMC::is_simulation_particle(truePart) ) {
230  const xAOD::TruthParticle* mother = getMother(truePart) ;
231  if ( mother!=0 && MC::isPhoton(mother) ) return false ;
232  }
233 
234  // reject particles interacted in detector
235  const xAOD::TruthVertex* v = truePart->decayVtx();
236  if (!v) return false;// should never happen, but just in case...
237  if ( v->nOutgoingParticles()>0 ) {
238  if ( v->perp()<m_rTruthConv
239  && fabs(v->z())<m_zTruthConv ) return false ;
240  }
241  return true ;
242 }

◆ isFinalStatePhotonMC()

bool D3PD::PhotonTruthTool::isFinalStatePhotonMC ( const xAOD::TruthParticle truePart) const
private

Test for a final-state photon.

Definition at line 210 of file PhotonTruthTool.cxx.

212 {
213  return ( isFinalState(truePart) && MC::isPhoton(truePart) ) ;
214 }

◆ isPromptParticleMC()

bool D3PD::PhotonTruthTool::isPromptParticleMC ( const xAOD::TruthParticle truePart) const

Test for a prompt particle.

Definition at line 159 of file PhotonTruthTool.cxx.

161 {
162  if ( truePart == 0 ) return false ;
163  const std::vector<const xAOD::TruthParticle*> mothers =
164  getMothers(truePart);
165  unsigned nmothers = mothers.size() ;
166  if ( nmothers == 0 ) {
167  // particles with NO mother are NEVER classified as PROMPT:
168  return false ;
169  }
170  else if ( nmothers == 1 ) {
171  // particles with ONE mother are classified as PROMPT if coming
172  // from non-QCD-boson decay:
173  // (including exotics like heavy bosons, MSSM Higgs, graviton)
174  int aPdgMother = abs(mothers[0]->pdgId());
175  return (( aPdgMother>=23 && aPdgMother<=39 ) || aPdgMother==5000039 ) ;
176  }
177  else {
178  // particles with more mothers are classified as PROMPT
179  // if they come from at least 1 parton:
180  // (is this sensible?)
181  int nParentPartons = 0 ;
182  for ( unsigned u=0 ; u<nmothers ; ++u ) {
183  int pdgMother = mothers[u]->pdgId() ;
184  if ( pdgMother==21 || ( std::abs(pdgMother)<7 && pdgMother!=0 ) )
185  ++nParentPartons ;
186  }
187  return ( nParentPartons >= 1 ) ;
188  }
189 }

◆ isPromptPhotonMC()

bool D3PD::PhotonTruthTool::isPromptPhotonMC ( const xAOD::TruthParticle truePart) const

Test for a prompt photon.

Definition at line 149 of file PhotonTruthTool.cxx.

151 {
152  return ( isFinalStatePhotonMC(truePart) && isPromptParticleMC(truePart) ) ;
153 }

◆ isQuarkBremMC()

bool D3PD::PhotonTruthTool::isQuarkBremMC ( const xAOD::TruthParticle truePart) const

Test for a brem.

Definition at line 195 of file PhotonTruthTool.cxx.

197 {
198  if ( ! isFinalStatePhotonMC(truePart) ) return false ;
199  const std::vector<const xAOD::TruthParticle*> mothers =
200  getMothers(truePart) ;
201  if ( mothers.size() != 1 ) return false ;
202  int pdgMother = mothers[0]->pdgId() ;
203  return ( pdgMother==21 || ( std::abs(pdgMother)<7 && pdgMother!=0 ) ) ;
204 }

◆ msg() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

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

Definition at line 27 of file AthCommonMsg.h.

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

◆ msgLvl()

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

Definition at line 30 of file AthCommonMsg.h.

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

◆ outputHandles()

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

Return this algorithm's output handles.

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

◆ queryInterface()

StatusCode D3PD::PhotonTruthTool::queryInterface ( const InterfaceID &  riid,
void **  ppvIf 
)
virtual

Standard Gaudi queryInterface method.

Definition at line 58 of file PhotonTruthTool.cxx.

59 {
60  if ( riid == PhotonTruthTool::interfaceID() ) {
61  *ppvIf = static_cast<PhotonTruthTool*> (this);
62  addRef();
63  return StatusCode::SUCCESS;
64  }
65 
66  return AthAlgTool::queryInterface( riid, ppvIf );
67 }

◆ renounce()

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

Definition at line 380 of file AthCommonDataStore.h.

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

◆ renounceArray()

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

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ sysInitialize()

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

Perform system initialization for an algorithm.

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

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

◆ sysStart()

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

Handle START transition.

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

◆ toTruthParticle()

const xAOD::TruthParticle * D3PD::PhotonTruthTool::toTruthParticle ( const xAOD::Photon g) const

Go from a photon to a matching TruthParticle.

Parameters
gThe input photon.
cacheTruth classifier association cache.
Returns
The matching TruthParticle, or null.
Parameters
gThe input photon.
Returns
The matching TruthParticle, or null.

Definition at line 76 of file PhotonTruthTool.cxx.

77 {
79  m_classifier->particleTruthClassifier (&g, &info);
80  return info.genPart;
81 }

◆ updateVHKA()

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

Definition at line 308 of file AthCommonDataStore.h.

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

Member Data Documentation

◆ m_classifier

ToolHandle<IMCTruthClassifier> D3PD::PhotonTruthTool::m_classifier
private

Property: classifier tool.

Definition at line 124 of file PhotonTruthTool.h.

◆ m_detStore

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

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

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

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_rTruthConv

float D3PD::PhotonTruthTool::m_rTruthConv
private

Property: Conversion vertex r cut.

Definition at line 130 of file PhotonTruthTool.h.

◆ m_useG4Particles

bool D3PD::PhotonTruthTool::m_useG4Particles
private

Property.

Definition at line 133 of file PhotonTruthTool.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.

◆ m_zTruthConv

float D3PD::PhotonTruthTool::m_zTruthConv
private

Property: Conversion vertex z cut.

Definition at line 127 of file PhotonTruthTool.h.


The documentation for this class was generated from the following files:
grepfile.info
info
Definition: grepfile.py:38
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
D3PD::PhotonTruthTool::getMothers
std::vector< const xAOD::TruthParticle * > getMothers(const xAOD::TruthParticle *p) const
Return list of mother particles of p.
Definition: PhotonTruthTool.cxx:284
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
initialize
void initialize()
Definition: run_EoverP.cxx:894
D3PD::PhotonTruthTool::getMotherVert
const xAOD::TruthVertex * getMotherVert(const xAOD::TruthParticle *p) const
Get the mother vertex for p.
Definition: PhotonTruthTool.cxx:249
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:83
PowhegPy8EG_H2a.pdgId
dictionary pdgId
Definition: PowhegPy8EG_H2a.py:128
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
D3PD::PhotonTruthTool::isPromptParticleMC
bool isPromptParticleMC(const xAOD::TruthParticle *truePart) const
Test for a prompt particle.
Definition: PhotonTruthTool.cxx:160
D3PD::PhotonTruthTool::getMother
const xAOD::TruthParticle * getMother(const xAOD::TruthParticle *p) const
Get the (first) mother particle of p.
Definition: PhotonTruthTool.cxx:269
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
CheckAppliedSFs.e3
e3
Definition: CheckAppliedSFs.py:264
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:299
lumiFormat.i
int i
Definition: lumiFormat.py:92
python.CaloCondTools.g
g
Definition: CaloCondTools.py:15
beamspotman.n
n
Definition: beamspotman.py:731
xAOD::EgammaHelpers::isElectron
bool isElectron(const xAOD::Egamma *eg)
is the object an electron (not Fwd)
Definition: EgammaxAODHelpers.cxx:13
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:41
test_pyathena.parent
parent
Definition: test_pyathena.py:15
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
xAOD::TruthParticle_v1::decayVtx
const TruthVertex_v1 * decayVtx() const
The decay vertex of this particle.
xAOD::TruthParticle_v1::prodVtx
const TruthVertex_v1 * prodVtx() const
The production vertex of this particle.
Definition: TruthParticle_v1.cxx:80
xAOD::TruthVertex_v1
Class describing a truth vertex in the MC record.
Definition: TruthVertex_v1.h:41
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
D3PD::PhotonTruthTool::isFinalState
bool isFinalState(const xAOD::TruthParticle *truePart) const
Test for a final-state particle.
Definition: PhotonTruthTool.cxx:221
python.PyAthena.v
v
Definition: PyAthena.py:157
MC::isStable
bool isStable(const T &p)
Definition: HepMCHelpers.h:30
a
TList * a
Definition: liststreamerinfos.cxx:10
h
D3PD::PhotonTruthTool::interfaceID
static const InterfaceID & interfaceID()
Gaudi interface definition.
Definition: PhotonTruthTool.h:43
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
xAOD::EgammaHelpers::isPhoton
bool isPhoton(const xAOD::Egamma *eg)
is the object a photon
Definition: EgammaxAODHelpers.cxx:22
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
D3PD::PhotonTruthTool::m_useG4Particles
bool m_useG4Particles
Property.
Definition: PhotonTruthTool.h:133
D3PD::PhotonTruthTool::m_zTruthConv
float m_zTruthConv
Property: Conversion vertex z cut.
Definition: PhotonTruthTool.h:127
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
D3PD::PhotonTruthTool::isFinalStatePhotonMC
bool isFinalStatePhotonMC(const xAOD::TruthParticle *truePart) const
Test for a final-state photon.
Definition: PhotonTruthTool.cxx:211
D3PD::PhotonTruthTool::m_classifier
ToolHandle< IMCTruthClassifier > m_classifier
Property: classifier tool.
Definition: PhotonTruthTool.h:124
D3PD::PhotonTruthTool::PhotonTruthTool
PhotonTruthTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard Gaudi tool constructor.
Definition: PhotonTruthTool.cxx:30
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
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
D3PD::PhotonTruthTool::m_rTruthConv
float m_rTruthConv
Property: Conversion vertex r cut.
Definition: PhotonTruthTool.h:130
fitman.k
k
Definition: fitman.py:528