ATLAS Offline Software
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...
 
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
 

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 33 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 76 of file PhotonTruthTool.cxx.

79 {
80  RconvMC = +9.999e+10 ;
81  ZconvMC = +9.999e+10 ;
82  if (!truePart) return false;
83 
84  const xAOD::TruthVertex* v = truePart->decayVtx();
85  if (!v || v->nOutgoingParticles() < 2)
86  return false;
87 
88  int pdgId = truePart->pdgId();
89 
90  RconvMC = v->perp();
91  ZconvMC = v->z();
92 
93  bool OKint = ( RconvMC < m_rTruthConv ) && ( fabs(ZconvMC) < m_zTruthConv );
94 
95  if ( pdgId == 22 ) { // photon
96  if ( v->nOutgoingParticles() == 2 ) {
97  int pdgChild[2] = {0};
98  for ( unsigned u=0; u<2 ; ++u) {
99  const xAOD::TruthParticle* p = v->outgoingParticle(u);
100  if (p)
101  pdgChild[u] = p->pdgId();
102  }
103  if ( pdgChild[0]+pdgChild[1]==0 && pdgChild[0]*pdgChild[1]==-121 ) {
104  // gamma -> e+e-
105  return OKint ;
106  }
107  }
108  }
109  else if ( std::abs(pdgId) == 11 ) { // e+/e-
110  v = truePart->prodVtx();
111  if ( v->nIncomingParticles()==1 && v->nOutgoingParticles()==2 ) {
112  int pdgBrother[2] = {0};
113  for ( unsigned u=0 ; u<2 ; ++u ) {
114  const xAOD::TruthParticle* p = v->outgoingParticle(u);
115  if (p)
116  pdgBrother[u] = p->pdgId();
117  }
118  if ( pdgBrother[0]+pdgBrother[1]==(22+pdgId) &&
119  pdgBrother[0]*pdgBrother[1]==(22*pdgId) )
120  {
121  // e(+/-) -> e(+/-)gamma
122  return OKint ;
123  }
124  }
125  }
126  return false ;
127 }

◆ getMother()

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

Get the (first) mother particle of p.

Definition at line 253 of file PhotonTruthTool.cxx.

254 {
255  const xAOD::TruthVertex* v = getMotherVert (p);
256 
257  if (!v || v->nIncomingParticles() == 0)
258  return 0;
259 
260  return v->incomingParticle(0);
261 }

◆ 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 268 of file PhotonTruthTool.cxx.

269 {
270  std::vector<const xAOD::TruthParticle*> out;
271  const xAOD::TruthVertex* v = getMotherVert (p);
272 
273  if (v) {
274  int n = v->nIncomingParticles();
275  out.reserve (n);
276  for (int i = 0; i < n; i++)
277  out.push_back (v->incomingParticle(i));
278  }
279 
280  return out;
281 }

◆ getMotherVert()

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

Get the mother vertex for p.

Definition at line 233 of file PhotonTruthTool.cxx.

234 {
235  const xAOD::TruthVertex* v = p->prodVtx();
236 
237  // if mother is a duplicate, try climbing up the tree by one step...
238  while (v && v->nIncomingParticles() == 1 &&
239  v->incomingParticle(0)->pdgId() == p->pdgId())
240  {
241  p = v->incomingParticle(0);
242  v = p->prodVtx();
243  }
244 
245  return v;
246 }

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

◆ isFinalState()

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

Test for a final-state particle.

Definition at line 205 of file PhotonTruthTool.cxx.

206 {
207  if ( truePart == nullptr ) return false;
208  if ( !MC::isStable(truePart)) return false;
209  if ( !m_useG4Particles ) return ( !HepMC::is_simulation_particle(truePart) );
210  // if it is a photon, keep it regardless of its Geant interaction
211  if ( MC::isPhoton(truePart) ) return true ;
212  // reject Geant electron from conversion
213  if ( MC::isElectron(truePart) && HepMC::is_simulation_particle(truePart) ) {
214  const xAOD::TruthParticle* mother = getMother(truePart) ;
215  if ( mother!=0 && MC::isPhoton(mother) ) return false ;
216  }
217 
218  // reject particles interacted in detector
219  const xAOD::TruthVertex* v = truePart->decayVtx();
220  if (!v) return false;// should never happen, but just in case...
221  if ( v->nOutgoingParticles()>0 ) {
222  if ( v->perp()<m_rTruthConv
223  && fabs(v->z())<m_zTruthConv ) return false ;
224  }
225  return true ;
226 }

◆ isFinalStatePhotonMC()

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

Test for a final-state photon.

Definition at line 194 of file PhotonTruthTool.cxx.

196 {
197  return ( isFinalState(truePart) && MC::isPhoton(truePart) ) ;
198 }

◆ isPromptParticleMC()

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

Test for a prompt particle.

Definition at line 143 of file PhotonTruthTool.cxx.

145 {
146  if ( truePart == 0 ) return false ;
147  const std::vector<const xAOD::TruthParticle*> mothers =
148  getMothers(truePart);
149  unsigned nmothers = mothers.size() ;
150  if ( nmothers == 0 ) {
151  // particles with NO mother are NEVER classified as PROMPT:
152  return false ;
153  }
154  else if ( nmothers == 1 ) {
155  // particles with ONE mother are classified as PROMPT if coming
156  // from non-QCD-boson decay:
157  // (including exotics like heavy bosons, MSSM Higgs, graviton)
158  int aPdgMother = abs(mothers[0]->pdgId());
159  return (( aPdgMother>=23 && aPdgMother<=39 ) || aPdgMother==5000039 ) ;
160  }
161  else {
162  // particles with more mothers are classified as PROMPT
163  // if they come from at least 1 parton:
164  // (is this sensible?)
165  int nParentPartons = 0 ;
166  for ( unsigned u=0 ; u<nmothers ; ++u ) {
167  int pdgMother = mothers[u]->pdgId() ;
168  if ( pdgMother==21 || ( std::abs(pdgMother)<7 && pdgMother!=0 ) )
169  ++nParentPartons ;
170  }
171  return ( nParentPartons >= 1 ) ;
172  }
173 }

◆ isPromptPhotonMC()

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

Test for a prompt photon.

Definition at line 133 of file PhotonTruthTool.cxx.

135 {
136  return ( isFinalStatePhotonMC(truePart) && isPromptParticleMC(truePart) ) ;
137 }

◆ isQuarkBremMC()

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

Test for a brem.

Definition at line 179 of file PhotonTruthTool.cxx.

181 {
182  if ( ! isFinalStatePhotonMC(truePart) ) return false ;
183  const std::vector<const xAOD::TruthParticle*> mothers =
184  getMothers(truePart) ;
185  if ( mothers.size() != 1 ) return false ;
186  int pdgMother = mothers[0]->pdgId() ;
187  return ( pdgMother==21 || ( std::abs(pdgMother)<7 && pdgMother!=0 ) ) ;
188 }

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

◆ 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 60 of file PhotonTruthTool.cxx.

61 {
63  m_classifier->particleTruthClassifier (&g, &info);
64  return info.genPart;
65 }

◆ 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 110 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 116 of file PhotonTruthTool.h.

◆ m_useG4Particles

bool D3PD::PhotonTruthTool::m_useG4Particles
private

Property.

Definition at line 119 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 113 of file PhotonTruthTool.h.


The documentation for this class was generated from the following files:
grepfile.info
info
Definition: grepfile.py:38
D3PD::PhotonTruthTool::getMothers
std::vector< const xAOD::TruthParticle * > getMothers(const xAOD::TruthParticle *p) const
Return list of mother particles of p.
Definition: PhotonTruthTool.cxx:268
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:233
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:77
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:27
D3PD::PhotonTruthTool::isPromptParticleMC
bool isPromptParticleMC(const xAOD::TruthParticle *truePart) const
Test for a prompt particle.
Definition: PhotonTruthTool.cxx:144
D3PD::PhotonTruthTool::getMother
const xAOD::TruthParticle * getMother(const xAOD::TruthParticle *p) const
Get the (first) mother particle of p.
Definition: PhotonTruthTool.cxx:253
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
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:342
lumiFormat.i
int i
Definition: lumiFormat.py:85
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:12
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:37
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:37
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
D3PD::PhotonTruthTool::isFinalState
bool isFinalState(const xAOD::TruthParticle *truePart) const
Test for a final-state particle.
Definition: PhotonTruthTool.cxx:205
python.PyAthena.v
v
Definition: PyAthena.py:154
MC::isStable
bool isStable(const T &p)
Identify if the particle is stable, i.e. has not decayed.
Definition: HepMCHelpers.h:45
a
TList * a
Definition: liststreamerinfos.cxx:10
h
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:21
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
D3PD::PhotonTruthTool::m_useG4Particles
bool m_useG4Particles
Property.
Definition: PhotonTruthTool.h:119
D3PD::PhotonTruthTool::m_zTruthConv
float m_zTruthConv
Property: Conversion vertex z cut.
Definition: PhotonTruthTool.h:113
D3PD::PhotonTruthTool::isFinalStatePhotonMC
bool isFinalStatePhotonMC(const xAOD::TruthParticle *truePart) const
Test for a final-state photon.
Definition: PhotonTruthTool.cxx:195
D3PD::PhotonTruthTool::m_classifier
ToolHandle< IMCTruthClassifier > m_classifier
Property: classifier tool.
Definition: PhotonTruthTool.h:110
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
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:116
fitman.k
k
Definition: fitman.py:528