45 #include "GENIE/Utils/StringUtils.h" 47 #include "GENIE/Framework/Utils/StringUtils.h" 50 #include "cetlib_except/exception.h" 59 , fTimeBetweenBuckets(1e9/53.103e6)
60 , fBucketTimeSigma(0.750)
61 , fNBucketsPerBatch(84)
62 , fNFilledBucketsPerBatch(81)
63 , fDisallowedBatchMask(6,0)
66 std::vector<double> bi(6,1.0);
76 if ( config ==
"" )
return;
84 size_t nstrs = strs.size();
85 for (
size_t i=0; i<nstrs; ++i) {
86 if ( strs[i] ==
"numi" ) {
93 std::vector<double> bi(6,1.0);
96 if ( strs[i] ==
"booster" ) {
103 std::vector<double> bi(1,1.0);
106 if ( strs[i].find(
"intensity") != std::string::npos ) {
109 std::vector<double> bi;
111 for (
size_t jj=i+1; jj<nstrs; ++jj) {
114 size_t pos = strs[jj].find_first_not_of(
"0123456789.-+eE");
115 if ( pos != std::string::npos )
break;
117 double val = atof(strs[jj].c_str());
120 <<
"EvtTimeFNALBeam 'intensity' value [" << (jj-i-1)
121 <<
"]=" << val <<
" '" << strs[jj] <<
"' " 122 <<
"can't be less than zero, setting to zero";
131 <<
"EvtTimeFNALBeam error 'intensity' option didn't seem to have values";
136 if ( strs[i] ==
"bdisallowed" ) {
138 <<
"EvtTimeFNALBeam sorry 'bdisallowed' option not yet implemented";
141 if ( i+1 >= nstrs ) {
143 <<
"EvtTimeFNALBeam sorry too few values for '" << strs[i] <<
"'";
146 const char* arg = strs[i+1].c_str();
153 else if ( strs[i] ==
"seed" ) { ; }
156 <<
"unknown EvtTimeFNALBeam config key '" << strs[i] <<
"'";
167 <<
"set nfilled to match buckets per batch";
186 bool disallowed =
true;
190 while ( disallowed ) {
192 for (ibatch=0; ibatch<nbatch; ++ibatch) {
212 std::ostringstream msg;
213 msg <<
"EvtTimeFNALBeam config: \n" 219 <<
" Relative Fractions: ";
225 if (skip) msg <<
"{{";
227 if (skip) msg <<
"}}";
244 size_t ndis = disallow.size();
256 size_t nbi = bi.size();
257 for (
size_t i=0; i < nbi; ++i) {
virtual ~EvtTimeFNALBeam()
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
void SetBatchIntensities(std::vector< double > bi)
double fGlobalOffset
always displaced by this (in ns)
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
configurable FNAL Beam time distribution
EvtTimeFNALBeam(const std::string &config)
double fBucketTimeSigma
how wide is distribution in bucket
interface for event time distribution
virtual void PrintConfig(bool verbose=true)
provide a means of printing the configuration
void CalculateCPDF(std::vector< double > batchi)
std::vector< std::string > GetConfigTokens(const std::string &config)
virtual void Config(const std::string &config)
int fNFilledBucketsPerBatch
virtual double TimeOffset()
std::vector< int > fDisallowedBatchMask
disallow individual batches
double fTimeBetweenBuckets
time between buckets
A class for generating concrete EvtTimeShiftI derived classes based on the factory pattern...
Physics generators for neutrinos, cosmic rays, and others.
std::vector< double > fCummulativeBatchPDF
summed prob for batches
void SetDisallowedBatchMask(std::vector< int > disallow)
#define TIMESHIFTREG3(_ns, _name, _fqname)