GCylindTH1Flux.h
Go to the documentation of this file.
1 //____________________________________________________________________________
2 /*!
3 
4 \class genie::flux::GCylindTH1Flux
5 
6 \brief A generic GENIE flux driver.
7  Generates a 'cylindrical' neutrino beam along the input direction,
8  with the input transverse radius and centered at the input position.
9  The energies are generated from the input energy spectrum (TH1D).
10  Multiple neutrino species can be generated (you will need to supply
11  an energy spectrum for each).
12 
13 \author Costas Andreopoulos <costas.andreopoulos \at stfc.ac.uk>
14  University of Liverpool & STFC Rutherford Appleton Lab
15 
16 \created July 4, 2005
17 
18 \cpright Copyright (c) 2003-2019, The GENIE Collaboration
19  For the full text of the license visit http://copyright.genie-mc.org
20  or see $GENIE/LICENSE
21 */
22 //____________________________________________________________________________
23 
24 #ifndef _G_TH1_CYLICDRICAL_FLUX_H_
25 #define _G_TH1_CYLICDRICAL_FLUX_H_
26 
27 #include <string>
28 #include <vector>
29 
30 #include <TLorentzVector.h>
31 
33 
34 class TH1D;
35 class TF1;
36 class TVector3;
37 
38 using std::string;
39 using std::vector;
40 
41 namespace genie {
42 namespace flux {
43 
44 class GCylindTH1Flux: public GFluxI {
45 
46 public :
49 
50  // methods specific to this flux object
51  void SetNuDirection (const TVector3 & direction);
52  void SetBeamSpot (const TVector3 & spot);
53  void SetTransverseRadius (double Rt);
54  void AddEnergySpectrum (int nu_pdgc, TH1D * spectrum);
55  void SetRtDependence (string rdep);
56 
57  // methods implementing the GENIE GFluxI interface
58  const PDGCodeList & FluxParticles (void) { return *fPdgCList; }
59  double MaxEnergy (void) { return fMaxEv; }
60  bool GenerateNext (void);
61  int PdgCode (void) { return fgPdgC; }
62  double Weight (void) { return 1.0; }
63  const TLorentzVector & Momentum (void) { return fgP4; }
64  const TLorentzVector & Position (void) { return fgX4; }
65  bool End (void) { return false; }
66  long int Index (void) { return -1; }
67  void Clear (Option_t * opt);
68  void GenerateWeighted (bool gen_weighted);
69 
70 private:
71 
72  // private methods
73  void Initialize (void);
74  void CleanUp (void);
75  void ResetSelection (void);
76  void AddAllFluxes (void);
77  int SelectNeutrino (double Ev);
78  double GeneratePhi (void) const;
79  double GenerateRt (void) const;
80 
81  // private data members
82  double fMaxEv; ///< maximum energy
83  PDGCodeList * fPdgCList; ///< list of neutrino pdg-codes
84  int fgPdgC; ///< running generated nu pdg-code
85  TLorentzVector fgP4; ///< running generated nu 4-momentum
86  TLorentzVector fgX4; ///< running generated nu 4-position
87  vector<TH1D *> fSpectrum; ///< flux = f(Ev), 1/neutrino species
88  TH1D * fTotSpectrum; ///< combined flux = f(Ev)
89  TVector3 * fDirVec; ///< neutrino direction
90  TVector3 * fBeamSpot; ///< beam spot position
91  double fRt; ///< transverse size of neutrino beam
92  TF1 * fRtDep; ///< transverse radius dependence
93 };
94 
95 } // flux namespace
96 } // genie namespace
97 
98 #endif // _G_TH1_CYLICDRICAL_FLUX_H_
THE MAIN GENIE PROJECT NAMESPACE
Definition: GeneratorBase.h:8
long int Index(void)
returns corresponding index for current flux neutrino (e.g. for a flux ntuple returns the current ent...
PDGCodeList * fPdgCList
list of neutrino pdg-codes
bool GenerateNext(void)
generate the next flux neutrino (return false in err)
void SetRtDependence(string rdep)
TLorentzVector fgP4
running generated nu 4-momentum
void Clear(Option_t *opt)
reset state variables based on opt
TVector3 * fBeamSpot
beam spot position
Loaders::FluxType flux
TLorentzVector fgX4
running generated nu 4-position
vector< TH1D * > fSpectrum
flux = f(Ev), 1/neutrino species
A list of PDG codes.
Definition: PDGCodeList.h:33
TF1 * fRtDep
transverse radius dependence
double GenerateRt(void) const
TVector3 * fDirVec
neutrino direction
int fgPdgC
running generated nu pdg-code
A generic GENIE flux driver. Generates a &#39;cylindrical&#39; neutrino beam along the input direction...
double fRt
transverse size of neutrino beam
const TLorentzVector & Momentum(void)
returns the flux neutrino 4-momentum
bool End(void)
true if no more flux nu&#39;s can be thrown (eg reaching end of beam sim ntuples)
double MaxEnergy(void)
declare the max flux neutrino energy that can be generated (for init. purposes)
double Weight(void)
returns the flux neutrino weight (if any)
void SetTransverseRadius(double Rt)
void SetNuDirection(const TVector3 &direction)
double GeneratePhi(void) const
const TLorentzVector & Position(void)
returns the flux neutrino 4-position (note: expect SI rather than physical units) ...
TH1D * fTotSpectrum
combined flux = f(Ev)
void GenerateWeighted(bool gen_weighted)
set whether to generate weighted or unweighted neutrinos
void SetBeamSpot(const TVector3 &spot)
void AddEnergySpectrum(int nu_pdgc, TH1D *spectrum)
const PDGCodeList & FluxParticles(void)
declare list of flux neutrinos that can be generated (for init. purposes)
double fMaxEv
maximum energy
int PdgCode(void)
returns the flux neutrino pdg code
GENIE Interface for user-defined flux classes.
Definition: GFluxI.h:37
enum BeamMode string