ATLAS Offline Software
HepMCTruthReader.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef HEPMCTRUTHREADER_H
6 #define HEPMCTRUTHREADER_H
7 
9 
14 
16 
17 
21 public:
22 
24  HepMCTruthReader(const std::string& name, ISvcLocator* svcLoc);
25 
27  virtual StatusCode initialize();
28 
30  virtual StatusCode execute(const EventContext& ctx) const;
31 
32 
33 private:
34 
37  this, "HepMCContainerKey", "GEN_EVENT", "The input McEvenCollection"};
38 
40  Gaudi::Property<bool> m_do4momPtEtaPhi{this, "Do4momPtEtaPhi", false};
41 
42  static void printEvent(const HepMC::GenEvent* evt, bool do4momPtEtaPhi);
43  static void printVertex(const HepMC::ConstGenVertexPtr& vtx, bool do4momPtEtaPhi );
44  static void printParticle(const HepMC::ConstGenParticlePtr& part, bool do4momPtEtaPhi);
45 
46 }; // class HepMCTruthReader
47 
48 
49 
50 #endif // HEPMCTRUTHREADER_H
LArG4FSStartPointFilter.part
part
Definition: LArG4FSStartPointFilter.py:21
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
HepMCTruthReader
Algorithm demonstrating reading of HepMC truth, and printing to screen.
Definition: HepMCTruthReader.h:20
GenParticle_fwd.h
LArG4FSStartPointFilter.evt
evt
Definition: LArG4FSStartPointFilter.py:42
SG::ReadHandleKey< McEventCollection >
HepMCTruthReader::printParticle
static void printParticle(const HepMC::ConstGenParticlePtr &part, bool do4momPtEtaPhi)
Definition: HepMCTruthReader.cxx:206
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:74
HepMCTruthReader::m_do4momPtEtaPhi
Gaudi::Property< bool > m_do4momPtEtaPhi
Flag to printout in pt,eta,phi instead of px,py,pz.
Definition: HepMCTruthReader.h:40
HepMCTruthReader::printEvent
static void printEvent(const HepMC::GenEvent *evt, bool do4momPtEtaPhi)
Definition: HepMCTruthReader.cxx:67
HepMCTruthReader::HepMCTruthReader
HepMCTruthReader(const std::string &name, ISvcLocator *svcLoc)
Regular algorithm constructor.
Definition: HepMCTruthReader.cxx:20
McEventCollection.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
GenVertex_fwd.h
HepMCTruthReader::m_hepMCContainerKey
SG::ReadHandleKey< McEventCollection > m_hepMCContainerKey
The key of the input HepMC truth container.
Definition: HepMCTruthReader.h:36
GenEvent_fwd.h
HepMCTruthReader::execute
virtual StatusCode execute(const EventContext &ctx) const
Function executing the algorithm.
Definition: HepMCTruthReader.cxx:35
AthReentrantAlgorithm.h
HepMC::ConstGenParticlePtr
const GenParticle * ConstGenParticlePtr
Definition: GenParticle.h:38
HepMCTruthReader::initialize
virtual StatusCode initialize()
Function initialising the algorithm.
Definition: HepMCTruthReader.cxx:25
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
HepMCTruthReader::printVertex
static void printVertex(const HepMC::ConstGenVertexPtr &vtx, bool do4momPtEtaPhi)
Definition: HepMCTruthReader.cxx:87
HepMC::ConstGenVertexPtr
const HepMC::GenVertex * ConstGenVertexPtr
Definition: GenVertex.h:60