ATLAS Offline Software
FCALHVManager.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_FCALHVMANAGER_H
6 #define LARHV_FCALHVMANAGER_H
7 
8 #include "LArHV/FCALHVModule.h"
10 #include <memory>
11 #include <functional>
12 
13 #if !(defined(SIMULATIONBASE) || defined(GENERATIONBASE))
14 class LArHVIdMapping;
15 #endif
16 
18 struct FCALHVPayload;
19 
35 {
36  public:
37  class FCALHVData
38  {
39  public:
40  static constexpr double INVALID = -99999;
41  class Payload;
43  FCALHVData (std::unique_ptr<Payload> payload);
46  bool hvOn (const FCALHVLine& line) const;
47  double voltage (const FCALHVLine& line) const;
48  double current (const FCALHVLine& line) const;
49  int hvLineNo (const FCALHVLine& line) const;
50  private:
51  static int index (const FCALHVLine& line) ;
52  std::unique_ptr<Payload> m_payload;
53  };
54 
55  FCALHVManager();
57 
58  // Begin/End side index (0=negative and 1= positive)
59  static unsigned int beginSideIndex() ;
60  static unsigned int endSideIndex() ;
61 
62  static unsigned int beginSectorIndex(unsigned int iSampling) ;
63  static unsigned int endSectorIndex(unsigned int iSampling) ;
64 
65  static unsigned int beginSamplingIndex() ;
66  static unsigned int endSamplingIndex() ;
67 
68  const FCALHVModule& getHVModule(unsigned int iSide
69  , unsigned int iSector
70  , unsigned int iSampling) const;
71 
72  // Get the database payload --- for use by simulation only
73  // (doesn't account for conditions changes)
74  FCALHVData getDataSim() const;
75 
76 #if !(defined(SIMULATIONBASE) || defined(GENERATIONBASE))
77  FCALHVData getData (const LArHVIdMapping& hvIdMapping,
78  const std::vector<const CondAttrListCollection*>& attrLists) const;
79  // Get hvLine for an electrode
80  int hvLineNo(const FCALHVLine& line
81  , const LArHVIdMapping* hvIdMapping
82  , HWIdentifier *hvlId=nullptr) const;
83 #endif
84 
85  private:
86  using idfunc_t = std::function<std::vector<HWIdentifier>(HWIdentifier)>;
87  FCALHVData getData (const idfunc_t& idfunc,
88  const std::vector<const CondAttrListCollection*>& attrLists) const;
89 
90  FCALHVManager(const FCALHVManager& right) = delete;
91  FCALHVManager& operator=(const FCALHVManager& right) = delete;
92 
93  class Clockwork;
94  std::unique_ptr<const Clockwork> m_c;
95 };
96 
97 #endif
FCALHVManager::getData
FCALHVData getData(const LArHVIdMapping &hvIdMapping, const std::vector< const CondAttrListCollection * > &attrLists) const
Definition: FCALHVManager.cxx:276
FCALHVManager::FCALHVData::hvLineNo
int hvLineNo(const FCALHVLine &line) const
Definition: FCALHVManager.cxx:131
checkFileSG.line
line
Definition: checkFileSG.py:75
FCALHVManager::m_c
std::unique_ptr< const Clockwork > m_c
Definition: FCALHVManager.h:93
FCALHVManager::FCALHVManager
FCALHVManager()
Definition: FCALHVManager.cxx:149
FCALHVManager::FCALHVData::m_payload
std::unique_ptr< Payload > m_payload
Definition: FCALHVManager.h:52
FCALHVManager::FCALHVManager
FCALHVManager(const FCALHVManager &right)=delete
FCALHVManager::FCALHVData::voltage
double voltage(const FCALHVLine &line) const
Definition: FCALHVManager.cxx:119
FCALHVManager::hvLineNo
int hvLineNo(const FCALHVLine &line, const LArHVIdMapping *hvIdMapping, HWIdentifier *hvlId=nullptr) const
Definition: FCALHVManager.cxx:284
FCALHVManager::~FCALHVManager
~FCALHVManager()
FCALHVManager::getHVModule
const FCALHVModule & getHVModule(unsigned int iSide, unsigned int iSector, unsigned int iSampling) const
Definition: FCALHVManager.cxx:190
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
FCALHVManager::getDataSim
FCALHVData getDataSim() const
Definition: FCALHVManager.cxx:258
FCALHVLine
Definition: FCALHVLine.h:15
FCALHVManager::FCALHVData::INVALID
static constexpr double INVALID
Definition: FCALHVManager.h:40
FCALHVManager::FCALHVData::current
double current(const FCALHVLine &line) const
Definition: FCALHVManager.cxx:125
FCALHVPayload
Definition: FCALHVPayload.h:8
HWIdentifier.h
FCALHVManager::FCALHVData::Payload
Definition: FCALHVManager.cxx:86
FCALHVManager::FCALHVData::hvOn
bool hvOn(const FCALHVLine &line) const
Definition: FCALHVManager.cxx:113
FCALHVManager::FCALHVData::~FCALHVData
~FCALHVData()
PixelModuleFeMask_create_db.payload
string payload
Definition: PixelModuleFeMask_create_db.py:69
FCALHVManager::endSamplingIndex
static unsigned int endSamplingIndex()
Definition: FCALHVManager.cxx:185
FCALHVManager::operator=
FCALHVManager & operator=(const FCALHVManager &right)=delete
FCALHVManager::beginSectorIndex
static unsigned int beginSectorIndex(unsigned int iSampling)
Definition: FCALHVManager.cxx:167
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
LArHVIdMapping
Definition: LArHVIdMapping.h:21
FCALHVModule.h
FCALHVManager::endSectorIndex
static unsigned int endSectorIndex(unsigned int iSampling)
Definition: FCALHVManager.cxx:172
FCALHVManager::FCALHVData::operator=
FCALHVData & operator=(FCALHVData &&other) noexcept
Definition: FCALHVManager.cxx:102
FCALHVModule
Describes one HV Module within the FCAL.
Definition: FCALHVModule.h:20
FCALHVManager::Clockwork
Definition: FCALHVManager.cxx:57
FCALHVManager::beginSideIndex
static unsigned int beginSideIndex()
Definition: FCALHVManager.cxx:157
FCALHVManager::idfunc_t
std::function< std::vector< HWIdentifier >(HWIdentifier)> idfunc_t
Definition: FCALHVManager.h:86
FCALHVManager::FCALHVData::index
static int index(const FCALHVLine &line)
Definition: FCALHVManager.cxx:137
FCALHVManager
This class provides direct access to information on the HV electrodes within the barrels....
Definition: FCALHVManager.h:35
FCALHVManager::FCALHVData
Definition: FCALHVManager.h:38
FCALHVManager::FCALHVData::FCALHVData
FCALHVData()
FCALHVManager::beginSamplingIndex
static unsigned int beginSamplingIndex()
Definition: FCALHVManager.cxx:180
FCALHVManager::endSideIndex
static unsigned int endSideIndex()
Definition: FCALHVManager.cxx:162