ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonCalib
MdtCalib
MdtCalibData
src
MdtTubeCalibContainer.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
#include <
MdtCalibData/MdtTubeCalibContainer.h
>
5
#include <algorithm>
//std::max
6
#include <utility>
//std::in_range
7
8
namespace
MuonCalib
{
9
MdtTubeCalibContainer::MdtTubeCalibContainer
(
const
Muon::IMuonIdHelperSvc
*
idHelperSvc
,
10
const
Identifier
& moduleID):
11
m_moduleID
{
idHelperSvc
->chamberId(moduleID)},
12
m_idHelperSvc
{
idHelperSvc
}{
13
const
int
nMl =
m_idHelper
.numberOfMultilayers(moduleID);
14
if
(!std::in_range<std::uint8_t>(nMl)) {
15
throw
std::runtime_error(
"Invalid number of multilayers for module"
);
16
}
17
m_nMl
=
static_cast<
std::uint8_t
>
(nMl);
18
const
Identifier
secondMl =
m_idHelper
.multilayerID(
m_moduleID
,
m_nMl
);
19
m_nLayers
= std::max(
m_idHelper
.tubeLayerMax(
m_moduleID
),
20
m_idHelper
.tubeLayerMax(secondMl));
21
m_nTubes
= std::max(
m_idHelper
.tubeMax(
m_moduleID
),
22
m_idHelper
.tubeMax(secondMl));
23
m_data
.resize(
m_nLayers
*
m_nTubes
*
m_nMl
);
24
}
25
bool
MdtTubeCalibContainer::setCalib
(
SingleTubeCalib
val,
const
Identifier
& tubeId, MsgStream&
msg
) {
27
const
unsigned
int
index
=
vectorIndex
(tubeId);
28
if
(
m_moduleID
!=
m_idHelperSvc
->chamberId(tubeId)) {
29
msg
<< MSG::ERROR<<__FILE__<<
":"
<<__LINE__<<
" The channel "
<<
m_idHelperSvc
->toString(tubeId)
30
<<
" does not correspond to chamber "
<<
m_idHelperSvc
->chamberNameString(tubeId) <<
endmsg
;
31
return
false
;
32
}
33
if
(
index
>=
m_data
.size()) {
34
msg
<< MSG::WARNING<<__FILE__<<
":"
<<__LINE__<<
" The channel "
<<
m_idHelperSvc
->toString(tubeId)
35
<<
"does not seem to match the anticipated chamber sizes of "
36
<<
m_idHelperSvc
->chamberNameString(
m_moduleID
)<<
endmsg
;
37
m_data
.resize(
index
+1);
38
}
39
m_data
[
index
] = std::move(val);
40
if
(
msg
.level() <= MSG::VERBOSE) {
41
msg
<< MSG::VERBOSE<<
" Succesfully stored calibration data for channel "
<<
m_idHelperSvc
->toString(tubeId) <<
endmsg
;
42
}
43
return
true
;
44
}
45
const
Muon::IMuonIdHelperSvc
*
MdtTubeCalibContainer::idHelperSvc
()
const
{
46
return
m_idHelperSvc
;
47
}
48
}
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
MdtTubeCalibContainer.h
MuonCalib::MdtTubeCalibContainer::m_data
std::vector< SingleTubeCalib > m_data
Definition
MdtTubeCalibContainer.h:72
MuonCalib::MdtTubeCalibContainer::m_idHelper
const MdtIdHelper & m_idHelper
Definition
MdtTubeCalibContainer.h:61
MuonCalib::MdtTubeCalibContainer::m_nTubes
uint8_t m_nTubes
number of tubes
Definition
MdtTubeCalibContainer.h:71
MuonCalib::MdtTubeCalibContainer::setCalib
bool setCalib(SingleTubeCalib val, const Identifier &tubeId, MsgStream &msg)
set the calibration constants of a single tube
Definition
MdtTubeCalibContainer.cxx:25
MuonCalib::MdtTubeCalibContainer::m_moduleID
const Identifier m_moduleID
Definition
MdtTubeCalibContainer.h:59
MuonCalib::MdtTubeCalibContainer::m_nLayers
uint8_t m_nLayers
number of layer
Definition
MdtTubeCalibContainer.h:70
MuonCalib::MdtTubeCalibContainer::MdtTubeCalibContainer
MdtTubeCalibContainer(const Muon::IMuonIdHelperSvc *idHelperSvc, const Identifier &moduleID)
nMl = number of multilayres, nLayers = number of layers in multilayer (3 or 4); nTubes = number of tu...
Definition
MdtTubeCalibContainer.cxx:9
MuonCalib::MdtTubeCalibContainer::m_nMl
uint8_t m_nMl
number of multilayers in chamber
Definition
MdtTubeCalibContainer.h:69
MuonCalib::MdtTubeCalibContainer::idHelperSvc
const Muon::IMuonIdHelperSvc * idHelperSvc() const
Definition
MdtTubeCalibContainer.cxx:45
MuonCalib::MdtTubeCalibContainer::m_idHelperSvc
const Muon::IMuonIdHelperSvc * m_idHelperSvc
Definition
MdtTubeCalibContainer.h:60
MuonCalib::MdtTubeCalibContainer::vectorIndex
unsigned int vectorIndex(const Identifier &measID) const
calculate postion of tube in vector
Definition
MdtTubeCalibContainer.h:64
Muon::IMuonIdHelperSvc
Interface for Helper service that creates muon Identifiers and can be used to print Identifiers.
Definition
IMuonIdHelperSvc.h:27
Identifier
Definition
IdentifierFieldParser.cxx:14
MuonCalib
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.
Definition
CscCalcPed.cxx:21
index
Definition
index.py:1
MuonCalib::MdtTubeCalibContainer::SingleTubeCalib
Definition
MdtTubeCalibContainer.h:24
msg
MsgStream & msg
Definition
testRead.cxx:32
Generated on
for ATLAS Offline Software by
1.17.0