ATLAS Offline Software
McAodTupleWriterTool.h
Go to the documentation of this file.
1 
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
27 class ITHistSvc;
28 class TTree;
30 
31 class 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
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 
95  struct McAodParticles {
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  };
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
McAodTupleWriterTool::McAodParticles::m_status
std::array< int, s_nMax > m_status
Definition: McAodTupleWriterTool.h:103
McAodTupleWriterTool::setupBackend
void setupBackend(Gaudi::Details::PropertyBase &outputFileName)
Method to configure the back-end to write out the HepMC::GenEvent.
Definition: McAodTupleWriterTool.cxx:179
McAodTupleWriterTool::McAodParticles::m_etcone50
std::array< double, s_nMax > m_etcone50
Definition: McAodTupleWriterTool.h:111
McAodTupleWriterTool::McAodParticles::m_etcone20
std::array< double, s_nMax > m_etcone20
Definition: McAodTupleWriterTool.h:107
McAodTupleWriterTool::McAodParticles::m_etcone60
std::array< double, s_nMax > m_etcone60
Definition: McAodTupleWriterTool.h:112
McAodTupleWriterTool::McAodParticles::m_pdgId
std::array< int, s_nMax > m_pdgId
Definition: McAodTupleWriterTool.h:102
McAodTupleWriterTool::m_outputFileName
StringProperty m_outputFileName
Name of the output tuple file.
Definition: McAodTupleWriterTool.h:126
McAodTupleWriterTool::McAodParticles::m_py
std::array< double, s_nMax > m_py
Definition: McAodTupleWriterTool.h:98
McAodTupleWriterTool::m_tuple
TTree * m_tuple
cached pointer to the tuple
Definition: McAodTupleWriterTool.h:132
McAodTupleWriterTool::McAodParticles::m_etcone70
std::array< double, s_nMax > m_etcone70
Definition: McAodTupleWriterTool.h:113
McAodTupleWriterTool::McAodParticles::m_barcode
std::array< int, s_nMax > m_barcode
Definition: McAodTupleWriterTool.h:104
TruthParticleContainer
Definition: PhysicsAnalysis/TruthParticleID/McParticleEvent/McParticleEvent/TruthParticleContainer.h:42
McAodTupleWriterTool
Definition: McAodTupleWriterTool.h:33
McAodTupleWriterTool::McAodParticles::m_pz
std::array< double, s_nMax > m_pz
Definition: McAodTupleWriterTool.h:99
McAodTupleWriterTool::finalize
StatusCode finalize()
Definition: McAodTupleWriterTool.cxx:100
McAodTupleWriterTool::m_outputStreamName
StringProperty m_outputStreamName
Name of the output tuple stream.
Definition: McAodTupleWriterTool.h:129
McAodTupleWriterTool::McAodTupleWriterTool
McAodTupleWriterTool()
Default constructor:
McAodTupleWriterTool::s_nMax
static const int s_nMax
maximum number of particles per event
Definition: McAodTupleWriterTool.h:92
McAodTupleWriterTool::McAodParticles::m_ene
std::array< double, s_nMax > m_ene
Definition: McAodTupleWriterTool.h:101
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
McAodTupleWriterTool::bookTuple
void bookTuple()
book the tuple
Definition: McAodTupleWriterTool.cxx:213
AthAlgTool.h
McAodTupleWriterTool::McAodParticles::m_etcone10
std::array< double, s_nMax > m_etcone10
Definition: McAodTupleWriterTool.h:106
McAodTupleWriterTool::McAodParticles::m_m
std::array< double, s_nMax > m_m
Definition: McAodTupleWriterTool.h:100
test_pyathena.parent
parent
Definition: test_pyathena.py:15
McAodTupleWriterTool::McAodParticles
A simple representation of a TruthParticle.
Definition: McAodTupleWriterTool.h:95
McAodTupleWriterTool::initialize
StatusCode initialize()
Athena Algorithm's Hooks.
Definition: McAodTupleWriterTool.cxx:76
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
McAodTupleWriterTool::~McAodTupleWriterTool
virtual ~McAodTupleWriterTool()
Destructor:
Definition: McAodTupleWriterTool.cxx:68
McAodTupleWriterTool::m_tupleSvc
ServiceHandle< ITHistSvc > m_tupleSvc
Pointer to @ ITHistSvc.
Definition: McAodTupleWriterTool.h:119
McAodTupleWriterTool::McAodParticles::m_etcone40
std::array< double, s_nMax > m_etcone40
Definition: McAodTupleWriterTool.h:109
McAodTupleWriterTool::McAodParticles::m_nParticles
unsigned int m_nParticles
Definition: McAodTupleWriterTool.h:96
IIOMcAodTool.h
McAodTupleWriterTool::m_particles
McAodParticles m_particles
our cached particles
Definition: McAodTupleWriterTool.h:116
IIOMcAodTool
Definition: IIOMcAodTool.h:25
McAodTupleWriterTool::m_truthParticlesName
StringProperty m_truthParticlesName
Location of the TruthParticleContainer to be written out.
Definition: McAodTupleWriterTool.h:123
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
McAodTupleWriterTool::write
StatusCode write(const TruthParticleContainer *mcAod)
Process the TruthParticleContainer through the I/O backend.
Definition: McAodTupleWriterTool.cxx:134
McAodTupleWriterTool::McAodParticles::m_px
std::array< double, s_nMax > m_px
Definition: McAodTupleWriterTool.h:97
McAodTupleWriterTool::McAodParticles::m_etcone30
std::array< double, s_nMax > m_etcone30
Definition: McAodTupleWriterTool.h:108
AthAlgTool
Definition: AthAlgTool.h:26
McAodTupleWriterTool::McAodParticles::m_etcone45
std::array< double, s_nMax > m_etcone45
Definition: McAodTupleWriterTool.h:110
McAodTupleWriterTool::execute
StatusCode execute()
Definition: McAodTupleWriterTool.cxx:106
AthenaPoolExample_Copy.outputFileName
string outputFileName
Definition: AthenaPoolExample_Copy.py:40
ServiceHandle< ITHistSvc >