ATLAS Offline Software
HECHVManager.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef LARHV_HECHVMANAGER_H
6 #define LARHV_HECHVMANAGER_H
7 
9 #include "LArHV/HECHVModule.h"
11 #include <memory>
12 #include <functional>
13 
14 #if !(defined(SIMULATIONBASE) || defined(GENERATIONBASE))
15 class LArHVIdMapping;
16 #endif
17 
19 struct HECHVPayload;
20 
36 {
37  public:
38  class HECHVData
39  {
40  public:
41  static constexpr double INVALID = -99999;
42  class Payload;
44  HECHVData (std::unique_ptr<Payload> payload);
45  HECHVData& operator= (HECHVData&& other) noexcept;
47  bool hvOn (const HECHVSubgap& subgap) const;
48  double voltage (const HECHVSubgap& subgap) const;
49  double current (const HECHVSubgap& subgap) const;
50  int hvLineNo (const HECHVSubgap& subgap) const;
51  private:
52  static int index (const HECHVSubgap& subgap) ;
53  std::unique_ptr<Payload> m_payload;
54  };
55 
56  HECHVManager();
58 
59  const HECHVDescriptor& getDescriptor() const;
60 
61  // Begin/End side index (0=negative and 1= positive)
62  static unsigned int beginSideIndex() ;
63  static unsigned int endSideIndex() ;
64 
65  static unsigned int beginPhiIndex() ;
66  static unsigned int endPhiIndex() ;
67 
68  static unsigned int beginSamplingIndex() ;
69  static unsigned int endSamplingIndex() ;
70 
71  const HECHVModule& getHVModule(unsigned int iSide
72  , unsigned int iPhi
73  , unsigned int iSampling) const;
74 
75  // Get the database payload --- for use by simulation only
76  // (doesn't account for conditions changes)
77  HECHVData getDataSim() const;
78 
79 #if !(defined(SIMULATIONBASE) || defined(GENERATIONBASE))
80  HECHVData getData (const LArHVIdMapping& hvIdMapping,
81  const std::vector<const CondAttrListCollection*>& attrLists) const;
82  // Get hvLine for a subgap
83  int hvLineNo(const HECHVSubgap& subgap
84  , const LArHVIdMapping* hvIdMapping
85  , HWIdentifier *hvlId=nullptr) const;
86 #endif
87 
88  private:
89  using idfunc_t = std::function<std::vector<HWIdentifier>(HWIdentifier)>;
90  HECHVData getData (const idfunc_t& idfunc,
91  const std::vector<const CondAttrListCollection*>& attrLists) const;
92 
93  HECHVManager(const HECHVManager& right) = delete;
94  HECHVManager& operator=(const HECHVManager& right) = delete;
95 
96  class Clockwork;
97  std::unique_ptr<const Clockwork> m_c;
98 };
99 
100 #endif
HECHVDescriptor
Definition: HECHVDescriptor.h:11
HECHVManager::m_c
std::unique_ptr< const Clockwork > m_c
Definition: HECHVManager.h:96
HECHVModule
Describes one HV Module within the HEC.
Definition: HECHVModule.h:21
HECHVManager::beginSideIndex
static unsigned int beginSideIndex()
Definition: HECHVManager.cxx:164
HECHVManager::getDataSim
HECHVData getDataSim() const
Definition: HECHVManager.cxx:272
HECHVManager::beginPhiIndex
static unsigned int beginPhiIndex()
Definition: HECHVManager.cxx:174
HECHVManager::getData
HECHVData getData(const LArHVIdMapping &hvIdMapping, const std::vector< const CondAttrListCollection * > &attrLists) const
Definition: HECHVManager.cxx:290
HECHVPayload
Definition: HECHVPayload.h:8
HECHVManager::HECHVData::index
static int index(const HECHVSubgap &subgap)
Definition: HECHVManager.cxx:142
HECHVDescriptor.h
HECHVManager::HECHVData::hvLineNo
int hvLineNo(const HECHVSubgap &subgap) const
Definition: HECHVManager.cxx:136
HECHVManager::HECHVData::operator=
HECHVData & operator=(HECHVData &&other) noexcept
Definition: HECHVManager.cxx:106
HECHVManager::HECHVData::HECHVData
HECHVData()
HWIdentifier
Definition: HWIdentifier.h:13
CondAttrListCollection
This class is a collection of AttributeLists where each one is associated with a channel number....
Definition: CondAttrListCollection.h:52
HECHVManager::HECHVData
Definition: HECHVManager.h:39
HECHVManager::endSideIndex
static unsigned int endSideIndex()
Definition: HECHVManager.cxx:169
HECHVManager::idfunc_t
std::function< std::vector< HWIdentifier >(HWIdentifier)> idfunc_t
Definition: HECHVManager.h:89
HECHVManager::HECHVData::voltage
double voltage(const HECHVSubgap &subgap) const
Definition: HECHVManager.cxx:124
HECHVManager::endSamplingIndex
static unsigned int endSamplingIndex()
Definition: HECHVManager.cxx:189
HECHVManager::HECHVData::~HECHVData
~HECHVData()
HECHVManager::getDescriptor
const HECHVDescriptor & getDescriptor() const
Definition: HECHVManager.cxx:159
HECHVManager::HECHVManager
HECHVManager()
Definition: HECHVManager.cxx:154
HECHVManager::HECHVData::m_payload
std::unique_ptr< Payload > m_payload
Definition: HECHVManager.h:53
HECHVManager::~HECHVManager
~HECHVManager()
HECHVManager::HECHVData::current
double current(const HECHVSubgap &subgap) const
Definition: HECHVManager.cxx:130
HWIdentifier.h
PixelModuleFeMask_create_db.payload
string payload
Definition: PixelModuleFeMask_create_db.py:69
Trk::iPhi
@ iPhi
Definition: ParamDefs.h:47
HECHVManager
This class provides direct access to information on the HV electrodes within the barrels....
Definition: HECHVManager.h:36
HECHVManager::HECHVData::hvOn
bool hvOn(const HECHVSubgap &subgap) const
Definition: HECHVManager.cxx:118
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
LArHVIdMapping
Definition: LArHVIdMapping.h:21
HECHVManager::endPhiIndex
static unsigned int endPhiIndex()
Definition: HECHVManager.cxx:179
HECHVModule.h
HECHVManager::Clockwork
Definition: HECHVManager.cxx:60
HECHVManager::beginSamplingIndex
static unsigned int beginSamplingIndex()
Definition: HECHVManager.cxx:184
HECHVManager::HECHVData::Payload
Definition: HECHVManager.cxx:90
HECHVManager::hvLineNo
int hvLineNo(const HECHVSubgap &subgap, const LArHVIdMapping *hvIdMapping, HWIdentifier *hvlId=nullptr) const
Definition: HECHVManager.cxx:298
HECHVManager::operator=
HECHVManager & operator=(const HECHVManager &right)=delete
HECHVManager::HECHVManager
HECHVManager(const HECHVManager &right)=delete
HECHVSubgap
Definition: HECHVSubgap.h:15
HECHVManager::HECHVData::INVALID
static constexpr double INVALID
Definition: HECHVManager.h:41
HECHVManager::getHVModule
const HECHVModule & getHVModule(unsigned int iSide, unsigned int iPhi, unsigned int iSampling) const
Definition: HECHVManager.cxx:194