Public Member Functions | Private Member Functions | List of all members
genie::flux::GBGLRSAtmoFlux Class Reference

A flux driver for the Bartol Atmospheric Neutrino Flux. More...

#include <GBGLRSAtmoFlux.h>

Inheritance diagram for genie::flux::GBGLRSAtmoFlux:
genie::flux::GAtmoFlux genie::GFluxI

Public Member Functions

 GBGLRSAtmoFlux ()
 
 ~GBGLRSAtmoFlux ()
 
- 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< stringfFluxFile
 input flux file for each neutrino species More...
 

Detailed Description

A flux driver for the Bartol Atmospheric Neutrino Flux.

G. Barr, T.K. Gaisser, P. Lipari, S. Robbins and T. Stanev, astro-ph/0403630

To be able to use this flux driver you will need to download the flux data from: http://www-pnp.physics.ox.ac.uk/~barr/fluxfiles/

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

Note that in the BGLRS input files the flux is defined as dN/dlnE, while in the FLUKA files the flux is defined as dN/dE. We compensate for logarithmic units (dlnE = dE/E) as we read-in the BGLRS files.

Author
Christopher Backhouse c.bac.nosp@m.khou.nosp@m.se1@p.nosp@m.hysi.nosp@m.cs.ox.nosp@m..ac..nosp@m.uk Oxford University

January 26, 2008

Copyright (c) 2003-2020, The GENIE Collaboration For the full text of the license visit http://copyright.genie-mc.org

Definition at line 59 of file GBGLRSAtmoFlux.h.

Constructor & Destructor Documentation

GBGLRSAtmoFlux::GBGLRSAtmoFlux ( )

Definition at line 32 of file GBGLRSAtmoFlux.cxx.

32  :
33 GAtmoFlux()
34 {
35  LOG("Flux", pNOTICE)
36  << "Instantiating the GENIE BGLRS atmospheric neutrino flux driver";
37 
38  this->Initialize();
39  this->SetBinSizes();
40 }
#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
GBGLRSAtmoFlux::~GBGLRSAtmoFlux ( )

Definition at line 42 of file GBGLRSAtmoFlux.cxx.

43 {
44 
45 }

Member Function Documentation

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

Implements genie::flux::GAtmoFlux.

Definition at line 119 of file GBGLRSAtmoFlux.cxx.

120 {
121  LOG("Flux", pNOTICE)
122  << "Loading BGLRS flux for neutrino: " << nu_pdg
123  << " from file: " << filename;
124 
125  TH3D* histo = 0;
126  std::map<int,TH3D*>::iterator myMapEntry = fRawFluxHistoMap.find(nu_pdg);
127  if( myMapEntry != fRawFluxHistoMap.end() ){
128  histo = myMapEntry->second;
129  }
130  if(!histo) {
131  LOG("Flux", pERROR) << "Null flux histogram!";
132  return false;
133  }
134  ifstream flux_stream(filename.c_str(), ios::in);
135  if(!flux_stream) {
136  LOG("Flux", pERROR) << "Could not open file: " << filename;
137  return false;
138  }
139 
140  int ibin;
141  double energy, costheta, flux;
142  double junkd; // throw away error estimates
143 
144  double scale = 1.0; // 1.0 [m^2], OR 1.0e-4 [cm^2]
145 
146  // throw away comment line
147  flux_stream.ignore(99999, '\n');
148 
149  while ( !flux_stream.eof() ) {
150  flux = 0.0;
151  flux_stream >> energy >> costheta >> flux >> junkd >> junkd;
152  if( flux>0.0 ){
153  // Compensate for logarithmic units - dlogE=dE/E
154  // [Note: should do this explicitly using bin widths]
155  flux /= energy;
156  LOG("Flux", pINFO)
157  << "Flux[Ev = " << energy
158  << ", cos8 = " << costheta << "] = " << flux;
159  ibin = histo->FindBin( (Axis_t)energy, (Axis_t)costheta, (Axis_t)kPi );
160  histo->SetBinContent( ibin, (Stat_t)(scale*flux) );
161  }
162  }
163  return true;
164 }
intermediate_table::iterator iterator
#define pERROR
Definition: Messenger.h:59
string filename
Definition: train.py:213
#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
static const double kPi
Definition: Constants.h:37
void GBGLRSAtmoFlux::SetBinSizes ( void  )
private

Definition at line 47 of file GBGLRSAtmoFlux.cxx.

48 {
49 // Generate the correct cos(theta) and energy bin sizes.
50 //
51 // Zenith angle binning: the flux is given in 20 bins of
52 // cos(zenith angle) from -1.0 to 1.0 (bin width = 0.1)
53 //
54 // Neutrino energy binning: the Bartol flux files are
55 // provided in two pieces
56 // (1) low energy piece (<10 GeV), solar min or max,
57 // given in 40 log-spaced bins from 0.1 to 10 GeV
58 // (20 bins per decade)
59 // (2) high energy piece (>10 GeV), without solar effects,
60 // given in 30 log-spaced bins from 10 to 1000 GeV
61 // (10 bins per decade)
62 
63  fPhiBins = new double [2];
64  fCosThetaBins = new double [kBGLRS3DNumCosThetaBins + 1];
66 
67  fPhiBins[0] = 0;
68  fPhiBins[1] = 2.*kPi;
69 
70  double dcostheta =
72  (double) kBGLRS3DNumCosThetaBins;
73 
74  double logEmin = TMath::Log10(kBGLRS3DEvMin);
75  double dlogElow = 1.0 / (double) kBGLRS3DNumLogEvBinsPerDecadeLow;
76  double dlogEhigh = 1.0 / (double) kBGLRS3DNumLogEvBinsPerDecadeHigh;
77 
78  double costheta = kBGLRS3DCosThetaMin;
79 
80  for(unsigned int i=0; i<= kBGLRS3DNumCosThetaBins; i++) {
81  if( i==0 ) ; // do nothing
82  else costheta += dcostheta;
83  fCosThetaBins[i] = costheta;
84  if(i != kBGLRS3DNumCosThetaBins) {
85  LOG("Flux", pDEBUG)
86  << "FLUKA 3d flux: CosTheta bin " << i+1
87  << ": lower edge = " << fCosThetaBins[i];
88  } else {
89  LOG("Flux", pDEBUG)
90  << "FLUKA 3d flux: CosTheta bin " << kBGLRS3DNumCosThetaBins
91  << ": upper edge = " << fCosThetaBins[kBGLRS3DNumCosThetaBins];
92  }
93  }
94 
95  double logE = logEmin;
96 
97  for(unsigned int i=0; i<=kBGLRS3DNumLogEvBinsLow+kBGLRS3DNumLogEvBinsHigh; i++) {
98  if( i==0 ) ; // do nothing
99  else if( i<=kBGLRS3DNumLogEvBinsLow ) logE += dlogElow;
100  else logE += dlogEhigh;
101  fEnergyBins[i] = TMath::Power(10.0, logE);
102  if(i != kBGLRS3DNumLogEvBinsLow+kBGLRS3DNumLogEvBinsHigh) {
103  LOG("Flux", pDEBUG)
104  << "FLUKA 3d flux: Energy bin " << i+1
105  << ": lower edge = " << fEnergyBins[i];
106  } else {
107  LOG("Flux", pDEBUG)
108  << "FLUKA 3d flux: Energy bin " << kBGLRS3DNumLogEvBinsLow+kBGLRS3DNumLogEvBinsHigh
110  }
111  }
112 
113  fNumPhiBins = 1;
117 }
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
const double kBGLRS3DCosThetaMin
unsigned int fNumCosThetaBins
number of cos(theta) bins in input flux data files
Definition: GAtmoFlux.h:144
const unsigned int kBGLRS3DNumLogEvBinsHigh
const unsigned int kBGLRS3DNumLogEvBinsLow
const unsigned int kBGLRS3DNumLogEvBinsPerDecadeLow
const double kBGLRS3DEvMin
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
const double kBGLRS3DCosThetaMax
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
const unsigned int kBGLRS3DNumLogEvBinsPerDecadeHigh
double fMaxEv
maximum energy (in input flux files)
Definition: GAtmoFlux.h:131
const unsigned int kBGLRS3DNumCosThetaBins
static const double kPi
Definition: Constants.h:37
#define pDEBUG
Definition: Messenger.h:63

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