ATLAS Offline Software
LArADC2MeV.h
Go to the documentation of this file.
1 //Dear emacs, this is -*-c++-*-
2 
3 /*
4  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 #ifndef LARRAWCONDITIONS_LARADC2MEV
8 #define LARRAWCONDITIONS_LARADC2MEV
9 
15 
16 #include <vector>
17 #include <array>
18 #include <bitset>
20 
21 class LArADC2MeV {
22 
23  public:
24  LArADC2MeV() = delete;
25  LArADC2MeV(const LArOnlineID_Base* onlineID,
27  const size_t nGains,
28  const unsigned rampDegree);
29 
30  ~LArADC2MeV();
31 
32  const LArVectorProxy ADC2MEV(const HWIdentifier& id, int gain) const {
34  return ADC2MEV(h,gain);
35  }
36 
37  const LArVectorProxy ADC2MEV(const IdentifierHash& hid, int gain) const {
38  if (!m_adc2MeV[gain].valid.test(hid)) {
39  return LArVectorProxy();
40  }
41  else {
42  const float* ptr1=&(m_adc2MeV[gain].data[hid*m_rampDegree]);
43  return LArVectorProxy(ptr1,ptr1+m_rampDegree);
44  }
45  };
46 
47  const LArVectorProxy ADC2MEV(const Identifier& offid, int gain) const {
48  const HWIdentifier hwid=m_cabling->createSignalChannelID(offid);
49  return ADC2MEV(hwid,gain);
50  }
51 
52  bool set(const IdentifierHash& hid, const int gain, const std::vector<float>& adc2mev);
53 
54  private:
55 
56  struct validVec_t {
57  std::vector<float> data;
58  std::bitset<200000> valid;
59  };
60 
61  std::array<validVec_t,CaloGain::LARNGAIN> m_adc2MeV;
62 
65  const unsigned m_rampDegree;
66 };
67 
68 #include "AthenaKernel/CLASS_DEF.h"
69 CLASS_DEF( LArADC2MeV, 87645297, 1)
70 #include "AthenaKernel/CondCont.h"
72 #endif
73 
LArADC2MeV::LArADC2MeV
LArADC2MeV()=delete
LArADC2MeV::ADC2MEV
const LArVectorProxy ADC2MEV(const HWIdentifier &id, int gain) const
Definition: LArADC2MeV.h:32
LArOnlineID_Base::channel_Hash
IdentifierHash channel_Hash(HWIdentifier channelId) const
Create channel_hash from channel_Id.
Definition: LArOnlineID_Base.cxx:1636
LArADC2MeV::ADC2MEV
const LArVectorProxy ADC2MEV(const IdentifierHash &hid, int gain) const
Definition: LArADC2MeV.h:37
LArOnlineID_Base.h
CaloCondBlobAlgs_fillNoiseFromASCII.gain
gain
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:110
ReadCellNoiseFromCool.cabling
cabling
Definition: ReadCellNoiseFromCool.py:154
LArVectorProxy.h
Proxy for accessing a range of float values like a vector.
LArADC2MeV::~LArADC2MeV
~LArADC2MeV()
Definition: LArADC2MeV.cxx:21
HWIdentifier
Definition: HWIdentifier.h:13
LArADC2MeV::validVec_t::valid
std::bitset< 200000 > valid
Definition: LArADC2MeV.h:58
LArADC2MeV::m_rampDegree
const unsigned m_rampDegree
Definition: LArADC2MeV.h:65
calibdata.valid
list valid
Definition: calibdata.py:45
LArOnOffIdMapping.h
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
LArADC2MeV::validVec_t
Definition: LArADC2MeV.h:56
LArADC2MeV::m_adc2MeV
std::array< validVec_t, CaloGain::LARNGAIN > m_adc2MeV
Definition: LArADC2MeV.h:61
LArADC2MeV::set
bool set(const IdentifierHash &hid, const int gain, const std::vector< float > &adc2mev)
Definition: LArADC2MeV.cxx:23
LArOnOffIdMapping::createSignalChannelID
HWIdentifier createSignalChannelID(const Identifier &id) const
create a HWIdentifier from an Identifier (not inline)
Definition: LArOnOffIdMapping.h:126
LArADC2MeV::ADC2MEV
const LArVectorProxy ADC2MEV(const Identifier &offid, int gain) const
Definition: LArADC2MeV.h:47
LArOnlineID_Base
Helper for the Liquid Argon Calorimeter cell identifiers.
Definition: LArOnlineID_Base.h:105
HWIdentifier.h
IdentifierHash.h
LArADC2MeV
Definition: LArADC2MeV.h:21
h
LArADC2MeV::m_onlineID
const LArOnlineID_Base * m_onlineID
Definition: LArADC2MeV.h:63
LArADC2MeV::m_cabling
const LArOnOffIdMapping * m_cabling
Definition: LArADC2MeV.h:64
CONDCONT_MIXED_DEF
CONDCONT_MIXED_DEF(LArADC2MeV, 155872295)
CLASS_DEF
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Definition: Control/AthenaKernel/AthenaKernel/CLASS_DEF.h:64
LArADC2MeV::validVec_t::data
std::vector< float > data
Definition: LArADC2MeV.h:57
IdentifierHash
Definition: IdentifierHash.h:38
CaloGain.h
CLASS_DEF.h
macros to associate a CLID to a type
LArVectorProxy
Proxy for accessing a range of float values like a vector.
Definition: LArVectorProxy.h:38
LArOnOffIdMapping
Definition: LArOnOffIdMapping.h:20