ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Generators
TruthIO
src
HepMcTupleWriterTool.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
// HepMcTupleWriterTool.h
6
// Header file for class HepMcTupleWriterTool
7
// Author: S.Binet<binet@cern.ch>
9
#ifndef MCPARTICLETOOLS_HEPMCTUPLEWRITERTOOL_H
10
#define MCPARTICLETOOLS_HEPMCTUPLEWRITERTOOL_H
11
12
// STL includes
13
#include <string>
14
15
16
#include <array>
17
18
// FrameWork includes
19
#include "GaudiKernel/ServiceHandle.h"
20
#include "
AthenaBaseComps/AthAlgTool.h
"
21
22
// McParticleKernel includes
23
#include "
TruthIO/IIOHepMcTool.h
"
24
25
// Forward declaration
26
class
ITHistSvc;
27
class
TTree;
28
#include "
AtlasHepMC/GenEvent_fwd.h
"
29
30
class
HepMcTupleWriterTool
:
public
extends<AthAlgTool, IIOHepMcTool>
31
{
32
33
public
:
34
36
HepMcTupleWriterTool
(
const
std::string&
type
,
const
std::string& name,
const
IInterface* parent );
37
39
virtual
~HepMcTupleWriterTool
();
40
41
// Athena algorithm's Hooks
42
StatusCode
initialize
();
43
StatusCode
execute
();
44
StatusCode
finalize
();
45
46
49
StatusCode
write
(
const
HepMC::GenEvent
* evt );
50
51
protected
:
52
55
HepMcTupleWriterTool
();
56
60
void
setupBackend
( Gaudi::Details::PropertyBase&
outputFileName
);
61
65
void
bookTuple
();
66
67
protected
:
68
70
static
const
int
s_nMax
= 2000;
71
73
struct
HepMcParticles
{
74
int
m_nParticles
;
75
std::array<double, s_nMax>
m_px
;
76
std::array<double, s_nMax>
m_py
;
77
std::array<double, s_nMax>
m_pz
;
78
std::array<double, s_nMax>
m_m
;
79
std::array<double, s_nMax>
m_ene
;
80
std::array<int, s_nMax>
m_pdgId
;
81
std::array<int, s_nMax>
m_status
;
82
std::array<int, s_nMax>
m_barcode
;
83
};
84
85
HepMcParticles
m_particles
{};
86
88
ServiceHandle<ITHistSvc>
m_tupleSvc
;
89
94
StringProperty
m_mcEventsName
;
95
97
StringProperty
m_outputFileName
;
98
100
StringProperty
m_outputStreamName
;
101
103
TTree*
m_tuple
;
104
};
105
106
#endif
//> MCPARTICLETOOLS_HEPMCTUPLEWRITERTOOL_H
AthAlgTool.h
GenEvent_fwd.h
IIOHepMcTool.h
outputFileName
static const std::string outputFileName
Definition
ProduceDummyStripCabling.cxx:17
HepMcTupleWriterTool::write
StatusCode write(const HepMC::GenEvent *evt)
Process the HepMC::GenEvent through the I/O backend.
Definition
HepMcTupleWriterTool.cxx:122
HepMcTupleWriterTool::m_tuple
TTree * m_tuple
cached pointer to the tuple
Definition
HepMcTupleWriterTool.h:103
HepMcTupleWriterTool::m_outputStreamName
StringProperty m_outputStreamName
Name of the output tuple stream.
Definition
HepMcTupleWriterTool.h:100
HepMcTupleWriterTool::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
HepMcTupleWriterTool.h:94
HepMcTupleWriterTool::finalize
StatusCode finalize()
Definition
HepMcTupleWriterTool.cxx:89
HepMcTupleWriterTool::m_outputFileName
StringProperty m_outputFileName
Name of the output tuple file.
Definition
HepMcTupleWriterTool.h:97
HepMcTupleWriterTool::s_nMax
static const int s_nMax
maximum number of particles per event
Definition
HepMcTupleWriterTool.h:70
HepMcTupleWriterTool::setupBackend
void setupBackend(Gaudi::Details::PropertyBase &outputFileName)
Method to configure the back-end to write out the HepMC::GenEvent.
Definition
HepMcTupleWriterTool.cxx:151
HepMcTupleWriterTool::bookTuple
void bookTuple()
book the tuple
Definition
HepMcTupleWriterTool.cxx:178
HepMcTupleWriterTool::m_tupleSvc
ServiceHandle< ITHistSvc > m_tupleSvc
Pointer to @ ITHistSvc.
Definition
HepMcTupleWriterTool.h:88
HepMcTupleWriterTool::m_particles
HepMcParticles m_particles
our cached particles
Definition
HepMcTupleWriterTool.h:85
HepMcTupleWriterTool::HepMcTupleWriterTool
HepMcTupleWriterTool()
Default constructor:
HepMcTupleWriterTool::HepMcTupleWriterTool
HepMcTupleWriterTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Definition
HepMcTupleWriterTool.cxx:28
HepMcTupleWriterTool::initialize
StatusCode initialize()
Athena Algorithm's Hooks.
Definition
HepMcTupleWriterTool.cxx:64
HepMcTupleWriterTool::~HepMcTupleWriterTool
virtual ~HepMcTupleWriterTool()
Destructor:
Definition
HepMcTupleWriterTool.cxx:57
HepMcTupleWriterTool::execute
StatusCode execute()
Definition
HepMcTupleWriterTool.cxx:95
ServiceHandle
Definition
ClusterMakerTool.h:36
HepMC::GenEvent
HepMC3::GenEvent GenEvent
Definition
GenEvent.h:39
type
HepMcTupleWriterTool::HepMcParticles
A simple representation of a HepMc particle.
Definition
HepMcTupleWriterTool.h:73
HepMcTupleWriterTool::HepMcParticles::m_py
std::array< double, s_nMax > m_py
Definition
HepMcTupleWriterTool.h:76
HepMcTupleWriterTool::HepMcParticles::m_status
std::array< int, s_nMax > m_status
Definition
HepMcTupleWriterTool.h:81
HepMcTupleWriterTool::HepMcParticles::m_px
std::array< double, s_nMax > m_px
Definition
HepMcTupleWriterTool.h:75
HepMcTupleWriterTool::HepMcParticles::m_pz
std::array< double, s_nMax > m_pz
Definition
HepMcTupleWriterTool.h:77
HepMcTupleWriterTool::HepMcParticles::m_ene
std::array< double, s_nMax > m_ene
Definition
HepMcTupleWriterTool.h:79
HepMcTupleWriterTool::HepMcParticles::m_nParticles
int m_nParticles
Definition
HepMcTupleWriterTool.h:74
HepMcTupleWriterTool::HepMcParticles::m_pdgId
std::array< int, s_nMax > m_pdgId
Definition
HepMcTupleWriterTool.h:80
HepMcTupleWriterTool::HepMcParticles::m_m
std::array< double, s_nMax > m_m
Definition
HepMcTupleWriterTool.h:78
HepMcTupleWriterTool::HepMcParticles::m_barcode
std::array< int, s_nMax > m_barcode
Definition
HepMcTupleWriterTool.h:82
Generated on
for ATLAS Offline Software by
1.17.0