ATLAS Offline Software
Loading...
Searching...
No Matches
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
10#include <memory>
11#include <functional>
12
13#if !(defined(SIMULATIONBASE) || defined(GENERATIONBASE))
14class LArHVIdMapping;
15#endif
16
18struct FCALHVPayload;
19
33
35{
36 public:
38 {
39 public:
40 static constexpr double INVALID = -99999;
41 class Payload;
43 FCALHVData (std::unique_ptr<Payload> payload);
44 FCALHVData& operator= (FCALHVData&& other) noexcept;
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
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
This class is a collection of AttributeLists where each one is associated with a channel number.
bool hvOn(const FCALHVLine &line) const
std::unique_ptr< Payload > m_payload
static constexpr double INVALID
FCALHVData & operator=(FCALHVData &&other) noexcept
double current(const FCALHVLine &line) const
double voltage(const FCALHVLine &line) const
int hvLineNo(const FCALHVLine &line) const
static unsigned int beginSideIndex()
FCALHVManager & operator=(const FCALHVManager &right)=delete
static unsigned int endSamplingIndex()
static unsigned int endSideIndex()
FCALHVData getDataSim() const
int hvLineNo(const FCALHVLine &line, const LArHVIdMapping *hvIdMapping, HWIdentifier *hvlId=nullptr) const
std::unique_ptr< const Clockwork > m_c
FCALHVManager(const FCALHVManager &right)=delete
static unsigned int beginSectorIndex(unsigned int iSampling)
static unsigned int beginSamplingIndex()
const FCALHVModule & getHVModule(unsigned int iSide, unsigned int iSector, unsigned int iSampling) const
static unsigned int endSectorIndex(unsigned int iSampling)
FCALHVData getData(const LArHVIdMapping &hvIdMapping, const std::vector< const CondAttrListCollection * > &attrLists) const
std::function< std::vector< HWIdentifier >(HWIdentifier)> idfunc_t
Describes one HV Module within the FCAL.
Definition index.py:1