#include <TFile.h>
#include <TNtuple.h>
#include <TSystem.h>
#include <TH1D.h>
#include <TF1.h>
#include "Tools/Flux/GCylindTH1Flux.h"
#include "Framework/Messenger/Messenger.h"
#include "Framework/ParticleData/PDGCodes.h"
Go to the source code of this file.
TNtuple* createFluxNtuple |
( |
GFluxI * |
flux | ) |
|
Definition at line 98 of file gtestFluxSimple.cxx.
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;
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);
const unsigned int kNEvents
virtual const TLorentzVector & Position(void)=0
returns the flux neutrino 4-position (note: expect SI rather than physical units) ...
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
virtual bool GenerateNext(void)=0
generate the next flux neutrino (return false in err)
virtual int PdgCode(void)=0
returns the flux neutrino pdg code
virtual const TLorentzVector & Momentum(void)=0
returns the flux neutrino 4-momentum
int main |
( |
int |
, |
|
|
char ** |
|
|
) |
| |
Definition at line 38 of file gtestFluxSimple.cxx.
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");
TNtuple * runGCylindTH1FluxDriver(void)
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
TNtuple * runGCylindTH1FluxDriver |
( |
void |
| ) |
|
Definition at line 57 of file gtestFluxSimple.cxx.
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);
74 TVector3 beam_spot(0,0,-10);
76 double Rtransverse = 0.5;
78 LOG(
"test",
pINFO) <<
"Configuring GCylindTH1Flux flux driver";
81 flux -> SetBeamSpot (beam_spot);
82 flux -> SetTransverseRadius (Rtransverse);
83 flux -> AddEnergySpectrum (
kPdgNuMu, spectrum1);
86 LOG(
"test",
pINFO) <<
"Creating flux ntuple";
TNtuple * createFluxNtuple(GFluxI *flux)
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
A generic GENIE flux driver. Generates a 'cylindrical' neutrino beam along the input direction...
GENIE Interface for user-defined flux classes.
const unsigned int kNEvents = 10000 |