GENIEGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Member Functions | List of all members
genie::flux::GFLUKAAtmoFlux Class Reference

A flux driver for the FLUKA 3-D Atmospheric Neutrino Flux. More...

#include <GFLUKAAtmoFlux.h>

Inheritance diagram for genie::flux::GFLUKAAtmoFlux:
Inheritance graph
[legend]
Collaboration diagram for genie::flux::GFLUKAAtmoFlux:
Collaboration graph
[legend]

Public Member Functions

 GFLUKAAtmoFlux ()
 
 ~GFLUKAAtmoFlux ()
 
- Public Member Functions inherited from genie::flux::GAtmoFlux
virtual ~GAtmoFlux ()
 
virtual const PDGCodeListFluxParticles (void)
 declare list of flux neutrinos that can be generated (for init. purposes) More...
 
virtual double MaxEnergy (void)
 declare the max flux neutrino energy that can be generated (for init. purposes) More...
 
virtual bool GenerateNext (void)
 generate the next flux neutrino (return false in err) More...
 
virtual int PdgCode (void)
 returns the flux neutrino pdg code More...
 
virtual double Weight (void)
 returns the flux neutrino weight (if any) More...
 
virtual const TLorentzVector & Momentum (void)
 returns the flux neutrino 4-momentum More...
 
virtual const TLorentzVector & Position (void)
 returns the flux neutrino 4-position (note: expect SI rather than physical units) More...
 
virtual bool End (void)
 true if no more flux nu's can be thrown (eg reaching end of beam sim ntuples) More...
 
virtual long int Index (void)
 returns corresponding index for current flux neutrino (e.g. for a flux ntuple returns the current entry number) More...
 
virtual void Clear (Option_t *opt)
 reset state variables based on opt More...
 
virtual void GenerateWeighted (bool gen_weighted)
 set whether to generate weighted or unweighted neutrinos More...
 
double Enu (void)
 
double Energy (void)
 
double CosTheta (void)
 
double CosZenith (void)
 
long int NFluxNeutrinos (void) const
 Number of flux nu's generated. Not the same as the number of nu's thrown towards the geometry (if there are cuts). More...
 
void ForceMinEnergy (double emin)
 
void ForceMaxEnergy (double emax)
 
void SetSpectralIndex (double index)
 
void SetRadii (double Rlongitudinal, double Rtransverse)
 
double GetFluxSurfaceArea (void)
 
double GetLongitudinalRadius (void)
 
double GetTransverseRadius (void)
 
void SetUserCoordSystem (TRotation &rotation)
 Rotation: Topocentric Horizontal -> User-defined Topocentric Coord System. More...
 
void AddFluxFile (int neutrino_pdg, string filename)
 
void AddFluxFile (string filename)
 
bool LoadFluxData (void)
 
TH3D * GetFluxHistogram (int flavour)
 
double GetTotalFlux (void)
 
double GetTotalFluxInEnergyRange (void)
 
double GetFlux (int flavour)
 
double GetFlux (int flavour, double energy)
 
double GetFlux (int flavour, double energy, double costh)
 
double GetFlux (int flavour, double energy, double costh, double phi)
 
- Public Member Functions inherited from genie::GFluxI
virtual ~GFluxI ()
 

Private Member Functions

void SetBinSizes (void)
 
bool FillFluxHisto (int nu_pdg, string filename)
 

Additional Inherited Members

- Protected Member Functions inherited from genie::flux::GAtmoFlux
 GAtmoFlux ()
 
bool GenerateNext_1try (void)
 
void Initialize (void)
 
void CleanUp (void)
 
void ResetSelection (void)
 
double MinEnergy (void)
 
TH3D * CreateFluxHisto (string name, string title)
 
void ZeroFluxHisto (TH3D *hist)
 
void AddAllFluxes (void)
 
int SelectNeutrino (double Ev, double costheta, double phi)
 
TH3D * CreateNormalisedFluxHisto (TH3D *hist)
 
- Protected Member Functions inherited from genie::GFluxI
 GFluxI ()
 
- Protected Attributes inherited from genie::flux::GAtmoFlux
double fMaxEv
 maximum energy (in input flux files) More...
 
PDGCodeListfPdgCList
 input list of neutrino pdg-codes More...
 
int fgPdgC
 current generated nu pdg-code More...
 
TLorentzVector fgP4
 current generated nu 4-momentum More...
 
TLorentzVector fgX4
 current generated nu 4-position More...
 
double fWeight
 current generated nu weight More...
 
long int fNNeutrinos
 number of flux neutrinos thrown so far More...
 
double fMaxEvCut
 user-defined cut: maximum energy More...
 
double fMinEvCut
 user-defined cut: minimum energy More...
 
double fRl
 defining flux neutrino generation surface: longitudinal radius More...
 
double fRt
 defining flux neutrino generation surface: transverse radius More...
 
TRotation fRotTHz2User
 coord. system rotation: THZ -> Topocentric user-defined More...
 
unsigned int fNumPhiBins
 number of phi bins in input flux data files More...
 
unsigned int fNumCosThetaBins
 number of cos(theta) bins in input flux data files More...
 
unsigned int fNumEnergyBins
 number of energy bins in input flux data files More...
 
double * fPhiBins
 phi bins in input flux data files More...
 
double * fCosThetaBins
 cos(theta) bins in input flux data files More...
 
double * fEnergyBins
 energy bins in input flux data files More...
 
bool fGenWeighted
 generate a weighted or unweighted flux? More...
 
double fSpectralIndex
 power law function used for weighted flux More...
 
bool fInitialized
 flag to check that initialization is run More...
 
TH3D * fTotalFluxHisto
 flux = f(Ev,cos8,phi) summed over neutrino species More...
 
double fTotalFluxHistoIntg
 fFluxSum2D integral More...
 
map< int, TH3D * > fFluxHistoMap
 flux = f(Ev,cos8,phi) for each neutrino species More...
 
map< int, TH3D * > fRawFluxHistoMap
 flux = f(Ev,cos8,phi) for each neutrino species More...
 
vector< int > fFluxFlavour
 input flux file for each neutrino species More...
 
vector< string > fFluxFile
 input flux file for each neutrino species More...
 

Detailed Description

A flux driver for the FLUKA 3-D Atmospheric Neutrino Flux.

References:
Astrop.Phys.19 (2003) p.269; hep-ph/0207035; hep-ph/9907408 Alfredo.Ferrari Alfre.nosp@m.do.F.nosp@m.errar.nosp@m.i@ce.nosp@m.rn.ch Paola.Sala Paola.nosp@m..Sal.nosp@m.a@cer.nosp@m.n.ch Giuseppe Battistoni Giuse.nosp@m.ppe..nosp@m.Batti.nosp@m.ston.nosp@m.i@mi..nosp@m.infn.nosp@m..it Teresa Montaruli Teres.nosp@m.a.Mo.nosp@m.ntaru.nosp@m.li@b.nosp@m.a.inf.nosp@m.n.it

To be able to use this flux driver you will need to download the flux data from: http://pcbat1.mi.infn.it/~battist/neutrino.html

Please note that this class expects to read flux files formatted as described in the above FLUKA flux page. Each file contains 3 columns:

Author
Costas Andreopoulos <c.andreopoulos cern.ch> University of Liverpool
Created:
July 3, 2005
License:
Copyright (c) 2003-2024, The GENIE Collaboration For the full text of the license visit http://copyright.genie-mc.org

Definition at line 54 of file GFLUKAAtmoFlux.h.

Constructor & Destructor Documentation

GFLUKAAtmoFlux::GFLUKAAtmoFlux ( )

Definition at line 31 of file GFLUKAAtmoFlux.cxx.

References Initialize(), LOG, and pNOTICE.

31  :
32 GAtmoFlux()
33 {
34  LOG("Flux", pNOTICE)
35  << "Instantiating the GENIE FLUKA atmospheric neutrino flux driver";
36 
37  this->Initialize();
38  this->SetBinSizes();
39 }
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
#define pNOTICE
Definition: Messenger.h:61
GFLUKAAtmoFlux::~GFLUKAAtmoFlux ( )

Definition at line 41 of file GFLUKAAtmoFlux.cxx.

42 {
43 
44 }

Member Function Documentation

bool GFLUKAAtmoFlux::FillFluxHisto ( int  nu_pdg,
string  filename 
)
privatevirtual

Implements genie::flux::GAtmoFlux.

Definition at line 109 of file GFLUKAAtmoFlux.cxx.

References genie::flux::GAtmoFlux::fRawFluxHistoMap, genie::constants::kPi, LOG, pERROR, pINFO, and pNOTICE.

110 {
111  LOG("Flux", pNOTICE)
112  << "Loading FLUKA atmospheric flux for neutrino: " << nu_pdg
113  << " from file: " << filename;
114 
115  TH3D* histo = 0;
116  std::map<int,TH3D*>::iterator myMapEntry = fRawFluxHistoMap.find(nu_pdg);
117  if( myMapEntry != fRawFluxHistoMap.end() ){
118  histo = myMapEntry->second;
119  }
120  if(!histo) {
121  LOG("Flux", pERROR) << "Null flux histogram!";
122  return false;
123  }
124  ifstream flux_stream(filename.c_str(), ios::in);
125  if(!flux_stream) {
126  LOG("Flux", pERROR) << "Could not open file: " << filename;
127  return false;
128  }
129 
130  int ibin;
131  double energy, costheta, flux;
132  char j1, j2;
133 
134  double scale = 1.0; // 1.0 [m^2], OR 1.0e-4 [cm^2]
135 
136  while ( !flux_stream.eof() ) {
137  flux = 0.0;
138  flux_stream >> energy >> j1 >> costheta >> j2 >> flux;
139  if( flux>0.0 ){
140  LOG("Flux", pINFO)
141  << "Flux[Ev = " << energy
142  << ", cos8 = " << costheta << "] = " << flux;
143  // note: reversing the Fluka sign convention for zenith angle
144  // 1 phi bin
145  ibin = histo->FindBin( (Axis_t)energy, (Axis_t)(-costheta), (Axis_t)kPi );
146  histo->SetBinContent( ibin, (Stat_t)(scale*flux) );
147  }
148  }
149  return true;
150 }
#define pERROR
Definition: Messenger.h:59
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
#define pINFO
Definition: Messenger.h:62
map< int, TH3D * > fRawFluxHistoMap
flux = f(Ev,cos8,phi) for each neutrino species
Definition: GAtmoFlux.h:155
#define pNOTICE
Definition: Messenger.h:61
void GFLUKAAtmoFlux::SetBinSizes ( void  )
private

Definition at line 46 of file GFLUKAAtmoFlux.cxx.

References genie::flux::GAtmoFlux::fCosThetaBins, genie::flux::GAtmoFlux::fEnergyBins, genie::flux::GAtmoFlux::fMaxEv, genie::flux::GAtmoFlux::fNumCosThetaBins, genie::flux::GAtmoFlux::fNumEnergyBins, genie::flux::GAtmoFlux::fNumPhiBins, genie::flux::GAtmoFlux::fPhiBins, genie::flux::kGFlk3DCosThetaMax, genie::flux::kGFlk3DCosThetaMin, genie::flux::kGFlk3DEvMin, genie::flux::kGFlk3DNumCosThetaBins, genie::flux::kGFlk3DNumLogEvBins, genie::flux::kGFlk3DNumLogEvBinsPerDecade, genie::constants::kPi, LOG, and pDEBUG.

47 {
48 // Generate the correct cos(theta) and energy bin sizes
49 // The flux is given in 40 bins of cos(zenith angle) from -1.0 to 1.0
50 // (bin width = 0.05) and 61 equally log-spaced energy bins (20 bins
51 // per decade), with Emin = 0.100 GeV.
52 //
53 
54  fPhiBins = new double [2];
55  fCosThetaBins = new double [kGFlk3DNumCosThetaBins + 1];
56  fEnergyBins = new double [kGFlk3DNumLogEvBins + 1];
57 
58  fPhiBins[0] = 0;
59  fPhiBins[1] = 2.*kPi;
60 
61  double dcostheta =
63  (double) kGFlk3DNumCosThetaBins;
64 
65  double logEmax = TMath::Log10(1.);
66  double logEmin = TMath::Log10(kGFlk3DEvMin);
67  double dlogE =
68  (logEmax - logEmin) /
70 
71  for(unsigned int i=0; i<= kGFlk3DNumCosThetaBins; i++) {
72  fCosThetaBins[i] = kGFlk3DCosThetaMin + i * dcostheta;
73  if(i != kGFlk3DNumCosThetaBins) {
74  LOG("Flux", pDEBUG)
75  << "FLUKA 3d flux: CosTheta bin " << i+1
76  << ": lower edge = " << fCosThetaBins[i];
77  } else {
78  LOG("Flux", pDEBUG)
79  << "FLUKA 3d flux: CosTheta bin " << kGFlk3DNumCosThetaBins
80  << ": upper edge = " << fCosThetaBins[kGFlk3DNumCosThetaBins];
81  }
82  }
83 
84  for(unsigned int i=0; i<= kGFlk3DNumLogEvBins; i++) {
85  fEnergyBins[i] = TMath::Power(10., logEmin + i*dlogE);
86  if(i != kGFlk3DNumLogEvBins) {
87  LOG("Flux", pDEBUG)
88  << "FLUKA 3d flux: Energy bin " << i+1
89  << ": lower edge = " << fEnergyBins[i];
90  } else {
91  LOG("Flux", pDEBUG)
92  << "FLUKA 3d flux: Energy bin " << kGFlk3DNumLogEvBins
93  << ": upper edge = " << fEnergyBins[kGFlk3DNumLogEvBins];
94  }
95  }
96 
97  for(unsigned int i=0; i< kGFlk3DNumLogEvBins; i++) {
98  LOG("Flux", pDEBUG)
99  << "FLUKA 3d flux: Energy bin " << i+1
100  << ": bin centre = " << (fEnergyBins[i] + fEnergyBins[i+1])/2.;
101  }
102 
103  fNumPhiBins = 1;
107 }
double * fPhiBins
phi bins in input flux data files
Definition: GAtmoFlux.h:146
unsigned int fNumEnergyBins
number of energy bins in input flux data files
Definition: GAtmoFlux.h:145
unsigned int fNumCosThetaBins
number of cos(theta) bins in input flux data files
Definition: GAtmoFlux.h:144
const double kGFlk3DCosThetaMax
const unsigned int kGFlk3DNumCosThetaBins
const unsigned int kGFlk3DNumLogEvBins
const unsigned int kGFlk3DNumLogEvBinsPerDecade
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
const double kGFlk3DCosThetaMin
const double kGFlk3DEvMin
double * fCosThetaBins
cos(theta) bins in input flux data files
Definition: GAtmoFlux.h:147
unsigned int fNumPhiBins
number of phi bins in input flux data files
Definition: GAtmoFlux.h:143
double * fEnergyBins
energy bins in input flux data files
Definition: GAtmoFlux.h:148
double fMaxEv
maximum energy (in input flux files)
Definition: GAtmoFlux.h:131
#define pDEBUG
Definition: Messenger.h:63

The documentation for this class was generated from the following files: