5 #include <boost/lexical_cast.hpp>
7 #include <fdet/FSimulationCalibManager.h>
8 #include <fwk/CentralConfig.h>
9 #include <det/Detector.h>
11 #include <utl/ErrorLogger.h>
12 #include <utl/TimeStamp.h>
13 #include <utl/Reader.h>
14 #include <utl/TabulatedFunction.h>
15 #include <utl/AugerException.h>
16 #include <utl/ShadowPtr.h>
18 #include <fdet/FManagerRegister.h>
19 #include <fdet/FDetector.h>
20 #include <fdet/Telescope.h>
40 curB.GetChild(
"calibration").GetData(val);
41 fCalibConst[FindComponent<string>(
"signature", curB.GetAttributes())] = val;
47 FSimulationCalibManager::GetData(
double& returnData,
48 const string& componentProperty,
49 const string& componentName,
50 const IndexMap& index)
54 if (componentName!=
"fd_sim_calib")
57 if (componentProperty ==
"sim_pixel_calibs") {
59 const IndexMap::const_iterator iSig = index.find(
"signature");
60 if (iSig == index.end()) {
62 err <<
"Could not find \"signature\" in index map.";
66 const IndexMap::const_iterator iPix = index.find(
"pixelId");
67 if (iPix == index.end()) {
69 err <<
"Could not find \"pixelId\" in index map.";
73 const map<string, vector<double> >::const_iterator iCal = fCalibConst.find(iSig->second);
74 if (iCal == fCalibConst.end()) {
76 err <<
"Could not find signature=\"" << iSig->second <<
"\".";
80 const int pixelId = boost::lexical_cast<
int>(iPix->second);
81 if (pixelId < 1 || pixelId >
int(iCal->second.size())+1) {
83 err <<
"Could not find pixel with Id=\"" << pixelId <<
"\". "
84 "Configuration provieds only \"" << iCal->second.size()+1 <<
"\" "
85 "calibration constants!";
89 returnData = iCal->second[pixelId-1];
void Init()
Initialise the registry.
Branch GetNextSibling() const
Get next sibling of this branch.
Class representing a document branch.
#define REGISTER_F_MANAGER(_name_, _Type_)
Branch GetFirstChild() const
Get first child of this Branch.
#define ERROR(message)
Macro for logging error messages.
Manager for FD calibration with a fixed constant.
Status
Specifies success or (eventually) various possible failure modes.