#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 | ) |
|
int main |
( |
int |
, |
|
|
char ** |
|
|
) |
| |
Definition at line 38 of file gtestFluxSimple.cxx.
References LOG, pINFO, runGCylindTH1FluxDriver(), and Write().
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.
References createFluxNtuple(), genie::kPdgAntiNuMu, genie::kPdgNuMu, LOG, and pINFO.
Referenced by main().
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);
83 flux -> AddEnergySpectrum (
kPdgNuMu, spectrum1);
86 LOG(
"test",
pINFO) <<
"Creating flux ntuple";
#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...
TNtuple * createFluxNtuple(GFluxI *flux)
GENIE Interface for user-defined flux classes.
const unsigned int kNEvents = 10000 |