REvent/Station.h
Go to the documentation of this file.
1 #ifndef _revt_Station_h_
2 #define _revt_Station_h_
3 
4 #include <utl/ShadowPtr.h>
5 #include <utl/AugerException.h>
6 #include <utl/FFTDataContainer.h>
7 #include <utl/TimeStamp.h>
8 #include <utl/Trace.h>
9 #include <utl/ClassHelpers.h>
10 
11 #include <revt/StationConstants.h>
12 
13 #include <vector>
14 #include <boost/iterator/indirect_iterator.hpp>
15 
16 
17 namespace revt {
18 
19  class REvent;
20  class Channel;
21  class StationSimData;
22  class StationRecData;
23  class StationTriggerData;
24  class StationGPSData;
25  class StationHeader;
26 
27 
37 
38 
39  class Station {
40 
41  private:
42  typedef std::vector<Channel*>::iterator InternalChannelIterator;
43  typedef std::vector<Channel*>::const_iterator InternalConstChannelIterator;
44 
45  public:
46  Station(const Station& station);
47  Station& operator=(const Station& station);
48 
50  typedef boost::indirect_iterator<InternalChannelIterator, Channel&> ChannelIterator;
51 
53  typedef boost::indirect_iterator<InternalConstChannelIterator, const Channel&> ConstChannelIterator;
54 
56  int GetId() const { return fId; }
57 
59  bool HasChannel(const int pmtId) const;
60 
62  Channel& GetChannel(const int pmtId) { return OFFLINE_CAST_CONST_METHOD(GetChannel(pmtId)); }
63  const Channel& GetChannel(const int pmtId) const;
64 
67  { return ChannelIterator(fChannels.begin()); }
68 
71  { return ChannelIterator(fChannels.end()); }
72 
75  { return ConstChannelIterator(fChannels.begin()); }
76 
79  { return ConstChannelIterator(fChannels.end()); }
80 
82 
83 
84  unsigned int ChannelsSize() const { return fChannels.size(); }
85 
88  const StationSimData& GetSimData() const;
90  void MakeSimData();
92  bool HasSimData() const { return bool(fSimData); }
93 
96  const StationRecData& GetRecData() const;
98  void MakeRecData();
100  bool HasRecData() const { return bool(fRecData); }
101 
104  const StationTriggerData& GetTriggerData() const;
106  void MakeTriggerData();
108  bool HasTriggerData() const { return bool(fTriggerData); }
109 
112  const StationGPSData& GetGPSData() const;
114  void MakeGPSData();
116  bool HasGPSData() const { return bool(fGPSData); }
117 
120  const StationHeader& GetStationHeader() const;
122  void MakeStationHeader();
124  bool HasStationHeader() const { return bool(fStationHeader); }
125 
128 
130 
131  void
133  {
135  fRawTraceStartTime = time;
136  else {
137  const auto err =
138  "fRawTraceStartTime has already been locked in RdEventInitializer! Change is no longer allowed.";
139  ERROR(err);
140  throw utl::InitSequenceException(err);
141  }
142  }
143 
145 
148  void SetRawTraceStartTimeLocked(const bool lock = true) { fRawTraceStartTimeLocked = lock; }
149 
151  unsigned int GetNyquistZone() const { return fFFTDataContainer->GetNyquistZone(); }
152 
154  void SetNyquistZone(const unsigned int zone) { fFFTDataContainer->SetNyquistZone(zone); }
155 
158  { return fFFTDataContainer->GetFrequencyOfBin(bin); }
159 
161  double GetMinimumFrequency() const
162  { return std::min(GetFrequencyOfBin(0), GetFrequencyOfBin(fFFTDataContainer->GetConstFrequencySpectrum().GetSize() - 1)); }
163 
165  double GetMaximumFrequency() const
166  { return std::max(GetFrequencyOfBin(0), GetFrequencyOfBin(fFFTDataContainer->GetConstFrequencySpectrum().GetSize() - 1)); }
167 
171  const StationTimeSeries& GetStationTimeSeries() const { return fFFTDataContainer->GetConstTimeSeries(); }
172 
177  { return fFFTDataContainer->GetConstFrequencySpectrum(); }
178 
183 
184  /*
185  Stations can have one of the following ReconstructionStatus:
186  - eExcluded: Station is for what ever reason excluded. It will not longer be considered
187  in the reconstruction. But it will be written into the ADST files. Check reasons in
188  revt::StationConstants::ExcludedReason.
189  - eRejected: Station operated normally. Pulse is fully reconstructed. However for what
190  ever reason the pulse is rejected for any shower reconstruction. For example due to the
191  contamination with noise. Check revt::StationConstants::RejectionStatus.
192  - eNoSignal: Station is found to not have a significant signal (is a CandidateStation)
193  - eSignal: Station is found to have a signal (is a CandidateStation)
194  Further information see
195  - wiki page for the Feb 2019 Radio Offline Workshop:
196  https://www.auger.unam.mx/AugerWiki/Event_reconstruction_and_Analysis_Workshop_February_2019#preview
197  - the GitLab-MR: https://gitlab.com/auger-observatory/offline/offline/-/merge_requests/6/
198  */
200  bool HasSignal() const { return fReconstructionStatus == eHasSignal; }
201 
203  bool HasNoSignal() const { return fReconstructionStatus == eHasNoSignal; }
204 
205  bool IsExcluded() const { return fReconstructionStatus == eExcluded; }
206  void SetExcludedReason(const ExcludedReason reason);
208 
210 
211  void SetRejectedReason(const unsigned long long int reason);
212  bool IsRejected() const { return fReconstructionStatus == eRejected; }
213  bool HasRejectedReason(const unsigned long long int reason) const { return fRejectedReason & reason; }
214  unsigned long long int GetRejectedReason() const { return fRejectedReason; }
216 
219 
221  void SetSaturated() { fIsSaturated = true; }
222  void SetNotSaturated() { fIsSaturated = false; }
223  bool IsSaturated() const { return fIsSaturated; }
224 
225  void SetHWTemperature(const double temp) { fHWTemperature = temp; }
226  double GetHWTemperature() const { return fHWTemperature; }
227  void SetHWTemperatureInt(const double temp) { fHWTemperatureInt = temp; }
228  double GetHWTemperatureInt() const { return fHWTemperatureInt; }
229  void SetHWTemperatureExt(const double temp) { fHWTemperatureExt = temp; }
230  double GetHWTemperatureExt()const { return fHWTemperatureExt; }
231 
232  private:
233  Station(const int stationId);
234  ~Station();
235 
236  int fId = 0;
237  std::vector<Channel*> fChannels;
249  bool fIsSaturated = false;
250  unsigned long long int fRejectedReason = eNoRejection;
251  double fHWTemperature = 0;
252  double fHWTemperatureInt = 0;
253  double fHWTemperatureExt = 0;
254 
255  friend class revt::REvent;
256  };
257 
258 
259  struct StationFilter {
260  bool operator()(const Station& station) const
261  { return !station.IsExcluded(); }
262  };
263 
264 
266  bool operator()(const Station& station) const
267  { return station.HasSignal(); }
268  };
269 
270 
272  bool operator()(const Station& station) const
273  { return station.IsCandidate(); }
274  };
275 
276 
278  bool operator()(const Station& station) const
279  { return station.HasNoSignal(); }
280  };
281 
282 
284  public:
285  RejectedStationFilter(const int statusMask) : fStatusMask(statusMask) { }
286 
287  bool operator()(const Station& station) const
288  { return station.GetRejectedReason() & fStatusMask; }
289 
290  private:
292  };
293 
294 }
295 
296 
297 #endif
pointer with built-in initialization, deletion, deep copying
Definition: ShadowPtr.h:163
ConstChannelIterator ChannelsBegin() const
begin Channel iterator for read
void SetNotSaturated()
Class to access station level reconstructed data.
StationSimData & GetSimData()
Get simulated data at station level.
Station Level Simulated Data
Station & operator=(const Station &station)
StationFrequencySpectrum & GetStationFrequencySpectrum()
retrieve Station Frequency Spectrum (write access, only use this if you intend to change the data) ...
#define OFFLINE_MAKE_BOTH_ITERATOR_RANGES(_Iterator_, _ConstIterator_, _NamePrefix_)
Definition: IteratorRange.h:43
StationTriggerData & GetTriggerData()
Get Trigger data for the station.
boost::indirect_iterator< InternalChannelIterator, Channel & > ChannelIterator
Iterator over station for read/write.
utl::TraceV3D StationTimeSeries
bool HasTriggerData() const
Check whether trigger data object exists.
double GetFrequencyOfBin(const StationFrequencySpectrum::SizeType bin) const
Get the frequency corresponding to a bin of the frequency spectrum.
StationRecData & GetRecData()
Get station level reconstructed data.
ReconstructionStatus GetReconstructionStatus() const
boost::indirect_iterator< InternalConstChannelIterator, const Channel & > ConstChannelIterator
Iterator over station for read.
Interface class to access to the Radio part of an event.
Definition: REvent.h:42
std::vector< Channel * >::const_iterator InternalConstChannelIterator
void MakeSimData()
Make station simulated data object.
Station Trigger Data description
unsigned int ChannelsSize() const
Retrieve number of Channels in this Station.
void SetSaturated()
Saturation status.
bool HasRejectedReason(const unsigned long long int reason) const
bool IsExcluded() const
Station(const Station &station)
bool fRawTraceStartTimeLocked
ChannelIterator ChannelsBegin()
begin Channel iterator for read/write
unsigned int GetNyquistZone() const
Get the Nyquist zone.
StationTimeSeries & GetStationTimeSeries()
retrieve Station Time Series (write access, only use this if you intend to change the data) ...
void SetHWTemperatureExt(const double temp)
utl::FFTDataContainer< utl::Trace, utl::Vector3D, utl::Vector3C > StationFFTDataContainer
ChannelIterator ChannelsEnd()
end Channel iterator for read/write
A TimeStamp holds GPS second and nanosecond for some event.
Definition: TimeStamp.h:110
utl::ShadowPtr< StationGPSData > fGPSData
void MakeGPSData()
Make GPS data object.
void MakeTriggerData()
Make trigger data object.
StationFFTDataContainer & GetFFTDataContainer()
retrieve Station FFTDataContainer (write access)
bool HasChannel(const int pmtId) const
Check if a particular Channel object exists.
Exception to use if sequence of initialisations violated.
double fHWTemperatureExt
double GetHWTemperatureInt() const
double GetHWTemperatureExt() const
bool HasStationHeader() const
Check whether StationHeader exists.
#define max(a, b)
bool operator()(const Station &station) const
bool IsCandidate() const
class to hold data at the radio Station level.
constexpr double s
Definition: AugerUnits.h:163
void SetRawTraceStartTime(const utl::TimeStamp &time)
Set absolute start time of the station-level trace as originally provided in raw data, for reconstructions use eTraceStartTime in StationRecData!
std::vector< T >::size_type SizeType
Definition: Trace.h:58
ExcludedReason fExcludedReason
utl::InitializedShadowPtr< StationFFTDataContainer > fFFTDataContainer
container for the radio time and frequency data
void MakeStationHeader()
Make Station Header object.
utl::ShadowPtr< StationHeader > fStationHeader
#define OFFLINE_CAST_CONST_METHOD(_Method_)
Definition: ClassHelpers.h:51
bool operator()(const Station &station) const
bool IsSaturated() const
std::vector< Channel * >::iterator InternalChannelIterator
void SetRawTraceStartTimeLocked(const bool lock=true)
std::vector< Channel * > fChannels
void SetNyquistZone(const unsigned int zone)
Set the Nyquist zone.
bool HasSimData() const
Check whether station simulated data exists.
ReconstructionStatus fReconstructionStatus
StationGPSData & GetGPSData()
Get GPS data for the station.
utl::TimeStamp GetRawTraceStartTime() const
Get absolute start time of the station-level trace as originally provided in raw data, for reconstructions use eTraceStartTime in StationRecData!
void SetRejectedReason(const unsigned long long int reason)
int GetId() const
Get the station Id.
utl::ShadowPtr< StationRecData > fRecData
ConstChannelIterator ChannelsEnd() const
end Channel iterator for read
Channel & GetChannel(const int pmtId)
Retrieve a Channel by Id.
Template class for a data container that offers and takes both time series and corresponding frequenc...
bool operator()(const Station &station) const
void MakeRecData()
Make station reconstructed data object.
const StationFFTDataContainer & GetFFTDataContainer() const
retrieve Station FFTDataContainer (read access)
Template class for a FADC data or calibrated data container. Use the typedefs (TraceD, TraceI, etc.) defined in Trace-fwd.h.
Definition: Trace-fwd.h:19
bool operator()(const Station &station) const
unsigned long long int fRejectedReason
utl::TraceV3C StationFrequencySpectrum
ExcludedReason GetExcludedReason() const
const StationFrequencySpectrum & GetStationFrequencySpectrum() const
retrieve Station Frequency Spectrum (read access)
Class that holds the data associated to an individual radio channel.
void SetExcludedReason(const ExcludedReason reason)
double fHWTemperature
unsigned long long int GetRejectedReason() const
double GetMinimumFrequency() const
Get the mimimum frequency of the spectrum frequency spectrum.
StationHeader & GetStationHeader()
Get the Station Header.
Store information provided by the DAQ about the station.
Definition: StationHeader.h:13
bool IsRejected() const
bool HasRecData() const
Check whether station reconstructed data exists.
void ClearRejectedReason()
void SetReconstructionStatus(const ReconstructionStatus s)
double GetMaximumFrequency() const
Get the maximum frequency of the spectrum frequency spectrum.
#define ERROR(message)
Macro for logging error messages.
Definition: ErrorLogger.h:165
bool HasGPSData() const
Check whether GPS data object exists.
utl::TimeStamp fRawTraceStartTime
double fHWTemperatureInt
void SetHWTemperatureInt(const double temp)
RejectedStationFilter(const int statusMask)
utl::ShadowPtr< StationTriggerData > fTriggerData
bool HasNoSignal() const
void SetHWTemperature(const double temp)
const StationTimeSeries & GetStationTimeSeries() const
retrieve Station Time Series (read access)
bool HasSignal() const
bool GetRawTraceStartTimeLocked() const
double GetHWTemperature() const
utl::ShadowPtr< StationSimData > fSimData
bool operator()(const Station &station) const

, generated on Tue Sep 26 2023.