ATLAS Offline Software
Loading...
Searching...
No Matches
McAodTupleWriterTool.h
Go to the documentation of this file.
1
2
3/*
4 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
5*/
6
7// McAodTupleWriterTool.h
8// Header file for class McAodTupleWriterTool
9// Author: S.Binet<binet@cern.ch>
11#ifndef MCPARTICLETOOLS_MCAODTUPLEWRITERTOOL_H
12#define MCPARTICLETOOLS_MCAODTUPLEWRITERTOOL_H
13
14// STL includes
15#include <string>
16
17#include <array>
18
19// FrameWork includes
20#include "GaudiKernel/ServiceHandle.h"
22
23// McParticleKernel includes
25
26// Forward declaration
27class ITHistSvc;
28class TTree;
30
31class McAodTupleWriterTool : virtual public IIOMcAodTool,
32 public AthAlgTool
33{
34
36 // Public methods:
38 public:
39
40 // Copy constructor:
41
43 McAodTupleWriterTool( const std::string& type,
44 const std::string& name,
45 const IInterface* parent );
46
48 virtual ~McAodTupleWriterTool();
49
50 // Athena algorithm's Hooks
51 StatusCode initialize();
52 StatusCode execute();
53 StatusCode finalize();
54
56 // Const methods:
58
60 // Non-const methods:
62
65 StatusCode write( const TruthParticleContainer* mcAod );
66
68 // Protected methods:
70 protected:
71
75
79 void setupBackend( Gaudi::Details::PropertyBase& outputFileName );
80
84 void bookTuple();
85
87 // Protected data:
89 protected:
90
92 static const int s_nMax = 2000;
93
96 unsigned int m_nParticles;
97 std::array<double, s_nMax> m_px;
98 std::array<double, s_nMax> m_py;
99 std::array<double, s_nMax> m_pz;
100 std::array<double, s_nMax> m_m;
101 std::array<double, s_nMax> m_ene;
102 std::array<int, s_nMax> m_pdgId;
103 std::array<int, s_nMax> m_status;
104 std::array<int, s_nMax> m_barcode;
105 // et isolation stuff
106 std::array<double, s_nMax> m_etcone10;
107 std::array<double, s_nMax> m_etcone20;
108 std::array<double, s_nMax> m_etcone30;
109 std::array<double, s_nMax> m_etcone40;
110 std::array<double, s_nMax> m_etcone45;
111 std::array<double, s_nMax> m_etcone50;
112 std::array<double, s_nMax> m_etcone60;
113 std::array<double, s_nMax> m_etcone70;
114 };
115
117
120
123 StringProperty m_truthParticlesName;
124
126 StringProperty m_outputFileName;
127
129 StringProperty m_outputStreamName;
130
132 TTree* m_tuple;
133};
134
137
141
142#endif //> MCPARTICLETOOLS_MCAODTUPLEWRITERTOOL_H
static const std::string outputFileName
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
StatusCode write(const TruthParticleContainer *mcAod)
Process the TruthParticleContainer through the I/O backend.
virtual ~McAodTupleWriterTool()
Destructor:
McAodParticles m_particles
our cached particles
TTree * m_tuple
cached pointer to the tuple
McAodTupleWriterTool()
Default constructor:
McAodTupleWriterTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
StringProperty m_outputStreamName
Name of the output tuple stream.
static const int s_nMax
maximum number of particles per event
StringProperty m_outputFileName
Name of the output tuple file.
ServiceHandle< ITHistSvc > m_tupleSvc
Pointer to @ ITHistSvc.
StringProperty m_truthParticlesName
Location of the TruthParticleContainer to be written out.
void setupBackend(Gaudi::Details::PropertyBase &outputFileName)
Method to configure the back-end to write out the HepMC::GenEvent.
void bookTuple()
book the tuple
StatusCode initialize()
Athena Algorithm's Hooks.
A simple representation of a TruthParticle.
std::array< double, s_nMax > m_etcone70
std::array< double, s_nMax > m_etcone30
std::array< double, s_nMax > m_etcone40
std::array< double, s_nMax > m_etcone60
std::array< double, s_nMax > m_etcone45
std::array< double, s_nMax > m_etcone50
std::array< double, s_nMax > m_etcone20
std::array< double, s_nMax > m_etcone10