GENIEGenerator
Loading...
Searching...
No Matches
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-2025, 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
33class TH1D;
34class TF1;
35class TVector3;
36
37using std::string;
38using std::vector;
39
40namespace genie {
41namespace flux {
42
43class GCylindTH1Flux: public GFluxI {
44
45public :
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
69private:
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_
A list of PDG codes.
Definition PDGCodeList.h:32
void SetNuDirection(const TVector3 &direction)
void SetRtDependence(string rdep)
TLorentzVector fgP4
running generated nu 4-momentum
double fRt
transverse size of neutrino beam
const PDGCodeList & FluxParticles(void)
declare list of flux neutrinos that can be generated (for init. purposes)
double fMaxEv
maximum energy
void GenerateWeighted(bool gen_weighted)
set whether to generate weighted or unweighted neutrinos
const TLorentzVector & Position(void)
returns the flux neutrino 4-position (note: expect SI rather than physical units)
TH1D * fTotSpectrum
combined flux = f(Ev)
void Clear(Option_t *opt)
reset state variables based on opt
int fgPdgC
running generated nu pdg-code
TVector3 * fDirVec
neutrino direction
bool End(void)
true if no more flux nu'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)
vector< TH1D * > fSpectrum
flux = f(Ev), 1/neutrino species
TLorentzVector fgX4
running generated nu 4-position
void AddEnergySpectrum(int nu_pdgc, TH1D *spectrum)
PDGCodeList * fPdgCList
list of neutrino pdg-codes
TVector3 * fBeamSpot
beam spot position
const TLorentzVector & Momentum(void)
returns the flux neutrino 4-momentum
void SetBeamSpot(const TVector3 &spot)
TF1 * fRtDep
transverse radius dependence
long int Index(void)
returns corresponding index for current flux neutrino (e.g. for a flux ntuple returns the current ent...
double Weight(void)
returns the flux neutrino weight (if any)
int PdgCode(void)
returns the flux neutrino pdg code
bool GenerateNext(void)
generate the next flux neutrino (return false in err)
GENIE flux drivers.
THE MAIN GENIE PROJECT NAMESPACE
Definition AlgCmp.h:25