30 using namespace genie;
31 using namespace genie::flux;
42 LOG(
"test",
pINFO) <<
"Running GFlukaAtmo3DFlux driver test";
44 ntfluka->SetTitle(
"GFlukaAtmo3DFlux driver data");
46 LOG(
"test",
pINFO) <<
"Running GBartolAtmoFlux driver test";
48 ntbartol->SetTitle(
"GBartolAtmoFlux driver data");
50 LOG(
"test",
pINFO) <<
"Saving flux ntuples";
52 TFile f(
"./genie-flux-drivers.root",
"recreate");
53 ntfluka ->
Write(
"ntfluka");
54 ntbartol ->
Write(
"ntbartol");
65 (gSystem->Getenv(
"GFLUX_FLUKA3DATMO") ?
66 gSystem->Getenv(
"GFLUX_FLUKA3DATMO") :
".");
68 double Rlongitudinal = 1000.;
69 double Rtransverse = 100.;
73 LOG(
"test",
pINFO) << base_dir +
"/sdave_numu07.dat";
74 LOG(
"test",
pINFO) << base_dir +
"/sdave_anumu07.dat";
75 LOG(
"test",
pINFO) << base_dir +
"/sdave_nue07.dat";
76 LOG(
"test",
pINFO) << base_dir +
"/sdave_anue07.dat";
79 flux -> AddFluxFile (
kPdgNuMu, base_dir +
"/sdave_numu07.dat" );
80 flux -> AddFluxFile (
kPdgAntiNuMu, base_dir +
"/sdave_anumu07.dat" );
81 flux -> AddFluxFile (
kPdgNuE, base_dir +
"/sdave_nue07.dat" );
82 flux -> AddFluxFile (
kPdgAntiNuE, base_dir +
"/sdave_anue07.dat" );
83 flux -> SetRadii(Rlongitudinal, Rtransverse);
84 flux -> LoadFluxData();
85 flux -> GenerateWeighted(
true);
88 LOG(
"test",
pINFO) <<
"Generating events";
96 (gSystem->Getenv(
"GFLUX_BGLRS3DATMO") ?
97 gSystem->Getenv(
"GFLUX_BGLRS3DATMO") :
".");
99 double Rlongitudinal = 1000.;
100 double Rtransverse = 100.;
104 flux -> AddFluxFile (
kPdgNuMu, base_dir +
"/f210_3_z.kam_num" );
105 flux -> AddFluxFile (
kPdgAntiNuMu, base_dir +
"/f210_3_z.kam_nbm" );
106 flux -> AddFluxFile (
kPdgNuE, base_dir +
"/f210_3_z.kam_nue" );
107 flux -> AddFluxFile (
kPdgAntiNuE, base_dir +
"/f210_3_z.kam_nbe" );
108 flux -> SetRadii(Rlongitudinal, Rtransverse);
109 flux -> LoadFluxData();
110 flux -> GenerateWeighted(
true);
113 LOG(
"test",
pINFO) <<
"Generating events";
123 new TNtuple(
"fluxntp",
"flux",
"x:y:z:t:px:py:pz:E:pdgc:wght");
125 LOG(
"test",
pINFO) <<
"Generating flux neutrinos";
127 unsigned int ievent = 0;
129 LOG(
"test",
pINFO) <<
"Event number: " << ievent;
132 double wght = flux->
Weight();
133 const TLorentzVector & x4 = flux->
Position();
134 const TLorentzVector & p4 = flux->
Momentum();
136 x4.X(), x4.Y(), x4.Z(), x4.T(),
137 p4.Px(), p4.Py(), p4.Pz(), p4.E(), pdgc, wght);
virtual const TLorentzVector & Position(void)=0
returns the flux neutrino 4-position (note: expect SI rather than physical units) ...
TNtuple * runGFlukaAtmo3DFluxDriver(void)
int main(int argc, char **argv)
A flux driver for the FLUKA 3-D Atmospheric Neutrino Flux.
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
const unsigned int kNEvents
TNtuple * createFluxNtuple(GFluxI *flux)
virtual bool GenerateNext(void)=0
generate the next flux neutrino (return false in err)
TNtuple * runGBartolAtmoFluxDriver(void)
virtual int PdgCode(void)=0
returns the flux neutrino pdg code
virtual const TLorentzVector & Momentum(void)=0
returns the flux neutrino 4-momentum
virtual double Weight(void)=0
returns the flux neutrino weight (if any)
A flux driver for the Bartol Atmospheric Neutrino Flux.
Most commonly used PDG codes. A set of utility functions to handle PDG codes is provided in PDGUtils...
GENIE Interface for user-defined flux classes.