FDetector.h
Go to the documentation of this file.
1 #ifndef _fdet_FDetector_h_
2 #define _fdet_FDetector_h_
3 
4 #include <boost/iterator/indirect_iterator.hpp>
5 #include <boost/iterator/filter_iterator.hpp>
6 
7 #include <list>
8 #include <string>
9 
10 #include <fdet/FDetComponentSelector.h>
11 #include <det/ValidityStamp.h>
12 
13 namespace det {
14  class Detector;
15 }
16 
17 namespace fevt {
18  class Channel;
19  class Pixel;
20  class Eye;
21  class Telescope;
22 }
23 
24 
25 namespace fdet {
26 
27  class Eye;
28  class Channel;
29  class Pixel;
30  class Telescope;
31 
32 
44  class FDetector {
45 
46  private:
47  // FDetector offers only const list interface to const Eyes
48  typedef std::list<int> InternalEyeIdCollection;
49  typedef std::list<Eye*> InternalEyeCollection;
50  typedef InternalEyeCollection::const_iterator InternalEyeIterator;
51 
53  typedef boost::indirect_iterator<InternalEyeIterator, const Eye&> AllEyeIterator;
54 
56  { return AllEyeIterator(fCommissionedEyeList.begin()); }
58  { return AllEyeIterator(fCommissionedEyeList.end()); }
59 
60  public:
62  unsigned int GetFirstEyeId() const;
63 
65  unsigned int GetLastEyeId() const;
66 
69  typedef boost::filter_iterator<FDetComponentSelector, AllEyeIterator> EyeIterator;
70 
74 
78 
80  const Eye& GetEye(const unsigned int eyeId) const;
81 
83  const Eye& GetEye(const std::string& eyeName) const;
84 
86  const Eye& GetEye(const fevt::Eye& eventEye) const;
87 
89  const Telescope& GetTelescope(const fevt::Telescope& eventTel) const;
90 
92  const Channel& GetChannel(const fevt::Channel& eventChannel) const;
93  const Channel& GetChannel(const fdet::Pixel& p) const;
94  const Channel& GetChannel(const fevt::Pixel& p) const;
95 
97  const Pixel& GetPixel(const fevt::Pixel& eventPixel) const;
98  const Pixel& GetPixel(const fevt::Channel& c) const;
99  const Pixel& GetPixel(const fdet::Channel& c) const;
100 
101 
102  // dynamic up time data
103  double GetCDASUpTimeFraction() const;
104  //double GetCDASVetoFraction() const;
105  bool IsCDASInAquisition() const;
106  int GetCDASDAQStatus() const;
107  bool HasFdUpTime() const;
108 
109  double GetModelMinWavelength() const;
110  double GetModelMaxWavelength() const;
111 
112  // reference wavelength to be used for all calculations
113  double GetReferenceLambda() const;
114 
115  private:
116  template<typename T> inline const T& GetFDetectorData(T*& requestedData,
117  const std::string& property,
118  const std::string& component,
119  const std::string& errorMsg) const;
120  template<typename T> inline void GetFDetectorData(T& requestedData,
121  const std::string& property,
122  const std::string& component,
123  const std::string& errorMsg) const;
124 
126  ~FDetector();
127 
128  FDetector(const FDetector&);
129  FDetector& operator=(const FDetector&);
130 
131  void Update();
132  void UpdateFdUpTime() const;
133 
135 
136  // Container for all commissioned Eyes (note that, currently, all eyes found
137  // in the external file (XML file or possibly database) are
138  // considered to be "commissioned." Individual telescopes within eyes, however, will
139  // have real commission and decommission times associated with them,however.)
140  //
142 
143  // List of all eyes available in the external sources
144  // (external sources are, for example, the XML file containing
145  // the telescope/eye list or perhaps at some point a MySQL database
147 
148  // up time info
150  mutable double fUpTimeFraction;
151  mutable double fVetoFraction;
152  mutable int fStatus;
153  mutable int fHasFdUpTime;
154  mutable double* fReferenceLambda;
155 
156  friend class det::Detector;
157 
158  };
159 
160 } // namespace fdet
161 
162 
163 #endif // _fdet_FDetector_h_
164 
165 // Configure (x)emacs for this file ...
166 // Local Variables:
167 // mode:c++
168 // compile-command: "make -C .. -k"
169 // End:
InternalEyeIdCollection * fFullEyeList
Definition: FDetector.h:146
Description of the electronic channel for the 480 channels of the crate.
AllEyeIterator AllEyesBegin() const
Definition: FDetector.h:55
Predicate specifying whether telescope is selected or not.
Type
Possible component status.
Fluorescence Detector Eye Event.
Definition: FEvent/Eye.h:29
bool IsCDASInAquisition() const
Definition: FDetector.cc:244
const Pixel & GetPixel(const fevt::Pixel &eventPixel) const
Get fdet::Pixel from fevt::Channel.
Definition: FDetector.cc:198
double GetModelMinWavelength() const
Definition: FDetector.cc:291
unsigned int GetLastEyeId() const
Get Id of last eye.
Definition: FDetector.cc:35
const Eye & GetEye(const unsigned int eyeId) const
Find eye by numerical Id.
Definition: FDetector.cc:68
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 Eye-related data.
Definition: FDetector/Eye.h:45
const T & GetFDetectorData(T *&requestedData, const std::string &property, const std::string &component, const std::string &errorMsg) const
Definition: FDetector.cc:345
void UpdateFdUpTime() const
Definition: FDetector.cc:271
Detector description interface for FDetector-related data.
Definition: FDetector.h:44
double fUpTimeFraction
Definition: FDetector.h:150
std::list< Eye * > InternalEyeCollection
Definition: FDetector.h:49
InternalEyeCollection fCommissionedEyeList
Definition: FDetector.h:141
boost::filter_iterator< FDetComponentSelector, AllEyeIterator > EyeIterator
Definition: FDetector.h:69
Fluorescence Detector Pixel event.
Definition: FEvent/Pixel.h:28
double GetModelMaxWavelength() const
Definition: FDetector.cc:312
FDetector & operator=(const FDetector &)
double GetCDASUpTimeFraction() const
Definition: FDetector.cc:235
Top of the hierarchy of the detector description interface.
Definition: Detector.h:81
const Channel & GetChannel(const fevt::Channel &eventChannel) const
Get fdet::Channel from fevt::Channel.
Definition: FDetector.cc:161
std::list< int > InternalEyeIdCollection
Definition: FDetector.h:48
Fluorescence Detector Channel Event.
const InternalEyeIdCollection & GetFullEyeList() const
Definition: FDetector.cc:111
double GetReferenceLambda() const
Definition: FDetector.cc:332
unsigned int GetFirstEyeId() const
Get Id of first eye.
Definition: FDetector.cc:25
Detector description interface for Telescope-related data.
const Telescope & GetTelescope(const fevt::Telescope &eventTel) const
Get fdet::Telescope from fevt::Telescope.
Definition: FDetector.cc:150
InternalEyeCollection::const_iterator InternalEyeIterator
Definition: FDetector.h:50
Description of a pixel.
double fVetoFraction
Definition: FDetector.h:151
Fluorescence Detector Telescope Event.
Object to keep track of whether data are valid, or have expired.
Definition: ValidityStamp.h:29
det::ValidityStamp fUpTimeValidityStamp
Definition: FDetector.h:149
AllEyeIterator AllEyesEnd() const
Definition: FDetector.h:57
int GetCDASDAQStatus() const
Definition: FDetector.cc:253
boost::indirect_iterator< InternalEyeIterator, const Eye & > AllEyeIterator
An iterator over eyes for read only.
Definition: FDetector.h:53
double * fReferenceLambda
Definition: FDetector.h:154
bool HasFdUpTime() const
Definition: FDetector.cc:262
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.