USCMuonProfile.h
Go to the documentation of this file.
1 #ifndef h_USCMuonProfile
2 #define h_USCMuonProfile
3 
4 #include <utl/AugerUnits.h>
5 #include <tls/VMuonProfile.h>
6 #include <tls/MuonProfileUtilities.h>
7 
8 #include <cmath>
9 #include <vector>
10 
11 class TFile;
12 
13 class TH2D;
14 
15 namespace utl { class Branch; }
16 
17 namespace USCMuonProfileNS {
18 
27  public:
30 
31  inline
32  void SetProfile(double theta, double phi, double energy)
33  {
34  if (theta < fThetaRange[0]) theta = GetThetaMin();
35  else if (theta > fThetaRange[1]) theta = GetThetaMax();
36 
37  if (theta == fTheta && phi == fPhi && energy == fEnergy) return;
38 
39  fTheta = theta;
40  fPhi = phi;
41  fEnergy = energy;
42  fBPsi = tls::GetBpsi(theta, phi);
43 
45 
47  }
48 
49  double NMuon(double xpos, double ypos, double theta, double phi, double energy);
50  double ThetaMuon(double xpos, double ypos, double theta, double phi, double energy);
51  double EnergyMuon(double xpos, double ypos, double theta, double phi, double energy);
52 
53  double GetThetaMax();
54  double GetThetaMin();
55 
56  private:
57  TFile* fDensity;
58 
59  std::vector<double> fThetaRange;
60 
61  double fTheta, fPhi, fEnergy;
62  double fBPsi;
63 
64  double fExponent;
65 
66  double fNMuonScale;
68 
70  unsigned int fIndexPhiLow, fIndexPhiUp;
71 
72  TH2D* fHistDen1;
73  TH2D* fHistDen2;
74  TH2D* fHistDen3;
75  TH2D* fHistDen4;
76 
77  void LoadHistograms(double theta, double phi);
78 
79  unsigned int Theta2IndexLower(double theta);
80  unsigned int Theta2IndexUpper(double theta);
81  unsigned int Phi2IndexLower(double theta);
82  unsigned int Phi2IndexUpper(double theta);
83 
84  double Index2Theta(unsigned int itheta);
85  double Index2Phi(unsigned int iphi);
86 
87  double PhiMap(double phi);
88 
89  // rounding function to handle the problems with floating point precission and the indexing system.
90  inline
91  double approx(double num, double prec = 1e-3)
92  {
93  return floor(num/prec+0.5)*prec;
94  }
95  };
96 }
97 
98 #endif
constexpr double eV
Definition: AugerUnits.h:185
double GetBpsi(const double theta, const double phi)
void SetProfile(double theta, double phi, double energy)
double pow(const double x, const unsigned int i)
unsigned int Theta2IndexLower(double theta)
void LoadHistograms(double theta, double phi)
Class representing a document branch.
Definition: Branch.h:107
double NMuon(double xpos, double ypos, double theta, double phi, double energy)
Expected average number of muons per tank, at the given coordinates on the ground, for a certain combination of theta, phi, and energy of the primary particle.
double Index2Theta(unsigned int itheta)
double approx(double num, double prec=1e-3)
Muon profile interpolated from maps derived from Monte Carlo simulations. Tables from the Santiago de...
unsigned int Phi2IndexUpper(double theta)
double GetThetaMax()
Maximum zenith angle, at which the tank response function is defined.
unsigned int Theta2IndexUpper(double theta)
double EnergyMuon(double xpos, double ypos, double theta, double phi, double energy)
Expected average muon energy on the ground, at the given coordinates on the ground, for a certain combination of theta, phi, and energy of the primary particle.
USCMuonProfile(utl::Branch branch)
double GetThetaMin()
Minimum zenith angle, at which the tank response function is defined.
unsigned int Phi2IndexLower(double theta)
double ThetaMuon(double xpos, double ypos, double theta, double phi, double energy)
Expected average muon inclination angle on the ground, at the given coordinates on the ground...
double Index2Phi(unsigned int iphi)
std::vector< double > fThetaRange
This is the virtual base class for muon numbers. The implementation has to provide these virtual meth...
Definition: VMuonProfile.h:11

, generated on Tue Sep 26 2023.