17 #include "TStopwatch.h" 31 #include "nugen/EventGeneratorBase/GENIE/GENIEHelper.h" 40 #include "Utilities/AssociationUtil.h" 42 #include "dk2nu/tree/dk2nu.h" 43 #include "dk2nu/tree/NuChoice.h" 44 #include "dk2nu/genie/GDk2NuFlux.h" 45 #include "dk2nu/tree/dkmeta.h" 92 produces< std::vector<simb::MCTruth> >();
93 produces< std::vector<simb::MCFlux> >();
94 produces< std::vector<simb::GTruth> >();
95 produces< sumdata::SpillData >();
96 produces< sumdata::POTSum, art::InSubRun >();
97 produces< sumdata::SubRunData, art::InSubRun >();
98 produces< sumdata::RunData, art::InRun >();
100 produces< art::Assns<simb::MCTruth, simb::MCFlux> >();
101 produces< art::Assns<simb::MCTruth, simb::GTruth> >();
103 produces< std::vector<bsim::Dk2Nu> >();
104 produces< std::vector<bsim::NuChoice> >();
105 #ifdef PUT_DK2NU_ASSN 106 produces< art::Assns<simb::MCTruth, bsim::Dk2Nu> >();
107 produces< art::Assns<simb::MCTruth, bsim::NuChoice> >();
112 geo->ROOTGeoManager(),
121 mf::LogInfo(
"GENIEGen") <<
"real time to produce file: " 137 std::unique_ptr<sumdata::RunData>
142 run.
put(std::move(runcol));
167 sr.
put(std::move(p));
172 sr.
put(std::move(sd));
181 double SpillExpTemp = 0.0;
183 std::unique_ptr< std::vector<simb::MCTruth> > truthcol(
new std::vector<simb::MCTruth>);
184 std::unique_ptr< std::vector<simb::MCFlux> > fluxcol (
new std::vector<simb::MCFlux >);
185 std::unique_ptr< std::vector<simb::GTruth> > gtruthcol (
new std::vector<simb::GTruth >);
189 std::unique_ptr< std::vector<bsim::Dk2Nu> >
190 dk2nucol(
new std::vector<bsim::Dk2Nu>);
191 std::unique_ptr< std::vector<bsim::NuChoice> >
192 nuchoicecol(
new std::vector<bsim::NuChoice>);
194 std::unique_ptr< art::Assns<simb::MCTruth, bsim::Dk2Nu> >
196 std::unique_ptr< art::Assns<simb::MCTruth, bsim::NuChoice> >
199 bool passedPOTLimit =
false;
202 while ( truthcol->size() < 1 ) {
209 passedPOTLimit =
true;
223 if (
fGENIEHelp->Sample(truth, flux, gTruth ) ) {
239 truthcol ->push_back(truth);
240 gtruthcol->push_back(gTruth);
241 fluxcol ->push_back(flux);
244 fluxcol->
size()-1, fluxcol->size());
247 gtruthcol->
size()-1, gtruthcol->size());
254 dk2nucol ->push_back(dk2nuObj);
256 nuchoicecol->push_back(nuchoiceObj);
258 #ifdef PUT_DK2NU_ASSN 260 dk2nucol->
size()-1, dk2nucol->size());
262 nuchoicecol->
size()-1, nuchoicecol->size());
277 <<
"no events made for this spill " 278 <<
" continue on until we get a spill with events";
285 evt.
put(std::move(truthcol));
286 evt.
put(std::move(fluxcol));
287 evt.
put(std::move(gtruthcol));
288 evt.
put(std::move(assns));
289 evt.
put(std::move(tgtassn));
293 evt.
put(std::move(dk2nucol));
294 evt.
put(std::move(nuchoicecol));
295 #ifdef PUT_DK2NU_ASSN 296 evt.
put(std::move(dk2nuassn));
297 evt.
put(std::move(nuchoiceassn));
311 sd->spillpot = ThisSpillPoT;
316 sd->deltaspilltimensec = 0;
334 sd->hornI = std::stof(stripped_horncfg);
340 }
else if (sd->hornI == 0){
372 evt.
put(std::move(sd));
#define LOG_DEBUG(stream)
static bool CreateAssn(art::EDProducer const &prod, art::Event &evt, std::vector< T > &a, art::Ptr< U > b, art::Assns< T, U > &assn, size_t indx=UINT_MAX, std::string const &instance=std::string())
Create a 1 to 1 association between a new product and one already in the event.
double fEventsPerSpill
how many events to simulate per spill
int fSpillCounter
how many spills so far?
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
void beginRun(art::Run &run)
void endSubRun(art::SubRun &sr)
const bsim::NuChoice & GetNuChoice(void)
art::ProductID put(std::unique_ptr< PROD > &&)
DEFINE_ART_MODULE(TestTMapFile)
object containing MC flux information
ProductID put(std::unique_ptr< PROD > &&product)
double sd(Eigen::VectorXd x)
double fTotalExposure
total exposure in POT
void produce(art::Event &evt)
GENIEGen(fhicl::ParameterSet const &pset)
int fPassEmptySpills
whether or not to allow for events with no interactions to be put into the event
evgb::GENIEHelper * fGENIEHelp
GENIEHelper object.
T get(std::string const &key) const
novadaq::cnv::DetId DetId() const
Prefer ds::DetectorService::DetId() instead.
const bsim::DkMeta & GetDkMeta(void)
int fCycle
cycle number in the MC generation
double fPOTPerSpill
how many POT to simulate per spill
ProductID put(std::unique_ptr< PROD > &&)
double fTotalPOTLimit
total POT limit
An implementation of the GENIE GFluxI interface ("flux driver") encapsulating reading/processing the ...
std::string ExtractGDML() const
Extract contents from fGDMLFile and return as a string.
Event generator information.
TStopwatch fStopwatch
keep track of how long it takes to run the job
const bsim::Dk2Nu & GetDk2Nu(void)
Module to generate only pions from cosmic rays.
Encapsulate the geometry of one entire detector (near, far, ndos)
A module to check the results from the Monte Carlo generator.
std::string FileBaseName() const
GENIE Interface for user-defined flux classes.