REvent/Channel.h
Go to the documentation of this file.
1 #ifndef _revt_Channel_h_
2 #define _revt_Channel_h_
3 
4 #include <revt/ChannelRecData.h>
5 
6 #include <utl/ShadowPtr.h>
7 #include <utl/FFTDataContainer.h>
8 #include <utl/ClassHelpers.h>
9 
10 namespace revt {
11 
12  class Station;
13 
14 
25 
26 
27  class Channel {
28 
29  public:
31  int GetId() const { return fId; }
32 
34  int GetStationId() const { return fStationId; }
35 
37  unsigned int GetNyquistZone() const { return fFFTDataContainer.GetNyquistZone(); }
39  void SetNyquistZone(const unsigned int zone) { fFFTDataContainer.SetNyquistZone(zone); }
40 
42  double GetFrequencyOfBin(const ChannelFrequencySpectrum::SizeType bin) const { return fFFTDataContainer.GetFrequencyOfBin(bin); }
43 
45  double GetMinimumFrequency() const
46  { return std::min(GetFrequencyOfBin(0), GetFrequencyOfBin(fFFTDataContainer.GetConstFrequencySpectrum().GetSize() - 1)); }
47 
49  double GetMaximumFrequency() const
50  { return std::max(GetFrequencyOfBin(0), GetFrequencyOfBin(fFFTDataContainer.GetConstFrequencySpectrum().GetSize() - 1)); }
51 
55  const ChannelTimeSeries& GetChannelTimeSeries() const { return fFFTDataContainer.GetConstTimeSeries(); }
56 
60  const ChannelFrequencySpectrum& GetChannelFrequencySpectrum() const { return fFFTDataContainer.GetConstFrequencySpectrum(); }
61 
66 
71 
72  void SetSaturated() { fIsSaturated = true; }
73  void SetNotSaturated(){ fIsSaturated = false; }
74  bool IsSaturated() const { return fIsSaturated; }
75 
77  void SetActive() { fIsActive = true; }
78  void SetNotActive() { fIsActive = false; }
79  bool IsActive() const { return fIsActive; }
80 
81  void SetSignalThreshold(const unsigned int thresh) { fSignalThreshold = thresh; }
82  void SetNoiseThreshold(const unsigned int thresh) { fNoiseThreshold = thresh; }
83  unsigned int GetSignalThreshold() const { return fSignalThreshold; }
84  unsigned int GetNoiseThreshold() const { return fNoiseThreshold; }
85 
86  void SetScintHighVoltage(const double scinthv) { fScintHighVoltage = scinthv; }
87  double GetScintHighVoltage() const { return fScintHighVoltage; }
88 
91  const ChannelRecData& GetRecData() const { return *fRecData; }
92 
94  void MakeRecData();
96  bool HasRecData() const { return bool(fRecData); }
97 
99  unsigned int GetParity() const { return fParity; }
101  void SetParity(const unsigned int parity) { fParity = parity; }
102 
103  private:
104  Channel(const int stationId, const int id) : fStationId(stationId), fId(id) { }
105 
106  int fStationId = 0;
107  int fId = 0;
108  bool fIsSaturated = false;
109  bool fIsActive = true;
110  unsigned int fSignalThreshold = 0;
111  unsigned int fNoiseThreshold = 0;
112  double fScintHighVoltage = 0;
114  unsigned int fParity = 0;
117 
118  friend class revt::Station;
119 
120  };
121 }
122 
123 
124 #endif
Class to access channel level reconstructed data.
ChannelFFTDataContainer & GetFFTDataContainer()
retrieve Channel FFTDataContainer (write access)
utl::Trace< std::complex< double > > ChannelFrequencySpectrum
void MakeRecData()
Make channel reconstructed data object.
double GetMaximumFrequency() const
Get the maximum frequency of the spectrum frequency spectrum.
pointer with built-in initialization, deletion, deep copying
Definition: ShadowPtr.h:163
unsigned int fParity
const ChannelADCTimeSeries & GetChannelADCTimeSeries() const
Get const Channel ADC trace (read only)
double GetScintHighVoltage() const
bool IsActive() const
unsigned int GetSignalThreshold() const
From DAQ.
int GetId() const
Return Id of the Channel.
const ChannelFFTDataContainer & GetFFTDataContainer() const
retrieve Channel FFTDataContainer (read access)
unsigned int GetNyquistZone() const
get the Nyquist zone
bool IsSaturated() const
ChannelRecData & GetRecData()
Get channel level reconstructed data.
unsigned int GetParity() const
Get parity of the Channel.
utl::FFTDataContainer< utl::Trace, double, std::complex< double > > ChannelFFTDataContainer
void SetSaturated()
bool HasRecData() const
Check whether channel reconstructed data exists.
int GetStationId() const
Return Id of the station to which this Channel belongs.
ChannelFFTDataContainer fFFTDataContainer
unsigned int GetNyquistZone() const
Get the Nyquist zone.
ChannelTimeSeries & GetChannelTimeSeries()
retrieve Channel Time Series (write access, only use this if you intend to change the data) ...
void SetNoiseThreshold(const unsigned int thresh)
From DAQ.
#define max(a, b)
double GetMinimumFrequency() const
Get the mimimum frequency of the spectrum frequency spectrum.
unsigned int fSignalThreshold
class to hold data at the radio Station level.
C< F > & GetFrequencySpectrum()
read out the frequency spectrum (write access)
const ChannelRecData & GetRecData() const
std::vector< std::complex< double > >::size_type SizeType
Definition: Trace.h:58
#define OFFLINE_CAST_CONST_METHOD(_Method_)
Definition: ClassHelpers.h:51
C< T > & GetTimeSeries()
read out the time series (write access)
const ChannelTimeSeries & GetChannelTimeSeries() const
retrieve Channel Time Series (read access)
utl::Trace< int > ChannelADCTimeSeries
utl::ShadowPtr< ChannelRecData > fRecData
Template class for a data container that offers and takes both time series and corresponding frequenc...
void SetSignalThreshold(const unsigned int thresh)
void SetScintHighVoltage(const double scinthv)
From DAQ.
ChannelFrequencySpectrum & GetChannelFrequencySpectrum()
retrieve Channel Frequency Spectrum (write access, only use this if you intend to change the data) ...
double GetFrequencyOfBin(const ChannelFrequencySpectrum::SizeType bin) const
Get the frequency corresponding to a bin of the frequency spectrum.
ChannelADCTimeSeries & GetChannelADCTimeSeries()
Get Channel ADC trace (write access, only use this if you intend to change the data) ...
const ChannelFrequencySpectrum & GetChannelFrequencySpectrum() const
retrieve Channel Frequency Spectrum (read access)
Class that holds the data associated to an individual radio channel.
unsigned int fNoiseThreshold
void SetNyquistZone(const unsigned int zone)
set the Nyquist zone
void SetNotSaturated()
void SetParity(const unsigned int parity)
Set parity of the Channel.
void SetNyquistZone(const unsigned int zone)
Set the Nyquist zone.
void SetNotActive()
Channel(const int stationId, const int id)
utl::Trace< double > ChannelTimeSeries
Definition: XbArray.h:7
void SetActive()
Active means that it is used in reconstruction. By default this is true after read-in, but can be deactivated later.
ChannelADCTimeSeries fChannelADCTrace
unsigned int GetNoiseThreshold() const
From DAQ.
double fScintHighVoltage

, generated on Tue Sep 26 2023.