3 #include <boost/lambda/lambda.hpp>
5 #include <cdet/COverrideXMLManager.h>
6 #include <fwk/CentralConfig.h>
7 #include <det/VManager.h>
8 #include <utl/ErrorLogger.h>
9 #include <utl/Reader.h>
10 #include <cdet/CManagerRegister.h>
18 using namespace boost::lambda;
27 const
string& componentProperty,
28 const
string& componentName,
33 FindBranch(componentProperty, componentName, componentIndex);
45 const string& componentProperty,
46 const string& componentName,
51 FindBranch(componentProperty, componentName, componentIndex);
74 for_each(y.begin(), y.end(), _1 *= scaleY);
77 const unsigned int n = x.size();
78 for (
unsigned int i = 0; i < n; ++i)
86 COverrideXMLManager::FindBranch(
const string& componentProperty,
87 const string& componentName,
97 const int nIndices = componentIndex.size();
103 const IndexMap::const_iterator it = componentIndex.begin();
104 if (it->first !=
"stationId") {
105 if (IsReportingErrors())
106 INFO(
string(
"If data request is made using one index, "
107 "that index must specify the stationId; ") +
108 QueryInfoMessage(componentProperty, componentName, componentIndex));
113 atts[
"id"] = it->second;
119 if (!stationComponentB)
122 Branch stationComponentPropertyB = stationComponentB.
GetChild(componentProperty);
123 return stationComponentPropertyB;
128 const IndexMap::const_iterator sIt = componentIndex.find(
"stationId");
129 if (sIt == componentIndex.end()) {
130 if (IsReportingErrors())
131 INFO(
string(
"Request for data using two indices, "
132 "neither of which specifies stationId; ") +
133 QueryInfoMessage(componentProperty, componentName, componentIndex));
136 const string& stationId = sIt->second;
139 const IndexMap::const_iterator pIt = componentIndex.find(
"RPCId");
140 if (pIt == componentIndex.end()) {
141 if (IsReportingErrors())
142 INFO(
string(
"Request for data using two indices, "
143 "neither of which specifies RPCId; ") +
144 QueryInfoMessage(componentProperty, componentName, componentIndex));
149 atts[
"id"] = stationId;
155 if (!stationComponentB)
158 const string& rpcId = pIt->second;
160 atts2[
"RPCId"] = rpcId;
162 Branch stationComponentPropertyB = stationComponentB.
GetChild(componentProperty,atts2);
163 if (!stationComponentPropertyB)
166 return stationComponentPropertyB;
169 if (IsReportingErrors())
170 INFO(
string(
"Three indices in query: not yet supported; ") +
171 QueryInfoMessage(componentProperty, componentName, componentIndex));
174 if (IsReportingErrors())
175 INFO(
string(
"Invalid number of parameters specified in component index map; ") +
176 QueryInfoMessage(componentProperty, componentName, componentIndex));
Class to hold collection (x,y) points and provide interpolation between them.
#define INFO(message)
Macro for logging informational messages.
Interface for detector managers.
void PushBack(const double x, const double y)
Branch GetChild(const std::string &childName) const
Get child of this Branch by child name.
Class representing a document branch.
Status
Return code for seek operation.
REGISTER_C_MANAGER("CStationListXMLManager", CStationListXMLManager)
void GetData(bool &b) const
Overloads of the GetData member template function.
std::map< std::string, std::string > IndexMap
Manager for SD description in XML "override" files.
Status
Specifies success or (eventually) various possible failure modes.