ATLAS Offline Software
HepMCTruthReader.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef HEPMCTRUTHREADER_H
6 #define HEPMCTRUTHREADER_H
7 
9 
14 
15 
19 public:
20 
22  HepMCTruthReader(const std::string& name, ISvcLocator* svcLoc);
23 
25  virtual StatusCode initialize();
26 
28  virtual StatusCode execute(const EventContext& ctx) const;
29 
30 
31 private:
32 
35  this, "HepMCContainerKey", "GEN_EVENT", "The input McEvenCollection"};
36 
38  Gaudi::Property<bool> m_do4momPtEtaPhi{this, "Do4momPtEtaPhi", false};
39 
40  static void printEvent(const HepMC::GenEvent* evt, bool do4momPtEtaPhi);
41  static void printVertex(const HepMC::ConstGenVertexPtr& vtx, bool do4momPtEtaPhi );
42  static void printParticle(const HepMC::ConstGenParticlePtr& part, bool do4momPtEtaPhi);
43 
44 }; // class HepMCTruthReader
45 
46 
47 
48 #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:18
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:83
HepMCTruthReader::m_do4momPtEtaPhi
Gaudi::Property< bool > m_do4momPtEtaPhi
Flag to printout in pt,eta,phi instead of px,py,pz.
Definition: HepMCTruthReader.h:38
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
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:34
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:228
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