4 # pragma warning( disable : 1572 ) 14 #include "HepPDT/HeavyIonUnknownID.hh" 18 #include <boost/algorithm/string/case_conv.hpp> 19 #include <boost/tokenizer.hpp> 27 error() <<
"Could not initialize main svc" <<
endmsg;
33 typedef boost::tokenizer<boost::char_separator<char>> tokenizer;
34 boost::char_separator<char> sep(
", " );
35 boost::char_separator<char> sep_eq(
"=" );
37 tokenizer tokens( key, sep );
38 for (
auto it = tokens.begin(); it != tokens.end(); ++it ) {
40 tokenizer tok2( *it, sep_eq );
43 auto it2 = tok2.begin();
47 info() <<
"No table format type specified for \"" << fname <<
"\". Assuming PDG" <<
endmsg;
56 if ( rfile.
empty() ) {
57 error() <<
"Could not find PDT file: \"" << fname <<
"\" in $DATAPATH" <<
endmsg;
64 error() <<
"Could not open PDT file: \"" << rfile <<
"\"" <<
endmsg;
68 std::string FMT = boost::algorithm::to_upper_copy( fmt );
74 error() <<
"Could not determine Particle Property table type: \"" << FMT <<
"\" for file \"" << fname <<
"\"" 79 debug() <<
"Adding PDT file \"" << rfile <<
"\" type " << FMT <<
endmsg;
110 static const auto table = {
117 error() <<
"Unknown Particle Data file type: \"" << typ <<
"\"" <<
endmsg;
135 HepPDT::TableBuilder tb( *
m_pdt );
137 for (
const auto& itr :
m_inputs ) {
138 const auto& f = itr.first;
139 const auto& pF = itr.second;
141 debug() <<
"Reading PDT file \"" << f <<
"\"" <<
endmsg;
145 if ( !pF( pdfile, tb ) ) {
146 error() <<
"Error reading PDT file: \"" << f <<
"\"" <<
endmsg;
161 fatal() <<
"Could not create ParticleDataTable" <<
endmsg;
166 return m_pdt.get_ptr();
173 error() <<
"not setting Unknown Particle Handler \"" << n <<
"\" as ParticleDataTable already instantiated" 178 debug() <<
"setting Unknown Particle Handler \"" << n <<
"\" at " << puid <<
endmsg;
181 warning() <<
"overriding previously selected Unknown Particle Handler \"" <<
m_upid_name <<
"\" with \"" << n
StatusCode initialize() override
boost::optional< HepPDT::ParticleDataTable > m_pdt
StatusCode initialize() override
StatusCode finalize() override
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
inputFunPtr parseTableType(const std::string &)
bool(*)(std::istream &, HepPDT::TableBuilder &) inputFunPtr
constexpr static const auto SUCCESS
Gaudi::Property< std::string > m_pdtFiles
std::vector< std::pair< std::string, inputFunPtr > > m_inputs
StatusCode finalize() override
HepPDT::ProcessUnknownID * m_upid
#define DECLARE_COMPONENT(type)
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
This class is used for returning status codes from appropriate routines.
static std::string find_file(const std::string &logical_file_name, const std::string &search_path, SearchType search_type=LocalSearch)
HepPDT::ParticleDataTable * PDT() override
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
constexpr static const auto FAILURE
MsgStream & fatal() const
shortcut for the method msgStream(MSG::FATAL)
void setUnknownParticleHandler(HepPDT::ProcessUnknownID *, const std::string &) override
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.