ATLAS Offline Software
Loading...
Searching...
No Matches
MdtTubeCalibContainer.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
5namespace MuonCalib {
7 const Identifier& moduleID):
8 m_moduleID{idHelperSvc->chamberId(moduleID)},
10
11 m_nMl = m_idHelper.numberOfMultilayers(moduleID);
12 const Identifier secondMl = m_idHelper.multilayerID(m_moduleID, m_nMl);
13 m_nLayers = std::max(m_idHelper.tubeLayerMax(m_moduleID),
14 m_idHelper.tubeLayerMax(secondMl));
15 m_nTubes = std::max(m_idHelper.tubeMax(m_moduleID),
16 m_idHelper.tubeMax(secondMl));
17 m_data.resize(m_nLayers * m_nTubes * m_nMl);
18}
19bool MdtTubeCalibContainer::setCalib(SingleTubeCalib val, const Identifier& tubeId, MsgStream& msg) {
21 const unsigned int index = vectorIndex(tubeId);
22 if (m_moduleID != m_idHelperSvc->chamberId(tubeId)) {
23 msg << MSG::ERROR<<__FILE__<<":"<<__LINE__<<" The channel "<<m_idHelperSvc->toString(tubeId)
24 <<" does not correspond to chamber "<<m_idHelperSvc->chamberNameString(tubeId) <<endmsg;
25 return false;
26 }
27 if (index >= m_data.size()) {
28 msg << MSG::WARNING<<__FILE__<<":"<<__LINE__<<" The channel "<<m_idHelperSvc->toString(tubeId)
29 <<"does not seem to match the anticipated chamber sizes of "
30 <<m_idHelperSvc->chamberNameString(m_moduleID)<<endmsg;
31 m_data.resize(index +1);
32 }
33 m_data[index] = std::move(val);
34 if (msg.level() <= MSG::VERBOSE) {
35 msg << MSG::VERBOSE<<" Succesfully stored calibration data for channel "<<m_idHelperSvc->toString(tubeId) << endmsg;
36 }
37 return true;
38}
42}
#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