ATLAS Offline Software
EMECHVManager.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_EMECHVMANAGER_H
6 #define LARHV_EMECHVMANAGER_H
7 
8 #include "LArHV/EMECHVModule.h"
11 #include <memory>
12 #include <functional>
13 
14 #if !(defined(SIMULATIONBASE) || defined(GENERATIONBASE))
15 class LArHVIdMapping;
16 #endif
17 
18 struct EMECHVPayload;
20 
36 {
37  public:
39 
40  class EMECHVData
41  {
42  public:
43  static constexpr double INVALID = -99999;
44  class Payload;
46  EMECHVData (std::unique_ptr<Payload> payload);
49  bool hvOn (const EMECHVElectrode& electrode, const int& iGap) const;
50  double voltage (const EMECHVElectrode& electrode, const int& iGap) const;
51  double current (const EMECHVElectrode& electrode, const int& iGap) const;
52  int hvLineNo (const EMECHVElectrode& electrode, const int& iGap) const;
53  private:
54  static int index (const EMECHVElectrode& electrode) ;
55  std::unique_ptr<Payload> m_payload;
56  };
57 
58  EMECHVManager(IOType wheel);
60 
61  const EMECHVDescriptor& getDescriptor() const;
62 
63  unsigned int beginPhiIndex() const;
64  unsigned int endPhiIndex() const;
65 
66  unsigned int beginEtaIndex() const;
67  unsigned int endEtaIndex() const;
68 
69  const EMECHVModule& getHVModule(unsigned int iSide
70  , unsigned int iEta
71  , unsigned int iPhi
72  , unsigned int iSector) const;
73 
74  // Begin/End side index (0=negative and 1= positive)
75  static unsigned int beginSideIndex() ;
76  static unsigned int endSideIndex() ;
77 
78  unsigned int beginSectorIndex() const;
79  unsigned int endSectorIndex() const;
80 
81  // Gets the Wheel, 0 for the Outer Wheel HV Manager and 1 for the inner Wheel HV Manager
83 
84  // Get the database payload --- for use by simulation only
85  // (doesn't account for conditions changes)
86  EMECHVData getDataSim() const;
87 
88 #if !(defined(SIMULATIONBASE) || defined(GENERATIONBASE))
89  EMECHVData getData (const LArHVIdMapping& hvIdMapping,
90  const std::vector<const CondAttrListCollection*>& attrLists) const;
91  // Get hvLine for an electrode
92  int hvLineNo(const EMECHVElectrode& electrode
93  , int gap
94  , const LArHVIdMapping* hvIdMapping) const;
95 #endif
96 
97  private:
98  using idfunc_t = std::function<std::vector<HWIdentifier>(HWIdentifier)>;
99  EMECHVData getData (const idfunc_t& idfunc,
100  const std::vector<const CondAttrListCollection*>& attrLists) const;
101 
102  EMECHVManager& operator=(const EMECHVManager& right) = delete;
103  EMECHVManager(const EMECHVManager& right) = delete;
104 
105  class Clockwork;
106  std::unique_ptr<const Clockwork> m_c;
107 };
108 
109 #endif
EMECHVManager::EMECHVData::hvOn
bool hvOn(const EMECHVElectrode &electrode, const int &iGap) const
Definition: EMECHVManager.cxx:131
EMECHVManager::beginSideIndex
static unsigned int beginSideIndex()
Definition: EMECHVManager.cxx:230
EMECHVDescriptor.h
EMECHVManager::getHVModule
const EMECHVModule & getHVModule(unsigned int iSide, unsigned int iEta, unsigned int iPhi, unsigned int iSector) const
Definition: EMECHVManager.cxx:222
EMECHVManager::getData
EMECHVData getData(const LArHVIdMapping &hvIdMapping, const std::vector< const CondAttrListCollection * > &attrLists) const
Definition: EMECHVManager.cxx:388
EMECHVManager::endSectorIndex
unsigned int endSectorIndex() const
Definition: EMECHVManager.cxx:245
EMECHVManager::EMECHVData::voltage
double voltage(const EMECHVElectrode &electrode, const int &iGap) const
Definition: EMECHVManager.cxx:137
EMECHVManager::endEtaIndex
unsigned int endEtaIndex() const
Definition: EMECHVManager.cxx:217
EMECHVManager::IOType
EMECHVModule::IOType IOType
Definition: EMECHVManager.h:38
EMECHVManager::endPhiIndex
unsigned int endPhiIndex() const
Definition: EMECHVManager.cxx:207
EMECHVManager::EMECHVData::operator=
EMECHVData & operator=(EMECHVData &&other) noexcept
Definition: EMECHVManager.cxx:118
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
CaloSwCorrections.gap
def gap(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:212
EMECHVModule
Definition: EMECHVModule.h:20
EMECHVManager::EMECHVManager
EMECHVManager(const EMECHVManager &right)=delete
EMECHVManager::getWheelIndex
EMECHVManager::IOType getWheelIndex() const
Definition: EMECHVManager.cxx:250
EMECHVManager::beginEtaIndex
unsigned int beginEtaIndex() const
Definition: EMECHVManager.cxx:212
EMECHVManager::EMECHVData::hvLineNo
int hvLineNo(const EMECHVElectrode &electrode, const int &iGap) const
Definition: EMECHVManager.cxx:149
EMECHVDescriptor
Definition: EMECHVDescriptor.h:11
EMECHVManager::m_c
std::unique_ptr< const Clockwork > m_c
Definition: EMECHVManager.h:105
EMECHVManager::EMECHVData
Definition: EMECHVManager.h:41
EMECHVManager::EMECHVData::m_payload
std::unique_ptr< Payload > m_payload
Definition: EMECHVManager.h:55
EMECHVManager::EMECHVData::INVALID
static constexpr double INVALID
Definition: EMECHVManager.h:43
EMECHVManager::EMECHVData::current
double current(const EMECHVElectrode &electrode, const int &iGap) const
Definition: EMECHVManager.cxx:143
EMECHVManager::operator=
EMECHVManager & operator=(const EMECHVManager &right)=delete
EMECHVPayload
Definition: EMECHVPayload.h:8
EMECHVManager::idfunc_t
std::function< std::vector< HWIdentifier >(HWIdentifier)> idfunc_t
Definition: EMECHVManager.h:98
HWIdentifier.h
EMECHVManager::EMECHVData::~EMECHVData
~EMECHVData()
EMECHVManager::endSideIndex
static unsigned int endSideIndex()
Definition: EMECHVManager.cxx:235
EMECHVManager::Clockwork
Definition: EMECHVManager.cxx:65
EMECHVManager::~EMECHVManager
~EMECHVManager()
PixelModuleFeMask_create_db.payload
string payload
Definition: PixelModuleFeMask_create_db.py:69
Trk::iPhi
@ iPhi
Definition: ParamDefs.h:53
EMECHVManager::getDataSim
EMECHVData getDataSim() const
Definition: EMECHVManager.cxx:370
EMECHVManager::EMECHVManager
EMECHVManager(IOType wheel)
Definition: EMECHVManager.cxx:172
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
LArHVIdMapping
Definition: LArHVIdMapping.h:21
EMECHVManager::beginPhiIndex
unsigned int beginPhiIndex() const
Definition: EMECHVManager.cxx:202
EMECHVModule::IOType
IOType
Definition: EMECHVModule.h:22
EMECHVManager::getDescriptor
const EMECHVDescriptor & getDescriptor() const
Definition: EMECHVManager.cxx:197
EMECHVManager::beginSectorIndex
unsigned int beginSectorIndex() const
Definition: EMECHVManager.cxx:240
EMECHVManager::hvLineNo
int hvLineNo(const EMECHVElectrode &electrode, int gap, const LArHVIdMapping *hvIdMapping) const
Definition: EMECHVManager.cxx:396
EMECHVManager::EMECHVData::index
static int index(const EMECHVElectrode &electrode)
Definition: EMECHVManager.cxx:155
EMECHVManager::EMECHVData::Payload
Definition: EMECHVManager.cxx:101
EMECHVElectrode
Definition: EMECHVElectrode.h:15
EMECHVManager
This class provides direct access to information on the HV electrodes within the EMEC....
Definition: EMECHVManager.h:36
EMECHVModule.h
EMECHVManager::EMECHVData::EMECHVData
EMECHVData()
xAOD::iEta
setScale setgFexType iEta
Definition: gFexJetRoI_v1.cxx:74