TSIOValidationObj.cc
Go to the documentation of this file.
1 #include <cmath>
2 #include <iostream>
3 #include <iomanip>
4 #include <utl/AugerUnits.h>
5 #include <TVector3.h>
6 #include "ValidationUtil.h"
7 #include "TSIOValidationObj.h"
8 
9 using namespace std;
10 
11 
12 ClassImp(TSIOValidationObj);
13 
14 
17  VEventId(0),
18  VTheta(-999.),
19  VPhi(-999.),
20  VS1000(-999.)
21 {
22 }
23 
24 
25 void
26 TSIOValidationObj::SetRecord(const Int_t nev, const Double_t th, const Double_t ph, const Double_t s1000)
27 {
28  VEventId = nev;
29  VTheta = th;
30  VPhi = ph;
31  VS1000 = s1000;
32 }
33 
34 
35 bool
37 {
38  using namespace utl;
39 
40  const TSIOValidationObj* const o = dynamic_cast<const TSIOValidationObj*>(vo);
41  if (!o) {
42  cerr << "Fault in casting TSIOValidationObj!!!!" << endl;
43  return false;
44  }
45 
46  if (o->VEventId != VEventId)
47  return false;
48 
49  if (o->VS1000 <= 0)
50  return false;
51  if (RelativeError(o->VS1000, VS1000) > 5e-3)
52  return false;
53 
54  const double angle =
55  Angle(o->VTheta*degree, o->VPhi*degree, VTheta*degree, VPhi*degree);
56  const double angleTolerance = 1e-2*degree;
57  if (angle > angleTolerance)
58  return false;
59 
60  return true;
61 }
62 
63 
64 void
66 {
67  cout << "Event ID " << VEventId << '\n'
68  << "Theta "<< setprecision(16) << VTheta << '\n'
69  << "Phi " << setprecision(16) << VPhi << '\n'
70  << "S(1000) " << setprecision(16) << VS1000 << endl;
71 }
virtual bool Validate(const TValidationObj *const vo)
const double degree
double Angle(const double theta1, const double phi1, const double theta2, const double phi2)
double RelativeError(const double a, const double b)
void SetRecord(const Int_t nev, const Double_t th, const Double_t ph, const Double_t s1000)
virtual void Dump()

, generated on Tue Sep 26 2023.