LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
evgen::MarleyTimeGen Class Reference
Inheritance diagram for evgen::MarleyTimeGen:
art::EDProducer art::detail::Producer art::detail::LegacyModule art::Modifier art::ModuleBase art::ProductRegistryHelper

Classes

struct  Config
 Collection of configuration parameters for the module. More...
 
class  FitParameters
 Stores parsed fit parameters from a single time bin and neutrino type in a "fit"-format spectrum file. More...
 
struct  KeysToIgnore
 
class  TimeFit
 Stores fitting parameters for all neutrino types from a single time bin in a "fit"-format spectrum file. More...
 

Public Types

using Name = fhicl::Name
 
using Comment = fhicl::Comment
 
using Parameters = art::EDProducer::Table< Config, KeysToIgnore >
 
using ModuleType = EDProducer
 
template<typename UserConfig , typename KeysToIgnore = void>
using Table = Modifier::Table< UserConfig, KeysToIgnore >
 

Public Member Functions

 MarleyTimeGen (const Parameters &p)
 
virtual void produce (art::Event &e) override
 
virtual void beginRun (art::Run &run) override
 
virtual void reconfigure (const Parameters &p)
 
void doBeginJob (SharedResources const &resources)
 
void doEndJob ()
 
void doRespondToOpenInputFile (FileBlock const &fb)
 
void doRespondToCloseInputFile (FileBlock const &fb)
 
void doRespondToOpenOutputFiles (FileBlock const &fb)
 
void doRespondToCloseOutputFiles (FileBlock const &fb)
 
bool doBeginRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doEndRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doBeginSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEndSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEvent (EventPrincipal &ep, ModuleContext const &mc, std::atomic< std::size_t > &counts_run, std::atomic< std::size_t > &counts_passed, std::atomic< std::size_t > &counts_failed)
 
void fillProductDescriptions ()
 
void registerProducts (ProductDescriptions &productsToRegister)
 
ModuleDescription const & moduleDescription () const
 
void setModuleDescription (ModuleDescription const &)
 
std::array< std::vector< ProductInfo >, NumBranchTypes > const & getConsumables () const
 
void sortConsumables (std::string const &current_process_name)
 
std::unique_ptr< Worker > makeWorker (WorkerParams const &wp)
 
template<typename T , BranchType BT>
ViewToken< T > consumesView (InputTag const &tag)
 
template<typename T , BranchType BT>
ViewToken< T > mayConsumeView (InputTag const &tag)
 

Protected Types

enum  TimeGenSamplingMode { TimeGenSamplingMode::HISTOGRAM, TimeGenSamplingMode::UNIFORM_TIME, TimeGenSamplingMode::UNIFORM_ENERGY }
 Enumerated type that defines the allowed ways that a neutrino's energy and arrival time may be sampled. More...
 
enum  PinchParamType { PinchParamType::ALPHA, PinchParamType::BETA }
 Enumerated type that defines the pinching parameter conventions that are understood by this module. More...
 
enum  SpectrumFileFormat { SpectrumFileFormat::RootTH2D, SpectrumFileFormat::FIT }
 Enumerated type that defines the allowed neutrino spectrum input file formats. More...
 

Protected Member Functions

simb::MCTruth make_uniform_energy_mctruth (double E_min, double E_max, double &E_nu, const TLorentzVector &vertex_pos)
 Creates a simb::MCTruth object using a uniformly-sampled neutrino energy. More...
 
std::unique_ptr< marley::NeutrinoSource > source_from_time_fit (const TimeFit &fit)
 Create a MARLEY neutrino source object using a set of fit parameters for a particular time bin. More...
 
void create_truths_th2d (simb::MCTruth &mc_truth, sim::SupernovaTruth &sn_truth, const TLorentzVector &vertex_pos)
 Create simb::MCTruth and sim::SupernovaTruth objects using spectrum information from a ROOT TH2D. More...
 
void create_truths_time_fit (simb::MCTruth &mc_truth, sim::SupernovaTruth &sn_truth, const TLorentzVector &vertex_pos)
 Create simb::MCTruth and sim::SupernovaTruth objects using a neutrino spectrum described by a previously-parsed "fit"-format file. More...
 
void make_final_timefit (double time)
 Helper function that makes a final dummy TimeFit object so that the final real time bin can have a right edge. More...
 
void make_nu_emission_histograms () const
 Makes ROOT histograms showing the emitted neutrinos in each time bin when using a "fit"-format spectrum file. More...
 
ConsumesCollector & consumesCollector ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > consumes (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > mayConsume (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 

Protected Attributes

std::unique_ptr< evgen::MARLEYHelperfMarleyHelper
 Object that provides an interface to the MARLEY event generator. More...
 
std::unique_ptr< evgen::ActiveVolumeVertexSamplerfVertexSampler
 Algorithm that allows us to sample vertex locations within the active volume(s) of the detector. More...
 
std::unique_ptr< marley::Event > fEvent
 unique_ptr to the current event created by MARLEY More...
 
std::unique_ptr< TH2D > fSpectrumHist
 ROOT TH2D that contains the time-dependent spectrum to use when sampling neutrino times and energies. More...
 
std::vector< TimeFitfTimeFits
 Vector that contains the fit parameter information for each time bin when using a "fit"-format spectrum file. More...
 
TimeGenSamplingMode fSamplingMode
 Represents the sampling mode to use when selecting neutrino times and energies. More...
 
PinchParamType fPinchType
 The pinching parameter convention to use when interpreting the time-dependent fits. More...
 
SpectrumFileFormat fSpectrumFileFormat
 Format to assume for the neutrino spectrum input file. More...
 
TTree * fEventTree
 The event TTree created by MARLEY. More...
 
uint_fast32_t fRunNumber
 Run number from the art::Event being processed. More...
 
uint_fast32_t fSubRunNumber
 Subrun number from the art::Event being processed. More...
 
uint_fast32_t fEventNumber
 Event number from the art::Event being processed. More...
 
double fTNu
 Time since the supernova core bounce for the current MARLEY neutrino vertex. More...
 
double fWeight
 Statistical weight for the current MARLEY neutrino vertex. More...
 
double fFluxAveragedCrossSection
 Flux-averaged total cross section (fm2, average is taken over all energies and times for all defined reactions) used by MARLEY to generate neutrino vertices. More...
 
unsigned int fNeutrinosPerEvent
 The number of MARLEY neutrino vertices to generate in each art::Event. More...
 
double fFitEmin
 Minimum neutrino energy to consider when using a "fit"-format spectrum file. More...
 
double fFitEmax
 Maximum neutrino energy to consider when using a "fit"-format spectrum file. More...
 

Detailed Description

Definition at line 114 of file MARLEYTimeGen_module.cc.

Member Typedef Documentation

Definition at line 17 of file EDProducer.h.

template<typename UserConfig , typename KeysToIgnore = void>
using art::detail::Producer::Table = Modifier::Table<UserConfig, KeysToIgnore>
inherited

Definition at line 26 of file Producer.h.

Member Enumeration Documentation

Enumerated type that defines the pinching parameter conventions that are understood by this module.

Enumerator
ALPHA 
BETA 

Definition at line 459 of file MARLEYTimeGen_module.cc.

459 { ALPHA, BETA };

Enumerated type that defines the allowed neutrino spectrum input file formats.

Enumerator
RootTH2D 
FIT 

Definition at line 480 of file MARLEYTimeGen_module.cc.

480 { RootTH2D, FIT };

Enumerated type that defines the allowed ways that a neutrino's energy and arrival time may be sampled.

Enumerator
HISTOGRAM 
UNIFORM_TIME 
UNIFORM_ENERGY 

Definition at line 428 of file MARLEYTimeGen_module.cc.

428 { HISTOGRAM, UNIFORM_TIME, UNIFORM_ENERGY };

Constructor & Destructor Documentation

evgen::MarleyTimeGen::MarleyTimeGen ( const Parameters p)
explicit

Definition at line 524 of file MARLEYTimeGen_module.cc.

References fEvent, fEventNumber, fEventTree, fFluxAveragedCrossSection, fRunNumber, fSubRunNumber, fTNu, fWeight, art::ProducerTable< UserConfig, ImplicitConfig, UserKeysToIgnore >::get_PSet(), and reconfigure().

525  : EDProducer{p.get_PSet()}
526  , fEvent(new marley::Event)
527  , fRunNumber(0)
528  , fSubRunNumber(0)
529  , fEventNumber(0)
530  , fTNu(0.)
532 {
533  // Configure the module (including MARLEY itself) using the FHiCL parameters
534  this->reconfigure(p);
535 
536  // Create a ROOT TTree using the TFileService that will store the MARLEY
537  // event objects (useful for debugging purposes)
539  fEventTree = tfs->make<TTree>("MARLEY_event_tree", "Neutrino events generated by MARLEY");
540  fEventTree->Branch("event", "marley::Event", fEvent.get());
541 
542  // Add branches that give the art::Event run, subrun, and event numbers for
543  // easy match-ups between the MARLEY and art TTrees. All three are recorded
544  // as 32-bit unsigned integers.
545  fEventTree->Branch("run_number", &fRunNumber, "run_number/i");
546  fEventTree->Branch("subrun_number", &fSubRunNumber, "subrun_number/i");
547  fEventTree->Branch("event_number", &fEventNumber, "event_number/i");
548  fEventTree->Branch("tSN", &fTNu, "tSN/D");
549  fEventTree->Branch("weight", &fWeight, "weight/D");
550 
551  produces<std::vector<simb::MCTruth>>();
552  produces<std::vector<sim::SupernovaTruth>>();
553  produces<art::Assns<simb::MCTruth, sim::SupernovaTruth>>();
554  produces<sumdata::RunData, art::InRun>();
555 }
uint_fast32_t fEventNumber
Event number from the art::Event being processed.
virtual void reconfigure(const Parameters &p)
EDProducer(fhicl::ParameterSet const &pset)
Definition: EDProducer.cc:6
double fFluxAveragedCrossSection
Flux-averaged total cross section (fm2, average is taken over all energies and times for all defined ...
double fWeight
Statistical weight for the current MARLEY neutrino vertex.
TTree * fEventTree
The event TTree created by MARLEY.
uint_fast32_t fSubRunNumber
Subrun number from the art::Event being processed.
uint_fast32_t fRunNumber
Run number from the art::Event being processed.
double fTNu
Time since the supernova core bounce for the current MARLEY neutrino vertex.
std::unique_ptr< marley::Event > fEvent
unique_ptr to the current event created by MARLEY

Member Function Documentation

void evgen::MarleyTimeGen::beginRun ( art::Run run)
overridevirtual

Reimplemented from art::EDProducer.

Definition at line 558 of file MARLEYTimeGen_module.cc.

References geo::GeometryCore::DetectorName(), art::fullRun(), and art::Run::put().

559 {
561  run.put(std::make_unique<sumdata::RunData>(geo->DetectorName()), art::fullRun());
562 }
constexpr auto fullRun()
PutHandle< PROD > put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
Definition: Run.h:121
std::string const & DetectorName() const
Returns a string with the name of the detector, as configured.
Definition: GeometryCore.h:203
Namespace collecting geometry-related classes utilities.
template<typename T , BranchType BT>
ProductToken< T > art::ModuleBase::consumes ( InputTag const &  tag)
protectedinherited

Definition at line 61 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::consumes().

62  {
63  return collector_.consumes<T, BT>(tag);
64  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
ProductToken< T > consumes(InputTag const &)
ConsumesCollector & art::ModuleBase::consumesCollector ( )
protectedinherited

Definition at line 57 of file ModuleBase.cc.

References art::ModuleBase::collector_.

58  {
59  return collector_;
60  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
template<typename T , BranchType BT>
void art::ModuleBase::consumesMany ( )
protectedinherited

Definition at line 75 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::consumesMany().

76  {
77  collector_.consumesMany<T, BT>();
78  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::ModuleBase::consumesView ( InputTag const &  )
protectedinherited
template<typename T , BranchType BT>
ViewToken<T> art::ModuleBase::consumesView ( InputTag const &  tag)
inherited

Definition at line 68 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::consumesView().

69  {
70  return collector_.consumesView<T, BT>(tag);
71  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
ViewToken< Element > consumesView(InputTag const &)
void evgen::MarleyTimeGen::create_truths_th2d ( simb::MCTruth mc_truth,
sim::SupernovaTruth sn_truth,
const TLorentzVector &  vertex_pos 
)
protected

Create simb::MCTruth and sim::SupernovaTruth objects using spectrum information from a ROOT TH2D.

Definition at line 565 of file MARLEYTimeGen_module.cc.

References fEvent, fFluxAveragedCrossSection, fMarleyHelper, fSamplingMode, fSpectrumHist, fTNu, fWeight, HISTOGRAM, sim::kUnbiased, sim::kUniformEnergy, sim::kUniformTime, make_uniform_energy_mctruth(), UNIFORM_ENERGY, and UNIFORM_TIME.

Referenced by produce().

568 {
569  // Get a reference to the generator object created by MARLEY (we'll need
570  // to do a few fancy things with it other than just creating events)
571  marley::Generator& gen = fMarleyHelper->get_generator();
572 
574  // Generate a MARLEY event using the time-integrated spectrum
575  // (the generator was already configured to use it by reconfigure())
576  mc_truth = fMarleyHelper->create_MCTruth(vertex_pos, fEvent.get());
577 
578  // Find the time distribution corresponding to the selected energy bin
579  double E_nu = fEvent->projectile().total_energy();
580  int E_bin_index = fSpectrumHist->GetYaxis()->FindBin(E_nu);
581  TH1D* t_hist = fSpectrumHist->ProjectionX("dummy_time_hist", E_bin_index, E_bin_index);
582  double* time_bin_weights = t_hist->GetArray();
583 
584  // Sample a time bin from the distribution
585  std::discrete_distribution<int> time_dist;
586  std::discrete_distribution<int>::param_type time_params(
587  time_bin_weights, &(time_bin_weights[t_hist->GetNbinsX() + 1]));
588  int time_bin_index = gen.sample_from_distribution(time_dist, time_params);
589 
590  // Sample a time uniformly from within the selected time bin
591  double t_min = t_hist->GetBinLowEdge(time_bin_index);
592  double t_max = t_min + t_hist->GetBinWidth(time_bin_index);
593  // sample a time on [ t_min, t_max )
594  fTNu = gen.uniform_random_double(t_min, t_max, false);
595  // Unbiased sampling was used, so assign this neutrino vertex a
596  // unit statistical weight
597  fWeight = ONE;
598 
600  }
601 
603  // Generate a MARLEY event using the time-integrated spectrum
604  // (the generator was already configured to use it by reconfigure())
605  mc_truth = fMarleyHelper->create_MCTruth(vertex_pos, fEvent.get());
606 
607  // Sample a time uniformly
608  TAxis* time_axis = fSpectrumHist->GetXaxis();
609  // underflow bin has index zero
610  double t_min = time_axis->GetBinLowEdge(1);
611  double t_max = time_axis->GetBinLowEdge(time_axis->GetNbins() + 1);
612  // sample a time on [ t_min, t_max )
613  fTNu = gen.uniform_random_double(t_min, t_max, false);
614 
615  // Get the value of the true dependent probability density (probability
616  // of the sampled time given the sampled energy) to use as a biasing
617  // correction in the neutrino vertex weight.
618  double E_nu = fEvent->projectile().total_energy();
619  int E_bin_index = fSpectrumHist->GetYaxis()->FindBin(E_nu);
620  TH1D* t_hist = fSpectrumHist->ProjectionX("dummy_time_hist", E_bin_index, E_bin_index);
621  int t_bin_index = t_hist->FindBin(fTNu);
622  double weight_bias = t_hist->GetBinContent(t_bin_index) * (t_max - t_min) /
623  (t_hist->Integral() * t_hist->GetBinWidth(t_bin_index));
624 
625  fWeight = weight_bias;
626 
628  }
629 
631  // Select a time bin using the energy-integrated spectrum
632  TH1D* t_hist = fSpectrumHist->ProjectionX("dummy_time_hist");
633  double* time_bin_weights = t_hist->GetArray();
634 
635  // Sample a time bin from the distribution
636  std::discrete_distribution<int> time_dist;
637  std::discrete_distribution<int>::param_type time_params(
638  time_bin_weights, &(time_bin_weights[t_hist->GetNbinsX() + 1]));
639  int time_bin_index = gen.sample_from_distribution(time_dist, time_params);
640 
641  // Sample a time uniformly from within the selected time bin
642  double t_min = t_hist->GetBinLowEdge(time_bin_index);
643  double t_max = t_min + t_hist->GetBinWidth(time_bin_index);
644  // sample a time on [ t_min, t_max )
645  fTNu = gen.uniform_random_double(t_min, t_max, false);
646 
647  // Sample an energy uniformly over the entire allowed range
648  // underflow bin has index zero
649  TAxis* energy_axis = fSpectrumHist->GetYaxis();
650  double E_min = energy_axis->GetBinLowEdge(1);
651  double E_max = energy_axis->GetBinLowEdge(energy_axis->GetNbins() + 1);
652 
653  double E_nu = std::numeric_limits<double>::lowest();
654 
655  // Generate a MARLEY event using a uniformly sampled energy
656  mc_truth = make_uniform_energy_mctruth(E_min, E_max, E_nu, vertex_pos);
657 
658  // Get the value of the true dependent probability density (probability
659  // of the sampled energy given the sampled time) to use as a biasing
660  // correction in the neutrino vertex weight.
661  //
662  // Get a 1D projection of the energy spectrum for the sampled time bin
663  TH1D* energy_spect = fSpectrumHist->ProjectionY("energy_spect", time_bin_index, time_bin_index);
664 
665  // Create a new MARLEY neutrino source object using this projection (this
666  // will create a normalized probability density that we can use) and load
667  // it into the generator.
668  auto nu_source =
669  marley_root::make_root_neutrino_source(marley_utils::ELECTRON_NEUTRINO, energy_spect);
670  double new_source_E_min = nu_source->get_Emin();
671  double new_source_E_max = nu_source->get_Emax();
672  gen.set_source(std::move(nu_source));
673  // NOTE: The marley::Generator object normalizes the E_pdf to unity
674  // automatically, but just in case, we redo it here.
675  double E_pdf_integ = integrate([&gen](double E_nu) -> double { return gen.E_pdf(E_nu); },
676  new_source_E_min,
677  new_source_E_max);
678 
679  // Compute the likelihood ratio that we need to bias the neutrino vertex
680  // weight
681  double weight_bias = (gen.E_pdf(E_nu) / E_pdf_integ) * (E_max - E_min);
682 
683  fWeight = weight_bias;
684 
686  }
687 
688  else {
689  throw cet::exception("MARLEYTimeGen") << "Unrecognized sampling mode"
690  << " encountered in evgen::MarleyTimeGen::produce()";
691  }
692 }
std::unique_ptr< evgen::MARLEYHelper > fMarleyHelper
Object that provides an interface to the MARLEY event generator.
double fFluxAveragedCrossSection
Flux-averaged total cross section (fm2, average is taken over all energies and times for all defined ...
double fWeight
Statistical weight for the current MARLEY neutrino vertex.
Arrival times were sampled uniformly.
double fTNu
Time since the supernova core bounce for the current MARLEY neutrino vertex.
simb::MCTruth make_uniform_energy_mctruth(double E_min, double E_max, double &E_nu, const TLorentzVector &vertex_pos)
Creates a simb::MCTruth object using a uniformly-sampled neutrino energy.
std::unique_ptr< TH2D > fSpectrumHist
ROOT TH2D that contains the time-dependent spectrum to use when sampling neutrino times and energies...
std::unique_ptr< marley::Event > fEvent
unique_ptr to the current event created by MARLEY
Sample directly from cross-section weighted spectrum.
TimeGenSamplingMode fSamplingMode
Represents the sampling mode to use when selecting neutrino times and energies.
Neutrino energies were sampled uniformly.
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
void evgen::MarleyTimeGen::create_truths_time_fit ( simb::MCTruth mc_truth,
sim::SupernovaTruth sn_truth,
const TLorentzVector &  vertex_pos 
)
protected

Create simb::MCTruth and sim::SupernovaTruth objects using a neutrino spectrum described by a previously-parsed "fit"-format file.

Definition at line 1042 of file MARLEYTimeGen_module.cc.

References fEvent, fFitEmax, fFitEmin, fFluxAveragedCrossSection, fMarleyHelper, fSamplingMode, fTimeFits, fTNu, fWeight, HISTOGRAM, sim::kUnbiased, sim::kUniformEnergy, sim::kUniformTime, evgen::MarleyTimeGen::TimeFit::make_FitParameters_iterator(), evgen::MarleyTimeGen::FitParameters::make_luminosity_iterator(), make_uniform_energy_mctruth(), source_from_time_fit(), UNIFORM_ENERGY, and UNIFORM_TIME.

Referenced by produce().

1045 {
1046  // Get a reference to the generator object created by MARLEY (we'll need
1047  // to do a few fancy things with it other than just creating events)
1048  marley::Generator& gen = fMarleyHelper->get_generator();
1049 
1050  // Initialize the time bin index to something absurdly large. This will help
1051  // us detect strange bugs that arise when it is sampled incorrectly.
1052  size_t time_bin_index = std::numeric_limits<size_t>::max();
1053 
1054  // Create an object to represent the discrete time distribution given in
1055  // the spectrum file. Use the luminosity for each bin as its sampling weight.
1056  // This distribution will actually be used to sample a neutrino arrival time
1057  // unless we're using the uniform time sampling mode, in which case it will
1058  // be used to help calculate the neutrino vertex weight.
1059  int source_pdg_code = gen.get_source().get_pid();
1060 
1061  const auto fit_params_begin =
1062  TimeFit::make_FitParameters_iterator(source_pdg_code, fTimeFits.begin());
1063  const auto fit_params_end =
1064  TimeFit::make_FitParameters_iterator(source_pdg_code, fTimeFits.end());
1065 
1066  const auto lum_begin = FitParameters::make_luminosity_iterator(fit_params_begin);
1067  const auto lum_end = FitParameters::make_luminosity_iterator(fit_params_end);
1068 
1069  std::discrete_distribution<size_t> time_dist(lum_begin, lum_end);
1070 
1073  time_bin_index = gen.sample_from_distribution(time_dist);
1074  }
1075 
1077  int last_time_index = 0;
1078  if (fTimeFits.size() > 0) last_time_index = fTimeFits.size() - 1;
1079  std::uniform_int_distribution<size_t> uid(0, last_time_index);
1080  // for c2: time_bin_index has already been declared
1081  time_bin_index = gen.sample_from_distribution(uid);
1082  }
1083 
1084  else {
1085  throw cet::exception("MARLEYTimeGen") << "Unrecognized sampling mode"
1086  << " encountered in evgen::MarleyTimeGen::produce()";
1087  }
1088 
1089  // Sample a time uniformly from within the selected time bin. Note that
1090  // the entries in fTimeFits use the time_ member to store the bin left
1091  // edges. The module creates fTimeFits in such a way that its last element
1092  // will always have luminosity_ == 0. (zero sampling weight), so we may
1093  // always add one to the sampled bin index without worrying about going
1094  // off the edge.
1095  double t_min = fTimeFits.at(time_bin_index).Time();
1096  double t_max = fTimeFits.at(time_bin_index + 1).Time();
1097  // sample a time on [ t_min, t_max )
1098  fTNu = gen.uniform_random_double(t_min, t_max, false);
1099 
1100  // Create a "beta-fit" neutrino source using the correct parameters for the
1101  // sampled time bin. This will be used to sample a neutrino energy unless
1102  // we're using the uniform time sampling mode. For uniform time sampling,
1103  // it will be used to determine the neutrino event weight.
1104  const auto& fit = fTimeFits.at(time_bin_index);
1105  std::unique_ptr<marley::NeutrinoSource> nu_source = source_from_time_fit(fit);
1106 
1109  // Replace the generator's old source with the new one for the current
1110  // time bin
1111  gen.set_source(std::move(nu_source));
1112 
1113  // Generate a MARLEY event using the updated source
1114  mc_truth = fMarleyHelper->create_MCTruth(vertex_pos, fEvent.get());
1115 
1117  // Unbiased sampling creates neutrino vertices with unit weight
1118  fWeight = ONE;
1120  }
1121  else {
1122  // fSamplingMode == TimeGenSamplingMode::UNIFORM_TIME
1123 
1124  // Multiply by the likelihood ratio in order to correct for uniform
1125  // time sampling if we're using that biasing method
1126  double weight_bias = time_dist.probabilities().at(time_bin_index) / (t_max - t_min) *
1127  (fTimeFits.back().Time() - fTimeFits.front().Time());
1128 
1129  fWeight = weight_bias;
1131  }
1132  }
1133 
1135  double E_nu = std::numeric_limits<double>::lowest();
1136  mc_truth = make_uniform_energy_mctruth(fFitEmin, fFitEmax, E_nu, vertex_pos);
1137 
1138  // Get the value of the true dependent probability density (probability
1139  // of the sampled energy given the sampled time) to use as a biasing
1140  // correction in the neutrino vertex weight.
1141 
1142  // Load the generator with the neutrino source that represents the
1143  // true (i.e., unbiased) energy probability distribution. This will
1144  // create a normalized probability density that we can use to determine
1145  // the neutrino vertex weight.
1146  double nu_source_E_min = nu_source->get_Emin();
1147  double nu_source_E_max = nu_source->get_Emax();
1148  gen.set_source(std::move(nu_source));
1149 
1150  // NOTE: The marley::Generator object normalizes the E_pdf to unity
1151  // automatically, but just in case, we redo it here.
1152  double E_pdf_integ = integrate(
1153  [&gen](double E_nu) -> double { return gen.E_pdf(E_nu); }, nu_source_E_min, nu_source_E_max);
1154 
1155  // Compute the likelihood ratio that we need to bias the neutrino vertex
1156  // weight
1157  double weight_bias = (gen.E_pdf(E_nu) / E_pdf_integ) * (fFitEmax - fFitEmin);
1158 
1159  fWeight = weight_bias;
1161  }
1162 
1163  else {
1164  throw cet::exception("MARLEYTimeGen") << "Unrecognized sampling mode"
1165  << " encountered in evgen::MarleyTimeGen::produce()";
1166  }
1167 }
std::unique_ptr< evgen::MARLEYHelper > fMarleyHelper
Object that provides an interface to the MARLEY event generator.
double fFluxAveragedCrossSection
Flux-averaged total cross section (fm2, average is taken over all energies and times for all defined ...
double fWeight
Statistical weight for the current MARLEY neutrino vertex.
Arrival times were sampled uniformly.
std::unique_ptr< marley::NeutrinoSource > source_from_time_fit(const TimeFit &fit)
Create a MARLEY neutrino source object using a set of fit parameters for a particular time bin...
static marley::IteratorToMember< It, double > make_luminosity_iterator(It it)
Converts an iterator that points to a FitParameters object into an iterator that points to that objec...
double fTNu
Time since the supernova core bounce for the current MARLEY neutrino vertex.
simb::MCTruth make_uniform_energy_mctruth(double E_min, double E_max, double &E_nu, const TLorentzVector &vertex_pos)
Creates a simb::MCTruth object using a uniformly-sampled neutrino energy.
double fFitEmax
Maximum neutrino energy to consider when using a "fit"-format spectrum file.
static marley::IteratorToMember< It, FitParameters > make_FitParameters_iterator(int pdg_code, It iterator)
Converts an iterator that points to a TimeFit object into an iterator that points to the appropriate ...
std::unique_ptr< marley::Event > fEvent
unique_ptr to the current event created by MARLEY
Sample directly from cross-section weighted spectrum.
TimeGenSamplingMode fSamplingMode
Represents the sampling mode to use when selecting neutrino times and energies.
double fFitEmin
Minimum neutrino energy to consider when using a "fit"-format spectrum file.
std::vector< TimeFit > fTimeFits
Vector that contains the fit parameter information for each time bin when using a "fit"-format spectr...
Neutrino energies were sampled uniformly.
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
void art::detail::Producer::doBeginJob ( SharedResources const &  resources)
inherited

Definition at line 22 of file Producer.cc.

References art::detail::Producer::beginJobWithFrame(), and art::detail::Producer::setupQueues().

23  {
24  setupQueues(resources);
25  ProcessingFrame const frame{ScheduleID{}};
26  beginJobWithFrame(frame);
27  }
virtual void setupQueues(SharedResources const &)=0
virtual void beginJobWithFrame(ProcessingFrame const &)=0
bool art::detail::Producer::doBeginRun ( RunPrincipal rp,
ModuleContext const &  mc 
)
inherited

Definition at line 65 of file Producer.cc.

References art::detail::Producer::beginRunWithFrame(), art::RangeSet::forRun(), art::RunPrincipal::makeRun(), r, art::RunPrincipal::runID(), and art::ModuleContext::scheduleID().

66  {
67  auto r = rp.makeRun(mc, RangeSet::forRun(rp.runID()));
68  ProcessingFrame const frame{mc.scheduleID()};
69  beginRunWithFrame(r, frame);
70  r.commitProducts();
71  return true;
72  }
TRandom r
Definition: spectrum.C:23
virtual void beginRunWithFrame(Run &, ProcessingFrame const &)=0
static RangeSet forRun(RunID)
Definition: RangeSet.cc:51
bool art::detail::Producer::doBeginSubRun ( SubRunPrincipal srp,
ModuleContext const &  mc 
)
inherited

Definition at line 85 of file Producer.cc.

References art::detail::Producer::beginSubRunWithFrame(), art::RangeSet::forSubRun(), art::SubRunPrincipal::makeSubRun(), art::ModuleContext::scheduleID(), and art::SubRunPrincipal::subRunID().

86  {
87  auto sr = srp.makeSubRun(mc, RangeSet::forSubRun(srp.subRunID()));
88  ProcessingFrame const frame{mc.scheduleID()};
89  beginSubRunWithFrame(sr, frame);
90  sr.commitProducts();
91  return true;
92  }
virtual void beginSubRunWithFrame(SubRun &, ProcessingFrame const &)=0
static RangeSet forSubRun(SubRunID)
Definition: RangeSet.cc:57
void art::detail::Producer::doEndJob ( )
inherited

Definition at line 30 of file Producer.cc.

References art::detail::Producer::endJobWithFrame().

31  {
32  ProcessingFrame const frame{ScheduleID{}};
33  endJobWithFrame(frame);
34  }
virtual void endJobWithFrame(ProcessingFrame const &)=0
bool art::detail::Producer::doEndRun ( RunPrincipal rp,
ModuleContext const &  mc 
)
inherited

Definition at line 75 of file Producer.cc.

References art::detail::Producer::endRunWithFrame(), art::RunPrincipal::makeRun(), r, art::ModuleContext::scheduleID(), and art::Principal::seenRanges().

76  {
77  auto r = rp.makeRun(mc, rp.seenRanges());
78  ProcessingFrame const frame{mc.scheduleID()};
79  endRunWithFrame(r, frame);
80  r.commitProducts();
81  return true;
82  }
TRandom r
Definition: spectrum.C:23
virtual void endRunWithFrame(Run &, ProcessingFrame const &)=0
bool art::detail::Producer::doEndSubRun ( SubRunPrincipal srp,
ModuleContext const &  mc 
)
inherited

Definition at line 95 of file Producer.cc.

References art::detail::Producer::endSubRunWithFrame(), art::SubRunPrincipal::makeSubRun(), art::ModuleContext::scheduleID(), and art::Principal::seenRanges().

96  {
97  auto sr = srp.makeSubRun(mc, srp.seenRanges());
98  ProcessingFrame const frame{mc.scheduleID()};
99  endSubRunWithFrame(sr, frame);
100  sr.commitProducts();
101  return true;
102  }
virtual void endSubRunWithFrame(SubRun &, ProcessingFrame const &)=0
bool art::detail::Producer::doEvent ( EventPrincipal ep,
ModuleContext const &  mc,
std::atomic< std::size_t > &  counts_run,
std::atomic< std::size_t > &  counts_passed,
std::atomic< std::size_t > &  counts_failed 
)
inherited

Definition at line 105 of file Producer.cc.

References art::detail::Producer::checkPutProducts_, e, art::EventPrincipal::makeEvent(), art::detail::Producer::produceWithFrame(), and art::ModuleContext::scheduleID().

110  {
111  auto e = ep.makeEvent(mc);
112  ++counts_run;
113  ProcessingFrame const frame{mc.scheduleID()};
114  produceWithFrame(e, frame);
115  e.commitProducts(checkPutProducts_, &expectedProducts<InEvent>());
116  ++counts_passed;
117  return true;
118  }
bool const checkPutProducts_
Definition: Producer.h:70
Float_t e
Definition: plot.C:35
virtual void produceWithFrame(Event &, ProcessingFrame const &)=0
void art::detail::Producer::doRespondToCloseInputFile ( FileBlock const &  fb)
inherited

Definition at line 44 of file Producer.cc.

References art::detail::Producer::respondToCloseInputFileWithFrame().

45  {
46  ProcessingFrame const frame{ScheduleID{}};
48  }
virtual void respondToCloseInputFileWithFrame(FileBlock const &, ProcessingFrame const &)=0
TFile fb("Li6.root")
void art::detail::Producer::doRespondToCloseOutputFiles ( FileBlock const &  fb)
inherited

Definition at line 58 of file Producer.cc.

References art::detail::Producer::respondToCloseOutputFilesWithFrame().

59  {
60  ProcessingFrame const frame{ScheduleID{}};
62  }
virtual void respondToCloseOutputFilesWithFrame(FileBlock const &, ProcessingFrame const &)=0
TFile fb("Li6.root")
void art::detail::Producer::doRespondToOpenInputFile ( FileBlock const &  fb)
inherited

Definition at line 37 of file Producer.cc.

References art::detail::Producer::respondToOpenInputFileWithFrame().

38  {
39  ProcessingFrame const frame{ScheduleID{}};
41  }
virtual void respondToOpenInputFileWithFrame(FileBlock const &, ProcessingFrame const &)=0
TFile fb("Li6.root")
void art::detail::Producer::doRespondToOpenOutputFiles ( FileBlock const &  fb)
inherited

Definition at line 51 of file Producer.cc.

References art::detail::Producer::respondToOpenOutputFilesWithFrame().

52  {
53  ProcessingFrame const frame{ScheduleID{}};
55  }
virtual void respondToOpenOutputFilesWithFrame(FileBlock const &, ProcessingFrame const &)=0
TFile fb("Li6.root")
void art::Modifier::fillProductDescriptions ( )
inherited

Definition at line 10 of file Modifier.cc.

References art::ProductRegistryHelper::fillDescriptions(), and art::ModuleBase::moduleDescription().

11  {
13  }
void fillDescriptions(ModuleDescription const &md)
ModuleDescription const & moduleDescription() const
Definition: ModuleBase.cc:13
std::array< std::vector< ProductInfo >, NumBranchTypes > const & art::ModuleBase::getConsumables ( ) const
inherited

Definition at line 43 of file ModuleBase.cc.

References art::ModuleBase::collector_, and art::ConsumesCollector::getConsumables().

44  {
45  return collector_.getConsumables();
46  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
std::array< std::vector< ProductInfo >, NumBranchTypes > const & getConsumables() const
void evgen::MarleyTimeGen::make_final_timefit ( double  time)
protected

Helper function that makes a final dummy TimeFit object so that the final real time bin can have a right edge.

Definition at line 1247 of file MARLEYTimeGen_module.cc.

References fTimeFits.

Referenced by reconfigure().

1248 {
1249  // The final time bin has zero luminosity, and therefore zero sampling
1250  // weight. We need it to be present so that the last nonzero weight bin
1251  // has a right edge.
1252  fTimeFits.emplace_back(time, 0., 0., 0., 0., 0., 0., 0., 0., 0.);
1253 }
std::vector< TimeFit > fTimeFits
Vector that contains the fit parameter information for each time bin when using a "fit"-format spectr...
void evgen::MarleyTimeGen::make_nu_emission_histograms ( ) const
protected

Makes ROOT histograms showing the emitted neutrinos in each time bin when using a "fit"-format spectrum file.

Definition at line 1256 of file MARLEYTimeGen_module.cc.

References DEFINE_ART_MODULE, f, fTimeFits, evgen::MarleyTimeGen::TimeFit::GetFitParameters(), evgen::MarleyTimeGen::FitParameters::Luminosity(), evgen::MarleyTimeGen::TimeFit::Time(), x_max, and x_min.

Referenced by reconfigure().

1257 {
1258  // To make a histogram with variable size bins, ROOT needs the bin
1259  // low edges to be contiguous in memory. This is not true of the
1260  // stored times in fTimeFits, so we'll need to make a temporary copy
1261  // of them.
1262  std::vector<double> temp_times;
1263  for (const auto& fit : fTimeFits)
1264  temp_times.push_back(fit.Time());
1265 
1266  // If, for some reason, there are fewer than two time bins, just return
1267  // without making the histograms.
1268  // TODO: consider throwing an exception here
1269  if (temp_times.size() < 2) return;
1270 
1271  // Get the number of time bins
1272  int num_bins = temp_times.size() - 1;
1273 
1274  // Create some ROOT TH1D objects using the TFileService. These will store
1275  // the number of emitted neutrinos of each type in each time bin
1277  TH1D* nue_hist =
1278  tfs->make<TH1D>("NueEmission",
1279  "Number of emitted #nu_{e}; time (s); number of neutrinos in time bin",
1280  num_bins,
1281  temp_times.data());
1282  TH1D* nuebar_hist =
1283  tfs->make<TH1D>("NuebarEmission",
1284  "Number of emitted #bar{#nu}_{e}; time (s); number of neutrinos in"
1285  " time bin",
1286  num_bins,
1287  temp_times.data());
1288  TH1D* nux_hist =
1289  tfs->make<TH1D>("NuxEmission",
1290  "Number of emitted #nu_{x}; time (s); number of neutrinos in time bin",
1291  num_bins,
1292  temp_times.data());
1293 
1294  // Load the histograms with the emitted neutrino counts
1295  for (size_t b = 1; b < temp_times.size(); ++b) {
1296  const TimeFit& current_fit = fTimeFits.at(b - 1);
1297  const TimeFit& next_fit = fTimeFits.at(b);
1298  double bin_deltaT = next_fit.Time() - current_fit.Time();
1299 
1300  const auto& nue_params = current_fit.GetFitParameters(marley_utils::ELECTRON_NEUTRINO);
1301  const auto& nuebar_params = current_fit.GetFitParameters(marley_utils::ELECTRON_ANTINEUTRINO);
1302  const auto& nux_params = current_fit.GetFitParameters(marley_utils::MUON_NEUTRINO);
1303 
1304  // Convert from bin luminosity to number of neutrinos by
1305  // multiplying by the bin time interval and dividing by the
1306  // mean neutrino energy
1307  double num_nue = 0.;
1308  double num_nuebar = 0.;
1309  double num_nux = 0.;
1310  if (nue_params.Emean() != 0.)
1311  num_nue = nue_params.Luminosity() * bin_deltaT / (nue_params.Emean() * MeV_to_erg);
1312  if (nuebar_params.Emean() != 0.)
1313  num_nuebar = nuebar_params.Luminosity() * bin_deltaT / (nuebar_params.Emean() * MeV_to_erg);
1314  if (nux_params.Emean() != 0.)
1315  num_nux = nux_params.Luminosity() * bin_deltaT / (nux_params.Emean() * MeV_to_erg);
1316 
1317  nue_hist->SetBinContent(b, num_nue);
1318  nuebar_hist->SetBinContent(b, num_nuebar);
1319  nux_hist->SetBinContent(b, num_nux);
1320  }
1321 }
std::vector< TimeFit > fTimeFits
Vector that contains the fit parameter information for each time bin when using a "fit"-format spectr...
simb::MCTruth evgen::MarleyTimeGen::make_uniform_energy_mctruth ( double  E_min,
double  E_max,
double &  E_nu,
const TLorentzVector &  vertex_pos 
)
protected

Creates a simb::MCTruth object using a uniformly-sampled neutrino energy.

This function samples a reacting neutrino energy uniformly from the full range of energies allowed by the incident spectrum and the currently defined reactions.

Definition at line 1198 of file MARLEYTimeGen_module.cc.

References fEvent, and fMarleyHelper.

Referenced by create_truths_th2d(), and create_truths_time_fit().

1202 {
1203  marley::Generator& gen = fMarleyHelper->get_generator();
1204 
1205  // Sample an energy uniformly over the entire allowed range
1206  double total_xs;
1207  int j = 0;
1208  do {
1209  // We have to check that the cross section is nonzero for the sampled
1210  // energy (otherwise we'll generate an unphysical event). However, if the
1211  // user has given us a histogram that is below threshold, the
1212  // program could get stuck here endlessly, sampling rejected energy
1213  // after rejected energy. Just in case, we cap the total number of tries
1214  // and quit if things don't work out.
1215  if (j >= MAX_UNIFORM_ENERGY_ITERATIONS) {
1216  throw cet::exception("MARLEYTimeGen")
1217  << "Exceeded the maximum of " << MAX_UNIFORM_ENERGY_ITERATIONS
1218  << " while attempting to sample"
1219  << " a neutrino energy uniformly.";
1220  }
1221  // Sample an energy uniformly on [ E_min, E_max )
1222  E_nu = gen.uniform_random_double(E_min, E_max, false);
1223  total_xs = 0.;
1224  // Check that at least one defined reaction has a non-zero total
1225  // cross section at the sampled energy. If this is not the case, try
1226  // again.
1227  for (const auto& react : gen.get_reactions()) {
1228  total_xs += react->total_xs(marley_utils::ELECTRON_NEUTRINO, E_nu);
1229  }
1230 
1231  ++j;
1232  } while (total_xs <= 0.);
1233 
1234  // Replace the existing neutrino source with a monoenergetic one at the
1235  // neutrino energy that was just sampled above
1236  std::unique_ptr<marley::NeutrinoSource> nu_source =
1237  std::make_unique<marley::MonoNeutrinoSource>(marley_utils::ELECTRON_NEUTRINO, E_nu);
1238  gen.set_source(std::move(nu_source));
1239 
1240  // Generate a MARLEY event using the new monoenergetic source
1241  auto mc_truth = fMarleyHelper->create_MCTruth(vertex_pos, fEvent.get());
1242 
1243  return mc_truth;
1244 }
std::unique_ptr< evgen::MARLEYHelper > fMarleyHelper
Object that provides an interface to the MARLEY event generator.
std::unique_ptr< marley::Event > fEvent
unique_ptr to the current event created by MARLEY
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
std::unique_ptr< Worker > art::ModuleBase::makeWorker ( WorkerParams const &  wp)
inherited

Definition at line 37 of file ModuleBase.cc.

References art::ModuleBase::doMakeWorker(), and art::NumBranchTypes.

38  {
39  return doMakeWorker(wp);
40  }
virtual std::unique_ptr< Worker > doMakeWorker(WorkerParams const &wp)=0
template<typename T , BranchType BT>
ProductToken< T > art::ModuleBase::mayConsume ( InputTag const &  tag)
protectedinherited

Definition at line 82 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::mayConsume().

83  {
84  return collector_.mayConsume<T, BT>(tag);
85  }
ProductToken< T > mayConsume(InputTag const &)
ConsumesCollector collector_
Definition: ModuleBase.h:56
template<typename T , BranchType BT>
void art::ModuleBase::mayConsumeMany ( )
protectedinherited

Definition at line 96 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::mayConsumeMany().

97  {
98  collector_.mayConsumeMany<T, BT>();
99  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::ModuleBase::mayConsumeView ( InputTag const &  )
protectedinherited
template<typename T , BranchType BT>
ViewToken<T> art::ModuleBase::mayConsumeView ( InputTag const &  tag)
inherited

Definition at line 89 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::mayConsumeView().

90  {
91  return collector_.mayConsumeView<T, BT>(tag);
92  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
ViewToken< Element > mayConsumeView(InputTag const &)
ModuleDescription const & art::ModuleBase::moduleDescription ( ) const
inherited

Definition at line 13 of file ModuleBase.cc.

References art::errors::LogicError.

Referenced by art::OutputModule::doRespondToOpenInputFile(), art::OutputModule::doWriteEvent(), art::Modifier::fillProductDescriptions(), art::OutputModule::makePlugins_(), art::OutputWorker::OutputWorker(), reco::shower::LArPandoraModularShowerCreation::produce(), art::Modifier::registerProducts(), and art::OutputModule::registerProducts().

14  {
15  if (md_.has_value()) {
16  return *md_;
17  }
18 
20  "There was an error while calling moduleDescription().\n"}
21  << "The moduleDescription() base-class member function cannot be called\n"
22  "during module construction. To determine which module is "
23  "responsible\n"
24  "for calling it, find the '<module type>:<module "
25  "label>@Construction'\n"
26  "tag in the message prefix above. Please contact artists@fnal.gov\n"
27  "for guidance.\n";
28  }
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
std::optional< ModuleDescription > md_
Definition: ModuleBase.h:55
void evgen::MarleyTimeGen::produce ( art::Event e)
overridevirtual

Implements art::EDProducer.

Definition at line 695 of file MARLEYTimeGen_module.cc.

References create_truths_th2d(), create_truths_time_fit(), art::Event::event(), fEventNumber, fEventTree, FIT, fNeutrinosPerEvent, fRunNumber, fSpectrumFileFormat, fSubRunNumber, fTNu, fVertexSampler, n, art::Event::put(), RootTH2D, art::Event::run(), and art::Event::subRun().

696 {
698 
699  // Get the run, subrun, and event numbers from the current art::Event
700  fRunNumber = e.run();
701  fSubRunNumber = e.subRun();
702  fEventNumber = e.event();
703 
704  // Prepare associations and vectors of truth objects that will be produced
705  // and loaded into the current art::Event
706  std::unique_ptr<std::vector<simb::MCTruth>> truthcol(new std::vector<simb::MCTruth>);
707 
708  std::unique_ptr<std::vector<sim::SupernovaTruth>> sn_truthcol(
709  new std::vector<sim::SupernovaTruth>);
710 
711  std::unique_ptr<art::Assns<simb::MCTruth, sim::SupernovaTruth>> truth_assns(
713 
714  // Create temporary truth objects that we will use to load the event
715  simb::MCTruth truth;
716  sim::SupernovaTruth sn_truth;
717 
718  for (unsigned int n = 0; n < fNeutrinosPerEvent; ++n) {
719 
720  // Sample a primary vertex location for this event
721  TLorentzVector vertex_pos = fVertexSampler->sample_vertex_pos(*geo);
722 
723  // Reset the neutrino's time-since-supernova to a bogus value (for now)
724  fTNu = std::numeric_limits<double>::lowest();
725 
727  create_truths_th2d(truth, sn_truth, vertex_pos);
728  }
730  create_truths_time_fit(truth, sn_truth, vertex_pos);
731  }
732  else {
733  throw cet::exception("MARLEYTimeGen")
734  << "Invalid spectrum file"
735  << " format encountered in evgen::MarleyTimeGen::produce()";
736  }
737 
738  // Write the marley::Event object to the event tree
739  fEventTree->Fill();
740 
741  // Add the truth objects to the appropriate vectors
742  truthcol->push_back(truth);
743 
744  sn_truthcol->push_back(sn_truth);
745 
746  // Associate the last entries in each of the truth object vectors (the
747  // truth objects that were just created for the current neutrino vertex)
748  // with each other
749  truth_assns->addSingle(art::PtrMaker<simb::MCTruth>{e}(truthcol->size() - 1),
750  art::PtrMaker<sim::SupernovaTruth>{e}(sn_truthcol->size() - 1));
751  }
752 
753  // Load the completed truth object vectors and associations into the event
754  e.put(std::move(truthcol));
755 
756  e.put(std::move(sn_truthcol));
757 
758  e.put(std::move(truth_assns));
759 }
SubRunNumber_t subRun() const
Definition: Event.cc:35
SpectrumFileFormat fSpectrumFileFormat
Format to assume for the neutrino spectrum input file.
uint_fast32_t fEventNumber
Event number from the art::Event being processed.
void create_truths_time_fit(simb::MCTruth &mc_truth, sim::SupernovaTruth &sn_truth, const TLorentzVector &vertex_pos)
Create simb::MCTruth and sim::SupernovaTruth objects using a neutrino spectrum described by a previou...
std::unique_ptr< evgen::ActiveVolumeVertexSampler > fVertexSampler
Algorithm that allows us to sample vertex locations within the active volume(s) of the detector...
TTree * fEventTree
The event TTree created by MARLEY.
PutHandle< PROD > put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
Definition: Event.h:77
uint_fast32_t fSubRunNumber
Subrun number from the art::Event being processed.
uint_fast32_t fRunNumber
Run number from the art::Event being processed.
void create_truths_th2d(simb::MCTruth &mc_truth, sim::SupernovaTruth &sn_truth, const TLorentzVector &vertex_pos)
Create simb::MCTruth and sim::SupernovaTruth objects using spectrum information from a ROOT TH2D...
double fTNu
Time since the supernova core bounce for the current MARLEY neutrino vertex.
EventNumber_t event() const
Definition: Event.cc:41
unsigned int fNeutrinosPerEvent
The number of MARLEY neutrino vertices to generate in each art::Event.
Char_t n[5]
Event generator information.
Definition: MCTruth.h:32
RunNumber_t run() const
Definition: Event.cc:29
Namespace collecting geometry-related classes utilities.
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
void evgen::MarleyTimeGen::reconfigure ( const Parameters p)
virtual

Definition at line 762 of file MARLEYTimeGen_module.cc.

References ALPHA, BETA, fFitEmax, fFitEmin, fFluxAveragedCrossSection, FIT, fMarleyHelper, fNeutrinosPerEvent, fPinchType, fSamplingMode, fSpectrumFileFormat, fSpectrumHist, fTimeFits, fVertexSampler, art::ProducerTable< UserConfig, ImplicitConfig, UserKeysToIgnore >::get_PSet(), evgen::MarleyTimeGen::TimeFit::GetFitParameters(), HISTOGRAM, evgen::MarleyTimeGen::FitParameters::Luminosity(), make_final_timefit(), make_nu_emission_histograms(), MF_LOG_INFO, MF_LOG_WARNING, RootTH2D, source_from_time_fit(), UNIFORM_ENERGY, and UNIFORM_TIME.

Referenced by MarleyTimeGen().

763 {
764  const auto& seed_service = art::ServiceHandle<rndm::NuRandomService>();
765  const auto& geom_service = art::ServiceHandle<geo::Geometry const>();
766 
767  // Create a new evgen::ActiveVolumeVertexSampler object based on the current
768  // configuration
769  fVertexSampler = std::make_unique<evgen::ActiveVolumeVertexSampler>(
770  p().vertex_, *seed_service, *geom_service, "MARLEY_Vertex_Sampler");
771 
772  // Create a new marley::Generator object based on the current configuration
773  const fhicl::ParameterSet marley_pset =
774  p.get_PSet().get<fhicl::ParameterSet>("marley_parameters");
775  fMarleyHelper = std::make_unique<MARLEYHelper>(marley_pset, *seed_service, "MARLEY");
776 
777  // Get the number of neutrino vertices per event from the FHiCL parameters
778  fNeutrinosPerEvent = p().nu_per_event_();
779 
780  // Determine the current sampling mode from the FHiCL parameters
781  const std::string& samp_mode_str = p().sampling_mode_();
782  if (samp_mode_str == "histogram")
784  else if (samp_mode_str == "uniform time")
786  else if (samp_mode_str == "uniform energy")
788  else
789  throw cet::exception("MARLEYTimeGen") << "Invalid sampling mode \"" << samp_mode_str << "\""
790  << " specified for the MARLEYTimeGen module.";
791 
792  MF_LOG_INFO("MARLEYTimeGen") << fNeutrinosPerEvent << " neutrino vertices"
793  << " will be generated for each art::Event using the \""
794  << samp_mode_str << "\" sampling mode.";
795 
796  // Retrieve the time-dependent neutrino spectrum from the spectrum file.
797  // Use different methods depending on the file's format.
798  std::string spectrum_file_format = marley_utils::to_lowercase(p().spectrum_file_format_());
799 
800  if (spectrum_file_format == "th2d")
802  else if (spectrum_file_format == "fit") {
804 
805  std::string pinch_type;
806  if (!p().pinching_parameter_type_(pinch_type)) {
807  throw cet::exception("MARLEYTimeGen") << "Missing pinching parameter"
808  << " type for a \"fit\" format spectrum file";
809  }
810 
811  marley_utils::to_lowercase_inplace(pinch_type);
812  if (pinch_type == "alpha")
814  else if (pinch_type == "beta")
816  else
817  throw cet::exception("MARLEYTimeGen") << "Invalid pinching parameter type \"" << pinch_type
818  << "\" specified for the MARLEYTimeGen module.";
819 
820  if (!p().fit_Emin_(fFitEmin))
821  throw cet::exception("MARLEYTimeGen")
822  << "Missing minimum energy for a \"fit\" format spectrum"
823  << " used by the MARLEYTimeGen module.";
824 
825  if (!p().fit_Emax_(fFitEmax))
826  throw cet::exception("MARLEYTimeGen")
827  << "Missing maximum energy for a \"fit\" format spectrum"
828  << " used by the MARLEYTimeGen module.";
829 
830  if (fFitEmax < fFitEmin)
831  throw cet::exception("MARLEYTimeGen")
832  << "Maximum energy is less than the minimum energy for"
833  << " a \"fit\" format spectrum used by the MARLEYTimeGen module.";
834  }
835  else
836  throw cet::exception("MARLEYTimeGen")
837  << "Invalid spectrum file format \"" << p().spectrum_file_format_()
838  << "\" specified for the MARLEYTimeGen module.";
839 
840  // Determine the full file name (including path) of the spectrum file
841  std::string full_spectrum_file_name = fMarleyHelper->find_file(p().spectrum_file_(), "spectrum");
842 
843  marley::Generator& gen = fMarleyHelper->get_generator();
844 
846 
847  // Retrieve the time-dependent neutrino flux from a ROOT file
848  std::unique_ptr<TFile> spectrum_file =
849  std::make_unique<TFile>(full_spectrum_file_name.c_str(), "read");
850  TH2D* temp_h2 = nullptr;
851  std::string namecycle;
852  if (!p().namecycle_(namecycle)) {
853  throw cet::exception("MARLEYTimeGen") << "Missing namecycle for"
854  << " a TH2D spectrum file";
855  }
856 
857  spectrum_file->GetObject(namecycle.c_str(), temp_h2);
858  fSpectrumHist.reset(temp_h2);
859 
860  // Disassociate the TH2D from its parent TFile. If we fail to do this,
861  // then ROOT will auto-delete the TH2D when the TFile goes out of scope.
862  fSpectrumHist->SetDirectory(nullptr);
863 
864  // Compute the flux-averaged total cross section using MARLEY. This will be
865  // used to compute neutrino vertex weights for the sim::SupernovaTruth
866  // objects.
867 
868  // Get a 1D projection of the energy spectrum (integrated over time)
869  TH1D* energy_spect = fSpectrumHist->ProjectionY("energy_spect");
870 
871  // Create a new MARLEY neutrino source object using this projection
872  // TODO: replace the hard-coded electron neutrino PDG code here (and in
873  // several other places in this source file) when you're ready to use
874  // MARLEY with multiple neutrino flavors
875  std::unique_ptr<marley::NeutrinoSource> nu_source =
876  marley_root::make_root_neutrino_source(marley_utils::ELECTRON_NEUTRINO, energy_spect);
877 
878  // Factor of hbar_c^2 converts from MeV^(-2) to fm^2
879  fFluxAveragedCrossSection = marley_utils::hbar_c2 * flux_averaged_total_xs(*nu_source, gen);
880 
881  // For speed, sample energies first whenever possible (and then sample from
882  // an energy-dependent timing distribution). This avoids unnecessary calls
883  // to MARLEY to change the energy spectrum.
886  gen.set_source(std::move(nu_source));
887  }
888 
889  } // spectrum_file_format == "th2d"
890 
892 
893  // Clear out the old parameterized spectrum, if one exists
894  fTimeFits.clear();
895 
896  std::ifstream fit_file(full_spectrum_file_name);
897  std::string line;
898 
899  bool found_end = false;
900 
901  // current line number
902  int line_num = 0;
903  // number of lines checked in last call to marley_utils::get_next_line()
904  int lines_checked = 0;
905 
906  double old_time = std::numeric_limits<double>::lowest();
907 
908  while (line = marley_utils::get_next_line(fit_file, rx_comment_or_empty, false, lines_checked),
909  line_num += lines_checked,
910  !line.empty()) {
911  if (found_end) {
912  MF_LOG_WARNING("MARLEYTimeGen") << "Trailing content after last time"
913  << " bin found on line " << line_num
914  << " of the spectrum file " << full_spectrum_file_name;
915  }
916 
917  double time;
918  double Emean_nue, alpha_nue, luminosity_nue;
919  double Emean_nuebar, alpha_nuebar, luminosity_nuebar;
920  double Emean_nux, alpha_nux, luminosity_nux;
921  std::istringstream iss(line);
922  bool ok_first = static_cast<bool>(iss >> time);
923 
924  if (time <= old_time)
925  throw cet::exception("MARLEYTimeGen")
926  << "Time bin left edges given in the spectrum file must be"
927  << " strictly increasing. Invalid time bin value found on line " << line_num
928  << " of the spectrum file " << full_spectrum_file_name;
929  else
930  old_time = time;
931 
932  bool ok_rest = static_cast<bool>(iss >> Emean_nue >> alpha_nue >> luminosity_nue >>
933  Emean_nuebar >> alpha_nuebar >> luminosity_nuebar >>
934  Emean_nux >> alpha_nux >> luminosity_nux);
935 
936  if (ok_first) {
937  // We haven't reached the final bin, so add another time bin
938  // in the typical way.
939  if (ok_rest) {
940  fTimeFits.emplace_back(time,
941  Emean_nue,
942  alpha_nue,
943  luminosity_nue,
944  Emean_nuebar,
945  alpha_nuebar,
946  luminosity_nuebar,
947  Emean_nux,
948  alpha_nux,
949  luminosity_nux);
950  }
951  else {
952  make_final_timefit(time);
953  found_end = true;
954  }
955  }
956  else
957  throw cet::exception("MARLEYTimeGen")
958  << "Parse error on line " << line_num << " of the spectrum file "
959  << full_spectrum_file_name;
960  }
961 
962  if (!found_end) {
963 
964  size_t num_time_bins = fTimeFits.size();
965  if (num_time_bins < 2)
966  throw cet::exception("MARLEYTimeGen")
967  << "Missing right edge for the final time bin in the spectrum file "
968  << full_spectrum_file_name << ". Unable to guess a bin width for the "
969  << " final bin.";
970 
971  // Guess that the width of the penultimate time bin and the width of
972  // the final time bin are the same
973  double delta_t_bin = fTimeFits.back().Time() - fTimeFits.at(num_time_bins - 2).Time();
974 
975  double last_bin_right_edge = fTimeFits.back().Time() + delta_t_bin;
976 
977  make_final_timefit(last_bin_right_edge);
978 
979  MF_LOG_WARNING("MARLEYTimeGen")
980  << "Missing right"
981  << " edge for the final time bin in the spectrum file " << full_spectrum_file_name
982  << ". Assuming a width of " << delta_t_bin << " s for the final bin.";
983  }
984 
985  // Compute the flux-averaged total cross section for the fitted spectrum.
986  // We will need this to compute neutrino vertex weights.
987  std::vector<std::unique_ptr<marley::NeutrinoSource>> fit_sources;
988  for (const auto& fit : fTimeFits) {
989  fit_sources.emplace_back(source_from_time_fit(fit));
990  }
991 
992  // TODO: add handling for non-nu_e neutrino types when suitable data become
993  // available in MARLEY
994  auto temp_source = std::make_unique<marley::FunctionNeutrinoSource>(
995  marley_utils::ELECTRON_NEUTRINO,
996  fFitEmin,
997  fFitEmax,
998  [&fit_sources, this](double E_nu) -> double {
999  double flux = 0.;
1000  for (size_t s = 0; s < fit_sources.size(); ++s) {
1001 
1002  const TimeFit& current_fit = this->fTimeFits.at(s);
1003  const auto& current_source = fit_sources.at(s);
1004  const FitParameters& params = current_fit.GetFitParameters(current_source->get_pid());
1005 
1006  double lum = params.Luminosity();
1007 
1008  // Skip entries with zero luminosity, since they won't contribute
1009  // anything to the overall integral. Skip negative luminosity ones as
1010  // well, just in case.
1011  if (lum <= 0.) continue;
1012 
1013  flux += lum * current_source->pdf(E_nu);
1014  }
1015  return flux;
1016  });
1017 
1018  double flux_integ = 0.;
1019  double tot_xs_integ = 0.;
1020  flux_averaged_total_xs(*temp_source, gen, flux_integ, tot_xs_integ);
1021 
1022  // Factor of hbar_c^2 converts from MeV^(-2) to fm^2
1023  fFluxAveragedCrossSection = marley_utils::hbar_c2 * tot_xs_integ / flux_integ;
1024 
1026 
1027  } // spectrum_file_format == "fit"
1028 
1029  else {
1030  throw cet::exception("MARLEYTimeGen")
1031  << "Unrecognized neutrino spectrum"
1032  << " file format \"" << p().spectrum_file_format_() << "\" encountered"
1033  << " in evgen::MarleyTimeGen::reconfigure()";
1034  }
1035 
1036  MF_LOG_INFO("MARLEYTimeGen") << "The flux-averaged total cross section"
1037  << " predicted by MARLEY for the current supernova spectrum is "
1038  << fFluxAveragedCrossSection << " fm^2";
1039 }
SpectrumFileFormat fSpectrumFileFormat
Format to assume for the neutrino spectrum input file.
PinchParamType fPinchType
The pinching parameter convention to use when interpreting the time-dependent fits.
std::unique_ptr< evgen::ActiveVolumeVertexSampler > fVertexSampler
Algorithm that allows us to sample vertex locations within the active volume(s) of the detector...
std::unique_ptr< evgen::MARLEYHelper > fMarleyHelper
Object that provides an interface to the MARLEY event generator.
double fFluxAveragedCrossSection
Flux-averaged total cross section (fm2, average is taken over all energies and times for all defined ...
std::unique_ptr< marley::NeutrinoSource > source_from_time_fit(const TimeFit &fit)
Create a MARLEY neutrino source object using a set of fit parameters for a particular time bin...
T get(std::string const &key) const
Definition: ParameterSet.h:314
double fFitEmax
Maximum neutrino energy to consider when using a "fit"-format spectrum file.
#define MF_LOG_INFO(category)
std::unique_ptr< TH2D > fSpectrumHist
ROOT TH2D that contains the time-dependent spectrum to use when sampling neutrino times and energies...
unsigned int fNeutrinosPerEvent
The number of MARLEY neutrino vertices to generate in each art::Event.
TimeGenSamplingMode fSamplingMode
Represents the sampling mode to use when selecting neutrino times and energies.
double fFitEmin
Minimum neutrino energy to consider when using a "fit"-format spectrum file.
void make_final_timefit(double time)
Helper function that makes a final dummy TimeFit object so that the final real time bin can have a ri...
std::vector< TimeFit > fTimeFits
Vector that contains the fit parameter information for each time bin when using a "fit"-format spectr...
#define MF_LOG_WARNING(category)
void make_nu_emission_histograms() const
Makes ROOT histograms showing the emitted neutrinos in each time bin when using a "fit"-format spectr...
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
void art::Modifier::registerProducts ( ProductDescriptions productsToRegister)
inherited

Definition at line 16 of file Modifier.cc.

References art::ModuleBase::moduleDescription(), and art::ProductRegistryHelper::registerProducts().

17  {
18  ProductRegistryHelper::registerProducts(productsToRegister,
20  }
void registerProducts(ProductDescriptions &productsToRegister, ModuleDescription const &md)
ModuleDescription const & moduleDescription() const
Definition: ModuleBase.cc:13
void art::ModuleBase::setModuleDescription ( ModuleDescription const &  md)
inherited

Definition at line 31 of file ModuleBase.cc.

References art::ModuleBase::md_.

32  {
33  md_ = md;
34  }
std::optional< ModuleDescription > md_
Definition: ModuleBase.h:55
void art::ModuleBase::sortConsumables ( std::string const &  current_process_name)
inherited

Definition at line 49 of file ModuleBase.cc.

References art::ModuleBase::collector_, and art::ConsumesCollector::sortConsumables().

50  {
51  // Now that we know we have seen all the consumes declarations,
52  // sort the results for fast lookup later.
53  collector_.sortConsumables(current_process_name);
54  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
void sortConsumables(std::string const &current_process_name)
std::unique_ptr< marley::NeutrinoSource > evgen::MarleyTimeGen::source_from_time_fit ( const TimeFit fit)
protected

Create a MARLEY neutrino source object using a set of fit parameters for a particular time bin.

Definition at line 1170 of file MARLEYTimeGen_module.cc.

References evgen::MarleyTimeGen::FitParameters::Alpha(), ALPHA, BETA, evgen::MarleyTimeGen::FitParameters::Emean(), fFitEmax, fFitEmin, fPinchType, and evgen::MarleyTimeGen::TimeFit::GetFitParameters().

Referenced by create_truths_time_fit(), and reconfigure().

1172 {
1173  // Create a "beta-fit" neutrino source using the given fit parameters.
1174 
1175  // The two common fitting schemes (alpha and beta) differ in their
1176  // definitions by \beta = \alpha + 1.
1177  // TODO: add handling for non-nu_e neutrino types
1178  const FitParameters& nue_parameters = fit.GetFitParameters(marley_utils::ELECTRON_NEUTRINO);
1179 
1180  double beta = nue_parameters.Alpha();
1182  beta += 1.;
1183  else if (fPinchType != PinchParamType::BETA) {
1184  throw cet::exception("MARLEYTimeGen")
1185  << "Unreognized pinching parameter"
1186  << " type encountered in evgen::MarleyTimeGen::source_from_time_fit()";
1187  }
1188 
1189  // Create the new source
1190  std::unique_ptr<marley::NeutrinoSource> nu_source =
1191  std::make_unique<marley::BetaFitNeutrinoSource>(
1192  marley_utils::ELECTRON_NEUTRINO, fFitEmin, fFitEmax, nue_parameters.Emean(), beta);
1193 
1194  return nu_source;
1195 }
PinchParamType fPinchType
The pinching parameter convention to use when interpreting the time-dependent fits.
double fFitEmax
Maximum neutrino energy to consider when using a "fit"-format spectrum file.
double fFitEmin
Minimum neutrino energy to consider when using a "fit"-format spectrum file.
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33

Member Data Documentation

std::unique_ptr<marley::Event> evgen::MarleyTimeGen::fEvent
protected

unique_ptr to the current event created by MARLEY

Definition at line 399 of file MARLEYTimeGen_module.cc.

Referenced by create_truths_th2d(), create_truths_time_fit(), make_uniform_energy_mctruth(), and MarleyTimeGen().

uint_fast32_t evgen::MarleyTimeGen::fEventNumber
protected

Event number from the art::Event being processed.

Definition at line 496 of file MARLEYTimeGen_module.cc.

Referenced by MarleyTimeGen(), and produce().

TTree* evgen::MarleyTimeGen::fEventTree
protected

The event TTree created by MARLEY.

This tree will be saved to the "hist" output file for validation purposes. The tree contains the same information as the generated simb::MCTruth objects, but in MARLEY's internal format

Definition at line 489 of file MARLEYTimeGen_module.cc.

Referenced by MarleyTimeGen(), and produce().

double evgen::MarleyTimeGen::fFitEmax
protected

Maximum neutrino energy to consider when using a "fit"-format spectrum file.

Definition at line 520 of file MARLEYTimeGen_module.cc.

Referenced by create_truths_time_fit(), reconfigure(), and source_from_time_fit().

double evgen::MarleyTimeGen::fFitEmin
protected

Minimum neutrino energy to consider when using a "fit"-format spectrum file.

Definition at line 516 of file MARLEYTimeGen_module.cc.

Referenced by create_truths_time_fit(), reconfigure(), and source_from_time_fit().

double evgen::MarleyTimeGen::fFluxAveragedCrossSection
protected

Flux-averaged total cross section (fm2, average is taken over all energies and times for all defined reactions) used by MARLEY to generate neutrino vertices.

Definition at line 508 of file MARLEYTimeGen_module.cc.

Referenced by create_truths_th2d(), create_truths_time_fit(), MarleyTimeGen(), and reconfigure().

std::unique_ptr<evgen::MARLEYHelper> evgen::MarleyTimeGen::fMarleyHelper
protected

Object that provides an interface to the MARLEY event generator.

Definition at line 392 of file MARLEYTimeGen_module.cc.

Referenced by create_truths_th2d(), create_truths_time_fit(), make_uniform_energy_mctruth(), and reconfigure().

unsigned int evgen::MarleyTimeGen::fNeutrinosPerEvent
protected

The number of MARLEY neutrino vertices to generate in each art::Event.

Definition at line 512 of file MARLEYTimeGen_module.cc.

Referenced by produce(), and reconfigure().

PinchParamType evgen::MarleyTimeGen::fPinchType
protected

The pinching parameter convention to use when interpreting the time-dependent fits.

Definition at line 463 of file MARLEYTimeGen_module.cc.

Referenced by reconfigure(), and source_from_time_fit().

uint_fast32_t evgen::MarleyTimeGen::fRunNumber
protected

Run number from the art::Event being processed.

Definition at line 492 of file MARLEYTimeGen_module.cc.

Referenced by MarleyTimeGen(), and produce().

TimeGenSamplingMode evgen::MarleyTimeGen::fSamplingMode
protected

Represents the sampling mode to use when selecting neutrino times and energies.

Definition at line 432 of file MARLEYTimeGen_module.cc.

Referenced by create_truths_th2d(), create_truths_time_fit(), and reconfigure().

SpectrumFileFormat evgen::MarleyTimeGen::fSpectrumFileFormat
protected

Format to assume for the neutrino spectrum input file.

Definition at line 483 of file MARLEYTimeGen_module.cc.

Referenced by produce(), and reconfigure().

std::unique_ptr<TH2D> evgen::MarleyTimeGen::fSpectrumHist
protected

ROOT TH2D that contains the time-dependent spectrum to use when sampling neutrino times and energies.

This member is only used when reading the spectrum from a ROOT file.

Definition at line 405 of file MARLEYTimeGen_module.cc.

Referenced by create_truths_th2d(), and reconfigure().

uint_fast32_t evgen::MarleyTimeGen::fSubRunNumber
protected

Subrun number from the art::Event being processed.

Definition at line 494 of file MARLEYTimeGen_module.cc.

Referenced by MarleyTimeGen(), and produce().

std::vector<TimeFit> evgen::MarleyTimeGen::fTimeFits
protected

Vector that contains the fit parameter information for each time bin when using a "fit"-format spectrum file.

This member is unused when the spectrum is read from a ROOT file.

Definition at line 411 of file MARLEYTimeGen_module.cc.

Referenced by create_truths_time_fit(), make_final_timefit(), make_nu_emission_histograms(), and reconfigure().

double evgen::MarleyTimeGen::fTNu
protected

Time since the supernova core bounce for the current MARLEY neutrino vertex.

Definition at line 500 of file MARLEYTimeGen_module.cc.

Referenced by create_truths_th2d(), create_truths_time_fit(), MarleyTimeGen(), and produce().

std::unique_ptr<evgen::ActiveVolumeVertexSampler> evgen::MarleyTimeGen::fVertexSampler
protected

Algorithm that allows us to sample vertex locations within the active volume(s) of the detector.

Definition at line 396 of file MARLEYTimeGen_module.cc.

Referenced by produce(), and reconfigure().

double evgen::MarleyTimeGen::fWeight
protected

Statistical weight for the current MARLEY neutrino vertex.

Definition at line 503 of file MARLEYTimeGen_module.cc.

Referenced by create_truths_th2d(), create_truths_time_fit(), and MarleyTimeGen().


The documentation for this class was generated from the following file: