16#include "GaudiKernel/ITHistSvc.h"
17#include "Gaudi/Property.h"
18#include "GaudiKernel/GaudiException.h"
36 const std::string& name,
37 const IInterface* parent ) :
48 "Name of the output file which will contain the McAod "
49 "tuple. Ex: mcaod.root" );
55 "Name of the stream which will contain the McAod tuple. "
60 "Input location of the TruthParticleContainer to write "
63 declareInterface<IIOMcAodTool>(
this);
80 if ( !
evtStore().retrieve().isSuccess() ) {
82 return StatusCode::FAILURE;
88 return StatusCode::FAILURE;
97 return StatusCode::SUCCESS;
103 return StatusCode::SUCCESS;
112 ATH_MSG_ERROR(
"Could not retrieve a TruthParticleContainer at ["
114 return StatusCode::FAILURE;
120 return StatusCode::FAILURE;
137 for ( std::size_t i = 0; i !=
m_particles.m_nParticles; ++i ) {
164 return StatusCode::SUCCESS;
183 throw GaudiException(
"Could not retrieve THistSvc",
185 StatusCode::FAILURE );
191 const std::string propName =
"Output";
195 updatedProp.push_back
203 ATH_MSG_ERROR(
"Could not configure the THistSvc's output filename ["
205 throw GaudiException(
"Could not configure THistSvc output file !!",
207 StatusCode::FAILURE );
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 );
226 t->Branch(
"nParts", &
m_particles.m_nParticles,
"nParts/i" );
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" );
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" );
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" );
#define ATH_MSG_WARNING(x)
static const std::string outputFileName
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ServiceHandle< StoreGateSvc > & evtStore()
(HepMC) Monte Carlo particle.