#include <src/PartPropSvc.h>
|
using | inputFunPtr = bool(*)(std::istream &, HepPDT::TableBuilder &) |
|
Definition at line 28 of file PartPropSvc.h.
PartPropSvc::PartPropSvc |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
svc |
|
) |
| |
Definition at line 25 of file PartPropSvc.cpp.
28 declareProperty(
"InputFile",
m_pdtFiles=
"PDGTABLE.MeV");
extends base_class
Typedef to this class.
StringProperty m_pdtFiles
PartPropSvc::~PartPropSvc |
( |
| ) |
|
|
overridedefault |
Definition at line 150 of file PartPropSvc.cpp.
155 "Default Heavy Ion Handler");
161 HepPDT::TableBuilder tb( *
m_pdt );
164 const auto& f = itr.first;
165 const auto& pF = itr.second;
170 std::ifstream pdfile{ f };
172 if ( ! pF(pdfile,tb) ) {
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
std::unique_ptr< HepPDT::ParticleDataTable > m_pdt
HepPDT::ProcessUnknownID * m_upid
void setUnknownParticleHandler(HepPDT::ProcessUnknownID *, const std::string &)
std::vector< std::pair< std::string, inputFunPtr > > m_inputs
Definition at line 104 of file PartPropSvc.cpp.
Definition of the MsgStream class used to transmit messages.
StatusCode finalize() override
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
bool isSuccess() const
Test for a status code of SUCCESS.
std::unique_ptr< HepPDT::ParticleDataTable > m_pdt
HepPDT::ProcessUnknownID * m_upid
This class is used for returning status codes from appropriate routines.
Definition at line 35 of file PartPropSvc.cpp.
48 static const boost::regex exp{
"[[:space:]]*([^[:space:]]+)[[:space:]]*=[[:space:]]*([^[:space:]]+)"};
49 static const auto tok_end = boost::sregex_iterator();
50 for (
auto tok_iter = boost::sregex_iterator(
begin(key),
end(key), exp);
51 tok_iter != tok_end; ++tok_iter)
53 const std::string fname = (*tok_iter)[1];
59 <<
"\" in $DATAPATH" <<
endmsg;
64 std::ifstream pdfile{ rfile };
71 std::string val = (*tok_iter)[1];
72 std::string VAL = boost::algorithm::to_upper_copy(val);
76 m_log <<
MSG::INFO <<
"No table format type specified for \"" << fname
77 <<
"\". Assuming PDG" <<
endmsg;
86 <<
"Could not determine Particle Property table type: \""
87 << val <<
"\" for file \"" << fname <<
"\"" <<
endmsg;
StatusCode initialize() override
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
inputFunPtr parseTableType(const std::string &)
auto begin(reverse_wrapper< T > &w)
bool isFailure() const
Test for a status code of FAILURE.
auto end(reverse_wrapper< T > &w)
This class is used for returning status codes from appropriate routines.
bool(*)(std::istream &, HepPDT::TableBuilder &) inputFunPtr
static std::string find_file(const std::string &logical_file_name, const std::string &search_path, SearchType search_type=LocalSearch)
const TYPE & value() const
explicit conversion
void setLevel(int level)
Update outputlevel.
std::vector< std::pair< std::string, inputFunPtr > > m_inputs
StringProperty m_pdtFiles
Definition at line 128 of file PartPropSvc.cpp.
130 static const auto table = { std::make_pair(
"PDG" , &HepPDT::addPDGParticles ),
131 std::make_pair(
"PYTHIA" , &HepPDT::addPythiaParticles ),
132 std::make_pair(
"EVTGEN" , &HepPDT::addEvtGenParticles ),
133 std::make_pair(
"HERWIG" , &HepPDT::addHerwigParticles ),
134 std::make_pair(
"ISAJET" , &HepPDT::addIsajetParticles ),
135 std::make_pair(
"QQ" , &HepPDT::addQQParticles ) };
137 [&](
const std::pair<const char*,inputFunPtr>& p)
138 {
return typ == p.first; } );
142 throw std::runtime_error(
"error parsing particle table type");
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
auto begin(reverse_wrapper< T > &w)
auto end(reverse_wrapper< T > &w)
HepPDT::ParticleDataTable * PartPropSvc::PDT |
( |
| ) |
|
Definition at line 187 of file PartPropSvc.cpp.
193 m_pdt.reset(
nullptr);
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
std::unique_ptr< HepPDT::ParticleDataTable > m_pdt
void PartPropSvc::setUnknownParticleHandler |
( |
HepPDT::ProcessUnknownID * |
puid, |
|
|
const std::string & |
n |
|
) |
| |
Definition at line 203 of file PartPropSvc.cpp.
207 <<
"\" as ParticleDataTable already instantiated" <<
endmsg;
212 <<
"\" at " << puid <<
endmsg;
216 <<
"overriding previously selected Unknown Particle Handler \""
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
std::unique_ptr< HepPDT::ParticleDataTable > m_pdt
HepPDT::ProcessUnknownID * m_upid
std::vector<std::pair<std::string,inputFunPtr> > PartPropSvc::m_inputs |
|
private |
std::unique_ptr<HepPDT::ParticleDataTable> PartPropSvc::m_pdt |
|
private |
HepPDT::ProcessUnknownID* PartPropSvc::m_upid = nullptr |
|
private |
bool PartPropSvc::m_upid_local = false |
|
private |
std::string PartPropSvc::m_upid_name |
|
private |
The documentation for this class was generated from the following files: