40 LOG(
"test",
pINFO) <<
"Running GCylindTH1Flux driver test";
42 ntcylh1f->SetTitle(
"GCylindTH1Flux driver data");
44 LOG(
"test",
pINFO) <<
"Saving flux ntuples";
46 TFile f(
"./genie-flux-drivers.root",
"recreate");
47 ntcylh1f ->
Write(
"ntcylh1f");
59 LOG(
"test",
pINFO) <<
"Creating GCylindTH1Flux flux driver";
63 LOG(
"test",
pINFO) <<
"Setting configuration data";
65 TF1 * f1 =
new TF1(
"f1",
"1./x",0.5,5.0);
66 TH1D * spectrum1 =
new TH1D(
"spectrum1",
"numu E", 20,0.5,5);
67 spectrum1->FillRandom(
"f1",100000);
69 TF1 * f2 =
new TF1(
"f2",
"x",0.5,5.0);
70 TH1D * spectrum2 =
new TH1D(
"spectrum2",
"numubar E", 20,0.5,5);
71 spectrum2->FillRandom(
"f2",10000);
73 TVector3 direction(0,0,1);
74 TVector3 beam_spot(0,0,-10);
76 double Rtransverse = 0.5;
78 LOG(
"test",
pINFO) <<
"Configuring GCylindTH1Flux flux driver";
80 flux -> SetNuDirection (direction);
81 flux -> SetBeamSpot (beam_spot);
82 flux -> SetTransverseRadius (Rtransverse);
86 LOG(
"test",
pINFO) <<
"Creating flux ntuple";
101 new TNtuple(
"fluxntp",
102 "flux data",
"x:y:z:t:px:py:pz:E:pdgc");
104 LOG(
"test",
pINFO) <<
"Generating flux neutrinos";
106 unsigned int ievent = 0;
109 flux->GenerateNext();
111 int pdgc =
flux->PdgCode();
112 const TLorentzVector & x4 =
flux->Position();
113 const TLorentzVector & p4 =
flux->Momentum();
115 fluxntp->Fill( x4.X(), x4.Y(), x4.Z(), x4.T(),
116 p4.Px(), p4.Py(), p4.Pz(), p4.E(), pdgc);
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE,...
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.
A generic GENIE flux driver. Generates a 'cylindrical' neutrino beam along the input direction,...
const unsigned int kNEvents
TNtuple * runGCylindTH1FluxDriver(void)
TNtuple * createFluxNtuple(GFluxI *flux)
THE MAIN GENIE PROJECT NAMESPACE