32 char operator() (
char c)
const {
return std::tolower(c); }
42 const std::string& name,
43 const IInterface* parent ) :
53 "Name of the back-end we'll use to write out the "
54 "TruthParticleContainer.\nEx: ascii:mcaod.txt" );
60 "Input location of the TruthParticleContainer to write out" );
62 declareInterface<IIOMcAodTool>(
this);
83 if ( !
evtStore().retrieve().isSuccess() ) {
85 return StatusCode::FAILURE;
93 return StatusCode::SUCCESS;
102 return StatusCode::SUCCESS;
110 nullptr == mcParts ) {
113 return StatusCode::RECOVERABLE;
116 return write(mcParts);
125 if (
nullptr == mcParts ) {
127 return StatusCode::RECOVERABLE;
133 out <<
"---" << std::setw(5) << mcParts->
size() << std::endl;
134 for (
unsigned int i = 0; i != mcParts->
size(); ++i ) {
136 out <<
"P " << std::setprecision(3) << std::setw(10) <<
mc->px()
137 <<
" " << std::setprecision(3) << std::setw(10) <<
mc->py()
138 <<
" " << std::setprecision(3) << std::setw(10) <<
mc->pz()
139 <<
" " << std::setprecision(3) << std::setw(10) <<
mc->e()
140 <<
" " << std::setprecision(3) << std::setw(10) <<
mc->pdgId()
141 <<
" " << std::setprecision(3) << std::setw(10) <<
mc->charge()
142 <<
" " << std::setprecision(3) << std::setw(10) <<
HepMC::barcode(
mc->genParticle())
147 for (
unsigned int iCone = 0;
150 out <<
" " << std::setprecision(3) << std::setw(10)
156 return StatusCode::SUCCESS;
162 std::string protocol =
"ascii";
163 std::string fileName =
"mcaod.txt";
174 std::string::size_type protocolPos = url.find(
s_protocolSep);
176 if ( std::string::npos != protocolPos ) {
177 protocol = url.substr( 0, protocolPos );
178 fileName = url.substr( protocolPos+1, std::string::npos );
185 std::transform( protocol.begin(), protocol.end(),
189 if (
"ascii" == protocol ) {
191 std::ios::out | std::ios::trunc );
195 <<
"Will use [ascii] instead...");
198 std::ios::out | std::ios::trunc );
201 ATH_MSG_DEBUG(
"Using protocol [" << protocol <<
"] and write to ["
#define ATH_MSG_WARNING(x)
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ServiceHandle< StoreGateSvc > & evtStore()
size_type size() const noexcept
Returns the number of elements in the collection.
(HepMC) Monte Carlo particle.
ConeSize
Enum for Cone size indexes (for isolation)