ReadFDCalib.cc
Go to the documentation of this file.
1 #include <sstream>
2 
3 #include "ReadFDCalib.h"
4 #include <utl/ErrorLogger.h>
5 
6 #include <evt/Event.h>
7 #include <det/Detector.h>
8 
9 #include <utl/TimeStamp.h>
10 #include <utl/UTCDateTime.h>
11 #include <utl/TabulatedFunction.h>
12 #include <utl/AugerUnits.h>
13 #include <utl/AugerException.h>
14 
15 #include <fdet/FDetector.h>
16 #include <fdet/Telescope.h>
17 #include <fdet/Eye.h>
18 #include <fdet/Pixel.h>
19 
20 using namespace std;
21 using namespace utl;
22 using namespace fwk;
23 using namespace det;
24 using namespace fdet;
25 
26 using namespace ReadFDCalibNS;
27 
28 ReadFDCalib::ReadFDCalib(){}
29 
30 ReadFDCalib::~ReadFDCalib(){}
31 
34 {
35  INFO("ReadFDCalib::Init()");
36  return eSuccess;
37 }
38 
40 ReadFDCalib::Run(evt::Event& event)
41 {
42  INFO("ReadFDCalib::Run()");
43 
44  // Set detector time
45  Detector::GetInstance().Update(UTCDateTime(2012,1,1,0,0).GetTimeStamp());
46 
47  const FDetector& fDet = Detector::GetInstance().GetFDetector();
48 
49  // iterate over all eyes
50  for (FDetector::EyeIterator eyeIt = fDet.EyesBegin() ;
51  eyeIt != fDet.EyesEnd() ; ++eyeIt) {
52 
53 
54  cout << "eye : " << eyeIt->GetName() << endl;
55  cout << "---------------------------" << endl;
56 
57  // iterate over all telescopes in the eye
58  for (Eye::TelescopeIterator telIt = eyeIt->TelescopesBegin();
59  telIt != eyeIt->TelescopesEnd(); ++telIt) {
60 
61  cout << " telescope : " << telIt->GetId() << endl;
62 
63  // loop on all pixels
64 
65  for (unsigned int iPixId = telIt->GetFirstPixelId() ;
66  iPixId <= telIt->GetLastPixelId() ; ++iPixId) {
67 
68  cout << iPixId << ": ";
69 
70  // Get calibration constants as function of wavelength
71  TabulatedFunction calVsWavelength;
72  try {
73  calVsWavelength = telIt->GetPixel(iPixId).GetEndToEndCalibrationConstant();
74  } catch (DataNotFoundInDBException& ed) {
75  cout << "could not retrieve calib consts for eye : "
76  << eyeIt->GetName() << ", telescope " << telIt->GetId()
77  << " " << endl;
78  break;
79  }
80 
81  // Iterate through calibration constants for each wavelength
82  for (TabulatedFunction::ConstIterator calIt = calVsWavelength.Begin() ;
83  calIt != calVsWavelength.End() ; ++calIt) {
84  cout << "(" << calIt->X()/nanometer << " nm, " << calIt->Y() << ") ";
85  }
86  cout << ", ";
87  }
88  cout << endl;
89  }
90  }
91  return eSuccess;
92 }
93 
95 ReadFDCalib::Finish()
96 {
97  INFO("ReadFDCalib::Finish()");
98  return eSuccess;
99 }
Class to hold collection (x,y) points and provide interpolation between them.
#define INFO(message)
Macro for logging informational messages.
Definition: ErrorLogger.h:161
void Init()
Initialise the registry.
EyeIterator EyesBegin(const FDetComponentSelector::Type type=FDetComponentSelector::ePhysical) const
iterator pointing to first eye of given type (ePhysical, eVirtual, eAll)
Definition: FDetector.h:72
Detector description interface for FDetector-related data.
Definition: FDetector.h:44
constexpr double nanometer
Definition: AugerUnits.h:102
Exception to use in case requested data not found in the database with detailed printout.
boost::filter_iterator< FDetComponentSelector, AllEyeIterator > EyeIterator
Definition: FDetector.h:69
boost::filter_iterator< TelIsCommissioned, InternalConstTelescopeIterator > TelescopeIterator
An iterator over telescopes.
Definition: FDetector/Eye.h:76
ResultFlag
Flag returned by module methods to the RunController.
Definition: VModule.h:60
EyeIterator EyesEnd(const FDetComponentSelector::Type type=FDetComponentSelector::ePhysical) const
iterator pointing to end of available eyes of given type (ePhysical, eVirtual, eAll) ...
Definition: FDetector.h:76

, generated on Tue Sep 26 2023.