ATLAS Offline Software
EMBHVManager.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_EMBHVMANAGER_H
6 #define LARHV_EMBHVMANAGER_H
7 
8 #include "LArHV/EMBHVModule.h"
11 #include <memory>
12 #include <functional>
13 
14 #if !(defined(SIMULATIONBASE) || defined(GENERATIONBASE))
15 class LArHVIdMapping;
16 #endif
17 
19 struct EMBHVPayload;
20 
36 {
37  public:
38  class EMBHVData
39  {
40  public:
41  static constexpr double INVALID = -99999;
42  class Payload;
44  EMBHVData (std::unique_ptr<Payload> payload);
45  EMBHVData& operator= (EMBHVData&& other) noexcept;
47  bool hvOn (const EMBHVElectrode& electrode, const int& iGap) const;
48  double voltage (const EMBHVElectrode& electrode, const int& iGap) const;
49  double current (const EMBHVElectrode& electrode, const int& iGap) const;
50  int hvLineNo (const EMBHVElectrode& electrode, const int& iGap) const;
51  private:
52  static int index (const EMBHVElectrode& electrode) ;
53  std::unique_ptr<Payload> m_payload;
54  };
55 
56  EMBHVManager();
58 
59  // Gets the descriptor. (Not generally for users but nothing to hide here).
60  const EMBHVDescriptor& getDescriptor() const;
61 
62  unsigned int beginPhiIndex() const;
63  unsigned int endPhiIndex() const;
64 
65  unsigned int beginEtaIndex() const;
66  unsigned int endEtaIndex() const;
67 
68  static unsigned int beginSectorIndex() ;
69  static unsigned int endSectorIndex() ;
70 
71  // Returns a high voltage module
72  const EMBHVModule& getHVModule(unsigned int iSide
73  , unsigned int iEta
74  , unsigned int iPhi
75  , unsigned int iSector) const;
76 
77  // Begin/End side index (0=negative and 1= positive)
78  static unsigned int beginSideIndex() ;
79  static unsigned int endSideIndex() ;
80 
81  // Get the database payload --- for use by simulation only
82  // (doesn't account for conditions changes)
83  EMBHVData getDataSim() const;
84 
85 #if !(defined(SIMULATIONBASE) || defined(GENERATIONBASE))
86  EMBHVData getData (const LArHVIdMapping& hvIdMapping,
87  const std::vector<const CondAttrListCollection*>& attrLists) const;
88  // Get hvLine for an electrode
89  int hvLineNo(const EMBHVElectrode& electrode
90  , int gap
91  , const LArHVIdMapping* hvIdMapping) const;
92 #endif
93 
94  private:
95  using idfunc_t = std::function<std::vector<HWIdentifier>(HWIdentifier)>;
96  EMBHVData getData (const idfunc_t& idfunc,
97  const std::vector<const CondAttrListCollection*>& attrLists) const;
98 
99  EMBHVManager(const EMBHVManager& right) = delete;
100  EMBHVManager& operator=(const EMBHVManager& right) = delete;
101 
102  friend class ImaginaryFriend;
103  class Clockwork;
104  std::unique_ptr<const Clockwork> m_c;
105 };
106 
107 #endif
EMBHVManager::EMBHVData::hvOn
bool hvOn(const EMBHVElectrode &electrode, const int &iGap) const
Definition: EMBHVManager.cxx:124
EMBHVManager::beginEtaIndex
unsigned int beginEtaIndex() const
Definition: EMBHVManager.cxx:184
EMBHVElectrode
Definition: EMBHVElectrode.h:15
EMBHVManager::endPhiIndex
unsigned int endPhiIndex() const
Definition: EMBHVManager.cxx:179
EMBHVManager::EMBHVData::m_payload
std::unique_ptr< Payload > m_payload
Definition: EMBHVManager.h:53
EMBHVManager::Clockwork
Definition: EMBHVManager.cxx:64
EMBHVManager::idfunc_t
std::function< std::vector< HWIdentifier >(HWIdentifier)> idfunc_t
Definition: EMBHVManager.h:95
EMBHVManager::beginSectorIndex
static unsigned int beginSectorIndex()
Definition: EMBHVManager.cxx:199
EMBHVManager::EMBHVData::current
double current(const EMBHVElectrode &electrode, const int &iGap) const
Definition: EMBHVManager.cxx:136
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
EMBHVPayload
Definition: EMBHVPayload.h:8
CaloSwCorrections.gap
def gap(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:212
EMBHVManager::EMBHVData::hvLineNo
int hvLineNo(const EMBHVElectrode &electrode, const int &iGap) const
Definition: EMBHVManager.cxx:142
EMBHVManager::beginSideIndex
static unsigned int beginSideIndex()
Definition: EMBHVManager.cxx:209
EMBHVManager::endEtaIndex
unsigned int endEtaIndex() const
Definition: EMBHVManager.cxx:189
EMBHVManager::EMBHVData::Payload
Definition: EMBHVManager.cxx:96
EMBHVManager::getHVModule
const EMBHVModule & getHVModule(unsigned int iSide, unsigned int iEta, unsigned int iPhi, unsigned int iSector) const
Definition: EMBHVManager.cxx:194
EMBHVManager::getDescriptor
const EMBHVDescriptor & getDescriptor() const
Definition: EMBHVManager.cxx:169
EMBHVDescriptor
Definition: EMBHVDescriptor.h:11
EMBHVManager::EMBHVData::voltage
double voltage(const EMBHVElectrode &electrode, const int &iGap) const
Definition: EMBHVManager.cxx:130
EMBHVManager::~EMBHVManager
~EMBHVManager()
EMBHVManager::EMBHVManager
EMBHVManager()
Definition: EMBHVManager.cxx:161
EMBHVManager::EMBHVData::operator=
EMBHVData & operator=(EMBHVData &&other) noexcept
Definition: EMBHVManager.cxx:112
EMBHVManager::operator=
EMBHVManager & operator=(const EMBHVManager &right)=delete
EMBHVManager::ImaginaryFriend
friend class ImaginaryFriend
Definition: EMBHVManager.h:102
EMBHVManager::getDataSim
EMBHVData getDataSim() const
Definition: EMBHVManager.cxx:324
EMBHVManager::m_c
std::unique_ptr< const Clockwork > m_c
Definition: EMBHVManager.h:103
EMBHVManager::beginPhiIndex
unsigned int beginPhiIndex() const
Definition: EMBHVManager.cxx:174
EMBHVManager::EMBHVData
Definition: EMBHVManager.h:39
HWIdentifier.h
EMBHVManager::EMBHVData::INVALID
static constexpr double INVALID
Definition: EMBHVManager.h:41
EMBHVManager
This class provides direct access to information on the HV electrodes within the barrels....
Definition: EMBHVManager.h:36
EMBHVManager::hvLineNo
int hvLineNo(const EMBHVElectrode &electrode, int gap, const LArHVIdMapping *hvIdMapping) const
Definition: EMBHVManager.cxx:351
PixelModuleFeMask_create_db.payload
string payload
Definition: PixelModuleFeMask_create_db.py:69
Trk::iPhi
@ iPhi
Definition: ParamDefs.h:47
EMBHVManager::EMBHVData::index
static int index(const EMBHVElectrode &electrode)
Definition: EMBHVManager.cxx:148
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
LArHVIdMapping
Definition: LArHVIdMapping.h:21
EMBHVDescriptor.h
EMBHVManager::getData
EMBHVData getData(const LArHVIdMapping &hvIdMapping, const std::vector< const CondAttrListCollection * > &attrLists) const
Definition: EMBHVManager.cxx:343
EMBHVManager::endSectorIndex
static unsigned int endSectorIndex()
Definition: EMBHVManager.cxx:204
EMBHVManager::EMBHVData::~EMBHVData
~EMBHVData()
EMBHVModule
Describes one HV Module within the EMB.
Definition: EMBHVModule.h:20
EMBHVManager::endSideIndex
static unsigned int endSideIndex()
Definition: EMBHVManager.cxx:214
xAOD::iEta
setScale setgFexType iEta
Definition: gFexJetRoI_v1.cxx:74
EMBHVModule.h
EMBHVManager::EMBHVManager
EMBHVManager(const EMBHVManager &right)=delete
EMBHVManager::EMBHVData::EMBHVData
EMBHVData()