ATLAS Offline Software
TileDCSCondAlg.h
Go to the documentation of this file.
1 //Dear emacs, this is -*- c++ -*-
2 
3 /*
4  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 #ifndef TILECONDITIONS_TILEDCSCONDALG_H
8 #define TILECONDITIONS_TILEDCSCONDALG_H
9 
10 // Tile includes
14 
15 // Athena includes
20 
21 class TileCablingService;
22 
34  public:
35 
36  TileDCSCondAlg(const std::string& name, ISvcLocator* pSvcLocator);
37  virtual ~TileDCSCondAlg() = default;
38 
39  virtual StatusCode initialize() override;
40  virtual StatusCode execute(const EventContext& ctx) const override;
41  virtual StatusCode finalize() override;
42 
43  private:
44 
45  enum TileModuleType {LONG_BARREL = 0, // LB
46  EXTENDED_BARREL = 1, // EB
47  EXTENDED_BARREL_NO_D4 = 2, // EB without D4: EBA15, EBC18
48  EXTENDED_BARREL_SPECIAL_C10 = 3 // EB with special C10
49  };
50 
51  enum TileLimits {
54  NUMBER_OF_MODULE_TYPES = 2, // LB, EB
55  NUMBER_OF_SPECIAL_MODULE_TYPES = 4 // // LB, EB, EB without D4, EB with special C10
56  };
57 
65  int readConfig(const std::string& fileName, const std::string& subStr, std::vector<std::pair<int, int>>& rosDrawer);
66 
72  int readBadHV(const std::string& fileName);
73 
79  StatusCode fillReferenceHV(TileDCSState& dcsState, SG::WriteCondHandle<TileDCSState>& wh, const EventContext& ctx) const;
80 
88  unsigned int getChannelKey(unsigned int ros, unsigned int drawer, unsigned int channel) const;
89 
94  "HV", "/TILE/DCS/HV", "The Tile DCS HV COOL folder name"};
95 
100  "HVSET", "/TILE/DCS/HVSET", "The Tile DCS HVSET COOL folder name"};
101 
106  "STATES", "/TILE/DCS/STATES", "The Tile DCS STATES COOL folder name"};
107 
112  "TileDCS", "TileDCS", "Output Tile DCS status"};
113 
118  "TileEMScale", "TileEMScale", "Input Tile EMS conditions"};
119 
123  Gaudi::Property<bool> m_readHV{this, "ReadHV", true,
124  "Flag to control reading Tile DCS HV folder from DB"};
125 
129  Gaudi::Property<bool> m_readHVSet{this, "ReadHVSET", false,
130  "Flag to control reading Tile DCS HVSET folder from DB"};
131 
135  Gaudi::Property<bool> m_readStates{this, "ReadSTATES", true,
136  "Flag to control reading Tile DCS STATES folder from DB"};
137 
142  Gaudi::Property<float> m_goodHVLimit{this, "GoodHVLimit", 2.0F,
143  "Status is OK if HV difference is below this limit"};
144 
149  Gaudi::Property<float> m_warningHVLimit{this, "WarningHVLimit", 10.0F,
150  "Mask channels with HV difference above this limit"};
151 
155  Gaudi::Property<int> m_goodDrawer{this, "GoodDrawer", 212222,
156  "Status is OK if Tile DCS drawer states is like this"};
157 
161  Gaudi::Property<std::vector<int>> m_warningDrawer{this, "WarningDrawer",
162  {202221, // module in emergency mode
163  202222, // 830V HV is on, no communication on HV can-bus, status is unknown (assume that it's good)
164  2222, // no communication on HV can-bus, status is unknown (assume that it's good)
165  212020, // no communication on LV can-bus, status is unknown (assume that it's good)
166  202020, // 830V HV is on, no communication on LV and HV can-bus, status is unknown (assume that it's good)
167  2020}, // no communication on LV and HV can-bus, status is unknown (assume that it's good)
168  "Status is WARNING if Tile DCS drawer states is like this"};
169 
173  Gaudi::Property<std::string> m_dcsChHvInCool{this,
174  "DCSChHVInCOOL", "DCSChHVInCOOL.dat",
175  "File name with mapping Tile DCS HV DB COOL channels to ROS and drawer"};
176 
180  Gaudi::Property<std::string> m_dcsChHvSetInCool{this,
181  "DCSChHVSETInCOOL", "DCSChHVSETInCOOL.dat",
182  "File name with mapping Tile DCS HVSET DB COOL channels to ROS and drawer"};
183 
187  Gaudi::Property<std::string> m_dcsChStatesInCool{this,
188  "DCSChStatesInCOOL", "DCSChStatesInCOOL.dat",
189  "File name with mapping Tile DCS STATES DB COOL channels to ROS and drawer"};
190 
195  "TileCablingSvc", "TileCablingSvc", "The Tile cabling service" };
196 
198 
199  std::vector<std::pair<int, int>> m_rosDrawerHV;
200  std::vector<std::pair<int, int>> m_rosDrawerHVSet;
201  std::vector<std::pair<int, int>> m_rosDrawerStates;
202 
203  std::map<int, std::pair<float,float> > m_knownBadHV;
204 
207  bool m_isChannelUsed[4][NUMBER_OF_CHANNELS] = {}; // 0=LB, 1=EB, 2=EB without D4, 3=EB with special C10
208 
209 };
210 
211 // inlines
212 
213 inline
214 unsigned int TileDCSCondAlg::getChannelKey(unsigned int ros, unsigned int drawer, unsigned int channel) const {
215  return ( ((((ros - 1) << 6) | drawer) << 6) | channel );
216 }
217 
218 
219 #endif // TILECONDITIONS_TILEDCSCONDALG_H
TileDCSCondAlg::m_dcsChHvSetInCool
Gaudi::Property< std::string > m_dcsChHvSetInCool
File name with mapping Tile DCS HVSET DB COOL channels to ROS and drawer.
Definition: TileDCSCondAlg.h:180
TileDCSState.h
TileDCSCondAlg::EXTENDED_BARREL_SPECIAL_C10
@ EXTENDED_BARREL_SPECIAL_C10
Definition: TileDCSCondAlg.h:48
TileDCSCondAlg::NUMBER_OF_CHANNELS
@ NUMBER_OF_CHANNELS
Definition: TileDCSCondAlg.h:52
TileDCSCondAlg::m_rosDrawerStates
std::vector< std::pair< int, int > > m_rosDrawerStates
Definition: TileDCSCondAlg.h:201
TileCablingSvc.h
TileDCSCondAlg::m_channel2pmt
int m_channel2pmt[2][NUMBER_OF_HVSET_CHANNELS]
Definition: TileDCSCondAlg.h:205
TileEMScale.h
TileDCSCondAlg::m_rosDrawerHV
std::vector< std::pair< int, int > > m_rosDrawerHV
Definition: TileDCSCondAlg.h:199
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:24
TileDCSCondAlg::TileModuleType
TileModuleType
Definition: TileDCSCondAlg.h:45
CondAttrListCollection.h
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
TileDCSCondAlg::finalize
virtual StatusCode finalize() override
Definition: TileDCSCondAlg.cxx:529
WriteCondHandleKey.h
TileDCSCondAlg::EXTENDED_BARREL_NO_D4
@ EXTENDED_BARREL_NO_D4
Definition: TileDCSCondAlg.h:47
TileDCSCondAlg::m_warningDrawer
Gaudi::Property< std::vector< int > > m_warningDrawer
Status is WARNING if Tile DCS drawer states is like this.
Definition: TileDCSCondAlg.h:161
TileDCSCondAlg::TileLimits
TileLimits
Definition: TileDCSCondAlg.h:51
TileDCSCondAlg::readBadHV
int readBadHV(const std::string &fileName)
Read special deltas for few unstable PMTs.
Definition: TileDCSCondAlg.cxx:386
TileDCSCondAlg::m_dcsChHvInCool
Gaudi::Property< std::string > m_dcsChHvInCool
File name with mapping Tile DCS HV DB COOL channels to ROS and drawer.
Definition: TileDCSCondAlg.h:173
TileDCSCondAlg::m_goodHVLimit
Gaudi::Property< float > m_goodHVLimit
Tile DCS Status is OK if difference between measured and requested HV is below this limit.
Definition: TileDCSCondAlg.h:142
Example_ReadSampleNoise.drawer
drawer
Definition: Example_ReadSampleNoise.py:39
TileDCSCondAlg::m_cabling
const TileCablingService * m_cabling
Definition: TileDCSCondAlg.h:197
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
TileDCSCondAlg::NUMBER_OF_SPECIAL_MODULE_TYPES
@ NUMBER_OF_SPECIAL_MODULE_TYPES
Definition: TileDCSCondAlg.h:55
TileDCSCondAlg::NUMBER_OF_MODULE_TYPES
@ NUMBER_OF_MODULE_TYPES
Definition: TileDCSCondAlg.h:54
TileDCSCondAlg::m_pmt2channel
int m_pmt2channel[2][NUMBER_OF_HVSET_CHANNELS]
Definition: TileDCSCondAlg.h:206
FortranAlgorithmOptions.fileName
fileName
Definition: FortranAlgorithmOptions.py:13
TileDCSCondAlg::fillReferenceHV
StatusCode fillReferenceHV(TileDCSState &dcsState, SG::WriteCondHandle< TileDCSState > &wh, const EventContext &ctx) const
Store reference HV from Tile CES or Laser DB folder in TileDCSState.
Definition: TileDCSCondAlg.cxx:480
TileDCSCondAlg::readConfig
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.
Definition: TileDCSCondAlg.cxx:321
TileDCSCondAlg::m_hvSetKey
SG::ReadCondHandleKey< CondAttrListCollection > m_hvSetKey
The Tile DCS HVSET COOL folder name.
Definition: TileDCSCondAlg.h:99
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TileDCSCondAlg::m_readHV
Gaudi::Property< bool > m_readHV
Flag to control reading Tile DCS HV folder from DB.
Definition: TileDCSCondAlg.h:123
TileDCSCondAlg::m_statesKey
SG::ReadCondHandleKey< CondAttrListCollection > m_statesKey
The Tile DCS STATES COOL folder name.
Definition: TileDCSCondAlg.h:105
TileDCSCondAlg::EXTENDED_BARREL
@ EXTENDED_BARREL
Definition: TileDCSCondAlg.h:46
TileDCSCondAlg::m_hvKey
SG::ReadCondHandleKey< CondAttrListCollection > m_hvKey
The Tile DCS HV COOL folder name.
Definition: TileDCSCondAlg.h:93
TileDCSCondAlg::~TileDCSCondAlg
virtual ~TileDCSCondAlg()=default
TileDCSCondAlg::m_warningHVLimit
Gaudi::Property< float > m_warningHVLimit
Mask channels with difference between measured and requested HV above this limit.
Definition: TileDCSCondAlg.h:149
parseDir.wh
wh
Definition: parseDir.py:46
TileDCSCondAlg::m_isChannelUsed
bool m_isChannelUsed[4][NUMBER_OF_CHANNELS]
Definition: TileDCSCondAlg.h:207
maskDeadModules.ros
ros
Definition: maskDeadModules.py:35
TileCablingService
Definition: TileCablingService.h:23
TileDCSCondAlg::initialize
virtual StatusCode initialize() override
Definition: TileDCSCondAlg.cxx:30
ReadCondHandleKey.h
AthReentrantAlgorithm.h
TileDCSCondAlg::m_dcsChStatesInCool
Gaudi::Property< std::string > m_dcsChStatesInCool
File name with mapping Tile DCS STATES DB COOL channels to ROS and drawer.
Definition: TileDCSCondAlg.h:187
TileDCSCondAlg::m_rosDrawerHVSet
std::vector< std::pair< int, int > > m_rosDrawerHVSet
Definition: TileDCSCondAlg.h:200
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
SG::ReadCondHandleKey< CondAttrListCollection >
TileDCSCondAlg::LONG_BARREL
@ LONG_BARREL
Definition: TileDCSCondAlg.h:45
TileDCSCondAlg::m_cablingSvc
ServiceHandle< TileCablingSvc > m_cablingSvc
Name of Tile cabling service.
Definition: TileDCSCondAlg.h:194
TileDCSState
Condition object to keep Tile DCS status from DB.
Definition: TileDCSState.h:24
SG::WriteCondHandleKey< TileDCSState >
TileDCSCondAlg::m_knownBadHV
std::map< int, std::pair< float, float > > m_knownBadHV
Definition: TileDCSCondAlg.h:203
TileDCSCondAlg::m_dcsStateKey
SG::WriteCondHandleKey< TileDCSState > m_dcsStateKey
The name of TileDCSState object to produce and put into condition store.
Definition: TileDCSCondAlg.h:111
TileDCSCondAlg::getChannelKey
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....
Definition: TileDCSCondAlg.h:214
TileDCSCondAlg
Condition algorithm to prepare TileDCSState object and put it into condition store.
Definition: TileDCSCondAlg.h:33
TileDCSCondAlg::m_goodDrawer
Gaudi::Property< int > m_goodDrawer
Status is OK if Tile DCS drawer states is like this.
Definition: TileDCSCondAlg.h:155
TileDCSCondAlg::m_emScaleKey
SG::ReadCondHandleKey< TileEMScale > m_emScaleKey
The name of TileEMScale object to get reference HV from Cesium or Laser folder.
Definition: TileDCSCondAlg.h:117
TileDCSCondAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition: TileDCSCondAlg.cxx:111
TileDCSCondAlg::TileDCSCondAlg
TileDCSCondAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: TileDCSCondAlg.cxx:22
SG::WriteCondHandle
Definition: WriteCondHandle.h:26
TileDCSCondAlg::NUMBER_OF_HVSET_CHANNELS
@ NUMBER_OF_HVSET_CHANNELS
Definition: TileDCSCondAlg.h:53
TileDCSCondAlg::m_readStates
Gaudi::Property< bool > m_readStates
Flag to control reading Tile DCS STATES folder from DB.
Definition: TileDCSCondAlg.h:135
ServiceHandle< TileCablingSvc >
TileDCSCondAlg::m_readHVSet
Gaudi::Property< bool > m_readHVSet
Flag to control reading Tile DCS HVSET folder from DB.
Definition: TileDCSCondAlg.h:129