ATLAS Offline Software
Loading...
Searching...
No Matches
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
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
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
87
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
213inline
214unsigned 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
Base class for conditions algorithms.
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
Base class for conditions algorithms.
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....
Gaudi::Property< std::string > m_dcsChHvInCool
File name with mapping Tile DCS HV DB COOL channels to ROS and drawer.
bool m_isChannelUsed[4][NUMBER_OF_CHANNELS]
std::map< int, std::pair< float, float > > m_knownBadHV
Gaudi::Property< std::string > m_dcsChHvSetInCool
File name with mapping Tile DCS HVSET DB COOL channels to ROS and drawer.
int readBadHV(const std::string &fileName)
Read special deltas for few unstable PMTs.
SG::WriteCondHandleKey< TileDCSState > m_dcsStateKey
The name of TileDCSState object to produce and put into condition store.
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_rosDrawerHV
int m_pmt2channel[2][NUMBER_OF_HVSET_CHANNELS]
Gaudi::Property< float > m_goodHVLimit
Tile DCS Status is OK if difference between measured and requested HV is below this limit.
Gaudi::Property< bool > m_readHVSet
Flag to control reading Tile DCS HVSET folder from DB.
std::vector< std::pair< int, int > > m_rosDrawerStates
virtual ~TileDCSCondAlg()=default
virtual StatusCode initialize() override
Gaudi::Property< float > m_warningHVLimit
Mask channels with difference between measured and requested HV above this limit.
SG::ReadCondHandleKey< CondAttrListCollection > m_hvSetKey
The Tile DCS HVSET COOL folder name.
Gaudi::Property< std::vector< int > > m_warningDrawer
Status is WARNING if Tile DCS drawer states is like this.
Gaudi::Property< int > m_goodDrawer
Status is OK if Tile DCS drawer states is like this.
TileDCSCondAlg(const std::string &name, ISvcLocator *pSvcLocator)
SG::ReadCondHandleKey< CondAttrListCollection > m_hvKey
The Tile DCS HV COOL folder name.
const TileCablingService * m_cabling
virtual StatusCode execute(const EventContext &ctx) const override
int m_channel2pmt[2][NUMBER_OF_HVSET_CHANNELS]
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.
std::vector< std::pair< int, int > > m_rosDrawerHVSet
ServiceHandle< TileCablingSvc > m_cablingSvc
Name of Tile cabling service.
Gaudi::Property< bool > m_readStates
Flag to control reading Tile DCS STATES folder from DB.
virtual StatusCode finalize() override
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.
StatusCode fillReferenceHV(TileDCSState &dcsState, SG::WriteCondHandle< TileDCSState > &wh, const EventContext &ctx) const
Store reference HV from Tile CES or Laser DB folder in TileDCSState.
SG::ReadCondHandleKey< TileEMScale > m_emScaleKey
The name of TileEMScale object to get reference HV from Cesium or Laser folder.
Condition object to keep Tile DCS status from DB.