GENIEGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 <c.andreopoulos \at cern.ch>
14  University of Liverpool
15 
16 \created July 4, 2005
17 
18 \cpright Copyright (c) 2003-2024, The GENIE Collaboration
19  For the full text of the license visit http://copyright.genie-mc.org
20 */
21 //____________________________________________________________________________
22 
23 #ifndef _G_TH1_CYLICDRICAL_FLUX_H_
24 #define _G_TH1_CYLICDRICAL_FLUX_H_
25 
26 #include <string>
27 #include <vector>
28 
29 #include <TLorentzVector.h>
30 
32 
33 class TH1D;
34 class TF1;
35 class TVector3;
36 
37 using std::string;
38 using std::vector;
39 
40 namespace genie {
41 namespace flux {
42 
43 class GCylindTH1Flux: public GFluxI {
44 
45 public :
48 
49  // methods specific to this flux object
50  void SetNuDirection (const TVector3 & direction);
51  void SetBeamSpot (const TVector3 & spot);
52  void SetTransverseRadius (double Rt);
53  void AddEnergySpectrum (int nu_pdgc, TH1D * spectrum);
54  void SetRtDependence (string rdep);
55 
56  // methods implementing the GENIE GFluxI interface
57  const PDGCodeList & FluxParticles (void) { return *fPdgCList; }
58  double MaxEnergy (void) { return fMaxEv; }
59  bool GenerateNext (void);
60  int PdgCode (void) { return fgPdgC; }
61  double Weight (void) { return 1.0; }
62  const TLorentzVector & Momentum (void) { return fgP4; }
63  const TLorentzVector & Position (void) { return fgX4; }
64  bool End (void) { return false; }
65  long int Index (void) { return -1; }
66  void Clear (Option_t * opt);
67  void GenerateWeighted (bool gen_weighted);
68 
69 private:
70 
71  // private methods
72  void Initialize (void);
73  void CleanUp (void);
74  void ResetSelection (void);
75  void AddAllFluxes (void);
76  int SelectNeutrino (double Ev);
77  double GeneratePhi (void) const;
78  double GenerateRt (void) const;
79 
80  // private data members
81  double fMaxEv; ///< maximum energy
82  PDGCodeList * fPdgCList; ///< list of neutrino pdg-codes
83  int fgPdgC; ///< running generated nu pdg-code
84  TLorentzVector fgP4; ///< running generated nu 4-momentum
85  TLorentzVector fgX4; ///< running generated nu 4-position
86  vector<TH1D *> fSpectrum; ///< flux = f(Ev), 1/neutrino species
87  TH1D * fTotSpectrum; ///< combined flux = f(Ev)
88  TVector3 * fDirVec; ///< neutrino direction
89  TVector3 * fBeamSpot; ///< beam spot position
90  double fRt; ///< transverse size of neutrino beam
91  TF1 * fRtDep; ///< transverse radius dependence
92 };
93 
94 } // flux namespace
95 } // genie namespace
96 
97 #endif // _G_TH1_CYLICDRICAL_FLUX_H_
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
TLorentzVector fgX4
running generated nu 4-position
vector< TH1D * > fSpectrum
flux = f(Ev), 1/neutrino species
A list of PDG codes.
Definition: PDGCodeList.h:32
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:29