FIOValidationObj.cc
Go to the documentation of this file.
1 #include "FIOValidationObj.h"
2 #include "TFIOValidationObj.h"
3 
4 #include <utl/ErrorLogger.h>
5 
6 #include <det/Detector.h>
7 
8 #include <fdet/Pixel.h>
9 #include <fdet/Telescope.h>
10 #include <fdet/FDetector.h>
11 #include <fdet/Channel.h>
12 #include <fdet/Eye.h>
13 
14 #include <utl/TimeStamp.h>
15 #include <utl/TabulatedFunctionErrors.h>
16 
17 #include <evt/Event.h>
18 #include <evt/ShowerRecData.h>
19 #include <evt/ShowerFRecData.h>
20 #include <evt/VGaisserHillasParameter.h>
21 
22 #include <fevt/FEvent.h>
23 #include <fevt/Header.h>
24 #include <fevt/Eye.h>
25 #include <fevt/Telescope.h>
26 #include <fevt/EyeHeader.h>
27 #include <fevt/EyeRecData.h>
28 #include <fevt/Pixel.h>
29 #include <fevt/PixelRecData.h>
30 
31 
32 #include <utl/Trace.h>
33 #include <utl/AugerUnits.h>
34 #include <utl/MathConstants.h>
35 #include <utl/PhysicalConstants.h>
36 
37 #include <fwk/LocalCoordinateSystem.h>
38 
39 using namespace det;
40 using namespace evt;
41 using namespace utl;
42 using namespace fevt;
43 using namespace std;
44 using namespace fwk;
45 
46 
48  ValidationObj("FIOValidationObj")
49 {
51  _myTObjectName = _myTObject->GetName();
52 }
53 
54 
55 bool
57 {
58  TFIOValidationObj* eFIO =
59  dynamic_cast<TFIOValidationObj*>(_myTObject);
60  if (!eFIO) {
61  cout << "Fault in casting TFIOValidationObj!!!!" << endl;
62  return false;
63  }
64  VEyeRecObj eyearray[4] = { VEyeRecObj(), VEyeRecObj(), VEyeRecObj(), VEyeRecObj() };
65  int EventNum = 0;
66  if (event.HasFEvent()) {
67  const fevt::FEvent& fevent = event.GetFEvent();
68  // iterate over eyes
69  for (FEvent::ConstEyeIterator eyeiter = fevent.EyesBegin();
70  eyeiter != fevent.EyesEnd(); ++eyeiter) {
71  const fevt::Eye& eye = *eyeiter; // dereferencing the eye iterator
72  // gives you a reference to the eye
73  const fevt::EyeRecData& eyerec = eye.GetRecData();
74  const int neye = eye.GetId();
75  const ShowerFRecData& frs = eyerec.GetFRecShower();
76  EventNum = eye.GetHeader().GetEventNumber();
77 
78  const Vector sdp = eyerec.GetSDP(); // get Shower Detector Plane
79  const Vector frsa = frs.GetAxis(); // get Shower Reconstructed Axis
80 
81  const Point eyeposition =
82  det::Detector::GetInstance().GetFDetector().GetEye(eye).GetPosition();
83 
84  const CoordinateSystemPtr eye2CS = fwk::LocalCoordinateSystem::Create(eyeposition);
85 
86  const Double_t theta = sdp.GetTheta(eye2CS) / degree;
87  const Double_t phi = sdp.GetPhi(eye2CS) / degree;
88  const Double_t theta_sra = frsa.GetTheta(eye2CS) / degree;
89  const Double_t phi_sra = frsa.GetPhi(eye2CS) / degree;
90  const Double_t e_em = frs.GetEmEnergy();
91  const Double_t e_tot = frs.GetTotalEnergy();
92  const Double_t xmax = frs.HasGHParameters() ?
93  frs.GetGHParameters().GetXMax()/(g/cm2) : 0;
94 
95  const int index = neye - 1;
96  eyearray[index] = VEyeRecObj(neye, theta, phi, theta_sra, phi_sra, xmax, e_em, e_tot);
97  }
98  eFIO->SetEventId(EventNum);
99  eFIO->SetEyeRec(eyearray);
100 
101  cout << "FIOValidationObj input end!" << endl;
102  return true;
103  }
104 
105  return false;
106 }
unsigned int GetId() const
Definition: FEvent/Eye.h:54
const double degree
Point object.
Definition: Point.h:32
double GetPhi(const CoordinateSystemPtr &coordinateSystem) const
azimuth (phi) angle in spherical and cylindrical coordinates
Definition: BasicVector.h:254
fevt::EyeHeader & GetHeader()
Header for this Eye Event.
Definition: FEvent/Eye.cc:180
Fluorescence Detector Eye Event.
Definition: FEvent/Eye.h:29
boost::filter_iterator< ComponentSelector, ConstAllEyeIterator > ConstEyeIterator
Definition: FEvent.h:56
double GetTotalEnergy() const
retrieve total energy and its uncertainty
bool HasFEvent() const
double GetTheta(const CoordinateSystemPtr &coordinateSystem) const
zenith (theta) angle in spherical coordinates
Definition: BasicVector.h:248
void SetEventId(const Int_t id)
EyeIterator EyesEnd(const ComponentSelector::Status status)
Definition: FEvent.h:66
TValidationObj * _myTObject
Definition: ValidationObj.h:22
std::string _myTObjectName
Definition: ValidationObj.h:21
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
evt::ShowerFRecData & GetFRecShower()
Reconstructed shower info for this eye.
Definition: EyeRecData.h:323
EyeIterator EyesBegin(const ComponentSelector::Status status)
Definition: FEvent.h:58
unsigned int GetEventNumber() const
Event number.
Definition: EyeHeader.h:124
void SetEyeRec(const VEyeRecObj *const eyerec)
constexpr double g
Definition: AugerUnits.h:200
double GetEmEnergy() const
retrieve electromagnetic energy and its uncertainty
Top of Fluorescence Detector event hierarchy.
Definition: FEvent.h:33
Eye-specific shower reconstruction data.
Definition: EyeRecData.h:65
const utl::AxialVector & GetSDP() const
Definition: EyeRecData.h:75
bool HasGHParameters() const
Vector object.
Definition: Vector.h:30
Interface class to access to Fluorescence reconstruction of a Shower.
static Policy::type Create(const utl::Point &theOrigin)
Create the standard local coordinate system for a Point.
virtual bool Fill(const evt::Event &event)
constexpr double cm2
Definition: AugerUnits.h:118
fevt::EyeRecData & GetRecData()
Reconstructed data for this eye.
Definition: FEvent/Eye.cc:130
const utl::Vector & GetAxis() const
Shower Axis as reconstructed by the FD or FD eye.

, generated on Tue Sep 26 2023.