 |
ATLAS Offline Software
|
Go to the documentation of this file.
22 static const char *
const s_protocolSep =
":";
29 m_ioBackend( nullptr )
35 declareProperty(
"Output",
37 "Name of the back-end we'll use to write out the HepMC::GenEvent."
38 "\nEx: ascii:hepmc.genevent.txt" );
42 declareProperty(
"McEvents",
44 "Input location of the McEventCollection to write out" );
66 if ( !evtStore().
retrieve().isSuccess() ) {
68 return StatusCode::FAILURE;
76 return StatusCode::SUCCESS;
82 return StatusCode::SUCCESS;
91 return StatusCode::FAILURE;
94 if ( mcEvts->
empty() ) {
96 return StatusCode::FAILURE;
99 const HepMC::GenEvent *
evt = mcEvts->
front();
101 ATH_MSG_ERROR(
"Retrieved NULL pointer to HepMC::GenEvent !!");
102 return StatusCode::FAILURE;
119 return StatusCode::SUCCESS;
125 std::string protocol =
"ascii";
126 std::string
fileName =
"hepmc.genevent.txt";
137 std::string::size_type protocolPos =
url.find(s_protocolSep);
139 if ( std::string::npos != protocolPos ) {
140 protocol =
url.substr( 0, protocolPos );
141 fileName =
url.substr( protocolPos+1, std::string::npos );
148 std::transform( protocol.begin(), protocol.end(), protocol.begin(), [](
unsigned char c){ return std::tolower(c); } );
150 if (
"ascii" == protocol ) {
154 ATH_MSG_WARNING(
"UNKNOWN protocol [" << protocol <<
"] !!" <<
endmsg <<
"Will use [ascii] instead...");
159 if (
"ascii" == protocol ) {
163 ATH_MSG_WARNING(
"UNKNOWN protocol [" << protocol <<
"] !!" <<
endmsg <<
"Will use [ascii] instead...");
def retrieve(aClass, aKey=None)
::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.