FEvent/Telescope.h
Go to the documentation of this file.
1 #ifndef _fevt_Telescope_h_
2 #define _fevt_Telescope_h_
3 
4 #include <list>
5 #include <vector>
6 #include <boost/iterator/indirect_iterator.hpp>
7 #include <boost/iterator/filter_iterator.hpp>
8 
9 #include <utl/TimeStamp.h>
10 #include <utl/ShadowPtr.h>
11 #include <utl/Vector.h>
12 
13 #include <fevt/FdComponentSelector.h>
14 #include <fevt/TelescopeSimData.h>
15 #include <fevt/TelescopeRecData.h>
16 #include <fevt/TelescopeTriggerData.h>
17 
18 #include <fdet/Camera.h>
19 
20 
21 namespace fevt {
22 
23  class Channel;
24  class Pixel;
25 
26 
33  class Telescope {
34 
35  private:
36  typedef std::list<Channel*> InternalChannelContainer;
37  typedef InternalChannelContainer::iterator InternalChannelIterator;
38  typedef InternalChannelContainer::const_iterator InternalConstChannelIterator;
39 
40  typedef std::list<Pixel*> InternalPixelContainer;
41  typedef InternalPixelContainer::iterator InternalPixelIterator;
42  typedef InternalPixelContainer::const_iterator InternalConstPixelIterator;
43 
45  typedef boost::indirect_iterator<InternalPixelIterator, Pixel&> AllPixelIterator;
46 
48  typedef boost::indirect_iterator<InternalConstPixelIterator, const Pixel&> ConstAllPixelIterator;
49 
50  typedef std::vector<utl::Vector> InternalPixelDirCollection;
51 
57 
58  public:
59  Telescope(const Telescope& t) { *this = t; }
60  Telescope& operator=(const Telescope& t);
61 
62  unsigned int GetId() const { return fTelescopeId; }
63  unsigned int GetEyeId() const { return fEyeId; }
64 
66  void Assign(const Telescope& t);
67 
69  typedef boost::indirect_iterator<InternalChannelIterator,
72  typedef boost::indirect_iterator<InternalConstChannelIterator,
74 
75  unsigned int GetNActiveChannels() const { return fChannels.size(); }
76  Channel& GetChannel(const unsigned int channelId);
77  const Channel& GetChannel(const unsigned int channelId) const;
78 
79  bool HasChannel(const unsigned int channelId) const;
80  void MakeChannel(const unsigned int channelId);
81 
83  { return ChannelIterator(fChannels.begin()); }
85  { return ChannelIterator(fChannels.end()); }
87  { return ConstChannelIterator(fChannels.begin()); }
89  { return ConstChannelIterator(fChannels.end()); }
91 
92  unsigned int GetNActivePixels() const { return fPixels.size(); }
93 
95  Pixel& GetPixel(const unsigned int pixelId,
97  const Pixel& GetPixel(const unsigned int pixelId,
100  void MakePixel(const unsigned int pixelId,
103  bool HasPixel(const unsigned int pixelId,
105 
107  typedef boost::filter_iterator<ComponentSelector,
109  typedef boost::filter_iterator<ComponentSelector,
111 
121 
122 
127  { return PixelIterator(ComponentSelector(status), AllPixelsEnd(), AllPixelsEnd()); }
135 
136 
138  utl::TimeStamp GetTracesStartTime() const { return fTracesStartTime; }
139  void SetTracesStartTime(const utl::TimeStamp& tstamp)
140  { fTracesStartTime = tstamp; }
141 
143  const fevt::TelescopeSimData& GetSimData() const;
144  void MakeSimData();
145  bool HasSimData() const { return bool(fSimData); }
146 
149  void MakeTriggerData();
150  bool HasTriggerData() const { return bool(fTriggerData); }
151 
154  const fevt::TelescopeRecData& GetRecData() const;
155  void MakeRecData();
156  bool HasRecData() const { return bool(fRecData); }
157 
159  unsigned int GetTimeOffset() const { return fTimeOffset; }
160  void SetTimeOffset(const unsigned int toffset) { fTimeOffset = toffset; }
161 
163  std::string GetRawTelPointing() const { return fRawTelPointing; }
164  void SetRawTelPointing(const std::string& pointing) { fRawTelPointing = pointing; }
165 
166  void SetStatus(const ComponentSelector::Status status) {fStatus=status;}
168 
170  typedef std::vector<utl::Vector>::const_iterator ConstMirrorEventBorderPixelsIterator;
176 
177  private:
178  Telescope(const unsigned int eyeId, const unsigned int telescopeId,
179  const ComponentSelector::Status status = ComponentSelector::eHasData);
180  ~Telescope();
181 
182  void CorrectIds(const unsigned int eyeId, const unsigned int telescopeId);
183 
186  void GenerateMirrorEventBorderPixels() const;
187 
188  unsigned int fTelescopeId = 0;
189  unsigned int fEyeId = 0;
190  utl::ShadowPtr<TelescopeSimData> fSimData;
191  utl::ShadowPtr<TelescopeRecData> fRecData;
193  utl::TimeStamp fTracesStartTime;
196  unsigned int fTimeOffset = 0;
197  std::string fRawTelPointing = "unknown";
202 
203  friend class Eye;
204 
205  };
206 
207 }
208 
209 
210 #endif
PixelIterator PixelsEnd(const ComponentSelector::Status status)
iterator pointing to end of available pixels of given status
#define OFFLINE_MAKE_BOTH_ITERATOR_RANGES_ARG(_Iterator_, _ConstIterator_, _NamePrefix_, _Arg_)
Definition: IteratorRange.h:69
Predicate specifying whether telescope is selected or not.
ChannelIterator ChannelsBegin()
bool HasRecData() const
boost::indirect_iterator< InternalPixelIterator, Pixel & > AllPixelIterator
An iterator over all pixels for read and write.
void GenerateMirrorEventBorderPixels() const
unsigned int fTimeOffset
bool HasTriggerData() const
AllPixelIterator AllPixelsEnd()
#define OFFLINE_MAKE_BOTH_ITERATOR_RANGES(_Iterator_, _ConstIterator_, _NamePrefix_)
Definition: IteratorRange.h:43
unsigned int GetTimeOffset() const
Time offset of this Telescope compared to fevt::Header::GetTime [ns].
Fluorescence Detector Eye Event.
Definition: FEvent/Eye.h:29
utl::TimeStamp fTracesStartTime
ComponentSelector::Status GetStatus() const
void SetStatus(const ComponentSelector::Status status)
void SetTimeOffset(const unsigned int toffset)
unsigned int GetEyeId() const
ChannelIterator ChannelsEnd()
std::string GetRawTelPointing() const
The pointing.
unsigned int GetNActiveChannels() const
std::list< Pixel * > InternalPixelContainer
Telescope & operator=(const Telescope &t)
ConstChannelIterator ChannelsBegin() const
fevt::TelescopeRecData & GetRecData()
Reconstructed data for this telescope.
InternalChannelContainer fChannels
InternalChannelContainer::const_iterator InternalConstChannelIterator
AllPixelIterator AllPixelsBegin()
PixelIterator PixelsEnd()
iterator pointing to end of available pixels of status eHasData (DEPRECATED)
std::vector< utl::Vector >::const_iterator ConstMirrorEventBorderPixelsIterator
A TimeStamp holds GPS second and nanosecond for some event.
Definition: TimeStamp.h:110
InternalPixelContainer fPixels
void MakePixel(const unsigned int pixelId, const ComponentSelector::Status status=ComponentSelector::eHasData)
Make Pixel telescopeId.
bool HasPixel(const unsigned int pixelId, const ComponentSelector::Status status=ComponentSelector::eHasData) const
Check if the pixel is in the event.
fevt::TelescopeSimData & GetSimData()
Description of simulated data for one Telescope.
ConstMirrorEventBorderPixelsIterator MirrorEventBorderPixelsEnd() const
End of list of pixels just outside the mirror event.
Status
Return code for seek operation.
Definition: IoCodes.h:24
Channel & GetChannel(const unsigned int channelId)
std::list< Channel * > InternalChannelContainer
InternalPixelDirCollection fMirrorEventBorderPixelsDir
Fluorescence Detector Pixel event.
Definition: FEvent/Pixel.h:28
void SetTracesStartTime(const utl::TimeStamp &tstamp)
unsigned int fTelescopeId
boost::indirect_iterator< InternalConstPixelIterator, const Pixel & > ConstAllPixelIterator
An iterator over pixels for read.
void CorrectIds(const unsigned int eyeId, const unsigned int telescopeId)
boost::filter_iterator< ComponentSelector, ConstAllPixelIterator > ConstPixelIterator
#define OFFLINE_MAKE_CONST_ITERATOR_RANGE(_ConstIterator_, _NamePrefix_)
Definition: IteratorRange.h:28
Telescope-specific shower reconstruction data.
void SetRawTelPointing(const std::string &pointing)
Fluorescence Detector Channel Event.
utl::ShadowPtr< TelescopeRecData > fRecData
Status
Possible component status.
ConstAllPixelIterator AllPixelsEnd() const
void MakeChannel(const unsigned int channelId)
ConstMirrorEventBorderPixelsIterator MirrorEventBorderPixelsBegin() const
Begin of list of pixels just outside the mirror event.
utl::ShadowPtr< TelescopeTriggerData > fTriggerData
unsigned int GetNActivePixels() const
Pixel & GetPixel(const unsigned int pixelId, const ComponentSelector::Status status=ComponentSelector::eHasData)
Retrieve Pixel by Id, throw exception if not existent.
boost::filter_iterator< ComponentSelector, AllPixelIterator > PixelIterator
selective Pixel iterators
bool HasChannel(const unsigned int channelId) const
ComponentSelector::Status fStatus
This is for HEAT to determine pointing.
unsigned int GetId() const
ConstAllPixelIterator AllPixelsBegin() const
utl::ShadowPtr< TelescopeSimData > fSimData
boost::indirect_iterator< InternalConstChannelIterator, const Channel & > ConstChannelIterator
An iterator over available channles for read.
unsigned int fEyeId
std::string fRawTelPointing
boost::indirect_iterator< InternalChannelIterator, Channel & > ChannelIterator
An iterator over available channels for r/w.
InternalPixelContainer::iterator InternalPixelIterator
std::vector< utl::Vector > InternalPixelDirCollection
Fluorescence Detector Telescope Event.
PixelIterator PixelsBegin()
iterator pointing to first available pixel of status eHasData (DEPRECATED)
Description of trigger data for one Telescope.
ConstPixelIterator PixelsEnd(const ComponentSelector::Status status) const
end of available pixels of given status
fevt::TelescopeTriggerData & GetTriggerData()
InternalChannelContainer::iterator InternalChannelIterator
bool HasSimData() const
ConstChannelIterator ChannelsEnd() const
ConstPixelIterator PixelsBegin(const ComponentSelector::Status status) const
first available pixel of given status
void Assign(const Telescope &t)
copy all but keep original telescope and eye id
utl::TimeStamp GetTracesStartTime() const
InternalPixelContainer::const_iterator InternalConstPixelIterator

, generated on Tue Sep 26 2023.