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 ) {
154 m_ioFrontend =
new HepMC3::ReaderAsciiHepMC2( fileName.c_str());
157 msg(MSG::WARNING) <<
"UNKNOWN protocol [" << protocol <<
"] !!" <<
endmsg<<
"Will use [ascii] instead..."<<
endmsg;
159 m_ioFrontend =
new HepMC3::ReaderAsciiHepMC2( fileName.c_str());
162 if (
"ascii" == protocol ) {
163 m_ioFrontend =
new HepMC::IO_GenEvent( fileName.c_str(), std::ios::in );
166 msg(MSG::WARNING) <<
"UNKNOWN protocol [" << protocol <<
"] !!" <<
endmsg <<
"Will use [ascii] instead..."<<
endmsg;
168 m_ioFrontend =
new HepMC::IO_GenEvent( fileName.c_str(), std::ios::in );
172 ATH_MSG_DEBUG(
"Using protocol [" << protocol <<
"] and write to ["<< fileName <<
"]");