24 static const char *
const s_protocolSep =
":";
34 const std::string&
name,
35 const IInterface*
parent ) :
37 m_ioFrontend( nullptr )
43 declareProperty(
"Input",
45 "Name of the front-end we'll use to read in the HepMC::GenEvent."
46 "\nEx: ascii:hepmc.genevent.txt" );
50 declareProperty(
"McEventsOutput",
52 "Output location of the McEventCollection to read out" );
71 if ( !evtStore().
retrieve().isSuccess() ) {
73 return StatusCode::FAILURE;
81 return StatusCode::SUCCESS;
87 return StatusCode::SUCCESS;
96 return StatusCode::FAILURE;
99 if ( evtStore()->setConst( mcEvts ).isFailure() ) {
103 HepMC::GenEvent *
evt =
new HepMC::GenEvent;
121 return StatusCode::SUCCESS;
127 std::string protocol =
"ascii";
128 std::string
fileName =
"hepmc.genevent.txt";
139 std::string::size_type protocolPos =
url.find(s_protocolSep);
141 if ( std::string::npos != protocolPos ) {
142 protocol =
url.substr( 0, protocolPos );
143 fileName =
url.substr( protocolPos+1, std::string::npos );
150 std::transform( protocol.begin(), protocol.end(), protocol.begin(), [](
unsigned char c){ return std::tolower(c); } );
153 if (
"ascii" == protocol ) {
157 msg(MSG::WARNING) <<
"UNKNOWN protocol [" << protocol <<
"] !!" <<
endmsg<<
"Will use [ascii] instead..."<<
endmsg;
162 if (
"ascii" == protocol ) {
166 msg(MSG::WARNING) <<
"UNKNOWN protocol [" << protocol <<
"] !!" <<
endmsg <<
"Will use [ascii] instead..."<<
endmsg;