ATLAS Offline Software
Loading...
Searching...
No Matches
MdtTubeCalibContainer.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef MUONCALIB_MDTTUBECALIBCONTAINER_H
6#define MUONCALIB_MDTTUBECALIBCONTAINER_H
7
8#include <iostream>
9#include <string>
10#include <vector>
13
14namespace MuonCalib {
15
18 public:
21 float t0{0.f};
23 float adcCal{0.f};
25 uint8_t statusCode{1};
26 SingleTubeCalib() = default;
27 };
29
32 const Identifier& moduleID);
33
35 const SingleTubeCalib* getCalib(const Identifier& tubeId) const {
36 unsigned int idx = vectorIndex(tubeId);
37 if (idx >= m_data.size()) return nullptr;
38 return &m_data[idx];
39 };
40
42 bool setCalib(SingleTubeCalib val, const Identifier& tubeId, MsgStream& msg);
43
45 const Identifier& identify() const { return m_moduleID; }
46 unsigned int size() const { return m_data.size(); }
47 unsigned int numMultilayers() const { return m_nMl; }
48 unsigned int numLayers() const { return m_nLayers; }
49 unsigned int numTubes() const { return m_nTubes; }
50
52
53 protected:
56 const MdtIdHelper& m_idHelper{m_idHelperSvc->mdtIdHelper()};
57
59 unsigned int vectorIndex(const Identifier& measID) const {
60 return (m_idHelper.multilayer(measID) - 1) * (m_nLayers * m_nTubes) +
61 (m_idHelper.tubeLayer(measID) - 1) * m_nTubes +
62 (m_idHelper.tube(measID) -1);
63 }
64 uint8_t m_nMl{0};
65 uint8_t m_nLayers{0};
66 uint8_t m_nTubes{0};
67 std::vector<SingleTubeCalib> m_data{};
68 };
69
70} // namespace MuonCalib
71
72#endif
MuonCalib::MdtTubeCalibContainer::SingleTubeCalib SingleTubeCalib
The TransientConstSharedPtr allows non-const access if the pointer itself is non-const but in the con...
std::vector< SingleTubeCalib > m_data
const SingleTubeCalib * getCalib(const Identifier &tubeId) const
return calibration constants of a single tube
const Identifier & identify() const
return container name and dimensions
GeoModel::TransientConstSharedPtr< SingleTubeCalib > SingleTubeCalibPtr
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.
float adcCal
quality flag for the SingleTubeCalib constants: 0 all ok, 1 no hits found, 2 too few hits,...
MsgStream & msg
Definition testRead.cxx:32