#include <HepMcReaderTool.h>
Definition at line 27 of file HepMcReaderTool.h.
◆ HepMcReaderTool() [1/2]
| HepMcReaderTool::HepMcReaderTool |
( |
const std::string & | type, |
|
|
const std::string & | name, |
|
|
const IInterface * | parent ) |
Constructor with parameters:
Constructors.
Definition at line 29 of file HepMcReaderTool.cxx.
29 :
30 base_class( type, name, parent )
31{
32
33
34
35
36 declareProperty(
"Input",
m_ioFrontendURL =
"auto:hepmc.genevent.txt",
"Name of the front-end we'll use to read in the HepMC::GenEvent.\nEx: ascii:hepmc.genevent.txt" );
38 declareProperty(
"McEventsOutput",
m_mcEventsOutputName =
"GEN_EVENT",
"Output location of the McEventCollection to read out" );
39}
◆ ~HepMcReaderTool()
| HepMcReaderTool::~HepMcReaderTool |
( |
| ) |
|
|
virtual |
◆ HepMcReaderTool() [2/2]
| HepMcReaderTool::HepMcReaderTool |
( |
| ) |
|
|
protected |
◆ execute()
| StatusCode HepMcReaderTool::execute |
( |
| ) |
|
Definition at line 73 of file HepMcReaderTool.cxx.
74{
75
79 return StatusCode::FAILURE;
80 }
81
82 if ( evtStore()->
setConst( mcEvts ).isFailure() ) {
84 }
85
88
90}
#define ATH_MSG_WARNING(x)
value_type push_back(value_type pElem)
Add an element to the end of the collection.
void setConst()
Set the const flag for this expression.
HepMC3::GenEvent GenEvent
◆ finalize()
| StatusCode HepMcReaderTool::finalize |
( |
| ) |
|
◆ initialize()
| StatusCode HepMcReaderTool::initialize |
( |
| ) |
|
Athena Algorithm's Hooks.
Definition at line 50 of file HepMcReaderTool.cxx.
51{
53
54 if ( !evtStore().retrieve().isSuccess() ) {
56 return StatusCode::FAILURE;
57 }
58
59
62 }
63
64 return StatusCode::SUCCESS;
65}
◆ read()
◆ setupFrontend()
| void HepMcReaderTool::setupFrontend |
( |
Gaudi::Details::PropertyBase & | ioFrontendURL | ) |
|
|
protected |
Method to configure the front-end to read out the HepMC::GenEvent.
Definition at line 98 of file HepMcReaderTool.cxx.
99{
100
101 std::string protocol = "auto";
102 std::string
fileName =
"hepmc.genevent.txt";
103
104
106
107
109
111
112 if ( std::string::npos != protocolPos ) {
113 protocol =
url.substr( 0, protocolPos );
114 fileName =
url.substr( protocolPos + 1, std::string::npos );
115 } else {
117 }
118
119
120 std::transform( protocol.begin(), protocol.end(), protocol.begin(), [](unsigned char c){ return std::tolower(c); } );
121
122 if ( "auto" == protocol ) {
124 } else if ( "ascii" == protocol ) {
126 } else {
127 msg(MSG::WARNING) <<
"UNKNOWN protocol [" << protocol <<
"] !!" <<
endmsg<<
"Will use [ascii] instead..."<<
endmsg;
128 protocol = "ascii";
130 }
131 ATH_MSG_DEBUG(
"Using protocol [" << protocol <<
"] and write to ["<< fileName <<
"]");
132}
◆ m_ioFrontend
| std::shared_ptr<HepMC3::Reader> HepMcReaderTool::m_ioFrontend {nullptr} |
|
protected |
◆ m_ioFrontendURL
| StringProperty HepMcReaderTool::m_ioFrontendURL |
|
protected |
URL of the I/O front-end (only "ASCII" for now...) glued with the name of the input file name.
Ex: "ascii:/home/foo/hepmc.txt" If no protocol separator ':' is found, fallback is "ASCII"
Definition at line 65 of file HepMcReaderTool.h.
◆ m_mcEventsOutputName
| StringProperty HepMcReaderTool::m_mcEventsOutputName |
|
protected |
The documentation for this class was generated from the following files: