ATLAS Offline Software
Loading...
Searching...
No Matches
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))
15class LArHVIdMapping;
16#endif
17
19struct EMBHVPayload;
20
34
36{
37 public:
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
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
92 , HWIdentifier *hvlId=nullptr) const;
93#endif
94
95 private:
96 using idfunc_t = std::function<std::vector<HWIdentifier>(HWIdentifier)>;
97 EMBHVData getData (const idfunc_t& idfunc,
98 const std::vector<const CondAttrListCollection*>& attrLists) const;
99
100 EMBHVManager(const EMBHVManager& right) = delete;
101 EMBHVManager& operator=(const EMBHVManager& right) = delete;
102
103 friend class ImaginaryFriend;
104 class Clockwork;
105 std::unique_ptr<const Clockwork> m_c;
106};
107
108#endif
This class is a collection of AttributeLists where each one is associated with a channel number.
static constexpr double INVALID
int hvLineNo(const EMBHVElectrode &electrode, const int &iGap) const
bool hvOn(const EMBHVElectrode &electrode, const int &iGap) const
std::unique_ptr< Payload > m_payload
double voltage(const EMBHVElectrode &electrode, const int &iGap) const
EMBHVData & operator=(EMBHVData &&other) noexcept
double current(const EMBHVElectrode &electrode, const int &iGap) const
unsigned int beginPhiIndex() const
unsigned int endEtaIndex() const
EMBHVManager & operator=(const EMBHVManager &right)=delete
static unsigned int endSectorIndex()
unsigned int beginEtaIndex() const
EMBHVManager(const EMBHVManager &right)=delete
const EMBHVDescriptor & getDescriptor() const
std::function< std::vector< HWIdentifier >(HWIdentifier)> idfunc_t
static unsigned int beginSectorIndex()
const EMBHVModule & getHVModule(unsigned int iSide, unsigned int iEta, unsigned int iPhi, unsigned int iSector) const
int hvLineNo(const EMBHVElectrode &electrode, int gap, const LArHVIdMapping *hvIdMapping, HWIdentifier *hvlId=nullptr) const
EMBHVData getData(const LArHVIdMapping &hvIdMapping, const std::vector< const CondAttrListCollection * > &attrLists) const
EMBHVData getDataSim() const
unsigned int endPhiIndex() const
static unsigned int beginSideIndex()
friend class ImaginaryFriend
std::unique_ptr< const Clockwork > m_c
static unsigned int endSideIndex()
Describes one HV Module within the EMB.
Definition EMBHVModule.h:20
Definition index.py:1