RDetector/Channel.h
Go to the documentation of this file.
1 #ifndef _rdet_Channel_h_
2 #define _rdet_Channel_h_
3 
4 #include <rdet/AntennaType.h>
5 #include <utl/TabulatedFunctionComplexLgAmpPhase.h>
6 #include <utl/Point.h>
7 #include <utl/AugerException.h>
8 #include <utl/ResponseMap.h>
9 #include <utl/Validated.h>
10 #include <rdet/RDetector.h>
11 #include <det/VManager.h>
12 #include <string>
13 
14 
15 namespace rdet {
27  class Channel {
28 
29  public:
31  int GetId() const { return fChannelId; }
32 
34  int GetOkFlag() const;
35 
36  //RChannel part of RModelConfig
37 
39  double GetDesignLowerFreq() const;
40 
42  double GetDesignUpperFreq() const;
43 
45  double GetOrientationZenith() const;
46 
48  double GetOrientationAzimuth() const;
49 
51  double GetOrientationZeta() const;
52 
54  const utl::Point& GetPosition() const;
55 
57  const std::string& GetChannelType() const;
58 
59  /*
61  const utl::TabulatedFunctionComplexLgAmpPhase& GetGlobalResponse() const
62  { return *fGlobalResponse; }
63  */
64 
66  const std::string& GetAntennaTypeName() const;
67 
68  //RADC part of RModelConfig
69 
71  const std::string& GetADCType() const;
72 
74  int GetBitDepth() const;
75 
77  double GetSamplingFrequency() const;
78 
80  double GetMinVoltage() const;
81 
83  double GetMaxVoltage() const;
84 
86  double GetDesignImpedance() const;
87 
89  double GetIntegratedHorizontalGain() const;
90 
92  double GetIntegratedVerticalGain() const;
93 
105  std::pair<std::complex<double>, std::complex<double> >
106  GetElectricFieldResponse(const double theta, const double phi, const double freq, std::string interpolationMode) const;
107 
108  double GetIntegratedEffectiveAntennaHeight(const double freq) const;
109 
111  const utl::ResponseMap& GetResponseMap() const;
112 
115 
116  private:
117 
118  Channel(const int stationId, const int ChannelId);
119  ~Channel(); // don't forget to delete all the pointer member objects in the destructor!
120 
121  Channel(const Channel&); // copy constructor is private so that no copy of a channel can be made (would need deep-copying)
122  Channel& operator=(const Channel&); // assignment operator is private so that no copy of a channel can be made (would need deep-copying)
123 
124  void Update() const;
125 
126  std::string fStationIdString;
127  std::string fChannelIdString;
128 
130 
131  // general Channel characteristics:
132  mutable utl::Validated<int> fChannelOk; // Channel OK flag
133  mutable utl::Validated<double> fDesignLowerFreq; // design value of the freq-band
134  mutable utl::Validated<double> fDesignUpperFreq; // design value of the freq-band
135  mutable utl::Validated<double> fOrientationZenith; // zenith-direction of Antenna for this Channel
136  mutable utl::Validated<double> fOrientationAzimuth; // azimuth-direction of Antenna for this Channel
137  mutable utl::Validated<double> fOrientationZeta; // zeta-tilt of Antenna for this Channel
138  mutable utl::Validated<utl::Point> fPosition; // Position of channel Ref.Point. wrt. Station Ref.Point
139  mutable utl::Validated<std::string> fChannelType; // Type of Channel
140 
141  // coming from the ADC:
142  mutable utl::Validated<std::string> fADCType; // description of ADC-Type
143  mutable utl::Validated<int> fBitDepth; // number of bits of ADC
144  mutable utl::Validated<double> fSamplingFrequency; // sampling Frequency of ADC
147 
148  // coming from the Antenna_type:
149  mutable utl::Validated<std::string> fAntennaTypeName; // description of Antenna-Type
150 
154 
155  mutable utl::Validated<utl::ResponseMap> fResponseMap; // table detailing the detector responses and their weights
156 
157  // mutable utl::TabulatedFunctionComplexLgAmpPhase* fGlobalResponse; // complex global response, tabulated in freq.
158 
159  // reference_phase map postponed or put into calibration
160 
161  // this is the antenna belonging to this channel
163 
164  friend class Station;
165 
166  // Helper method to do the redundant work of preparing requests for Channel data,
167  // sending it to the manager and reporting any errors.
168 
169  template<typename T>
170  const T&
172  const std::string& property,
173  const std::string& component,
174  const std::string& errorMsg)
175  const
176  {
177  if (!requestedData.IsValid()) {
178  det::VManager::IndexMap indexMap;
179  indexMap["station"] = fStationIdString;
180  indexMap["channel"] = fChannelIdString;
181 
182  const det::VManager& manager =
183  ::det::Detector::GetInstance().GetRManagerRegister();
184  const det::VManager::Status foundFlag =
185  manager.GetData(requestedData.Get(), property, component, indexMap);
186 
187  if (foundFlag == det::VManager::eNotFound)
188  NotFoundAndExit(errorMsg);
189 
190  requestedData.SetValid();
191  }
192  return requestedData.Get();
193  }
194 
195  void NotFoundAndExit(const std::string& msg) const;
196 
197  };
198 
199 }
200 
201 
202 #endif //_rdet_Channel_h_
int GetBitDepth() const
Get number of bits of ADC.
utl::Validated< double > fOrientationAzimuth
utl::Validated< double > fIntegratedHorizontalGain
utl::Validated< double > fSamplingFrequency
double GetOrientationZeta() const
Get zeta-tilt of Antenna for this Channel.
Point object.
Definition: Point.h:32
Detector description interface for Station-related data.
double GetDesignUpperFreq() const
Get design value of the freq-band.
const T & GetChannelData(utl::Validated< T > &requestedData, const std::string &property, const std::string &component, const std::string &errorMsg) const
int freq
Definition: dump1090.h:244
int GetId() const
return ID of the Channel
Class to hold collection (x,y) points and provide interpolation between them.
double GetDesignLowerFreq() const
Get design value of the freq-band.
double GetIntegratedHorizontalGain() const
Get IntegratedHorizontalGain of Antenna-Type.
const utl::Point & GetPosition() const
Get Position of this Antenna-Channel.
utl::Validated< double > fOrientationZenith
utl::Validated< int > fBitDepth
double GetMaxVoltage() const
Get voltage corresponding to max number of counts.
double GetDesignImpedance() const
Get DesignImpediance of Antenna-Type.
utl::Validated< double > fMaxVoltage
Detector description interface for Channel-related data.
double GetOrientationZenith() const
Get zenith-direction of Antenna for this Channel.
Interface for detector managers.
Definition: VManager.h:115
void Update() const
const utl::TabulatedFunction & GetCalibrationFunction() const
Get a TabulatedFunction with calibration factors for the frequency bins of the Channel, not yet implemented.
Interface to access antenna characteristics.
Definition: AntennaType.h:65
Channel(const int stationId, const int ChannelId)
utl::Validated< std::string > fChannelType
utl::Validated< double > fDesignLowerFreq
virtual Status GetData(double &returnData, const std::string &componentProperty, const std::string &componentName, const IndexMap &componentIndex) const =0
const std::string & GetChannelType() const
Get description of Channel Type.
double GetMinVoltage() const
Get voltage corresponding to 0 counts.
utl::Validated< std::string > fAntennaTypeName
utl::Validated< utl::ResponseMap > fResponseMap
const utl::ResponseMap & GetResponseMap() const
Get the ResponseMap of the Channel.
bool IsValid() const
Definition: Validated.h:64
utl::Validated< double > fDesignImpedance
A helper class which manages a list of system response identifiers (std::strings) and their correspon...
Definition: ResponseMap.h:28
void NotFoundAndExit(const std::string &msg) const
double GetIntegratedVerticalGain() const
Get IntegratedVerticalGain of Antenna-Type.
int GetOkFlag() const
Channel Ok flag (1 if the currently cached data are up to date, 0 if currently cached data are obsole...
utl::Validated< utl::Point > fPosition
std::string fStationIdString
utl::Validated< std::string > fADCType
utl::Validated< double > fDesignUpperFreq
AntennaType * fAntenna
utl::Validated< int > fChannelOk
utl::Validated< double > fOrientationZeta
std::map< std::string, std::string > IndexMap
Definition: VManager.h:133
const std::string & GetAntennaTypeName() const
Get description of Antenna-Type.
const std::string & GetADCType() const
Get description of ADC-Type.
void SetValid(const bool valid=true)
Definition: Validated.h:66
Channel & operator=(const Channel &)
double GetSamplingFrequency() const
Get sampling Frequency of ADC (unit?)
utl::Validated< double > fIntegratedVerticalGain
std::pair< std::complex< double >, std::complex< double > > GetElectricFieldResponse(const double theta, const double phi, const double freq, std::string interpolationMode) const
double GetIntegratedEffectiveAntennaHeight(const double freq) const
std::string fChannelIdString
utl::Validated< double > fMinVoltage
double GetOrientationAzimuth() const
Get azimuth-direction of Antenna for this Channel.
Status
Specifies success or (eventually) various possible failure modes.
Definition: VManager.h:127

, generated on Tue Sep 26 2023.