|
ATLAS Offline Software
|
Go to the documentation of this file.
22 static const char *
const s_protocolSep =
":";
29 m_ioBackend( nullptr )
37 "Name of the back-end we'll use to write out the HepMC::GenEvent."
38 "\nEx: ascii:hepmc.genevent.txt" );
44 "Input location of the McEventCollection to write out" );
46 declareInterface<IIOHepMcTool>(
this);
70 return StatusCode::FAILURE;
78 return StatusCode::SUCCESS;
84 return StatusCode::SUCCESS;
93 return StatusCode::FAILURE;
96 if ( mcEvts->
empty() ) {
98 return StatusCode::FAILURE;
101 const HepMC::GenEvent *
evt = mcEvts->
front();
103 ATH_MSG_ERROR(
"Retrieved NULL pointer to HepMC::GenEvent !!");
104 return StatusCode::FAILURE;
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); } );
152 if (
"ascii" == protocol ) {
156 ATH_MSG_WARNING(
"UNKNOWN protocol [" << protocol <<
"] !!" <<
endmsg <<
"Will use [ascii] instead...");
161 if (
"ascii" == protocol ) {
165 ATH_MSG_WARNING(
"UNKNOWN protocol [" << protocol <<
"] !!" <<
endmsg <<
"Will use [ascii] instead...");
def retrieve(aClass, aKey=None)
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
::StatusCode StatusCode
StatusCode definition for legacy code.
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
const T * front() const
Access the first element in the collection as an rvalue.
This defines the McEventCollection, which is really just an ObjectVector of McEvent objects.
#define ATH_MSG_WARNING(x)
bool empty() const noexcept
Returns true if the collection is empty.