ATLAS Offline Software
Loading...
Searching...
No Matches
MdtTubeCalibContainer.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef MUONCALIB_MDTTUBECALIBCONTAINER_H
6#define MUONCALIB_MDTTUBECALIBCONTAINER_H
7
8
10#include "MuonIdHelpers/IMuonIdHelperSvc.h" //used in header
11#include "MuonIdHelpers/MdtIdHelper.h" //used in header
12#include <string>
13#include <vector>
14#include <cstdint> //uint8_t
15#include "Identifier/Identifier.h"
16
17
18
19namespace MuonCalib {
20
23 public:
26 float t0{0.f};
28 float adcCal{0.f};
30 uint8_t statusCode{1};
31 SingleTubeCalib() = default;
32 };
34
37 const Identifier& moduleID);
38
40 const SingleTubeCalib* getCalib(const Identifier& tubeId) const {
41 unsigned int idx = vectorIndex(tubeId);
42 if (idx >= m_data.size()) return nullptr;
43 return &m_data[idx];
44 };
45
47 bool setCalib(SingleTubeCalib val, const Identifier& tubeId, MsgStream& msg);
48
50 const Identifier& identify() const { return m_moduleID; }
51 unsigned int size() const { return m_data.size(); }
52 unsigned int numMultilayers() const { return m_nMl; }
53 unsigned int numLayers() const { return m_nLayers; }
54 unsigned int numTubes() const { return m_nTubes; }
55
57
58 protected:
61 const MdtIdHelper& m_idHelper{m_idHelperSvc->mdtIdHelper()};
62
64 unsigned int vectorIndex(const Identifier& measID) const {
65 return (m_idHelper.multilayer(measID) - 1) * (m_nLayers * m_nTubes) +
66 (m_idHelper.tubeLayer(measID) - 1) * m_nTubes +
67 (m_idHelper.tube(measID) -1);
68 }
69 uint8_t m_nMl{0};
70 uint8_t m_nLayers{0};
71 uint8_t m_nTubes{0};
72 std::vector<SingleTubeCalib> m_data{};
73 };
74
75} // namespace MuonCalib
76
77#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