|
ATLAS Offline Software
|
Go to the documentation of this file.
12 #include "GaudiKernel/ITHistSvc.h"
13 #include "Gaudi/Property.h"
14 #include "GaudiKernel/GaudiException.h"
21 #include "CLHEP/Units/SystemOfUnits.h"
29 const std::string&
name,
30 const IInterface*
parent ) :
32 m_tupleSvc (
"THistSvc",
name ),
41 "Name of the output file which will contain the HepMC tuple"
47 "Name of the stream which will contain the HepMC tuple"
52 "Input location of the McEventCollection to write out" );
54 declareInterface<IIOHepMcTool>(
this);
73 return StatusCode::FAILURE;
79 return StatusCode::FAILURE;
88 return StatusCode::SUCCESS;
94 return StatusCode::SUCCESS;
103 return StatusCode::FAILURE;
106 if ( mcEvts->
empty() ) {
108 return StatusCode::FAILURE;
111 const HepMC::GenEvent *
evt = mcEvts->
front();
113 ATH_MSG_ERROR(
"Retrieved NULL pointer to HepMC::GenEvent !!");
114 return StatusCode::FAILURE;
128 for (
const auto&
p: *
evt)
132 const HepMC::FourVector
mom =
p->momentum();
146 return StatusCode::SUCCESS;
158 throw GaudiException(
"Could not retrieve THistSvc",
name(), StatusCode::FAILURE );
163 const std::string
propName =
"Output";
167 updatedProp.push_back
175 throw GaudiException(
"Could not configure THistSvc output file !!",
name(), StatusCode::FAILURE );
183 TTree*
t =
new TTree(
"hepmc",
"HepMC validation tuple");
185 ATH_MSG_ERROR(
"Could not register HepMC validation tuple !!");
186 delete t;
t =
nullptr;
187 throw GaudiException(
"Could not register HepMC validation tuple !!",
name(), StatusCode::FAILURE );
def retrieve(aClass, aKey=None)
std::array< double, s_nMax > m_ene
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
std::array< int, s_nMax > m_pdgId
std::array< double, s_nMax > m_py
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
::StatusCode StatusCode
StatusCode definition for legacy code.
const T * front() const
Access the first element in the collection as an rvalue.
This defines the McEventCollection, which is really just an ObjectVector of McEvent objects.
std::array< double, s_nMax > m_m
#define ATH_MSG_WARNING(x)
std::array< double, s_nMax > m_pz
std::array< int, s_nMax > m_barcode
std::array< double, s_nMax > m_px
bool empty() const noexcept
Returns true if the collection is empty.
std::array< int, s_nMax > m_status