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