![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
11 #include "nlohmann/json.hpp"
38 return StatusCode::SUCCESS;
49 if (wrHdl.isValid()) {
50 ATH_MSG_DEBUG(
"CondHandle " << wrHdl.fullKey() <<
" is already valid."
51 <<
" In theory this should not be called, but may happen"
52 <<
" if multiple concurrent events are being processed out of order.");
53 return StatusCode::SUCCESS;
56 ATH_MSG_DEBUG(
"Range of time/charge output is " << wrHdl.getRange());
75 if (wrHdl.record(std::move(wrCdo)).isFailure()) {
77 <<
" with EventRange " << wrHdl.getRange()
78 <<
" into Conditions Store");
79 return StatusCode::FAILURE;
81 ATH_MSG_DEBUG(
"Recorded new " << wrHdl.key() <<
" with range " << wrHdl.getRange() <<
" into Conditions Store");
83 return StatusCode::SUCCESS;
96 return StatusCode::FAILURE;
99 ATH_MSG_DEBUG(
"Size of CondAttrListCollection " << readHandle.fullKey() <<
" readCdo->size()= " << readCdo->size());
100 ATH_MSG_DEBUG(
"Range of input is " << readHandle.getRange() <<
", range of output is " << writeHandle.
getRange());
104 unsigned int nChns = 0;
105 for(itr = readCdo->begin(); itr != readCdo->end(); ++itr) {
108 const unsigned int chanNum = itr->first;
109 const std::string& chanName = readCdo->chanName(
chanNum);
110 if(chanName.empty()){
119 ATH_MSG_ERROR(
"Could not identify valid channelId for channel "<<
chanNum<<
" with name "<< chanName<<
"!");
120 throw std::runtime_error(
"NswDcsDbAlg: Could not identify valid channelId for HV channel");
129 dcs_data.
standbyVolt = *(
static_cast<const float*
>((atr[
"v0Set"]).addressOfData()));
130 dcs_data.readyVolt = *(
static_cast<const float*
>((atr[
"v1Set"]).addressOfData()));
131 dcs_data.fsmState =
MuonCond::getFsmStateEnum(*(
static_cast<const std::string*
>((atr[
"fsmCurrentState"]).addressOfData())));
132 ATH_MSG_DEBUG(
"channel " << chanName <<
" has fsm state " << *(
static_cast<const std::string*
>((atr[
"fsmCurrentState"]).addressOfData()))<<
" has v0 state " << *(
static_cast<const float*
>( (atr[
"v0Set"]).addressOfData()))<<
" has v1 " << *(
static_cast<const float*
>((atr[
"v1Set"]).addressOfData())));
139 return StatusCode::SUCCESS;
151 return StatusCode::FAILURE;
154 ATH_MSG_DEBUG(
"Size of CondAttrListCollection " << readHandle.fullKey() <<
" readCdo->size()= " << readCdo->size());
155 ATH_MSG_DEBUG(
"Range of input is " << readHandle.getRange() <<
", range of output is " << writeHandle.
getRange());
159 for(itr = readCdo->begin(); itr != readCdo->end(); ++itr) {
163 std::string
data = *(
static_cast<const std::string *
>((atr[
"data_array"]).addressOfData()));
167 unsigned int nLB = 0;
170 for (
auto &
yy : jx[
"holes"].
items()) {
180 ATH_MSG_DEBUG(
"Could not identify valid channelId for channel "<<jt[
"channelId"]<<
" with name "<< jt[
"channelName"]<<
"! Skipping...");
184 int channelDead = jt[
"channelDead"];
185 writeCdo->
setDataTDaq(tech,
channelId, jt[
"hole_iovSince"], jt[
"hole_iovUntil"], elink, channelDead );
189 ATH_MSG_VERBOSE(
"Retrieved data for "<<
nLB<<
" entries (combinations of lumi block and channel).");
192 return StatusCode::SUCCESS;
202 return StatusCode::FAILURE;
205 ATH_MSG_DEBUG(
"Size of CondAttrListCollection " << readHandle.fullKey() <<
" readCdo->size()= " << readCdo->size());
206 ATH_MSG_DEBUG(
"Range of input is " << readHandle.getRange() <<
", range of output is " << writeHandle.
getRange());
214 for(itr = readCdo->begin(); itr != readCdo->end(); ++itr) {
217 const unsigned int chanNum = itr->first;
218 const std::string& chanName = readCdo->chanName(
chanNum);
219 if(chanName.empty()){
224 bool online = *(
static_cast<const bool*
>((atr[
"online"]).addressOfData()));
225 ATH_MSG_DEBUG(
"found SCA " << chanName <<
" with status " << atr[
"online"] <<
" " <<
online);
235 return StatusCode::SUCCESS;
245 std::regex reMMG(
"^([A-Za-z]{1})([0-9]{2})_ML([0-9])P([0-9])_(IP|HO)R([0-9])__HV");
246 std::regex reMMD(
"^([A-Za-z]{1})([0-9]{2})_DRIFT_(IP|HO)R([0-9])__HV");
247 std::regex reSTG(
"^([A-Za-z]{1})([0-9]{2})_ML([0-9])_(IP|HO)R([0-9])__HV");
252 if(std::regex_match(chanName, reMMG)) {
256 else if(std::regex_match(chanName, reMMD)) {
260 else if(std::regex_match(chanName, reSTG)) {
265 ATH_MSG_ERROR(
"Could not identify channel with name "<<chanName);
279 std::regex_match(chanName,
m,
re);
282 std::vector<std::string>
res;
283 for(
unsigned int i=0;
i<
m.size(); ++
i)
res.push_back(
m[
i].str());
287 int wheel =
res[1]==
"A"? 1 : -1;
288 int sector = std::stoi(
res[2]);
289 const std::string
stationName = sector%2==0 ?
"MMS" :
"MML";
294 int pcb = std::stoi(
res[4]);
297 ATH_MSG_DEBUG(
"Could not extract valid channelId for MMG channel "<<chanName);
307 int wheel =
res[1]==
"A"? 1 : -1;
308 int sector = std::stoi(
res[2]);
309 const std::string
stationName = sector%2==0 ?
"MMS" :
"MML";
315 ATH_MSG_DEBUG(
"Could not extract valid elementId for MMGD channel "<<chanName);
322 ATH_MSG_DEBUG(
"Could not extract valid multilayerId for MMG channel "<<chanName);
332 int wheel =
res[1]==
"A"? 1 : -1;
333 int sector = std::stoi(
res[2]);
334 const std::string
stationName = sector%2==0 ?
"STS" :
"STL";
342 ATH_MSG_DEBUG(
"Could not extract valid channelId for STG channel "<<chanName);
359 std::regex reMMG(
"^ELink-MM-(A|C)/V([0-9]{1})/L1A/Strip/S([0-9]{1,2})/L([0-9]{1})/R([0-9]{1,2})/E([0-9]{1})");
360 std::regex reSTG(
"^ELink-sTGC-(A|C)/V([0-9]{1})/L1A/(Strip|Pad)/S([0-9]{1,2})/L([0-9]{1})/R([0-9]{1})/E([0-9]{1})");
361 std::regex reSTGTrigProc(
"^ELink-sTGC-A/V0/L1A/TrigProc/");
362 std::regex reSTGPadTrig(
"^ELink-sTGC-A/V0/L1A/PadTrig/");
368 if(std::regex_match(chanName, reMMG)) {
372 else if(std::regex_match(chanName, reSTG)) {
375 }
else if(std::regex_match(chanName, reSTGPadTrig) || std::regex_match(chanName, reSTGTrigProc)){
380 ATH_MSG_DEBUG(
"Could not identify channel with name "<<chanName);
394 std::regex_match(chanName,
m,
re);
397 std::vector<std::string>
res;
398 for(
unsigned int i=0;
i<
m.size(); ++
i)
res.push_back(
m[
i].str());
402 int wheel =
res[1]==
"A"? 1 : -1;
403 int sector = std::stoi(
res[3])+1;
416 elink = std::stoi(
res[6]);
418 ATH_MSG_DEBUG(
"Could not extract valid channelId for MMG channel "<<chanName);
428 int wheel =
res[1]==
"A"? 1 : -1;
429 int sector = std::stoi(
res[4]) + 1;
430 std::string
stationName = sector%2==0 ?
"STS" :
"STL";
444 uint channelType = (
res[3] ==
"Pad" ? sTgcIdHelper::sTgcChannelTypes::Pad : sTgcIdHelper::sTgcChannelTypes::Strip);
447 ATH_MSG_DEBUG(
"Could not extract valid channelId for STG channel "<<chanName);
453 elink = std::stoi(
res[7]);
464 std::regex re(
"^(A|C)_([0-9]{2})_L([0-9])_B([0-9]{2})");
468 if(!std::regex_match(chanName,
re)) {
477 std::regex_match(chanName,
m,
re);
480 std::vector<std::string>
res;
481 for(
unsigned int i=0;
i<
m.size(); ++
i)
res.push_back(
m[
i].str());
484 int wheel =
res[1]==
"A"? 1 : -1;
485 int sector = std::stoi(
res[2])+1;
486 int board = std::stoi(
res[4]);
497 board -= (
layer%2==1 ? 1 : 2);
501 }
else if (board%4==3) {
511 ATH_MSG_WARNING(
"Could not extract valid channelId for MMG channel "<<chanName);
527 else if((
layer&1)==1){
529 channelType=sTgcIdHelper::sTgcChannelTypes::Strip;
531 channelType=sTgcIdHelper::sTgcChannelTypes::Pad;
533 }
else if(
layer%1==0){
535 channelType=sTgcIdHelper::sTgcChannelTypes::Pad;
537 channelType=sTgcIdHelper::sTgcChannelTypes::Strip;
542 ATH_MSG_WARNING(
"Could not extract valid channelId for STG channel "<<chanName);
def retrieve(aClass, aKey=None)
bool buildChannelIdForEltx(Identifier &channelId, const DcsTechType tech0, const std::string &chanName, bool &isOK) const
char data[hepevt_bytes_allocation_ATLAS]
constexpr uint8_t stationPhi
station Phi 1 to 8
void setDataEltx(const DcsTechType tech, const Identifier &chnlId)
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
const EventIDRange & getRange() const
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
static EventIDRange infiniteMixed()
Produces an mixed EventIDRange that is infinite in Time and RunLumi.
const MuonGM::MuonDetectorManager * m_muDetMgrFromDetStore
#define ATH_MSG_VERBOSE(x)
bool buildChannelIdForTDaq(Identifier &channelId, uint &elink, const DcsTechType tech0, const std::string &chanName, bool &isOK) const
bool empty() const
Test if the key is blank.
This class is a collection of AttributeLists where each one is associated with a channel number....
readKey_t m_readKey_stg_tdaq
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
bool buildChannelIdForHv(Identifier &channelId, const DcsTechType tech0, const std::string &chanName, bool &isOK) const
::StatusCode StatusCode
StatusCode definition for legacy code.
std::pair< std::vector< unsigned int >, bool > res
Helper struct to cache all dcs constants in a common place of the memory.
StatusCode loadELTXData(const EventContext &ctx, const readKey_t &readKey, const DcsTechType tech, writeHandleDcs_t &writeHandle, NswDcsDbData *writeCdo) const
StatusCode loadHvData(const EventContext &ctx, const readKey_t &readKey, const DcsTechType tech, writeHandleDcs_t &writeHandle, NswDcsDbData *writeCdo) const
Gaudi::Property< bool > m_loadEltx
void setDataHv(const DcsTechType tech, const Identifier &chnlId, DcsConstants constants)
readKey_t m_readKey_mmg_tdaq
StatusCode initialize(bool used=true)
readKey_t m_readKey_mmg_eltx
virtual StatusCode execute(const EventContext &) const override
readKey_t m_readKey_stg_eltx
#define ATH_MSG_WARNING(x)
ChanAttrListMap::const_iterator const_iterator
const boost::regex re(r_e)
Gaudi::Property< bool > m_loadTdaq
readKey_t m_readKey_mmg_hv
DcsFsmState getFsmStateEnum(const std::string &fsmState)
StatusCode loadTDaqData(const EventContext &ctx, const readKey_t &readKey, const DcsTechType tech, writeHandleDcs_t &writeHandle, NswDcsDbData *writeCdo) const
void setDataTDaq(const DcsTechType tech, const Identifier &chnlId, uint64_t timeSince, uint64_t timeUntil, unsigned int elink, bool permanentlyDisabled)
virtual StatusCode initialize() override
ServiceHandle< ICondSvc > m_condSvc
constexpr uint8_t stationEta
1 to 3
readKey_t m_readKey_stg_hv
void addDependency(const EventIDRange &range)