ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
LArCalorimeter
LArRawConditions
src
LArADC2MeV.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3
*/
4
#include "
LArRawConditions/LArADC2MeV.h
"
5
#include "
LArIdentifier/LArOnlineID_Base.h
"
6
7
#include <cassert>
8
9
LArADC2MeV::LArADC2MeV
(
const
LArOnlineID_Base
* onlineID,
const
LArOnOffIdMapping
* cabling,
const
size_t
nGains
,
const
unsigned
rampSize=2) :
10
m_onlineID
(onlineID),
11
m_cabling
(cabling),
12
m_rampDegree
(rampSize),
13
m_nGains
(
nGains
) {
14
assert(
m_onlineID
);
15
assert(
nGains<=CaloGain::LARNGAIN && nGains>
0);
16
17
for
(
size_t
i=0;i<
nGains
;++i) {
18
m_adc2MeV
[i].data.resize(onlineID->
channelHashMax
()*
m_rampDegree
,1.0);
19
}
20
}
21
22
LArADC2MeV::~LArADC2MeV
() {}
23
24
bool
LArADC2MeV::set
(
const
IdentifierHash
& hid,
const
int
gain,
const
std::vector<float>& adc2mev) {
25
if
(gain>=(
int
)
m_adc2MeV
.size() || hid*
m_rampDegree
>=
m_adc2MeV
[gain].data.size()) {
26
//std::cout << "hid="<< hid << ",size overrun: " << gain << " ," << m_adc2MeV.size() << " ," << hid*m_rampDegree << " ," << m_adc2MeV[gain].data.size() << std::endl;
27
return
false
;
28
}
29
if
(adc2mev.size()!=
m_rampDegree
) {
30
//std::cout << "hid="<< hid << ", Got deg " << adc2mev.size() << ", expected " << m_rampDegree << std::endl;
31
return
false
;
32
}
33
m_adc2MeV
[gain].valid.set(hid);
34
std::vector<float>::iterator it=
m_adc2MeV
[gain].data.begin()+hid*
m_rampDegree
;
35
std::copy(adc2mev.begin(),adc2mev.end(),it);
36
37
return
true
;
38
}
39
LArADC2MeV.h
LArOnlineID_Base.h
IdentifierHash
This is a "hash" representation of an Identifier.
Definition
IdentifierHash.h:25
LArADC2MeV::LArADC2MeV
LArADC2MeV()=delete
LArADC2MeV::m_nGains
const int m_nGains
Definition
LArADC2MeV.h:69
LArADC2MeV::m_cabling
const LArOnOffIdMapping * m_cabling
Definition
LArADC2MeV.h:67
LArADC2MeV::m_adc2MeV
std::array< validVec_t, CaloGain::LARNGAIN > m_adc2MeV
Definition
LArADC2MeV.h:64
LArADC2MeV::nGains
int nGains() const
Definition
LArADC2MeV.h:55
LArADC2MeV::m_rampDegree
const unsigned m_rampDegree
Definition
LArADC2MeV.h:68
LArADC2MeV::m_onlineID
const LArOnlineID_Base * m_onlineID
Definition
LArADC2MeV.h:66
LArADC2MeV::set
bool set(const IdentifierHash &hid, const int gain, const std::vector< float > &adc2mev)
Definition
LArADC2MeV.cxx:24
LArADC2MeV::~LArADC2MeV
~LArADC2MeV()
Definition
LArADC2MeV.cxx:22
LArOnOffIdMapping
Definition
LArOnOffIdMapping.h:20
LArOnlineID_Base
Helper for the Liquid Argon Calorimeter cell identifiers.
Definition
LArOnlineID_Base.h:97
LArOnlineID_Base::channelHashMax
size_type channelHashMax() const
Define channel hash tables max size.
Definition
LArOnlineID_Base.cxx:1607
Generated on
for ATLAS Offline Software by
1.17.0