GENIEGenerator
Loading...
Searching...
No Matches
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 <c.andreopoulos \at cern.ch>
13 University of Liverpool
14
15\created Feb 08, 2008
16
17\cpright Copyright (c) 2003-2025, 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
32using std::string;
33using std::map;
34
35namespace genie {
36namespace flux {
37
39
40public :
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
70private:
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_
A list of PDG codes.
Definition PDGCodeList.h:32
TLorentzVector fgX4
running generated nu 4-position
bool GenerateNext(void)
generate the next flux neutrino (return false in err)
void SetNuDirection(const TVector3 &direction)
const TLorentzVector & Momentum(void)
returns the flux neutrino 4-momentum
double Weight(void)
returns the flux neutrino weight (if any)
int fgPdgC
running generated nu pdg-code
const PDGCodeList & FluxParticles(void)
declare list of flux neutrinos that can be generated (for init. purposes)
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)
void SetBeamSpot(const TVector3 &spot)
TLorentzVector fgP4
running generated nu 4-momentum
void SetDirectionCos(double dx, double dy, double dz)
const TLorentzVector & Position(void)
returns the flux neutrino 4-position (note: expect SI rather than physical units)
bool End(void)
true if no more flux nu's can be thrown (eg reaching end of beam sim ntuples)
void Clear(Option_t *opt)
reset state variables based on opt
long int Index(void)
returns corresponding index for current flux neutrino (e.g. for a flux ntuple returns the current ent...
void SetRayOrigin(double x, double y, double z)
void GenerateWeighted(bool gen_weighted)
set whether to generate weighted or unweighted neutrinos
PDGCodeList * fPdgCList
list of neutrino pdg-codes
void Initialize(void)
GENIE flux drivers.
Utilities for improving the code readability when using PDG codes.
THE MAIN GENIE PROJECT NAMESPACE
Definition AlgCmp.h:25