4 #pragma warning(disable:1572) 14 #include "HepPDT/HeavyIonUnknownID.hh" 18 #include <boost/tokenizer.hpp> 19 #include <boost/algorithm/string/case_conv.hpp> 30 error() <<
"Could not initialize main svc" <<
endmsg;
37 typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
38 boost::char_separator<char> sep(
", ");
39 boost::char_separator<char> sep_eq(
"=");
41 tokenizer tokens(key, sep);
42 for (
auto it = tokens.begin(); it != tokens.end(); ++it) {
44 tokenizer tok2(*it, sep_eq);
45 int nToks(distance(tok2.begin(), tok2.end()));
47 auto it2 = tok2.begin();
51 info() <<
"No table format type specified for \"" << fname
52 <<
"\". Assuming PDG" <<
endmsg;
62 error() <<
"Could not find PDT file: \"" << fname
63 <<
"\" in $DATAPATH" <<
endmsg;
70 error() <<
"Could not open PDT file: \"" << rfile
75 std::string FMT = boost::algorithm::to_upper_copy(fmt);
82 <<
"Could not determine Particle Property table type: \"" 83 << FMT <<
"\" for file \"" << fname <<
"\"" <<
endmsg;
87 debug() <<
"Adding PDT file \"" << rfile <<
"\" type " 115 debug() <<
"Service finalised successfully" <<
endmsg;
126 static const auto table = {
std::make_pair(
"PDG" , &HepPDT::addPDGParticles ),
134 {
return typ == p.first; } );
136 error() <<
"Unknown Particle Data file type: \"" 151 "Default Heavy Ion Handler");
157 HepPDT::TableBuilder tb( *
m_pdt );
160 const auto& f = itr.first;
161 const auto& pF = itr.second;
163 debug() <<
"Reading PDT file \"" << f <<
"\"" 168 if ( ! pF(pdfile,tb) ) {
169 error() <<
"Error reading PDT file: \"" << f
182 HepPDT::ParticleDataTable*
188 fatal() <<
"Could not create ParticleDataTable" <<
endmsg;
202 error() <<
"not setting Unknown Particle Handler \"" << n
203 <<
"\" as ParticleDataTable already instantiated" <<
endmsg;
207 debug() <<
"setting Unknown Particle Handler \"" << n
208 <<
"\" at " << puid <<
endmsg;
212 <<
"overriding previously selected Unknown Particle Handler \"" StatusCode initialize() override
StatusCode initialize() override
StatusCode finalize() override
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
inputFunPtr parseTableType(const std::string &)
bool isSuccess() const
Test for a status code of SUCCESS.
bool(*)(std::istream &, HepPDT::TableBuilder &) inputFunPtr
std::unique_ptr< HepPDT::ParticleDataTable > m_pdt
Gaudi::Property< std::string > m_pdtFiles
std::vector< std::pair< std::string, inputFunPtr > > m_inputs
bool isFailure() const
Test for a status code of FAILURE.
#define DECLARE_COMPONENT(type)
StatusCode finalize() override
HepPDT::ProcessUnknownID * m_upid
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)
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.