ATLAS Offline Software
MdtTubeCalibContainer.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
5 namespace MuonCalib {
7  const Identifier& moduleID):
8  m_moduleID{idHelperSvc->chamberId(moduleID)},
9  m_idHelperSvc{idHelperSvc}{
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 }
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 (!val) {
28  msg << MSG::ERROR<<__FILE__<<":" <<__LINE__<<" No data is parsed for "
29  << m_idHelperSvc->toString(tubeId)<<endmsg;
30  return false;
31  }
32  if (index >= m_data.size()) {
33  msg << MSG::WARNING<<__FILE__<<":"<<__LINE__<<" The channel "<<m_idHelperSvc->toString(tubeId)
34  <<"does not seem to match the anticipated chamber sizes of "
36  m_data.resize(index +1);
37  }
39  if (store) {
40  msg << MSG::ERROR<< __FILE__ << __LINE__<< " Data has already been stored for channel "
41  << m_idHelperSvc->toString(tubeId) << endmsg;
42  return false;
43  }
44  store = std::move(val);
45  if (msg.level() <= MSG::DEBUG) {
46  msg << MSG::DEBUG<<" Succesfully stored calibration data for channel "<<m_idHelperSvc->toString(tubeId) << endmsg;
47  }
48  return true;
49 }
51  return m_idHelperSvc;
52 }
53 }
store
StoreGateSvc * store
Definition: fbtTestBasics.cxx:69
max
#define max(a, b)
Definition: cfImp.cxx:41
MuonCalib::MdtTubeCalibContainer::vectorIndex
unsigned int vectorIndex(const Identifier &measID) const
calculate postion of tube in vector
Definition: MdtTubeCalibContainer.h:61
MdtTubeCalibContainer.h
index
Definition: index.py:1
m_data
std::vector< T > m_data
Definition: TrackTruthMatchingBaseAlg.cxx:660
MuonCalib::MdtTubeCalibContainer::m_idHelperSvc
const Muon::IMuonIdHelperSvc * m_idHelperSvc
Definition: MdtTubeCalibContainer.h:57
MuonCalib::MdtTubeCalibContainer::setCalib
bool setCalib(SingleTubeCalib &&val, const Identifier &tubeId, MsgStream &msg)
set the calibration constants of a single tube
Definition: MdtTubeCalibContainer.cxx:19
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:6
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
MuonCalib
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.
Definition: CscCalcPed.cxx:22
MuonCalib::MdtTubeCalibContainer::m_moduleID
const Identifier m_moduleID
Definition: MdtTubeCalibContainer.h:56
Muon::IMuonIdHelperSvc::chamberId
virtual Identifier chamberId(const Identifier &id) const =0
create a chamber ID
DeMoScan.index
string index
Definition: DeMoScan.py:362
Muon::IMuonIdHelperSvc::toString
virtual std::string toString(const Identifier &id) const =0
print all fields to string
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
DEBUG
#define DEBUG
Definition: page_access.h:11
Muon::IMuonIdHelperSvc
Interface for Helper service that creates muon Identifiers and can be used to print Identifiers.
Definition: IMuonIdHelperSvc.h:26
MuonCalib::MdtTubeCalibContainer::SingleTubeCalib
Definition: MdtTubeCalibContainer.h:18
MuonCalib::MdtTubeCalibContainer::m_data
std::vector< SingleTubeCalib > m_data
Definition: MdtTubeCalibContainer.h:69
Muon::IMuonIdHelperSvc::chamberNameString
virtual std::string chamberNameString(const Identifier &id) const =0
print chamber name to string
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
MuonCalib::MdtTubeCalibContainer::idHelperSvc
const Muon::IMuonIdHelperSvc * idHelperSvc() const
Definition: MdtTubeCalibContainer.cxx:50