|
ATLAS Offline Software
|
#include <HepMcTupleWriterTool.h>
|
| HepMcTupleWriterTool (const std::string &type, const std::string &name, const IInterface *parent) |
| Constructor with parameters: More...
|
|
virtual | ~HepMcTupleWriterTool () |
| Destructor: More...
|
|
StatusCode | initialize () |
| Athena Algorithm's Hooks. More...
|
|
StatusCode | execute () |
|
StatusCode | finalize () |
|
StatusCode | write (const HepMC::GenEvent *evt) |
| Process the HepMC::GenEvent through the I/O backend. More...
|
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysInitialize () override |
| Perform system initialization for an algorithm. More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
Definition at line 30 of file HepMcTupleWriterTool.h.
◆ StoreGateSvc_t
◆ HepMcTupleWriterTool() [1/2]
HepMcTupleWriterTool::HepMcTupleWriterTool |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
Constructor with parameters:
Constructors.
Definition at line 28 of file HepMcTupleWriterTool.cxx.
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);
◆ ~HepMcTupleWriterTool()
HepMcTupleWriterTool::~HepMcTupleWriterTool |
( |
| ) |
|
|
virtual |
◆ HepMcTupleWriterTool() [2/2]
HepMcTupleWriterTool::HepMcTupleWriterTool |
( |
| ) |
|
|
protected |
◆ bookTuple()
void HepMcTupleWriterTool::bookTuple |
( |
| ) |
|
|
protected |
book the tuple
Definition at line 180 of file HepMcTupleWriterTool.cxx.
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 );
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ execute()
StatusCode HepMcTupleWriterTool::execute |
( |
| ) |
|
|
virtual |
Implements IIOHepMcTool.
Definition at line 97 of file HepMcTupleWriterTool.cxx.
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;
◆ 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 HepMcTupleWriterTool::finalize |
( |
| ) |
|
|
virtual |
◆ initialize()
StatusCode HepMcTupleWriterTool::initialize |
( |
| ) |
|
|
virtual |
◆ 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 & IIOHepMcTool::interfaceID |
( |
| ) |
|
|
inlinestaticinherited |
I/O operators.
Inline methods:
Definition at line 64 of file IIOHepMcTool.h.
66 return IID_IIOHepMcTool;
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ 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()
◆ renounceArray()
◆ setupBackend()
void HepMcTupleWriterTool::setupBackend |
( |
Gaudi::Details::PropertyBase & |
outputFileName | ) |
|
|
protected |
Method to configure the back-end to write out the HepMC::GenEvent
.
Non-const methods:
Definition at line 153 of file HepMcTupleWriterTool.cxx.
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 );
◆ 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()
◆ write()
StatusCode HepMcTupleWriterTool::write |
( |
const HepMC::GenEvent * |
evt | ) |
|
Process the HepMC::GenEvent
through the I/O backend.
Non-const methods:
Definition at line 124 of file HepMcTupleWriterTool.cxx.
128 for (
const auto&
p: *
evt)
132 const HepMC::FourVector
mom =
p->momentum();
146 return StatusCode::SUCCESS;
◆ m_detStore
◆ m_evtStore
◆ m_mcEventsName
StringProperty HepMcTupleWriterTool::m_mcEventsName |
|
protected |
◆ m_outputFileName
StringProperty HepMcTupleWriterTool::m_outputFileName |
|
protected |
◆ m_outputStreamName
StringProperty HepMcTupleWriterTool::m_outputStreamName |
|
protected |
◆ m_particles
◆ m_tuple
TTree* HepMcTupleWriterTool::m_tuple |
|
protected |
◆ m_tupleSvc
◆ m_varHandleArraysDeclared
◆ m_vhka
◆ s_nMax
const int HepMcTupleWriterTool::s_nMax = 2000 |
|
staticprotected |
The documentation for this class was generated from the following files:
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
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
virtual void setOwner(IDataHandleHolder *o)=0
std::array< double, s_nMax > m_py
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const T * front() const
Access the first element in the collection as an rvalue.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
This defines the McEventCollection, which is really just an ObjectVector of McEvent objects.
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
std::array< double, s_nMax > m_m
#define ATH_MSG_WARNING(x)
std::array< double, s_nMax > m_pz
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
std::array< int, s_nMax > m_barcode
std::array< double, s_nMax > m_px
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
bool empty() const noexcept
Returns true if the collection is empty.
std::array< int, s_nMax > m_status