ATLAS Offline Software
WriteHepMC.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 TRUTHIO_WRITEHEPMC_H
6 #define TRUTHIO_WRITEHEPMC_H
7 
10 #include <memory>
11 
12 
14 class WriteHepMC : public GenBase {
15 public:
16 
17  WriteHepMC(const std::string& name, ISvcLocator* pSvcLocator);
20 
21  std::string m_outfile;
22  int m_precision{8};
23  std::string m_format;
24  std::string m_units;
25 
26 #ifdef HEPMC3
27  std::unique_ptr<HepMC3::Writer> m_hepmcio;
28  HepMC3::Units::MomentumUnit m_momentumunit{};
29  HepMC3::Units::LengthUnit m_lengthunit{};
30 #else
31  std::unique_ptr<HepMC::IO_GenEvent> m_hepmcio;
32  HepMC::Units::MomentumUnit m_momentumunit{};
33  HepMC::Units::LengthUnit m_lengthunit{};
34 #endif
35 };
36 
37 #endif
WriteHepMC::m_lengthunit
HepMC::Units::LengthUnit m_lengthunit
Definition: WriteHepMC.h:33
WriteHepMC
Write the MC event record to file in IO_GenEvent text format.
Definition: WriteHepMC.h:14
IO_GenEvent.h
WriteHepMC::m_outfile
std::string m_outfile
Definition: WriteHepMC.h:21
WriteHepMC::m_format
std::string m_format
Definition: WriteHepMC.h:23
WriteHepMC::m_hepmcio
std::unique_ptr< HepMC::IO_GenEvent > m_hepmcio
Definition: WriteHepMC.h:31
WriteHepMC::m_precision
int m_precision
Definition: WriteHepMC.h:22
WriteHepMC::m_momentumunit
HepMC::Units::MomentumUnit m_momentumunit
Definition: WriteHepMC.h:32
GenBase
Base class for common behaviour of MC truth algorithms.
Definition: GenBase.h:47
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
GenBase.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
WriteHepMC::WriteHepMC
WriteHepMC(const std::string &name, ISvcLocator *pSvcLocator)
Definition: WriteHepMC.cxx:10
WriteHepMC::initialize
StatusCode initialize()
Definition: WriteHepMC.cxx:20
WriteHepMC::execute
StatusCode execute()
Definition: WriteHepMC.cxx:48
WriteHepMC::m_units
std::string m_units
Definition: WriteHepMC.h:24