icemc
 All Classes Namespaces Files Functions Variables Friends Macros Pages
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  TSpline3 *sEdNdEdAdt; //spline of EdNdEdAdt
31  TSpline3 *sE2dNdEdAdt; //spline of E2dNdEdAdt
32  int EXPONENT; // set flux model
33 
34 public:
35 
36  double energy[E_bin_max]; // energies that correspond to the fluxes in the previous array
37  double EdNdEdAdt[E_bin_max]; //flux of incident neutrinos vs. energy E*dN/dE/dA/dt
38  double E2dNdEdAdt[E_bin_max]; //flux of incident neutrinos vs. energy E^2*dN/dE/dA/dt
39 
40  Spectra(int EXPONENT); // constructor
41 
42  double GetNuEnergy(); // get the neutrino energy which follows neutrino flux.
43 
44  TGraph *GetGEdNdEdAdt();
45  TGraph *GetGE2dNdEdAdt();
46 
47  TSpline3 *GetSEdNdEdAdt();
48  TSpline3 *GetSE2dNdEdAdt();
49 
50  double *Getenergy();
51  double *GetEdNdEdAdt();
52  double *GetE2dNdEdAdt();
53  double GetEdNdEdAdt(double E_val); // return flux value from TSpline
54  double GetE2dNdEdAdt(double E_val); // return flux value from TSpline
55 
56  double Getmaxflux();
57 
58  int GetE_bin(); // return energy bin number
59 
60 
61  int IsSpectrum(); // return 1 or 0 depend on EXPONENT value
62  int IsMonoenergetic(); // return 1 or 0 depend of EXPONENT value
63 
64  // destructor
65 
66 }; //class Spectra
67 
68 #endif