icemc
Spectra.h
Go to the documentation of this file.
1 #ifndef SPECTRA_H_
2 #define SPECTRA_H_
3 
4 #include "TSpline.h"
5 #include <string>
6 #include "TRandom3.h"
7 
8 
9 using namespace std;
10 
12 class Spectra {
13 
14 private:
15  TRandom3 Rand3;
16  double maxflux; // max flux value
17 // static const int NSPECTRA_MAX=300; // why need this??
18  static const int E_bin_max = 50;
19  int E_bin; // initialize # of energy bins (max = 50)
20 
21 // double energy[E_bin_max]; // energies that correspond to the fluxes in the previous array
22 // double EdNdEdAdt[E_bin_max]; //flux of incident neutrinos vs. energy E*dN/dE/dA/dt
23 // double E2dNdEdAdt[E_bin_max]; //flux of incident neutrinos vs. energy E^2*dN/dE/dA/dt
24 
25  void GetFlux(string filename); // read neutrino flux EdNdEdAdt (in GeV) from filename file
26 
27  TGraph *gEdNdEdAdt; //graph for EdNdEdAdt flux
28  TGraph *gE2dNdEdAdt; //graph for E2dNdEdAdt flux
29 
30  TGraph *CDF;
31  TGraph *inverse_CDF;
32 
33  TSpline3 *sEdNdEdAdt; //spline of EdNdEdAdt
34  TSpline3 *sE2dNdEdAdt; //spline of E2dNdEdAdt
35  int EXPONENT; // set flux model
36 
37 public:
38 
39  double energy[E_bin_max]; // energies that correspond to the fluxes in the previous array
40  double EdNdEdAdt[E_bin_max]; //flux of incident neutrinos vs. energy E*dN/dE/dA/dt
41  double E2dNdEdAdt[E_bin_max]; //flux of incident neutrinos vs. energy E^2*dN/dE/dA/dt
42 
43  Spectra(int EXPONENT); // constructor
44 
45  double GetNuEnergy(); // get the neutrino energy which follows neutrino flux.
46  double GetCDFEnergy();//get Energy from 'CDF'
47  void GetCDF();//set up CDF and inverse CDF;
48  TGraph *GetGEdNdEdAdt();
49  TGraph *GetGE2dNdEdAdt();
50 
51  TSpline3 *GetSEdNdEdAdt();
52  TSpline3 *GetSE2dNdEdAdt();
53 
54  double *Getenergy();
55  double *GetEdNdEdAdt();
56  double *GetE2dNdEdAdt();
57  double GetEdNdEdAdt(double E_val); // return flux value from TSpline
58  double GetE2dNdEdAdt(double E_val); // return flux value from TSpline
59 
60  double Getmaxflux();
61 
62  int GetE_bin(); // return energy bin number
63 
64 
65  int IsSpectrum(); // return 1 or 0 depend on EXPONENT value
66  int IsMonoenergetic(); // return 1 or 0 depend of EXPONENT value
67 
68  // destructor
69 
70 }; //class Spectra
71 
72 #endif
TSpline3 * sE2dNdEdAdt
Definition: Spectra.h:34
int E_bin
Definition: Spectra.h:19
TGraph * gEdNdEdAdt
Definition: Spectra.h:27
Neutrino spectra.
Definition: Spectra.h:12
TRandom3 Rand3
Definition: Spectra.h:15
double maxflux
Definition: Spectra.h:16
TGraph * CDF
Definition: Spectra.h:30
TSpline3 * sEdNdEdAdt
Definition: Spectra.h:33
TGraph * inverse_CDF
Definition: Spectra.h:31
TGraph * gE2dNdEdAdt
Definition: Spectra.h:28
int EXPONENT
Definition: Spectra.h:35