GMonoEnergeticFlux.h
Go to the documentation of this file.
1 //____________________________________________________________________________
2 /*!
3 
4 \class genie::flux::GMonoEnergeticFlux
5 
6 \brief A simple GENIE flux driver for monoenergetic neutrinos along the
7  z direction. Can handle a mix of neutrinos with their corresponding
8  weight. This trivial flux driver was added in so that single energy
9  neutrinos can be easily used with the event generation driver that
10  can handle a target mix or detailed geometries.
11 
12 \author Costas Andreopoulos <constantinos.andreopoulos \at cern.ch>
13  University of Liverpool & STFC Rutherford Appleton Laboratory
14 
15 \created Feb 08, 2008
16 
17 \cpright Copyright (c) 2003-2020, The GENIE Collaboration
18  For the full text of the license visit http://copyright.genie-mc.org
19 */
20 //____________________________________________________________________________
21 
22 #ifndef _G_MONOENERGETIC_FLUX_H_
23 #define _G_MONOENERGETIC_FLUX_H_
24 
25 #include <string>
26 #include <map>
27 
28 #include <TLorentzVector.h>
29 
31 
32 using std::string;
33 using std::map;
34 
35 namespace genie {
36 namespace flux {
37 
38 class GMonoEnergeticFlux: public GFluxI {
39 
40 public :
42  GMonoEnergeticFlux(double Ev, int pdg);
43  GMonoEnergeticFlux(double Ev, const map<int,double> & numap /* pdg -> weight*/);
45 
46  // methods implementing the GENIE GFluxI interface
47  const PDGCodeList & FluxParticles (void) { return *fPdgCList; }
48  double MaxEnergy (void) { return fMaxEv; }
49  bool GenerateNext (void);
50  int PdgCode (void) { return fgPdgC; }
51  double Weight (void) { return 1.0; }
52  const TLorentzVector & Momentum (void) { return fgP4; }
53  const TLorentzVector & Position (void) { return fgX4; }
54  bool End (void) { return false; }
55  long int Index (void) { return -1; }
56  void Clear (Option_t * opt);
57  void GenerateWeighted (bool gen_weighted);
58 
59  // special setters for this class
60  void SetDirectionCos (double dx, double dy, double dz);
61  void SetRayOrigin (double x, double y, double z);
62  // setters consistent w/ GCylindTH1Flux naming
63  void SetNuDirection (const TVector3 & direction);
64  void SetBeamSpot (const TVector3 & spot);
65 
66  // allow re-initialization, and/or initialization after default ctor
67  void Initialize (double Ev, int pdg);
68  void Initialize (double Ev, const map<int,double> & numap);
69 
70 private:
71 
72  // private methods
73  void CleanUp (void);
74 
75  // private data members
76  double fMaxEv; ///< maximum energy
77  PDGCodeList * fPdgCList; ///< list of neutrino pdg-codes
78  int fgPdgC; ///< running generated nu pdg-code
79  TLorentzVector fgP4; ///< running generated nu 4-momentum
80  TLorentzVector fgX4; ///< running generated nu 4-position
81  map<int, double> fProb;
82  double fProbMax;
83 };
84 
85 } // flux namespace
86 } // genie namespace
87 
88 #endif // _G_MONOENERGETIC_FLUX_H_
long int Index(void)
returns corresponding index for current flux neutrino (e.g. for a flux ntuple returns the current ent...
const PDGCodeList & FluxParticles(void)
declare list of flux neutrinos that can be generated (for init. purposes)
void GenerateWeighted(bool gen_weighted)
set whether to generate weighted or unweighted neutrinos
THE MAIN GENIE PROJECT NAMESPACE
Definition: AlgCmp.h:25
std::string string
Definition: nybbler.cc:12
int fgPdgC
running generated nu pdg-code
TLorentzVector fgP4
running generated nu 4-momentum
const TLorentzVector & Position(void)
returns the flux neutrino 4-position (note: expect SI rather than physical units) ...
opt
Definition: train.py:196
bool End(void)
true if no more flux nu&#39;s can be thrown (eg reaching end of beam sim ntuples)
bool GenerateNext(void)
generate the next flux neutrino (return false in err)
void Initialize(double Ev, int pdg)
A list of PDG codes.
Definition: PDGCodeList.h:32
void SetNuDirection(const TVector3 &direction)
double Weight(void)
returns the flux neutrino weight (if any)
void SetDirectionCos(double dx, double dy, double dz)
void SetRayOrigin(double x, double y, double z)
PDGCodeList * fPdgCList
list of neutrino pdg-codes
const TLorentzVector & Momentum(void)
returns the flux neutrino 4-momentum
A simple GENIE flux driver for monoenergetic neutrinos along the z direction. Can handle a mix of neu...
int PdgCode(void)
returns the flux neutrino pdg code
double MaxEnergy(void)
declare the max flux neutrino energy that can be generated (for init. purposes)
list x
Definition: train.py:276
TLorentzVector fgX4
running generated nu 4-position
void SetBeamSpot(const TVector3 &spot)
void Clear(Option_t *opt)
reset state variables based on opt
GENIE Interface for user-defined flux classes.
Definition: GFluxI.h:29