9 #ifndef LARSIM_ALGORITHMS_MARLEYGENERATOR_H 10 #define LARSIM_ALGORITHMS_MARLEYGENERATOR_H 39 #include "TLorentzVector.h" 42 #include "marley/Generator.hh" 43 #include "marley/JSON.hh" 44 #include "marley/Particle.hh" 61 Comment(
"Type of neutrino source for MARLEY to use")
66 Comment(
"Kind of neutrino (flavor, matter/antimatter) that the" 67 " neutrino source produces")
72 Comment(
"Minimum energy (MeV) of the neutrinos produced by this" 76 return (type ==
"fermi-dirac") || (type ==
"beta-fit" );
82 Comment(
"Maximum energy (MeV) of the neutrinos produced by this" 86 return (type ==
"fermi-dirac") || (type ==
"beta-fit" )
87 || (type ==
"histogram");
93 Comment(
"Effective temperature for the Fermi-Dirac distribution"),
96 return (type ==
"fermi-dirac");
102 Comment(
"Pinching parameter for the Fermi-Dirac distribution"),
105 return (type ==
"fermi-dirac");
111 Comment(
"Energy (MeV) of the neutrinos produced by a monoenergetic" 115 return (type ==
"monoenergetic");
121 Comment(
"Mean energy (MeV) of the neutrinos produced by a beta-fit" 125 return (type ==
"beta-fit");
131 Comment(
"Pinching parameter for a beta-fit source"),
134 return (type ==
"beta-fit");
140 Comment(
"Left edges for each energy bin in the histogram"),
143 return type ==
"histogram";
149 Comment(
"Weights for each energy bin in the histogram"),
152 return type ==
"histogram";
158 Comment(
"Energies (MeV) for each grid point"),
161 return type ==
"grid";
166 Name(
"prob_densities"),
167 Comment(
"Probability densities for each grid point"),
170 return type ==
"grid";
176 Comment(
"Interpolation rule for computing probability densities" 177 " between grid points. Allowed values include \"linlin\"," 178 " \"linlog\", \"loglin\", \"loglog\", and \"constant\""),
181 return type ==
"grid";
187 Comment(
"Name of the ROOT file that contains a TH1 or TGraph neutrino" 191 return (type ==
"th1") || (type ==
"tgraph");
197 Comment(
"Namecycle of the ROOT TH1 or TGraph to use"),
200 return (type ==
"th1") || (type ==
"tgraph");
212 Comment(
"Seed used for the MARLEY generator")
217 Comment(
"3-vector that points in the direction of motion of the" 218 " incident neutrinos"),
220 std::array<double, 3> {{ 0., 0., 1. }}
225 Comment(
"List of matrix element data files to use to define reactions" 231 Comment(
"List of TALYS format nuclear structure data files to use" 237 Comment(
"Neutrino source configuration")
245 const std::string& generator_name);
250 rand_service, generator_name) {}
258 marley::Event* marley_event =
nullptr);
264 std::string
find_file(
const std::string& fileName,
265 const std::string& fileType);
272 return marley::JSON(atom->operator()());
279 if (opt_atom->operator()(
value))
return marley::JSON(value);
281 else return marley::JSON();
287 marley::JSON
array = marley::JSON::make(
288 marley::JSON::DataType::Array);
290 for (
size_t i = 0; i < sequence->size(); ++i) {
291 array.append(sequence->operator()(i));
300 const std::vector<marley::Particle*>& particles,
301 const TLorentzVector& vtx_pos,
bool track);
304 const std::string& array_name);
323 #endif // LARSIM_ALGORITHMS_MARLEYGENERATOR_H
fhicl::Atom< double > temperature_
fhicl::Atom< std::string > tfile_
void load_marley_dictionaries()
void add_marley_particles(simb::MCTruth &truth, const std::vector< marley::Particle * > &particles, const TLorentzVector &vtx_pos, bool track)
fhicl::Atom< std::string > namecycle_
fhicl::Atom< std::string > type_
fhicl::Atom< double > Emin_
fhicl::Atom< std::string > neutrino_
MARLEYHelper(const fhicl::ParameterSet &pset, rndm::NuRandomService &rand_service, const std::string &generator_name)
marley::JSON fhicl_parameter_to_json(const fhicl::detail::ParameterBase *par)
simb::MCTruth create_MCTruth(const TLorentzVector &vtx_pos, marley::Event *marley_event=nullptr)
fhicl::Atom< double > Emean_
fhicl::Sequence< double > energies_
marley::JSON fhicl_optional_atom_to_json(const fhicl::OptionalAtom< T > *opt_atom)
marley::JSON fhicl_atom_to_json(const fhicl::Atom< T > *atom)
std::stringstream fMarleyLogStream
fhicl::OptionalAtom< double > beta_
fhicl::Sequence< double > weights_
std::unique_ptr< marley::Generator > fMarleyGenerator
fhicl::Atom< double > Emax_
std::string find_file(const std::string &fileName, const std::string &fileType)
auto array(Array const &a)
Returns a manipulator which will print the specified array.
fhicl::Atom< double > energy_
fhicl::Atom< std::string > rule_
fhicl::Sequence< double > prob_densities_
An art service to assist in the distribution of guaranteed unique seeds to all engines within an art ...
void reconfigure(const fhicl::Table< Config > &conf)
fhicl::OptionalAtom< double > eta_
std::string value(boost::any const &)
fhicl::Sequence< double > E_bin_lefts_
const marley::Generator & get_generator() const
Event generator information.
An art service to assist in the distribution of guaranteed unique seeds to all engines within an art ...
marley::Generator & get_generator()
Event Generation using GENIE, cosmics or single particles.
void load_full_paths_into_json(marley::JSON &json, const std::string &array_name)
MARLEYHelper(const fhicl::Table< Config > &conf, rndm::NuRandomService &rand_service, const std::string &generator_name)
marley::JSON fhicl_sequence_to_json(const S *sequence)