18 #include "cetlib_except/exception.h" 56 <<
"EvtTimeShiftFactory::GetEvtTimeShift rwh name --->" 57 << name <<
"<--- \n config -->" << config <<
"<---" <<
std::endl;
62 if( nameLocal.find_first_not_of(
" \t\n") != 0 )
63 nameLocal.erase( 0, nameLocal.find_first_not_of(
" \t\n") );
66 size_t iws = nameLocal.find_first_of(
" \t\n");
67 if ( iws != std::string::npos ) {
68 configLocal = nameLocal.substr(iws,std::string::npos);
70 nameLocal.erase(iws,std::string::npos);
75 <<
"EvtTimeShiftFactory::GetEvtTimeShift rwh name --->" 76 << nameLocal <<
"<--- \n config -->" << configLocal <<
"<---" <<
std::endl;
85 p = (*foo)(configLocal);
89 <<
"### EvtTimeShiftFactory WARNING: " 90 <<
"EvtTimeShiftI class \"" << nameLocal <<
"\" is not known" <<
std::endl;
93 <<
"EvtTimeShiftI class \"" << nameLocal <<
"\" is not known" <<
std::endl;
108 const std::vector<std::string>&
125 std::ostringstream
msg;
126 msg <<
"EvtTimeShiftFactory list of known EvtTimeShiftI classes: \n";
129 for (
size_t i=0; i < known.size(); ++i) {
void msg(const char *fmt,...)
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
static EvtTimeShiftFactory * fgTheInstance
bool IsKnownEvtTimeShift(const std::string &)
const std::vector< std::string > & AvailableEvtTimeShift() const
interface for event time distribution
virtual ~EvtTimeShiftFactory()
std::map< std::string, EvtTimeShiftICtorFuncPtr_t > fFunctionMap
bool RegisterCreator(std::string name, EvtTimeShiftICtorFuncPtr_t ctorptr, bool *ptr)
std::map< std::string, bool * > fBoolPtrMap
Q_EXPORT QTSManip setw(int w)
std::vector< std::string > listnames
MaybeLogger_< ELseverityLevel::ELsev_success, false > LogDebug
A class for generating concrete EvtTimeShiftI derived classes based on the factory pattern...
static EvtTimeShiftFactory & Instance()
evgb::EvtTimeShiftI *(* EvtTimeShiftICtorFuncPtr_t)(const std::string &)
Physics generators for neutrinos, cosmic rays, and others.
cet::coded_exception< error, detail::translate > exception
QTextStream & endl(QTextStream &s)
evgb::EvtTimeShiftI * GetEvtTimeShift(const std::string &name, const std::string &config="") const