28 using namespace genie;
29 using namespace genie::flux;
38 const double latitude = pi/5;
39 const double longitude = pi/4;
53 new TNtuple(
"fluxntp",
"flux",
"x:y:z:t:px:py:pz:E:pdgc:wght");
55 unsigned int ievent = 0;
57 LOG(
"test",
pINFO) <<
"Event number: " << ievent;
60 double wght = difflx->
Weight();
61 const TLorentzVector & x4 = difflx->
Position();
62 const TLorentzVector & p4 = difflx->
Momentum();
64 x4.X(), x4.Y(), x4.Z(), x4.T(),
65 p4.Px(), p4.Py(), p4.Pz(), p4.E(), pdgc, wght);
68 TFile f(
"./genie-astro-flux.root",
"recreate");
virtual const TLorentzVector & Momentum(void)
returns the flux neutrino 4-momentum
void ForceMinEnergy(double emin)
void SetEnergyPowLawIdx(double n)
void ForceMaxEnergy(double emax)
static constexpr double km
virtual bool GenerateNext(void)
generate the next flux neutrino (return false in err)
int main(int argc, char **argv)
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
virtual double Weight(void)
returns the flux neutrino weight (if any)
const unsigned int kNEvents
void SetDetectorPosition(double latitude, double longitude, double depth, double size)
virtual const TLorentzVector & Position(void)
returns the flux neutrino 4-position (note: expect SI rather than physical units) ...
virtual void GenerateWeighted(bool gen_weighted)
set whether to generate weighted or unweighted neutrinos
Most commonly used PDG codes. A set of utility functions to handle PDG codes is provided in PDGUtils...
virtual int PdgCode(void)
returns the flux neutrino pdg code
void SetRelNuPopulations(double nnue=1, double nnumu=2, double nnutau=0, double nnuebar=1, double nnumubar=2, double nnutaubar=0)