FDetector/Telescope.h
Go to the documentation of this file.
1 #ifndef _fdet_Telescope_h_
2 #define _fdet_Telescope_h_
3 
4 #include <det/ValidityStamp.h>
5 #include <utl/CoordinateSystem.h>
6 #include <utl/TabulatedFunction.h>
7 #include <utl/IteratorRange.h>
8 
9 #include <map>
10 #include <string>
11 #include <vector>
12 
13 
14 namespace utl {
15  class Point;
16  class Vector;
17  class TimeStamp;
18 }
19 
20 namespace det {
21  class Detector;
22 }
23 
24 namespace fevt {
25  class Pixel;
26 }
27 
28 namespace fdet {
29 
30  class Channel;
31  class Diaphragm;
32  class Filter;
33  class Corrector;
34  class Mirror;
35  class Camera;
36  class Eye;
37  class Pixel;
38 
39 
51  class Telescope {
52 
53  private:
54  // I beg nobody will ever think of a different camera geometry --RU ~2005
55  //
56  // I beg nobody will ever think of a camera geometry that can't be
57  // described with a number of columns and rows --Steffen 2009
58  //
59  // last remaining hardcoded properties
60  static const unsigned int kFirstChannel = 1;
61  static const unsigned int kLastChannel = 480;
62 
63  public:
64  const std::string& GetConfigSignature(const std::string& module) const;
65  const std::string& GetConfigSignatureStr(const std::string& module) const;
66 
67  utl::Point GetPosition() const;
68  utl::Vector GetAxis() const;
69 
76 
77  unsigned int GetId() const { return fTelescopeId; }
78  unsigned int GetEyeId() const { return fEyeId; }
79 
82  unsigned int GetParentPhysicalEyeId() const
84 
87  unsigned int GetParentPhysicalId() const
89 
92  const std::string& GetParentPhysicalEyeIdString() const
94 
97  const std::string& GetParentPhysicalIdString() const
99 
101  bool IsVirtual() const { return fIdOfParentPhysicalEye != 0; }
102 
104  const Channel& GetChannel(const unsigned int channelId) const;
105  const Channel& GetChannel(const fdet::Pixel& p) const;
106  const Channel& GetChannel(const fevt::Pixel& p) const;
108  const Pixel& GetPixel(const unsigned int pixelId) const;
110  const Pixel& GetPixel(const unsigned int row, const unsigned int col) const;
111 
113  bool HasCorrectorRing() const;
114 
116  const Diaphragm& GetDiaphragm() const;
117 
119  const Filter& GetFilter() const;
120 
122  const Corrector& GetCorrector() const;
123 
125  const Mirror& GetMirror() const;
126 
128  const Camera& GetCamera() const;
129 
131  const utl::TimeStamp& GetCommissionTime() const;
132 
134  const utl::TimeStamp& GetDecommissionTime() const;
135 
136  double GetDiaphragmArea() const;
137  double GetDiaphragmRadius() const;
138 
139  unsigned int GetFirstPixelId() const { return 1; }
140  unsigned int GetLastPixelId() const;
141 
142  unsigned int GetFirstChannelId() const { return kFirstChannel; }
143  unsigned int GetLastChannelId() const { return kLastChannel; }
144 
145  unsigned int GetFirstRow() const;
146  unsigned int GetFirstColumn() const;
147  unsigned int GetLastRow() const;
148  unsigned int GetLastColumn() const;
149 
150  utl::Vector GetCameraPixelDirection(const unsigned int pixelId) const;
151  utl::Vector GetCameraPixelDirection(const unsigned int row, const unsigned int col) const;
152 
156  double GetModelRelativeEfficiency(const double wl) const;
157  double GetModelMeanEfficiency(const std::string& configSignature, const double wl) const;
158 
161  double GetMeasuredRelativeEfficiency(const double wl) const;
163 
166  typedef std::vector<utl::Vector>::const_iterator OutOfBorderPixelsIterator;
167 
173 
174  // dynamic properties
175  double GetUpTimeFraction() const;
176  bool IsInAquisition() const;
177  int GetDAQStatus() const;
178 
179  std::string GetTelescopePointingId() const;
180 
181  typedef std::map<std::string, double> PointingAngleSet;
184 
185  double GetModelMinWavelength() const;
186  double GetModelMaxWavelength() const;
187 
189  void CachePixelCalibrations() const;
190 
193 
195  bool CachePixelCloudData() const;
196 
197  void UpdateFdUpTime() const;
198 
199  protected:
200  double GetModelWavelengthDependence(const double wl) const;
201 
202  private:
203  typedef std::map<unsigned int, const Channel*> InternalChannelCollection;
204  typedef std::map<unsigned int, Pixel*> InternalPixelCollection;
205  typedef std::vector<utl::Vector> InternalPixelDirCollection;
206 
207  void CacheTelescopePointing() const;
208  Telescope(const unsigned int eyeId, const unsigned int telescopeId);
209  ~Telescope();
210 
211  Telescope(const Telescope& tel);
212  Telescope& operator=(const Telescope& tel);
213 
214  void Update();
215 
217  void GenerateOutOfBorderPixels() const;
218 
219  template<typename T>
220  inline const T& GetTelescopeData(T*& requestedData,
221  const std::string& property,
222  const std::string& component,
223  const std::string& errorMsg) const;
224 
225  template<typename T>
226  inline void GetTelescopeData(T& requestedData,
227  const std::string& property,
228  const std::string& component,
229  const std::string& errorMsg) const;
230 
233 
234  unsigned int fEyeId = 0;
235  unsigned int fTelescopeId = 0;
236  std::string fEyeIdString;
237  std::string fTelescopeIdString;
238 
239  // Quantities filled by lazy evaluation
240  mutable int fIdOfParentPhysicalEye = -1;
244 
245  mutable std::string* fConfigSignatureStr = nullptr;
246  mutable std::string* fConfigSignature = nullptr;
247  mutable std::string fConfigSignatureModule;
248 
249  mutable utl::Point* fPosition = nullptr;
250  mutable utl::Vector* fAxis = nullptr;
252 
253  mutable utl::TimeStamp* fCommissionTime = nullptr;
254  mutable utl::TimeStamp* fDecommissionTime = nullptr;
255 
257 
259  mutable std::string* fTelPointingId = nullptr;
260 
265 
268 
270  mutable Diaphragm* fDiaphragm = nullptr;
271 
273  mutable Mirror* fMirror = nullptr;
274 
276  mutable Filter* fFilter = nullptr;
277 
279  mutable Corrector* fCorrector = nullptr;
280 
282  mutable Camera* fCamera = nullptr;
283 
284  // up time info
286  mutable double fUpTimeFraction = 0;
287  mutable int fStatus = 0;
288 
289  mutable std::map<int, utl::TabulatedFunction> fCalibMap;
290  mutable std::map<int, utl::TabulatedFunction> fOpticalEfficiencyMap;
293 
294  friend class Eye;
295 
296  };
297 
298 }
299 
300 
301 #endif
PointingAngleSet * fTelPointingPhiMap
Hold the azimuth of the various possible telescope pointing directions.
double GetModelRelativeEfficiency(const double wl) const
utl::Vector GetCameraPixelDirection(const unsigned int pixelId) const
InternalPixelDirCollection fOutBorderPixelsDir
Hold the directions of &quot;virtual&quot; pixels that are one col/row outside the camera.
void UpdateFdUpTime() const
utl::CoordinateSystemPtr fCoordinateSystem
Point object.
Definition: Point.h:32
utl::Point * fPosition
const Diaphragm & GetDiaphragm() const
Get the diaphragm that belongs to the telescope.
Description of the electronic channel for the 480 channels of the crate.
det::ValidityStamp fUpTimeValidityStamp
std::string fTelescopeIdString
utl::TimeStamp * fCommissionTime
bool IsInAquisition() const
std::string * fConfigSignatureStr
det::ValidityStamp fOpticalEfficiencyValidityStamp
det::ValidityStamp fCalibValidityStamp
std::string * fConfigSignature
unsigned int GetFirstPixelId() const
double GetUpTimeFraction() const
static const unsigned int kLastChannel
const std::string & GetParentPhysicalEyeIdString() const
void CachePixelCalibrations() const
Cache calibration constants for pixels in one go (minimize DB access)
double GetModelMaxWavelength() const
Class to hold collection (x,y) points and provide interpolation between them.
const Corrector & GetCorrector() const
Get the Corrector (corrector ring) object that belongs to the telescope.
unsigned int GetParentPhysicalEyeId() const
std::map< unsigned int, Pixel * > InternalPixelCollection
double GetDiaphragmRadius() const
std::string fEyeIdString
const std::string & GetConfigSignature(const std::string &module) const
bool CachePixelCloudData() const
Cache cloud coverage for pixels in one go (minimize DB access)
utl::Vector GetAxis() const
const Channel & GetChannel(const unsigned int channelId) const
Get Channel by id, throw utl::NonExistentComponentException if n.a.
unsigned int GetEyeId() const
double GetModelWavelengthDependence(const double wl) const
Detector description interface for Eye-related data.
Definition: FDetector/Eye.h:45
const std::string & GetConfigSignatureStr(const std::string &module) const
Diaphragm * fDiaphragm
Hold the diaphragm properties like radius and area.
Camera * fCamera
Hold the camera properties like the radius of curvature, Mercedes geometry and efficiency as function...
Corrector * fCorrector
Hold the corrector ring properties like the transmitance as function of the wavelength.
const Camera & GetCamera() const
Get the Camera object that belongs to the telescope.
unsigned int GetFirstColumn() const
std::string fConfigSignatureModule
double GetModelMeanEfficiency(const std::string &configSignature, const double wl) const
A TimeStamp holds GPS second and nanosecond for some event.
Definition: TimeStamp.h:110
bool HasCorrectorRing() const
flag for corrector ring presence
OutOfBorderPixelsIterator OutOfBorderPixelsEnd() const
End of pixels out of the border.
const Pixel & GetPixel(const unsigned int pixelId) const
Get Pixel by id, throw utl::NonExistentComponentException if n.a.
Mirror * fMirror
Hold the mirror properties like the reflectivity as function of the wavelength.
unsigned int GetLastChannelId() const
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
void CachePixelOpticalEfficiencyCorrections() const
Cache optical efficiency corrections for pixels in one go (minimize DB access)
unsigned int GetLastPixelId() const
utl::CoordinateSystemPtr GetTelescopeCoordinateSystem() const
std::map< unsigned int, const Channel * > InternalChannelCollection
PointingAngleSet * fTelPointingElevationMap
Hold the elevation of the various possible telescope pointing directions.
Fluorescence Detector Pixel event.
Definition: FEvent/Pixel.h:28
Telescope(const unsigned int eyeId, const unsigned int telescopeId)
int GetDAQStatus() const
InternalPixelCollection fPixel
std::string fIdOfParentPhysicalEyeString
PointingAngleSet GetTelescopePointingElevation() const
std::map< int, utl::TabulatedFunction > fOpticalEfficiencyMap
const utl::TimeStamp & GetDecommissionTime() const
Telescope decommission time.
std::vector< utl::Vector > InternalPixelDirCollection
utl::TimeStamp * fDecommissionTime
std::vector< utl::Vector >::const_iterator OutOfBorderPixelsIterator
unsigned int GetLastRow() const
Description of a corrector ring.
Definition: Corrector.h:36
void GenerateOutOfBorderPixels() const
Generate pixels for one row and one column outside the last actual pixels of the camera.
std::string GetTelescopePointingId() const
InternalChannelCollection fChannel
std::map< std::string, double > PointingAngleSet
const utl::TabulatedFunction & GetMeasuredRelativeEfficiency() const
unsigned int GetFirstChannelId() const
double GetModelMinWavelength() const
Detector description interface for Telescope-related data.
const Filter & GetFilter() const
Get the filter that belongs to the telescope.
double GetDiaphragmArea() const
std::map< int, utl::TabulatedFunction > fCalibMap
bool IsVirtual() const
Returns whether this telescope belongs to a virtual eye.
unsigned int GetParentPhysicalId() const
Description of a pixel.
utl::Point GetPosition() const
Vector object.
Definition: Vector.h:30
Filter * fFilter
Hold the filter properties like the trasmitance as function of the wavelength.
const Mirror & GetMirror() const
Get the Mirror object that belongs to the telescope.
OutOfBorderPixelsIterator OutOfBorderPixelsBegin() const
Begin of pixels out of the border.
const std::string & GetParentPhysicalIdString() const
Description of the diaphragm.
Definition: Diaphragm.h:33
const T & GetTelescopeData(T *&requestedData, const std::string &property, const std::string &component, const std::string &errorMsg) const
unsigned int GetLastColumn() const
unsigned int fTelescopeId
Description of a filter.
Object to keep track of whether data are valid, or have expired.
Definition: ValidityStamp.h:29
std::string * fTelPointingId
The id of the default telescope pointing.
Description of a mirror.
void CacheTelescopePointing() const
unsigned int GetFirstRow() const
unsigned int GetId() const
Telescope & operator=(const Telescope &tel)
PointingAngleSet GetTelescopePointingPhi() const
OFFLINE_DECLARE_CONST_ITERATOR_RANGE(OutOfBorderPixelsIterator, OutOfBorderPixels)
const utl::TimeStamp & GetCommissionTime() const
Telescope commission time.
Description of a camera.
std::string fIdOfParentPhysicalTelescopeString
utl::TabulatedFunction * fMeasuredRelativeEfficiency
static const unsigned int kFirstChannel

, generated on Tue Sep 26 2023.