5 #include <det/VManager.h>
6 #include <det/Detector.h>
8 #include <rdet/RDetector.h>
11 #include <revt/Station.h>
13 #include <utl/ErrorLogger.h>
14 #include <utl/TimeStamp.h>
15 #include <utl/UTCDateTime.h>
16 #include <utl/UTMPoint.h>
30 for (
const auto&
is : fFullStationMap)
32 for (
const auto& nr : fHardwareResponseProfileMap)
60 if (fFullStationList.IsValid()) {
61 for (
const auto&
is : fFullStationMap)
63 fFullStationList.SetValid(
false);
66 fFullStationMap.clear();
67 for (
const auto id : GetFullStationList()) {
68 fFullStationMap[id] =
new Station(
id);
87 if (!fFullStationList.IsValid()) {
88 fFullStationList.Get().clear();
91 const VManager& manager = Detector::GetInstance().GetRManagerRegister();
93 manager.
GetData(fFullStationList.Get(),
"fullStationList",
"stationList", indexMap);
96 if (!AddStationListFromSManager()) {
97 if (status == VManager::eNotFound) {
99 err <<
"Could not get a list of station ID's from RManagers. "
100 "No AERA station information will be available!";
105 if (AddStationListFromSManager()) {
106 std::vector<int> additionalRDStationIdsFromSManager;
107 additionalRDStationIdsFromSManager.clear();
109 const VManager& smanager = Detector::GetInstance().GetSManagerRegister();
110 status = smanager.
GetData(additionalRDStationIdsFromSManager,
"fullStationList",
"stationList", indexMap);
112 if (status == VManager::eNotFound) {
114 err <<
"Could not get a list of station ID's from SManagers. "
115 "No RD station information will be available!";
119 if (!additionalRDStationIdsFromSManager.empty()) {
120 for (
const auto id : additionalRDStationIdsFromSManager)
121 fFullStationList.Get().push_back(
id + fRdSdStationIdLink);
125 fFullStationList.SetValid();
128 return fFullStationList.Get();
136 return GetStation(station.
GetId());
146 if (it != fFullStationMap.end() &&
147 it->second->GetCommissionTimeRange() == Detector::GetInstance().GetTime())
151 err <<
"Station with Id = " <<
id <<
" is not available at "
152 "detector time = " << Detector::GetInstance().GetTime()
153 <<
" or detector description was not properly configured. "
154 <<
"If station ID is larger than " << fRdSdStationIdLink <<
", "
155 <<
"check if RModelsXMLManager and RHardwareProfileXMLManager are "
156 <<
"and configured.";
167 const HardwareResponseProfileMap::const_iterator it =
168 fHardwareResponseProfileMap.find(responseId);
170 if (it != fHardwareResponseProfileMap.end())
174 GetDetectorData(rResponse,
"Response", responseId,
"Response");
175 fHardwareResponseProfileMap[responseId] = rResponse;
182 const std::vector<double>&
188 fBeaconFreq =
nullptr;
190 GetDetectorData(fBeaconFreq,
"BeaconFreq",
"BeaconFreq",
"BeaconFrequencies");
200 if (fBeaconReferencePhase) {
201 delete fBeaconReferencePhase;
202 fBeaconReferencePhase =
nullptr;
205 indexMap[
"RStationId"] = boost::lexical_cast<
string>(stationId);
210 indexMap[
"BeaconFreq"] = boost::lexical_cast<
string>(beaconFreq);
211 GetDetectorData(fBeaconReferencePhase,
"BeaconRefPhase",
"BeaconRefPhase",
"BeaconFrequenciesReferencePhases", indexMap);
212 return *fBeaconReferencePhase;
216 unsigned long long int
220 unsigned long long int res = 0;
222 m.
GetDataOrThrow(res,
"BadStation", boost::lexical_cast<string>(stationId));
253 static double* temperature;
256 temperature =
nullptr;
259 GetDetectorData(temperature,
"monitoring",
"temperature",
"", indexMap);
260 return *temperature + 273.15;
268 if (!fAddStationListFromSManager.IsValid()) {
269 const det::ManagerRegister& managerRRegister = det::Detector::GetInstance().GetRManagerRegister();
273 fAddStationListFromSManager =
false;
280 managerRRegister.
GetData(addStations,
"addSStationList",
"", indexMap);
283 ERROR(
"Did not find requested component: addSStationList (Flag to add station Ids from SManager to RDetector.)");
285 "addSStationList (Flag to add station Ids from SManager to RDetector.)");
287 if (addStations == 1)
288 fAddStationListFromSManager =
true;
290 fAddStationListFromSManager =
false;
293 fAddStationListFromSManager.SetValid();
295 return fAddStationListFromSManager.Get();
double GetTemperature(const std::string &site) const
double GetBeaconReferencePhase(const int stationId, const double beaconFreq) const
Get beacon reference phases for one station.
Detector description interface for Station-related data.
Status GetDataOrThrow(T &returnData, const std::string &component, const std::string &property, const IndexMap &index=IndexMap()) const
bool is(const double a, const double b)
const std::vector< int > & GetFullStationList() const
Get list of ID's for all stations available in the database or configuration file.
ManagerIterator ManagersBegin() const
Iterator pointing to first available manager.
Status GetData(double &returnData, const std::string &componentProperty, const std::string &componentName, const IndexMap &componentIndex) const
Base class for exceptions trying to access non-existing components.
InternalStationMap::const_iterator InternalStationIterator
Interface for detector managers.
unsigned long long int GetBadStationReason(const int stationId) const
const std::vector< double > & GetBeaconFrequencies() const
Get vector of Beacon Frequencies for given detector-time from Manager.
virtual Status GetData(double &returnData, const std::string &componentProperty, const std::string &componentName, const IndexMap &componentIndex) const =0
class to hold data at the radio Station level.
const utl::TabulatedFunctionComplexLgAmpPhase & GetHardwareResponseProfile(const std::string &identifier) const
Get the response (TabulatedFunctionComplexLgAmpPhase) which corresponds to a hardware profile identif...
Class to hold collection (x,y) points and provide interpolation between them, where y are complex num...
int GetId() const
Get the station Id.
bool AddStationListFromSManager() const
std::map< std::string, std::string > IndexMap
Register for detector description managers.
ManagerIterator ManagersEnd() const
Iterator pointing one past the last available manager.
#define ERROR(message)
Macro for logging error messages.
const Station & GetStation(const int stationId) const
Get station by Station Id.
Status
Specifies success or (eventually) various possible failure modes.