17 #include "TStopwatch.h" 18 #include "TGeoManager.h" 32 #include "nutools/EventGeneratorBase/GENIE/GENIEHelper.h" 34 #include "nutools/EventGeneratorBase/GENIE/EVGBAssociationUtil.h" 44 #include "dk2nu/tree/dk2nu.h" 45 #include "dk2nu/tree/NuChoice.h" 46 #include "dk2nu/genie/GDk2NuFlux.h" 51 #include "GENIE/EVGCore/EventRecord.h" 53 #include "GENIE/Framework/EventGen/EventRecord.h" 57 #define PUT_DK2NU_ASSN 1 97 ,
fDebugFlags (pset.get<
unsigned int >(
"DebugFlags", 0))
101 produces< std::vector<simb::MCTruth> >();
102 produces< std::vector<simb::MCFlux> >();
103 produces< std::vector<simb::GTruth> >();
108 produces< art::Assns<simb::MCTruth, simb::MCFlux> >();
109 produces< art::Assns<simb::MCTruth, simb::GTruth> >();
113 produces< std::vector<bsim::Dk2Nu> >();
114 produces< std::vector<bsim::NuChoice> >();
115 #ifdef PUT_DK2NU_ASSN 116 produces< art::Assns<simb::MCTruth, bsim::Dk2Nu> >();
117 produces< art::Assns<simb::MCTruth, bsim::NuChoice> >();
124 mf::LogInfo(
"TestGENIEHelper") <<
"using GeomFileName '" 125 << geomFileName <<
"'";
127 double detectorMass = 1;
144 mf::LogInfo(
"TestGENIEHelper") <<
"real time to produce file: " 169 std::cerr <<
" *** TestGENIEHelper::beginRun() begin " 180 std::cerr <<
" *** TestGENIEHelper::beginRun() done " 203 mf::LogInfo(
"TestGENIEHelper") <<
"Total Exposure was " 216 std::unique_ptr< std::vector<simb::MCTruth> > truthcol(
new std::vector<simb::MCTruth>);
217 std::unique_ptr< std::vector<simb::MCFlux> > fluxcol (
new std::vector<simb::MCFlux >);
218 std::unique_ptr< std::vector<simb::GTruth> > gtruthcol (
new std::vector<simb::GTruth >);
222 std::cerr <<
" ******************************* TestGENIEHelper::produce() " <<
std::endl <<
std::flush;
223 std::cout <<
" stopwatch at produce() ";
229 std::unique_ptr< std::vector<bsim::Dk2Nu> >
230 dk2nucol(
new std::vector<bsim::Dk2Nu>);
231 std::unique_ptr< std::vector<bsim::NuChoice> >
232 nuchoicecol(
new std::vector<bsim::NuChoice>);
234 std::unique_ptr< art::Assns<simb::MCTruth, bsim::Dk2Nu> >
236 std::unique_ptr< art::Assns<simb::MCTruth, bsim::NuChoice> >
246 std::cerr <<
" *** TestGENIEHelper::produce() about to sample " 249 std::cout <<
" stopwatch before Sample() ";
260 std::cout <<
" stopwatch after Sample() ";
264 truthcol ->push_back(truth);
265 gtruthcol->push_back(gTruth);
266 fluxcol ->push_back(flux);
269 fluxcol->size()-1, fluxcol->size());
272 gtruthcol->size()-1, gtruthcol->size());
277 genie::flux::GDk2NuFlux* dk2nuDriver =
278 dynamic_cast<genie::flux::GDk2NuFlux*
>(fdriver);
280 const bsim::Dk2Nu& dk2nuObj = dk2nuDriver->GetDk2Nu();
281 dk2nucol ->push_back(dk2nuObj);
282 const bsim::NuChoice& nuchoiceObj = dk2nuDriver->GetNuChoice();
283 nuchoicecol->push_back(nuchoiceObj);
286 std::cout <<
"---------==== creation dump" <<
std::endl;
288 if ( gevtrec ) std::cout << *gevtrec <<
std::endl;
291 std::cout <<
" necm " << decay.necm
292 <<
" muparp4 " << decay.muparpx <<
" " 293 << decay.muparpy <<
" " << decay.muparpz <<
" " 298 #ifdef PUT_DK2NU_ASSN 300 dk2nucol->size()-1, dk2nucol->size());
302 nuchoicecol->size()-1, nuchoicecol->size());
307 std::cerr <<
" *** TestGENIEHelper::produce() sample success size " 311 std::cout <<
" stopwatch after push_back + CreateAssn ";
327 std::cerr <<
" *** TestGENIEHelper::produce() done " 328 <<
" event " << evt.
event()
338 #ifdef PUT_DK2NU_ASSN 339 std::cerr <<
" *** TestGENIEHelper::produce()" 340 <<
" put dk2nuAssn + nuchoiceAssn ** " 341 <<
" event " << evt.
event()
347 std::cerr <<
" *** TestGENIEHelper::produce() finished put " 348 <<
" event " << evt.
event()
genie::GFluxI * GetFluxDriver(bool base=true)
EventNumber_t event() const
void produce(art::Event &evt)
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
genie::EventRecord * GetGenieEventRecord()
bool Sample(simb::MCTruth &truth, simb::MCFlux &flux, simb::GTruth >ruth)
EDProducer(fhicl::ParameterSet const &pset)
void Decay(const Decayer *decayer, int pdgc, double E, int ndecays)
object containing MC flux information
void beginRun(art::Run &run)
A module to check the results from the Monte Carlo generator.
#define DEFINE_ART_MODULE(klass)
bool CreateAssn(PRODUCER const &prod, art::Event &evt, std::vector< T > const &a, art::Ptr< U > const &b, art::Assns< U, T > &assn, std::string a_instance, size_t indx=UINT_MAX)
Creates a single one-to-one association.
QTextStream & flush(QTextStream &s)
int fEventsPerSpill
negative for Poisson()
Generated Event Record. It is a GHepRecord object that can accept / be visited by EventRecordVisitorI...
void endSubRun(art::SubRun &sr)
TestGENIEHelper(fhicl::ParameterSet const &pset)
double TotalExposure() const
virtual ~TestGENIEHelper()
evgb::GENIEHelper * fGENIEHelp
GENIEHelper object.
Event generator information.
ProductID put(std::unique_ptr< PROD > &&edp, FullSemantic< Level::Run > const semantic)
Event Generation using GENIE, cosmics or single particles.
QTextStream & endl(QTextStream &s)
GENIE Interface for user-defined flux classes.