|
ATLAS Offline Software
|
Go to the documentation of this file.
17 #include "CoralBase/Attribute.h"
55 return StatusCode::FAILURE;
62 unsigned int ros = roses[moduleType];
107 return StatusCode::SUCCESS;
115 if (dcsState.isValid()) {
116 ATH_MSG_DEBUG(
"Found valid TileDCSState: " << dcsState.key());
117 return StatusCode::SUCCESS;
120 std::unique_ptr<TileDCSState> dcsStateData = std::make_unique<TileDCSState>();
127 dcsState.addDependency(hv);
132 const std::pair<int, int> rosDrawerPair =
m_rosDrawerHV.at(coolChannel);
133 unsigned int ros = rosDrawerPair.first;
134 unsigned int drawer = rosDrawerPair.second;
138 <<
", COOL channel: " << coolChannel
139 <<
", payload: " << chanAttrListPair.second);
143 for (
const coral::Attribute& attribute : chanAttrListPair.second) {
157 dcsState.addDependency(hvSet);
163 unsigned int ros = rosDrawerPair.first;
164 unsigned int drawer = rosDrawerPair.second;
168 <<
", COOL channel: " << coolChannel
169 <<
", payload: " << chanAttrListPair.second);
173 for (
const coral::Attribute& attribute : chanAttrListPair.second) {
176 ATH_MSG_VERBOSE(
"HVSET[" << pmt0 <<
"] = " << attribute.data<
float>() );
190 dcsState.addDependency(
states);
196 unsigned int ros = rosDrawerPair.first;
197 unsigned int drawer = rosDrawerPair.second;
201 <<
", COOL channel: " << coolChannel
202 <<
", payload: " << chanAttrListPair.second);
204 for (
const coral::Attribute& attribute : chanAttrListPair.second) {
219 int specialModuleType(moduleType);
237 if (hvSet >= 1.0 && hv >= 0.0
238 && hvSet < 999.9 && hv < 999.9) {
240 std::map<int, std::pair<float, float>>::const_iterator itr =
246 std::fabs(hvSet + itr->second.second - hv) : std::fabs(hvSet - hv);
252 float hvGap = std::fabs(hvSet - hv);
277 <<
" Status = " << drawerStatus <<
endmsg;
286 <<
" pmt = " << pmt0 + 1
298 if(dcsState.record(std::move(dcsStateData)).isFailure()) {
302 <<
" with EventRange " << dcsState.getRange()
303 <<
" into Conditions Store");
305 return StatusCode::FAILURE;
310 <<
" with EventRange " << dcsState.getRange()
311 <<
" into Conditions Store");
314 return StatusCode::SUCCESS;
322 const std::string& subStr,
323 std::vector<std::pair<int, int>>& rosDrawer) {
326 std::ifstream
file(fullFileName.c_str());
327 if (!
file.is_open()) {
334 rosDrawer.resize(257, std::make_pair<int, int>(0xFFFF, 0xFFFF));
336 std::string
compName[5] = {
"XXX",
"ATLTILLV01",
"ATLTILLV02",
"ATLTILLV00",
"ATLTILLV03" };
346 if (
file.eof() ||
file.fail())
break;
350 if (
pos != std::string::npos)
break;
359 if (
pos == std::string::npos) {
372 if (rosDrawer.size() <=
ind) {
373 rosDrawer.resize(
ind + 1, std::make_pair<int, int> (0xFFFF, 0xFFFF));
376 rosDrawer[
ind] = std::make_pair<int, int>(
ros, (
module - 1));
389 std::ifstream
file(fullFileName.c_str());
390 if (!
file.is_open()) {
397 std::string partName[5] = {
"AUX",
"LBA",
"LBC",
"EBA",
"EBC" };
409 if (
file.eof() ||
file.fail())
break;
415 if (
pos != std::string::npos)
break;
429 if (
pos == std::string::npos) {
440 pos =
line.find(
"Step Value is");
441 if (
pos == std::string::npos) {
447 if (delta <= 0.0 || delta > 1000.0) {
453 if (
pos == std::string::npos) {
459 if (offset < -1000.0 || offset > 1000.0) {
466 <<
" delta = " << delta
467 <<
" offset = " <<
offset);
482 const EventContext& ctx)
const {
485 wh.addDependency(emScale);
487 float laserReferenceHV = -5.;
488 float cesReferenceHV = -5.;
502 if (laserReferenceHV >= 0.) {
511 <<
" pmt = " << pmt0 + 1
514 if (laserReferenceHV >= 0.) {
516 << cesReferenceHV <<
" cesium value)" <<
endmsg;
525 return StatusCode::SUCCESS;
530 return StatusCode::SUCCESS;
Gaudi::Property< std::string > m_dcsChHvSetInCool
File name with mapping Tile DCS HVSET DB COOL channels to ROS and drawer.
@ EXTENDED_BARREL_SPECIAL_C10
float getChannelHVSet(unsigned int ros, unsigned int drawer, unsigned int channel) const
Return requested HV reported by DCS for given Tile channel.
std::vector< std::pair< int, int > > m_rosDrawerStates
int m_channel2pmt[2][NUMBER_OF_HVSET_CHANNELS]
std::vector< std::pair< int, int > > m_rosDrawerHV
static std::string find_file(const std::string &logical_file_name, const std::string &search_path, SearchType search_type=LocalSearch)
virtual StatusCode finalize() override
float getChannelHV(unsigned int ros, unsigned int drawer, unsigned int channel) const
Return measured HV reported by DCS for given Tile channel.
void setDCSHVStatus(unsigned int ros, unsigned int drawer, unsigned int channel, TileDCSStatus status)
Store TileDCSstatus for given Tile channel determined by deviation between measured and requested HV.
void setChannelHV(unsigned int ros, unsigned int drawer, unsigned int channel, float hv)
Store measured HV reported by DCS for given Tile channel.
Gaudi::Property< std::vector< int > > m_warningDrawer
Status is WARNING if Tile DCS drawer states is like this.
bool msgLvl(const MSG::Level lvl) const
TileDCSStatus getDCSHVStatus(unsigned int ros, unsigned int drawer, unsigned int channel) const
Return TileDCSstatus for given Tile channel determined by deviation between measured and requested HV...
#define ATH_MSG_VERBOSE(x)
const std::string & key() const
Return the StoreGate ID for the referenced object.
ChanAttrListMap::value_type ChanAttrListPair
int readBadHV(const std::string &fileName)
Read special deltas for few unstable PMTs.
Gaudi::Property< std::string > m_dcsChHvInCool
File name with mapping Tile DCS HV DB COOL channels to ROS and drawer.
Gaudi::Property< float > m_goodHVLimit
Tile DCS Status is OK if difference between measured and requested HV is below this limit.
const TileCablingService * m_cabling
static const unsigned int MAX_DRAWER
Number of drawers in ROS 1-4.
An algorithm that can be simultaneously executed in multiple threads.
void setDrawerStates(unsigned int ros, unsigned int drawer, int states)
Store Tile drawer summary states per LVPS reported by DCS.
int m_pmt2channel[2][NUMBER_OF_HVSET_CHANNELS]
TileDCSStatus
Describes Tile DCS status.
StatusCode fillReferenceHV(TileDCSState &dcsState, SG::WriteCondHandle< TileDCSState > &wh, const EventContext &ctx) const
Store reference HV from Tile CES or Laser DB folder in TileDCSState.
float getLaserReferenceHV(unsigned int drawerIdx, unsigned int channel) const
Returns the reference PMT HV from appropriate laser calibration.
int readConfig(const std::string &fileName, const std::string &subStr, std::vector< std::pair< int, int >> &rosDrawer)
Read mapping of DB COOL channels into Tile ROS and drawer pairs.
SG::ReadCondHandleKey< CondAttrListCollection > m_hvSetKey
The Tile DCS HVSET COOL folder name.
void setChannelHVSet(unsigned int ros, unsigned int drawer, unsigned int channel, float hvSet)
Store requested HV reported by DCS for given Tile channel.
void setGoodDrawer(int goodDrawer)
Store good Tile drawer summary states per LVPS as reference.
::StatusCode StatusCode
StatusCode definition for legacy code.
void setWarningDrawer(const std::vector< int > &warningDrawer)
Store vector of warning Tile drawer summary states per LVPS as reference.
Gaudi::Property< bool > m_readHV
Flag to control reading Tile DCS HV folder from DB.
SG::ReadCondHandleKey< CondAttrListCollection > m_statesKey
The Tile DCS STATES COOL folder name.
SG::ReadCondHandleKey< CondAttrListCollection > m_hvKey
The Tile DCS HV COOL folder name.
Gaudi::Property< float > m_warningHVLimit
Mask channels with difference between measured and requested HV above this limit.
bool m_isChannelUsed[4][NUMBER_OF_CHANNELS]
static const unsigned int MAX_ROS
Number of ROSs
virtual StatusCode initialize() override
TileDCSStatus setDCSStatus(unsigned int ros, unsigned int drawer, unsigned int channel, TileDCSStatus status)
Store TileDCSstatus for given Tile channel determined by summary states per LVPS and deviation betwee...
double atof(std::string_view str)
Converts a string into a double / float.
Gaudi::Property< std::string > m_dcsChStatesInCool
File name with mapping Tile DCS STATES DB COOL channels to ROS and drawer.
std::vector< std::pair< int, int > > m_rosDrawerHVSet
StatusCode initialize(bool used=true)
static std::string getDrawerString(unsigned int ros, unsigned int drawer)
Return the drawer name, e.g.
static bool C10_connected(int module)
#define ATH_MSG_WARNING(x)
ServiceHandle< TileCablingSvc > m_cablingSvc
Name of Tile cabling service.
static int channel2hole(int ros, int channel)
Condition object to keep Tile DCS status from DB.
int atoi(std::string_view str)
Helper functions to unpack numbers decoded in string into integers and doubles The strings are requir...
std::map< int, std::pair< float, float > > m_knownBadHV
SG::WriteCondHandleKey< TileDCSState > m_dcsStateKey
The name of TileDCSState object to produce and put into condition store.
static unsigned int getDrawerIdx(unsigned int ros, unsigned int drawer)
Returns a drawer hash.
unsigned int getChannelKey(unsigned int ros, unsigned int drawer, unsigned int channel) const
@ brief Return Tile channel key used as index in internal caches @ ros Tile ROS in range [1....
static const unsigned int MAX_CHAN
Number of channels in drawer.
Gaudi::Property< int > m_goodDrawer
Status is OK if Tile DCS drawer states is like this.
SG::ReadCondHandleKey< TileEMScale > m_emScaleKey
The name of TileEMScale object to get reference HV from Cesium or Laser folder.
float getCesiumReferenceHV(unsigned int drawerIdx, unsigned int channel) const
Return the reference PMT HV set in last cesium calibration.
virtual StatusCode execute(const EventContext &ctx) const override
TileDCSCondAlg(const std::string &name, ISvcLocator *pSvcLocator)
Gaudi::Property< bool > m_readStates
Flag to control reading Tile DCS STATES folder from DB.
Gaudi::Property< bool > m_readHVSet
Flag to control reading Tile DCS HVSET folder from DB.
TileDCSStatus getDCSStatus(unsigned int ros, unsigned int drawer) const
Return TileDCSstatus for given Tile drawer determined by summary states per LVPS.