ATLAS Offline Software
Loading...
Searching...
No Matches
MdtTubeCalibContainer.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
5#include <algorithm> //std::max
6#include <utility> //std::in_range
7
8namespace MuonCalib {
10 const Identifier& moduleID):
11 m_moduleID{idHelperSvc->chamberId(moduleID)},
13 m_nMl = static_cast<std::uint8_t>(m_idHelper.numberOfMultilayers(moduleID));
14
15 const Identifier secondMl = m_idHelper.multilayerID(m_moduleID, m_nMl);
16 m_nLayers = std::max(m_idHelper.tubeLayerMax(m_moduleID),
17 m_idHelper.tubeLayerMax(secondMl));
18 m_nTubes = std::max(m_idHelper.tubeMax(m_moduleID),
19 m_idHelper.tubeMax(secondMl));
20 m_data.resize(m_nLayers * m_nTubes * m_nMl);
21}
22bool MdtTubeCalibContainer::setCalib(SingleTubeCalib val, const Identifier& tubeId, MsgStream& msg) {
24 const unsigned int index = vectorIndex(tubeId);
25 if (m_moduleID != m_idHelperSvc->chamberId(tubeId)) {
26 msg << MSG::ERROR<<__FILE__<<":"<<__LINE__<<" The channel "<<m_idHelperSvc->toString(tubeId)
27 <<" does not correspond to chamber "<<m_idHelperSvc->chamberNameString(tubeId) <<endmsg;
28 return false;
29 }
30 if (index >= m_data.size()) {
31 msg << MSG::WARNING<<__FILE__<<":"<<__LINE__<<" The channel "<<m_idHelperSvc->toString(tubeId)
32 <<"does not seem to match the anticipated chamber sizes of "
33 <<m_idHelperSvc->chamberNameString(m_moduleID)<<endmsg;
34 m_data.resize(index +1);
35 }
36 m_data[index] = std::move(val);
37 if (msg.level() <= MSG::VERBOSE) {
38 msg << MSG::VERBOSE<<" Succesfully stored calibration data for channel "<<m_idHelperSvc->toString(tubeId) << endmsg;
39 }
40 return true;
41}
45}
#define endmsg
std::vector< SingleTubeCalib > m_data
bool setCalib(SingleTubeCalib val, const Identifier &tubeId, MsgStream &msg)
set the calibration constants of a single tube
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...
uint8_t m_nMl
number of multilayers in chamber
const Muon::IMuonIdHelperSvc * idHelperSvc() const
const Muon::IMuonIdHelperSvc * m_idHelperSvc
unsigned int vectorIndex(const Identifier &measID) const
calculate postion of tube in vector
Interface for Helper service that creates muon Identifiers and can be used to print Identifiers.
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.
Definition index.py:1
MsgStream & msg
Definition testRead.cxx:32