5 #include <det/Detector.h>
6 #include <det/ManagerRegister.h>
7 #include <fwk/CentralConfig.h>
8 #include <utl/Reader.h>
9 #include <utl/ErrorLogger.h>
10 #include <utl/TimeStamp.h>
12 #include <fwk/CoordinateSystemRegistry.h>
13 #include <utl/CoordinateSystem.h>
15 #include <sdet/SManagerRegister.h>
16 #include <sdet/SDetector.h>
17 #include <fdet/FManagerRegister.h>
18 #include <fdet/FDetector.h>
19 #include <atm/AManagerRegister.h>
21 #include <rdet/RManagerRegister.h>
22 #include <rdet/RDetector.h>
24 #include <mdet/MManagerRegister.h>
25 #include <mdet/MDetector.h>
27 #include <cdet/CManagerRegister.h>
28 #include <cdet/CDetector.h>
30 #warning RU: magnetic field model fwk->det
31 #include <fwk/MagneticFieldModel.h>
32 #include <fwk/ParametricGeoMagneticField.h>
48 const auto cc = CentralConfig::GetInstance();
51 auto sManagerConfigBranch = cc->GetTopBranch(
"SManagerRegister");
52 if (sManagerConfigBranch)
53 SManagerRegister::GetInstance().Configure(sManagerConfigBranch);
55 INFO(
"Could not access a configuration file for the SManagerRegister. "
56 "The Detector interface will not be able to get information about the SD "
57 "(This is not an error, unless you are planning to use the surface detector information).");
61 auto fManagerConfigBranch = cc->GetTopBranch(
"FManagerRegister");
62 if (fManagerConfigBranch)
63 FManagerRegister::GetInstance().Configure(fManagerConfigBranch);
65 INFO(
"Could not access a configuration file for the FManagerRegister. "
66 "The Detector interface will not be able to get information about the FD "
67 "(this is not an error, unless you are planning to use fluorescence detector information).");
71 auto rManagerConfigBranch = cc->GetTopBranch(
"RManagerRegister");
72 if (rManagerConfigBranch)
73 RManagerRegister::GetInstance().Configure(rManagerConfigBranch);
75 INFO(
"Could not access a configuration file for the RManagerRegister. "
76 "The Detector interface will not be able to get information about Radio "
77 "(this is not an error, unless you are planning to use radio detector information).");
81 auto mManagerConfigBranch = cc->GetTopBranch(
"MManagerRegister");
82 if (mManagerConfigBranch)
83 MManagerRegister::GetInstance().Configure(mManagerConfigBranch);
85 INFO(
"Could not access a configuration file for the MManagerRegister. "
86 "The Detector interface will not be able to get information about the MD "
87 "(this is not an error, unless you are planning to use muon detector information).");
91 auto cManagerConfigBranch = cc->GetTopBranch(
"CManagerRegister");
92 if (cManagerConfigBranch)
93 CManagerRegister::GetInstance().Configure(cManagerConfigBranch);
95 INFO(
"Could not access a configuration file for the CManagerRegister. "
96 "The Detector interface will not be able to get information about MARTA "
97 "(this is not an error, unless you are planning to use MARTA detector information).");
101 auto aManagerConfigBranch = cc->GetTopBranch(
"AManagerRegister");
102 if (aManagerConfigBranch) {
103 AManagerRegister::GetInstance().Configure(aManagerConfigBranch);
105 INFO(
"Could not access a configuration file for the AManagerRegister. "
106 "The Detector interface will not be able to get information about the Atmosphere "
107 "(this is not an error, unless you are planning to use the Atmosphere information).");
119 Detector::GetSDetector()
124 fSDetector->Update();
131 Detector::GetFDetector()
136 fFDetector->Update();
143 Detector::GetRDetector()
148 fRDetector->Update();
155 Detector::GetMDetector()
160 fMDetector->Update();
167 Detector::GetCDetector()
172 fCDetector->Update();
183 WARNING(
"Already at the requested time.");
186 info <<
"to time " << time;
197 fSDetector->Update();
199 fFDetector->Update();
201 fRDetector->Update();
203 fMDetector->Update(invData, invComp);
205 fCDetector->Update();
207 fAtmosphere.Update();
209 delete fGeoMagneticField;
210 fGeoMagneticField =
nullptr;
214 fSDetector->UpdateDense();
216 fCDetector->UpdateDense();
221 if (forceRadio && fRDetector)
222 fRDetector->Update();
227 Detector::GetGeoMagneticField()
229 #warning RU: Magnetic field should be handled same way as all other components. No global singleton.
230 if (!fGeoMagneticField)
233 return *fGeoMagneticField;
240 return GetGeoMagneticField().Get(location);
244 Detector::~Detector()
246 delete fGeoMagneticField;
Detector description interface for CDetector-related data.
void Update(std::vector< double > &init, const std::vector< double > &res)
#define INFO(message)
Macro for logging informational messages.
Detector associated to muon detector hierarchy.
Detector description interface for FDetector-related data.
A TimeStamp holds GPS second and nanosecond for some event.
Detector description interface for RDetector-related data.
static MagneticFieldModel & instance()
#define WARNING(message)
Macro for logging warning messages.
Spherical harmonics parametrisation of geomagnetic field.
Detector description interface for SDetector-related data.
utl::CoordinateSystemPtr Get(const std::string &id)
Get a well-known Coordinate System.