MuonProfileUtilities.h
Go to the documentation of this file.
1 #ifndef _tls_MuonProfileUtilities_h_
2 #define _tls_MuonProfileUtilities_h_
3 
4 #include <utl/AugerUnits.h>
5 #include <utl/Math.h>
6 
7 namespace tls {
8 
10  static const double kDeclination = 3.92*utl::degree;
12  static const double kInclination = -35.09*utl::degree;
13 
17  inline
18  double
19  GetBpsi(const double theta, const double phi)
20  {
21  using namespace std;
22  //Magnetic field in our coordinate system.
23  const double Bx = sin(kDeclination)*cos(kInclination);
24  const double By = cos(kDeclination)*cos(kInclination);
25  const double Bz = -sin(kInclination);
26 
27  //Rotate the magnetic field.
28  const double Bx2 = Bx*cos(phi) + By*sin(phi);
29  const double By2 = -Bx*sin(phi) + By*cos(phi);
30  const double Bz2 = Bz;
31 
32  const double Bx3 = Bx2*cos(theta) - Bz2*sin(theta);
33  const double By3 = By2;
34 
35  const double Bt = sqrt(Bx3*Bx3 + By3*By3);
36  const double c_beta = Bx3/Bt;
37  const double s_beta = By3/Bt;
38 
39  const double b_psi = atan2(s_beta,c_beta);
40 
41  return b_psi;
42  }
43 
45  inline
46  double
47  rPerpendicular(const double xpos, const double ypos,
48  const double theta, const double phi)
49  {
50  using namespace std;
51  // align with shower azimuth
52  double xRotate = xpos*cos(phi) + ypos*sin(phi);
53  double yRotate = -xpos*sin(phi) + ypos*cos(phi);
54  // project onto perpendicular plane
55  double xPerpendicular = xRotate * cos(theta);
56  double yPerpendicular = yRotate;
57 
58  double kRPerpendicular = sqrt(pow(xPerpendicular,2)+pow(yPerpendicular,2));
59 
60  return kRPerpendicular;
61  }
62 
64  inline
65  double
66  PsiPerpendicular(const double xpos, const double ypos,
67  const double theta, const double phi)
68  {
69  using namespace std;
70  // align with shower azimuth
71  double xRotate = xpos*cos(phi) + ypos*sin(phi);
72  double yRotate = -xpos*sin(phi) + ypos*cos(phi);
73  // project onto perpendicular plane
74  double xPerpendicular = xRotate * cos(theta);
75  double yPerpendicular = yRotate;
76 
77  return atan2(yPerpendicular,xPerpendicular);
78  }
79 
80 } // NS tls
81 
82 #endif
double GetBpsi(const double theta, const double phi)
double rPerpendicular(const double xpos, const double ypos, const double theta, const double phi)
radial distance in shower front plane coordinate system
double pow(const double x, const unsigned int i)
constexpr double degree
static const double kInclination
kInclination of geomagnetic field in Malargüe, 2007
static const double kDeclination
kDeclination of geomagnetic field in Malargüe, 2007
double PsiPerpendicular(const double xpos, const double ypos, const double theta, const double phi)
polar angle in shower front plane coordinate system

, generated on Tue Sep 26 2023.