ValidationUtil.h
Go to the documentation of this file.
1 #ifndef _ValidationUtil_h_
2 #define _ValidationUtil_h_
3 
4 #include <cmath>
5 #include <TVector3.h>
6 
7 
8 inline
9 double
10 Angle(const double theta1, const double phi1,
11  const double theta2, const double phi2)
12 {
13  TVector3 a;
14  a.SetMagThetaPhi(1, theta1, phi1);
15  TVector3 b;
16  b.SetMagThetaPhi(1, theta2, phi2);
17  return 2*std::asin(0.5 * (a - b).Mag());
18 }
19 
20 
21 inline
22 double
23 RelativeError(const double a, const double b)
24 {
25  return std::fabs(2 * (a - b) / (a + b));
26 }
27 
28 
29 #endif
double Angle(const double theta1, const double phi1, const double theta2, const double phi2)
double RelativeError(const double a, const double b)

, generated on Tue Sep 26 2023.