30 base_class(
type, name, parent )
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" );
54 if ( !evtStore().retrieve().isSuccess() ) {
56 return StatusCode::FAILURE;
64 return StatusCode::SUCCESS;
70 return StatusCode::SUCCESS;
79 return StatusCode::FAILURE;
82 if ( evtStore()->setConst( mcEvts ).isFailure() ) {
95 return StatusCode::SUCCESS;
101 std::string protocol =
"auto";
102 std::string fileName =
"hepmc.genevent.txt";
110 std::string::size_type protocolPos = url.find(
s_protocolSep);
112 if ( std::string::npos != protocolPos ) {
113 protocol = url.substr( 0, protocolPos );
114 fileName = url.substr( protocolPos + 1, std::string::npos );
120 std::transform( protocol.begin(), protocol.end(), protocol.begin(), [](
unsigned char c){ return std::tolower(c); } );
122 if (
"auto" == protocol ) {
123 m_ioFrontend = HepMC3::deduce_reader( fileName.c_str());
124 }
else if (
"ascii" == protocol ) {
125 m_ioFrontend = std::make_shared<HepMC3::ReaderAsciiHepMC2>( fileName.c_str());
127 msg(MSG::WARNING) <<
"UNKNOWN protocol [" << protocol <<
"] !!" <<
endmsg<<
"Will use [ascii] instead..."<<
endmsg;
129 m_ioFrontend = std::make_shared<HepMC3::ReaderAsciiHepMC2>( fileName.c_str());
131 ATH_MSG_DEBUG(
"Using protocol [" << protocol <<
"] and write to ["<< fileName <<
"]");
#define ATH_MSG_WARNING(x)
value_type push_back(value_type pElem)
Add an element to the end of the collection.
This defines the McEventCollection, which is really just an ObjectVector of McEvent objectsFile: Gene...
HepMC3::GenEvent GenEvent