ATLAS Offline Software
Loading...
Searching...
No Matches
HepMcReaderTool.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// HepMcReaderTool.h
6// Header file for class HepMcReaderTool
7// Author: S.Binet<binet@cern.ch>
9#ifndef MCPARTICLETOOLS_HEPMCREADERTOOL_H
10#define MCPARTICLETOOLS_HEPMCREADERTOOL_H 1
11
12// STL includes
13#include <string>
14
15// FrameWork includes
16#include "GaudiKernel/ServiceHandle.h"
18
19// McParticleKernel includes
21
22// Forward declaration
25#ifdef HEPMC3
26#include "HepMC3/Reader.h"
27#include "HepMC3/ReaderAsciiHepMC2.h"
28#endif
29
30class HepMcReaderTool : public extends<AthAlgTool, IIOHepMcTool>
31{
32
34 // Public methods:
36 public:
37
38 // Copy constructor:
39
41 HepMcReaderTool( const std::string& type, const std::string& name, const IInterface* parent );
42
44 virtual ~HepMcReaderTool();
45
46 // Athena algorithm's Hooks
47 StatusCode initialize();
48 StatusCode execute();
49 StatusCode finalize();
50
52 // Non-const methods:
54
57 StatusCode read( HepMC::GenEvent* evt );
58
60 // Protected methods:
62 protected:
63
67
71 void setupFrontend( Gaudi::Details::PropertyBase& ioFrontendURL );
72
74 // Protected data:
76 protected:
77
83 StringProperty m_ioFrontendURL;
84
87 StringProperty m_mcEventsOutputName;
88
91#ifdef HEPMC3
92 HepMC3::Reader* m_ioFrontend;
93#else
94 HepMC::IO_BaseClass* m_ioFrontend;
95#endif
96
97};
98#endif //> MCPARTICLETOOLS_HEPMCREADERTOOL_H
void setupFrontend(Gaudi::Details::PropertyBase &ioFrontendURL)
Method to configure the front-end to read out the HepMC::GenEvent.
StatusCode initialize()
Athena Algorithm's Hooks.
StringProperty m_mcEventsOutputName
Location of the McEventCollection to be read out.
StatusCode read(HepMC::GenEvent *evt)
Process the HepMC::GenEvent through the I/O frontend.
StringProperty m_ioFrontendURL
URL of the I/O front-end (only "ASCII" for now...) glued with the name of the input file name.
StatusCode finalize()
StatusCode execute()
HepMcReaderTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
HepMC::IO_BaseClass * m_ioFrontend
Abstract base class for the back-end.
virtual ~HepMcReaderTool()
Destructor:
HepMcReaderTool()
Default constructor: