ATLAS Offline Software
Loading...
Searching...
No Matches
HepMcWriterTool.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// 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
21
22// Forward declaration
25class HepMcWriterTool : public extends<AthAlgTool, IIOHepMcTool>
26{
27
28 public:
29
31 HepMcWriterTool( const std::string& type, const std::string& name, const IInterface* parent );
32
34 virtual ~HepMcWriterTool();
35
36 // Athena algorithm's Hooks
37 StatusCode initialize();
38 StatusCode execute();
39 StatusCode finalize();
40
43 StatusCode write( const HepMC::GenEvent* evt );
44
45 protected:
46
50
54 void setupBackend( Gaudi::Details::PropertyBase& ioBackendURL );
55
56 protected:
57
63 StringProperty m_ioBackendURL;
64
69 StringProperty m_mcEventsName;
70
73 std::shared_ptr<HepMC3::Writer> m_ioBackend{nullptr};
74
75};
76#endif //> MCPARTICLETOOLS_HEPMCWRITERTOOL_H
StatusCode finalize()
StringProperty m_ioBackendURL
URL of the I/O back-end (only "ASCII" for now...) glued with the name of the output file name.
HepMcWriterTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
std::shared_ptr< HepMC3::Writer > m_ioBackend
Abstract base class for the back-end.
StatusCode write(const HepMC::GenEvent *evt)
Process the HepMC::GenEvent through the I/O backend.
HepMcWriterTool()
Default constructor:
StatusCode execute()
virtual ~HepMcWriterTool()
Destructor:
StringProperty m_mcEventsName
Location of the McEventCollection to be written out If there is more than 1 HepMC::GenEvent in the Mc...
void setupBackend(Gaudi::Details::PropertyBase &ioBackendURL)
Method to configure the back-end to write out the HepMC::GenEvent.
StatusCode initialize()
Athena Algorithm's Hooks.
HepMC3::GenEvent GenEvent
Definition GenEvent.h:39