ATLAS Offline Software
LArOFC.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3 */
4 
7 
8 #include <cassert>
9 
10 LArOFC::LArOFC(const LArOnlineID_Base* onlineID, const LArOnOffIdMapping* cabling, const size_t nGains) :
11  m_onlineID(onlineID),
12  m_cabling(cabling) {
13 
14  assert(m_onlineID);
15  assert(nGains<=CaloGain::LARNGAIN && nGains>0);
16 
17  for (size_t i=0;i<nGains;++i) {
18  m_OFCa[i].resize(onlineID->channelHashMax());
19  m_OFCb[i].resize(onlineID->channelHashMax());
20  }
21 
22 }
23 
25 
26 bool LArOFC::setOFC(const IdentifierHash& hid, const int gain, std::pair<std::vector<float>,std::vector<float>> ofcab) {
27  if (gain >= CaloGain::LARNGAIN || hid >= m_OFCa[gain].size()) return false;
28  m_OFCa[gain][hid].swap(ofcab.first);
29  m_OFCb[gain][hid].swap(ofcab.second);
30  return true;
31 }
32 
33 ILArOFC::OFCRef_t LArOFC::OFC_a(const HWIdentifier &hwid, int gain, int) const {
34  const IdentifierHash hid = m_onlineID->channel_Hash(hwid);
35  return m_OFCa[gain][hid];
36 }
37 
38 ILArOFC::OFCRef_t LArOFC::OFC_a(const Identifier &id, int gain, int) const {
40  return this->OFC_a(hwid, gain);
41 }
42 
43 ILArOFC::OFCRef_t LArOFC::OFC_b(const HWIdentifier &hwid, int gain, int) const {
44  const IdentifierHash hid = m_onlineID->channel_Hash(hwid);
45  return m_OFCb[gain][hid];
46 }
47 
48 ILArOFC::OFCRef_t LArOFC::OFC_b(const Identifier &id, int gain, int) const {
50  return this->OFC_b(hwid, gain);
51 }
52 
53 float LArOFC::timeOffset(const HWIdentifier&, int) const {
54  return 0;
55 }
56 float LArOFC::timeOffset(const Identifier&, int) const {
57  return 0;
58 }
59 unsigned LArOFC::nTimeBins(const HWIdentifier&, int) const {
60  return 1;
61 }
62 unsigned LArOFC::nTimeBins(const Identifier&, int) const {
63  return 1;
64 }
65 float LArOFC::timeBinWidth(const HWIdentifier&, int) const {
66  return 1;
67 }
68 float LArOFC::timeBinWidth(const Identifier&, int) const {
69  return 1;
70 }
LArOFC::timeBinWidth
virtual float timeBinWidth(const HWIdentifier &id, int gain) const
Definition: LArOFC.cxx:65
LArOnlineID_Base::channel_Hash
IdentifierHash channel_Hash(HWIdentifier channelId) const
Create channel_hash from channel_Id.
Definition: LArOnlineID_Base.cxx:1632
LArOFC::m_cabling
const LArOnOffIdMapping * m_cabling
Definition: LArOFC.h:65
LArOnlineID_Base.h
CaloCondBlobAlgs_fillNoiseFromASCII.gain
gain
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:110
ReadCellNoiseFromCool.cabling
cabling
Definition: ReadCellNoiseFromCool.py:154
LArOFC::OFC_b
virtual ILArOFC::OFCRef_t OFC_b(const HWIdentifier &id, int gain, int tbin=0) const
Definition: LArOFC.cxx:43
HWIdentifier
Definition: HWIdentifier.h:13
CaloGain::LARNGAIN
@ LARNGAIN
Definition: CaloGain.h:19
LArOFC::nTimeBins
virtual unsigned nTimeBins(const HWIdentifier &id, int gain) const
Definition: LArOFC.cxx:59
LArOFC::m_onlineID
const LArOnlineID_Base * m_onlineID
Definition: LArOFC.h:64
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
lumiFormat.i
int i
Definition: lumiFormat.py:85
LArOFC::~LArOFC
virtual ~LArOFC()
Definition: LArOFC.cxx:24
LArOnOffIdMapping::createSignalChannelID
HWIdentifier createSignalChannelID(const Identifier &id) const
create a HWIdentifier from an Identifier (not inline)
Definition: LArOnOffIdMapping.h:126
LArOFC.h
LArOFC::setOFC
bool setOFC(const IdentifierHash &hid, const int gain, std::pair< std::vector< float >, std::vector< float >> ofcab)
Definition: LArOFC.cxx:26
LArOnlineID_Base
Helper for the Liquid Argon Calorimeter cell identifiers.
Definition: LArOnlineID_Base.h:105
LArOnlineID_Base::channelHashMax
size_type channelHashMax(void) const
Define channel hash tables max size.
Definition: LArOnlineID_Base.cxx:1897
LArOFC::m_OFCb
std::array< vecOFCa, CaloGain::LARNGAIN > m_OFCb
Definition: LArOFC.h:62
LArOFC::timeOffset
virtual float timeOffset(const HWIdentifier &id, int gain) const
Definition: LArOFC.cxx:53
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
LArOFC::OFC_a
virtual ILArOFC::OFCRef_t OFC_a(const HWIdentifier &id, int gain, int tbin=0) const
access to OFCs by online ID, gain, and tbin (!=0 for testbeam)
Definition: LArOFC.cxx:33
LArOFC::m_OFCa
std::array< vecOFCa, CaloGain::LARNGAIN > m_OFCa
Definition: LArOFC.h:61
LArOFC::LArOFC
LArOFC(const LArOnlineID_Base *onlineID, const LArOnOffIdMapping *cabling, const size_t nGains)
Definition: LArOFC.cxx:10
LArVectorProxy
Proxy for accessing a range of float values like a vector.
Definition: LArVectorProxy.h:38
LArOnOffIdMapping
Definition: LArOnOffIdMapping.h:20
Identifier
Definition: IdentifierFieldParser.cxx:14