#include <ZdcInjPulserAmpMap.h>
|
using | json = nlohmann::json |
|
Definition at line 24 of file ZdcInjPulserAmpMap.h.
◆ json
◆ RunRangeDescr
◆ StepsDescr
◆ StepsVector
◆ ZdcInjPulserAmpMap()
ZdcInjPulserAmpMap::ZdcInjPulserAmpMap |
( |
| ) |
|
Definition at line 19 of file ZdcInjPulserAmpMap.cxx.
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!" ) ;
◆ fillVVector()
Definition at line 129 of file ZdcInjPulserAmpMap.cxx.
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);
◆ getContext()
Definition at line 88 of file ZdcInjPulserAmpMap.h.
91 throw std::runtime_error(
"Invalid Injected Pulser configuration");
93 if (!token.isValid() ||
size_t(token.value()) >=
m_activeConfigs.size()) {
94 throw std::runtime_error(
"Invalid Injected Pulser configuration");
97 unsigned int index = token.value();
100 unsigned int firstLB = stepsConfig.first;
103 return std::make_pair(firstLB,
steps);
◆ getCycleNumber()
int ZdcInjPulserAmpMap::getCycleNumber |
( |
const Token & |
token, |
|
|
unsigned int |
lumiBlock |
|
) |
| const |
|
inline |
◆ getFilePath()
const std::string& ZdcInjPulserAmpMap::getFilePath |
( |
| ) |
const |
|
inline |
◆ getFirstLumiBlock()
unsigned int ZdcInjPulserAmpMap::getFirstLumiBlock |
( |
const Token & |
token | ) |
const |
|
inline |
◆ getInstance()
◆ getNumSteps()
unsigned int ZdcInjPulserAmpMap::getNumSteps |
( |
const Token & |
token | ) |
const |
|
inline |
◆ getPulserAmplitude()
float ZdcInjPulserAmpMap::getPulserAmplitude |
( |
const Token & |
token, |
|
|
unsigned int |
lumiBlock |
|
) |
| const |
|
inline |
Definition at line 140 of file ZdcInjPulserAmpMap.h.
147 unsigned int vecIndex = (
lumiBlock - firstLB) % map.size();
148 return map.at(vecIndex) * token.scaleFactor();
◆ initMessaging()
void AthMessaging::initMessaging |
( |
| ) |
const |
|
privateinherited |
Initialize our message level and MessageSvc.
This method should only be called once.
Definition at line 39 of file AthMessaging.cxx.
◆ lookupRun()
Definition at line 142 of file ZdcInjPulserAmpMap.cxx.
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);
◆ msg() [1/2]
MsgStream & asg::AsgMessaging::msg |
( |
| ) |
const |
|
inherited |
The standard message stream.
- Returns
- A reference to the default message stream of this object.
Definition at line 49 of file AsgMessaging.cxx.
50 #ifndef XAOD_STANDALONE
52 #else // not XAOD_STANDALONE
54 #endif // not XAOD_STANDALONE
◆ msg() [2/2]
MsgStream & asg::AsgMessaging::msg |
( |
const MSG::Level |
lvl | ) |
const |
|
inherited |
The standard message stream.
- Parameters
-
lvl | The message level to set the stream to |
- Returns
- A reference to the default message stream, set to level "lvl"
Definition at line 57 of file AsgMessaging.cxx.
58 #ifndef XAOD_STANDALONE
60 #else // not XAOD_STANDALONE
63 #endif // not XAOD_STANDALONE
◆ msgLvl()
bool asg::AsgMessaging::msgLvl |
( |
const MSG::Level |
lvl | ) |
const |
|
inherited |
Test the output level of the object.
- Parameters
-
lvl | The message level to test against |
- Returns
- boolean Indicting if messages at given level will be printed
-
true
If messages at level "lvl" will be printed
Definition at line 41 of file AsgMessaging.cxx.
42 #ifndef XAOD_STANDALONE
43 return ::AthMessaging::msgLvl( lvl );
44 #else // not XAOD_STANDALONE
45 return m_msg.msgLevel( lvl );
46 #endif // not XAOD_STANDALONE
◆ parseJsonFile()
bool ZdcInjPulserAmpMap::parseJsonFile |
( |
std::ifstream & |
ifs | ) |
|
|
private |
Definition at line 46 of file ZdcInjPulserAmpMap.cxx.
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());
◆ readPulserSteps()
Definition at line 107 of file ZdcInjPulserAmpMap.cxx.
116 if (
index ==0 && elem.size() == 1) {
117 if (elem.find(
"startLB") != elem.end()) {
118 steps.first = elem[
"startLB"];
◆ setLevel()
void AthMessaging::setLevel |
( |
MSG::Level |
lvl | ) |
|
|
inherited |
◆ ATLAS_THREAD_SAFE
std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT |
|
mutableprivateinherited |
◆ m_activeConfigs
◆ m_filePath
std::string ZdcInjPulserAmpMap::m_filePath |
|
private |
◆ m_imsg
std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr } |
|
mutableprivateinherited |
◆ m_lock
std::mutex ZdcInjPulserAmpMap::m_lock |
|
private |
◆ m_lvl
std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL } |
|
mutableprivateinherited |
◆ m_msg_tls
boost::thread_specific_ptr<MsgStream> AthMessaging::m_msg_tls |
|
mutableprivateinherited |
MsgStream instance (a std::cout like with print-out levels)
Definition at line 132 of file AthMessaging.h.
◆ m_nm
std::string AthMessaging::m_nm |
|
privateinherited |
◆ m_runRangeDescrs
◆ m_stepsConfigs
std::map<std::string, StepsDescr> ZdcInjPulserAmpMap::m_stepsConfigs |
|
private |
◆ m_validJSon
bool ZdcInjPulserAmpMap::m_validJSon {false} |
|
private |
The documentation for this class was generated from the following files: