#include <McAodTupleWriterTool.h>
|
| static const InterfaceID & | interfaceID () |
| | Inline methods:
|
|
| static const int | s_nMax = 2000 |
| | maximum number of particles per event
|
Definition at line 31 of file McAodTupleWriterTool.h.
◆ StoreGateSvc_t
◆ McAodTupleWriterTool() [1/2]
| McAodTupleWriterTool::McAodTupleWriterTool |
( |
const std::string & | type, |
|
|
const std::string & | name, |
|
|
const IInterface * | parent ) |
Constructor with parameters:
Public methods:
Constructors
Definition at line 35 of file McAodTupleWriterTool.cxx.
37 :
41{
42
43
44
45
48 "Name of the output file which will contain the McAod "
49 "tuple. Ex: mcaod.root" );
51 this );
52
55 "Name of the stream which will contain the McAod tuple. "
56 "Ex: mcaod" );
57
60 "Input location of the TruthParticleContainer to write "
61 "out." );
62
63 declareInterface<IIOMcAodTool>(this);
64}
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
◆ ~McAodTupleWriterTool()
| McAodTupleWriterTool::~McAodTupleWriterTool |
( |
| ) |
|
|
virtual |
◆ McAodTupleWriterTool() [2/2]
| McAodTupleWriterTool::McAodTupleWriterTool |
( |
| ) |
|
|
protected |
◆ bookTuple()
| void McAodTupleWriterTool::bookTuple |
( |
| ) |
|
|
protected |
book the tuple
Definition at line 212 of file McAodTupleWriterTool.cxx.
213{
216 TTree*
t =
new TTree(
"mcaod",
"McAod validation tuple");
217 if ( !
m_tupleSvc->regTree(
"/" + streamName +
"/mcaod", t ).isSuccess() ) {
218 ATH_MSG_ERROR(
"Could not register McAod validation tuple !!");
219 delete t;
t =
nullptr;
220 throw GaudiException( "Could not register McAod validation tuple !!",
222 StatusCode::FAILURE );
223 }
224
225
226 t->Branch(
"nParts", &
m_particles.m_nParticles,
"nParts/i" );
227
228 t->Branch(
"px",
m_particles.m_px.data(),
"px[nParts]/D" );
229 t->Branch(
"py",
m_particles.m_py.data(),
"py[nParts]/D" );
230 t->Branch(
"pz",
m_particles.m_pz.data(),
"pz[nParts]/D" );
231 t->Branch(
"m",
m_particles.m_m.data(),
"m[nParts]/D" );
232 t->Branch(
"e",
m_particles.m_ene.data(),
"e[nParts]/D" );
233
234 t->Branch(
"pdgId",
m_particles.m_pdgId.data(),
"pdgId[nParts]/I" );
235 t->Branch(
"sc",
m_particles.m_status.data(),
"sc[nParts]/I" );
236 t->Branch(
"bc",
m_particles.m_barcode.data(),
"bc[nParts]/I" );
237
238 t->Branch(
"etcone10",
m_particles.m_etcone10.data(),
"etcone10[nParts]/D" );
239 t->Branch(
"etcone20",
m_particles.m_etcone20.data(),
"etcone20[nParts]/D" );
240 t->Branch(
"etcone30",
m_particles.m_etcone30.data(),
"etcone30[nParts]/D" );
241 t->Branch(
"etcone40",
m_particles.m_etcone40.data(),
"etcone40[nParts]/D" );
242 t->Branch(
"etcone45",
m_particles.m_etcone45.data(),
"etcone45[nParts]/D" );
243 t->Branch(
"etcone50",
m_particles.m_etcone50.data(),
"etcone50[nParts]/D" );
244 t->Branch(
"etcone60",
m_particles.m_etcone60.data(),
"etcone60[nParts]/D" );
245 t->Branch(
"etcone70",
m_particles.m_etcone70.data(),
"etcone70[nParts]/D" );
246
248}
◆ declareGaudiProperty()
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
158 {
161 hndl.documentation());
162
163 }
◆ declareProperty()
Definition at line 145 of file AthCommonDataStore.h.
145 {
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
◆ detStore()
◆ evtStore()
◆ execute()
| StatusCode McAodTupleWriterTool::execute |
( |
| ) |
|
|
virtual |
Implements IIOMcAodTool.
Definition at line 106 of file McAodTupleWriterTool.cxx.
107{
108
111 nullptr == mc ) {
112 ATH_MSG_ERROR(
"Could not retrieve a TruthParticleContainer at ["
114 return StatusCode::FAILURE;
115 }
116
119 << "] is EMPTY !!");
120 return StatusCode::FAILURE;
121 }
122
124}
#define ATH_MSG_WARNING(x)
Athena::TPCnvVers::Current TruthParticleContainer
ServiceHandle< StoreGateSvc > & evtStore()
retrieve(aClass, aKey=None)
◆ extraDeps_update_handler()
Add StoreName to extra input/output deps as needed.
use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given
◆ finalize()
| StatusCode McAodTupleWriterTool::finalize |
( |
| ) |
|
|
virtual |
◆ initialize()
| StatusCode McAodTupleWriterTool::initialize |
( |
| ) |
|
|
virtual |
Athena Algorithm's Hooks.
Implements IIOMcAodTool.
Definition at line 76 of file McAodTupleWriterTool.cxx.
77{
79
82 return StatusCode::FAILURE;
83 }
84
85
88 return StatusCode::FAILURE;
89 }
90
91
93
94
96
97 return StatusCode::SUCCESS;
98}
◆ inputHandles()
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ interfaceID()
| const InterfaceID & IIOMcAodTool::interfaceID |
( |
| ) |
|
|
inlinestaticinherited |
◆ msg()
◆ msgLvl()
| bool AthCommonMsg< AlgTool >::msgLvl |
( |
const MSG::Level | lvl | ) |
const |
|
inlineinherited |
◆ outputHandles()
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ renounce()
Definition at line 380 of file AthCommonDataStore.h.
381 {
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)
◆ renounceArray()
◆ setupBackend()
| void McAodTupleWriterTool::setupBackend |
( |
Gaudi::Details::PropertyBase & | outputFileName | ) |
|
|
protected |
Method to configure the back-end to write out the HepMC::GenEvent.
Protected methods:
Const methods: Non-const methods:
Definition at line 179 of file McAodTupleWriterTool.cxx.
180{
183 throw GaudiException( "Could not retrieve THistSvc",
185 StatusCode::FAILURE );
186 }
187
190
191 const std::string
propName =
"Output";
195 updatedProp.push_back
197 "TYP='ROOT' "
198 "OPT='RECREATE'"
199 );
203 ATH_MSG_ERROR(
"Could not configure the THistSvc's output filename ["
205 throw GaudiException( "Could not configure THistSvc output file !!",
207 StatusCode::FAILURE );
208 }
209
210 }
static const std::string outputFileName
◆ sysInitialize()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
Definition at line 308 of file AthCommonDataStore.h.
308 {
309
310
313 for (
auto k :
keys) {
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka
◆ write()
Process the TruthParticleContainer through the I/O backend.
Const methods:
Non-const methods:
Definition at line 134 of file McAodTupleWriterTool.cxx.
135{
137 for ( std::size_t i = 0;
i !=
m_particles.m_nParticles; ++
i ) {
144
148
149 using namespace TruthParticleParameters;
150
159 }
160
161
163
164 return StatusCode::SUCCESS;
165}
TruthParticle_v1 TruthParticle
Typedef to implementation.
◆ m_detStore
◆ m_evtStore
◆ m_outputFileName
| StringProperty McAodTupleWriterTool::m_outputFileName |
|
protected |
◆ m_outputStreamName
| StringProperty McAodTupleWriterTool::m_outputStreamName |
|
protected |
◆ m_particles
◆ m_truthParticlesName
| StringProperty McAodTupleWriterTool::m_truthParticlesName |
|
protected |
◆ m_tuple
| TTree* McAodTupleWriterTool::m_tuple |
|
protected |
◆ m_tupleSvc
◆ m_varHandleArraysDeclared
◆ m_vhka
◆ s_nMax
| const int McAodTupleWriterTool::s_nMax = 2000 |
|
staticprotected |
The documentation for this class was generated from the following files: