21 msg().setLevel(MSG::INFO);
32 ATH_MSG_WARNING(
"ZdcInjPulserAmpMap constructor, JSON file not found in search path, trying local file" ) ;
33 filePath =
"./ZDC_InjectPulseSteps.json";
39 ATH_MSG_FATAL(
"ZdcInjPulserAmpMap constructor, JSON file cannot be opened!" ) ;
53 auto rangeIter = j.find(
"RunRanges");
54 if (rangeIter == j.end())
return false;
61 unsigned int last =
range.at(
"Last");
62 std::string
name =
range.at(
"StepsConfig");
67 ATH_MSG_DEBUG(
"ZdcInjPulserAmpMap::found run range: first, last = " <<
first <<
", " << last
68 <<
", config name = " <<
name <<
", scale factor = " <<
scale );
71 auto stepConfigIter = j.find(
"StepConfigurations");
72 if (stepConfigIter == j.end())
return false;
76 for (
json::iterator configIt = stepConfigIter->begin(); configIt != stepConfigIter->end(); ++configIt) {
77 std::string confName = configIt.key();
82 if (!insertResult)
return false;
87 if (!
steps.is_array()) {
96 ATH_MSG_DEBUG(
"ZdcInjPulserAmpMap::found steps configuration with name " << confName <<
", starting LB = "
97 << stepsDesc.first <<
", number of LBs = " << stepsDesc.second.size());
116 if (
index ==0 && elem.size() == 1) {
117 if (elem.find(
"startLB") != elem.end()) {
118 steps.first = elem[
"startLB"];
131 unsigned int nStep =
entry.at(
"nStep");
132 float vStart =
entry.at(
"vStart");
133 float vStep =
entry.at(
"vStep");
135 float voltage = vStart;
137 stepVec.push_back(voltage);
144 std::string configName = (allowDefault ?
"Default" :
"_none_");
145 float scaleFactor = 1;
148 if (
runNumber >= std::get<0>(rangeDescr) && runNumber < std::get<1>(rangeDescr)) {
149 configName = std::get<2>(rangeDescr);
150 scaleFactor = std::get<3>(rangeDescr);
152 ATH_MSG_DEBUG(
"ZdcInjPulserAmpMap::lookupRun(): found config name " << configName <<
" for run number "
165 const std::lock_guard<std::mutex> lock(
m_lock);
173 <<
" with index " << newIndex <<
", and scaleFactor " << scaleFactor);
175 return Token(newIndex, scaleFactor);