ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
LArCalorimeter
LArRawConditions
LArRawConditions
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
10
#include "
CaloIdentifier/CaloGain.h
"
11
#include "
LArIdentifier/LArOnlineID_Base.h
"
12
#include "
LArCabling/LArOnOffIdMapping.h
"
13
#include "
Identifier/HWIdentifier.h
"
14
#include "
Identifier/IdentifierHash.h
"
15
16
#include <vector>
17
#include <array>
18
#include <bitset>
19
#include "
LArElecCalib/LArVectorProxy.h
"
20
21
class
LArADC2MeV
{
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
30
~LArADC2MeV
();
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
64
const
LArOnlineID_Base
*
m_onlineID
{};
65
const
LArOnOffIdMapping
*
m_cabling
{};
66
const
unsigned
m_rampDegree
{};
67
};
68
69
#include "
AthenaKernel/CLASS_DEF.h
"
70
CLASS_DEF
(
LArADC2MeV
, 87645297, 1)
71
#include "AthenaKernel/CondCont.h"
72
CONDCONT_MIXED_DEF
(
LArADC2MeV
, 155872295);
73
#endif
74
CaloGain.h
CONDCONT_MIXED_DEF
#define CONDCONT_MIXED_DEF(...)
Definition
CondCont.h:1446
CLASS_DEF.h
macros to associate a CLID to a type
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:67
HWIdentifier.h
IdentifierHash.h
LArOnOffIdMapping.h
LArOnlineID_Base.h
LArVectorProxy.h
Proxy for accessing a range of float values like a vector.
h
Header file for AthHistogramAlgorithm.
HWIdentifier
Definition
HWIdentifier.h:13
IdentifierHash
This is a "hash" representation of an Identifier.
Definition
IdentifierHash.h:25
LArADC2MeV
Definition
LArADC2MeV.h:21
LArADC2MeV::LArADC2MeV
LArADC2MeV()=delete
LArADC2MeV::m_cabling
const LArOnOffIdMapping * m_cabling
Definition
LArADC2MeV.h:65
LArADC2MeV::m_adc2MeV
std::array< validVec_t, CaloGain::LARNGAIN > m_adc2MeV
Definition
LArADC2MeV.h:62
LArADC2MeV::m_rampDegree
const unsigned m_rampDegree
Definition
LArADC2MeV.h:66
LArADC2MeV::ADC2MEV
const LArVectorProxy ADC2MEV(const HWIdentifier &id, int gain) const
Definition
LArADC2MeV.h:32
LArADC2MeV::m_onlineID
const LArOnlineID_Base * m_onlineID
Definition
LArADC2MeV.h:64
LArADC2MeV::ADC2MEV
const LArVectorProxy ADC2MEV(const Identifier &offid, int gain) const
Definition
LArADC2MeV.h:48
LArADC2MeV::set
bool set(const IdentifierHash &hid, const int gain, const std::vector< float > &adc2mev)
Definition
LArADC2MeV.cxx:23
LArADC2MeV::ADC2MEV
const LArVectorProxy ADC2MEV(const IdentifierHash &hid, int gain) const
Definition
LArADC2MeV.h:37
LArADC2MeV::~LArADC2MeV
~LArADC2MeV()
Definition
LArADC2MeV.cxx:21
LArOnOffIdMapping
Definition
LArOnOffIdMapping.h:20
LArOnlineID_Base
Helper for the Liquid Argon Calorimeter cell identifiers.
Definition
LArOnlineID_Base.h:97
LArVectorProxy
Proxy for accessing a range of float values like a vector.
Definition
LArVectorProxy.h:38
Identifier
Definition
IdentifierFieldParser.cxx:14
LArADC2MeV::validVec_t
Definition
LArADC2MeV.h:57
LArADC2MeV::validVec_t::valid
std::bitset< 200000 > valid
Definition
LArADC2MeV.h:59
LArADC2MeV::validVec_t::data
std::vector< float > data
Definition
LArADC2MeV.h:58
Generated on
for ATLAS Offline Software by
1.17.0