ATLAS Offline Software
Loading...
Searching...
No Matches
LArADC2MeV.h
Go to the documentation of this file.
1//Dear emacs, this is -*-c++-*-
2
3/*
4 Copyright (C) 2002-2026 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
22
23 public:
24 LArADC2MeV() = delete;
25 LArADC2MeV(const LArOnlineID_Base* onlineID,
26 const LArOnOffIdMapping* cabling,
27 const size_t nGains,
28 const unsigned rampDegree);
29
31
32 const LArVectorProxy ADC2MEV(const HWIdentifier& id, int gain) const {
33 const IdentifierHash h=m_onlineID->channel_Hash(id);
34 return ADC2MEV(h,gain);
35 }
36
37 const LArVectorProxy ADC2MEV(const IdentifierHash& hid, int gain) const {
38 const auto & energyMeV = m_adc2MeV.at(gain); //gain may be 'UNKNOWN', = -1
39 if (!energyMeV.valid.test(hid)) {
40 return LArVectorProxy();
41 }
42 else {
43 const float* ptr1=&(energyMeV.data[hid*m_rampDegree]);
44 return LArVectorProxy(ptr1,ptr1+m_rampDegree);
45 }
46 };
47
48 const LArVectorProxy ADC2MEV(const Identifier& offid, int gain) const {
49 const HWIdentifier hwid=m_cabling->createSignalChannelID(offid);
50 return ADC2MEV(hwid,gain);
51 }
52
53 bool set(const IdentifierHash& hid, const int gain, const std::vector<float>& adc2mev);
54
55 private:
56
57 struct validVec_t {
58 std::vector<float> data;
59 std::bitset<200000> valid;
60 };
61
62 std::array<validVec_t,CaloGain::LARNGAIN> m_adc2MeV{};
63
66 const unsigned m_rampDegree{};
67};
68
70CLASS_DEF( LArADC2MeV, 87645297, 1)
71#include "AthenaKernel/CondCont.h"
73#endif
74
#define CONDCONT_MIXED_DEF(...)
Definition CondCont.h:1446
macros to associate a CLID to a type
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Proxy for accessing a range of float values like a vector.
Header file for AthHistogramAlgorithm.
This is a "hash" representation of an Identifier.
LArADC2MeV()=delete
const LArOnOffIdMapping * m_cabling
Definition LArADC2MeV.h:65
std::array< validVec_t, CaloGain::LARNGAIN > m_adc2MeV
Definition LArADC2MeV.h:62
const unsigned m_rampDegree
Definition LArADC2MeV.h:66
const LArVectorProxy ADC2MEV(const HWIdentifier &id, int gain) const
Definition LArADC2MeV.h:32
const LArOnlineID_Base * m_onlineID
Definition LArADC2MeV.h:64
const LArVectorProxy ADC2MEV(const Identifier &offid, int gain) const
Definition LArADC2MeV.h:48
bool set(const IdentifierHash &hid, const int gain, const std::vector< float > &adc2mev)
const LArVectorProxy ADC2MEV(const IdentifierHash &hid, int gain) const
Definition LArADC2MeV.h:37
Helper for the Liquid Argon Calorimeter cell identifiers.
Proxy for accessing a range of float values like a vector.
std::bitset< 200000 > valid
Definition LArADC2MeV.h:59
std::vector< float > data
Definition LArADC2MeV.h:58