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-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
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 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
69CLASS_DEF( LArADC2MeV, 87645297, 1)
70#include "AthenaKernel/CondCont.h"
72#endif
73
#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:64
std::array< validVec_t, CaloGain::LARNGAIN > m_adc2MeV
Definition LArADC2MeV.h:61
const unsigned m_rampDegree
Definition LArADC2MeV.h:65
const LArVectorProxy ADC2MEV(const HWIdentifier &id, int gain) const
Definition LArADC2MeV.h:32
const LArOnlineID_Base * m_onlineID
Definition LArADC2MeV.h:63
const LArVectorProxy ADC2MEV(const Identifier &offid, int gain) const
Definition LArADC2MeV.h:47
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:58
std::vector< float > data
Definition LArADC2MeV.h:57