ATLAS Offline Software
HepMcWriterTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // HepMcWriterTool.h
6 // Header file for class HepMcWriterTool
7 // Author: S.Binet<binet@cern.ch>
9 #ifndef MCPARTICLETOOLS_HEPMCWRITERTOOL_H
10 #define MCPARTICLETOOLS_HEPMCWRITERTOOL_H
11 
12 // STL includes
13 #include <string>
14 
15 // FrameWork includes
16 #include "GaudiKernel/ServiceHandle.h"
18 
19 // McParticleKernel includes
20 #include "TruthIO/IIOHepMcTool.h"
21 
22 // Forward declaration
25 #ifdef HEPMC3
26 #include "HepMC3/Writer.h"
27 #include "HepMC3/WriterAsciiHepMC2.h"
28 #endif
29 class HepMcWriterTool : virtual public IIOHepMcTool, public AthAlgTool
30 {
31 
33  // Public methods:
35  public:
36 
37  // Copy constructor:
38 
40  HepMcWriterTool( const std::string& type, const std::string& name, const IInterface* parent );
41 
43  virtual ~HepMcWriterTool();
44 
45  // Athena algorithm's Hooks
49 
51  // Non-const methods:
53 
56  StatusCode write( const HepMC::GenEvent* evt );
57 
59  // Protected methods:
61  protected:
62 
66 
70  void setupBackend( Gaudi::Details::PropertyBase& ioBackendURL );
71 
73  // Protected data:
75  protected:
76 
82  StringProperty m_ioBackendURL;
83 
88  StringProperty m_mcEventsName;
89 
92 #ifdef HEPMC3
94 #else
95  HepMC::IO_BaseClass* m_ioBackend;
96 #endif
97 
98 };
99 #endif //> MCPARTICLETOOLS_HEPMCWRITERTOOL_H
HepMcWriterTool::initialize
StatusCode initialize()
Athena Algorithm's Hooks.
Definition: HepMcWriterTool.cxx:63
HepMcWriterTool::finalize
StatusCode finalize()
Definition: HepMcWriterTool.cxx:81
LArG4FSStartPointFilter.evt
evt
Definition: LArG4FSStartPointFilter.py:42
HepMcWriterTool::~HepMcWriterTool
virtual ~HepMcWriterTool()
Destructor:
Definition: HepMcWriterTool.cxx:51
HepMcWriterTool::m_ioBackendURL
StringProperty m_ioBackendURL
URL of the I/O back-end (only "ASCII" for now...) glued with the name of the output file name.
Definition: HepMcWriterTool.h:82
IIOHepMcTool
Definition: IIOHepMcTool.h:25
HepMcWriterTool::m_mcEventsName
StringProperty m_mcEventsName
Location of the McEventCollection to be written out If there is more than 1 HepMC::GenEvent in the Mc...
Definition: HepMcWriterTool.h:88
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthAlgTool.h
GenEvent_fwd.h
test_pyathena.parent
parent
Definition: test_pyathena.py:15
HepMcWriterTool::HepMcWriterTool
HepMcWriterTool()
Default constructor:
HepMcWriterTool::setupBackend
void setupBackend(Gaudi::Details::PropertyBase &ioBackendURL)
Method to configure the back-end to write out the HepMC::GenEvent.
Definition: HepMcWriterTool.cxx:124
IIOHepMcTool.h
IO_BaseClass.h
HepMcWriterTool::m_ioBackend
HepMC::IO_BaseClass * m_ioBackend
Abstract base class for the back-end.
Definition: HepMcWriterTool.h:95
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
HepMcWriterTool::write
StatusCode write(const HepMC::GenEvent *evt)
Process the HepMC::GenEvent through the I/O backend.
Definition: HepMcWriterTool.cxx:114
HepMcWriterTool::execute
StatusCode execute()
Definition: HepMcWriterTool.cxx:87
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
AthAlgTool
Definition: AthAlgTool.h:26
HepMcWriterTool
Definition: HepMcWriterTool.h:30