ATLAS Offline Software
MdtTubeCalibContainer.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 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>
12 
13 namespace MuonCalib {
14 
17  public:
18  struct SingleTubeCalib {
20  float t0{0.f};
22  float inversePropSpeed{0.f};
24  float adcCal{0.f};
26  unsigned int statusCode{1};
27  SingleTubeCalib() = default;
28 
29  operator bool() const { return inversePropSpeed >0.;}
30  };
31 
34  const Identifier& moduleID);
35 
37  const SingleTubeCalib* getCalib(const Identifier& tubeId) const {
38  unsigned int idx = vectorIndex(tubeId);
39  if (idx >= m_data.size()) return nullptr;
40  return &m_data[idx];
41  };
42 
44  bool setCalib(SingleTubeCalib&& val, const Identifier& tubeId, MsgStream& msg);
45 
47  const Identifier& identify() const { return m_moduleID; }
48  unsigned int size() const { return m_data.size(); }
49  unsigned int numMultilayers() const { return m_nMl; };
50  unsigned int numLayers() const { return m_nLayers; };
51  unsigned int numTubes() const { return m_nTubes; };
52 
53  const Muon::IMuonIdHelperSvc* idHelperSvc() const;
54 
55  protected:
59 
61  unsigned int vectorIndex(const Identifier& measID) const {
62  return (m_idHelper.multilayer(measID) - 1) * (m_nLayers * m_nTubes) +
63  (m_idHelper.tubeLayer(measID) - 1) * m_nTubes +
64  (m_idHelper.tube(measID) -1);
65  }
66  unsigned int m_nMl{0};
67  unsigned int m_nLayers{0};
68  unsigned int m_nTubes{0};
69  std::vector<SingleTubeCalib> m_data{};
70  };
71 
72 } // namespace MuonCalib
73 
74 #endif
MdtIdHelper::multilayer
int multilayer(const Identifier &id) const
Access to components of the ID.
Definition: MdtIdHelper.cxx:722
MuonCalib::MdtTubeCalibContainer::SingleTubeCalib::t0
float t0
< relative t0 in chamber (ns)
Definition: MdtTubeCalibContainer.h:20
MuonCalib::MdtTubeCalibContainer::m_idHelper
const MdtIdHelper & m_idHelper
Definition: MdtTubeCalibContainer.h:58
MuonCalib::MdtTubeCalibContainer::identify
const Identifier & identify() const
return container name and dimensions
Definition: MdtTubeCalibContainer.h:47
MuonCalib::MdtTubeCalibContainer::vectorIndex
unsigned int vectorIndex(const Identifier &measID) const
calculate postion of tube in vector
Definition: MdtTubeCalibContainer.h:61
MuonCalib::MdtTubeCalibContainer::numMultilayers
unsigned int numMultilayers() const
Definition: MdtTubeCalibContainer.h:49
MuonCalib::MdtTubeCalibContainer::m_idHelperSvc
const Muon::IMuonIdHelperSvc * m_idHelperSvc
Definition: MdtTubeCalibContainer.h:57
MdtIdHelper::tubeLayer
int tubeLayer(const Identifier &id) const
Definition: MdtIdHelper.cxx:724
MuonCalib::MdtTubeCalibContainer::m_nTubes
unsigned int m_nTubes
number of tubes
Definition: MdtTubeCalibContainer.h:68
MuonCalib::MdtTubeCalibContainer::getCalib
const SingleTubeCalib * getCalib(const Identifier &tubeId) const
return calibration constants of a single tube
Definition: MdtTubeCalibContainer.h:37
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
MuonCalib::MdtTubeCalibContainer::numLayers
unsigned int numLayers() const
Definition: MdtTubeCalibContainer.h:50
MuonCalib::MdtTubeCalibContainer::SingleTubeCalib::statusCode
unsigned int statusCode
Definition: MdtTubeCalibContainer.h:26
MdtIdHelper
Definition: MdtIdHelper.h:61
MdtIdHelper::tube
int tube(const Identifier &id) const
Definition: MdtIdHelper.cxx:726
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
MuonCalib::MdtTubeCalibContainer::numTubes
unsigned int numTubes() const
Definition: MdtTubeCalibContainer.h:51
MuonCalib::MdtTubeCalibContainer
Holds single-tube calibration constants of one chamber.
Definition: MdtTubeCalibContainer.h:16
MuonCalib::MdtTubeCalibContainer::SingleTubeCalib::adcCal
float adcCal
quality flag for the SingleTubeCalib constants: 0 all ok, 1 no hits found, 2 too few hits,...
Definition: MdtTubeCalibContainer.h:24
MuonCalib::MdtTubeCalibContainer::SingleTubeCalib::SingleTubeCalib
SingleTubeCalib()=default
Muon::IMuonIdHelperSvc::mdtIdHelper
virtual const MdtIdHelper & mdtIdHelper() const =0
access to MdtIdHelper
MuonCalib::MdtTubeCalibContainer::SingleTubeCalib::inversePropSpeed
float inversePropSpeed
multiplicative correction factor for ADC measurement w.r.t.
Definition: MdtTubeCalibContainer.h:22
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
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_nMl
unsigned int m_nMl
number of multilayers in chamber
Definition: MdtTubeCalibContainer.h:66
MuonCalib::MdtTubeCalibContainer::m_data
std::vector< SingleTubeCalib > m_data
Definition: MdtTubeCalibContainer.h:69
xAOD::bool
setBGCode setTAP setLVL2ErrorBits bool
Definition: TrigDecision_v1.cxx:60
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
MuonCalib::MdtTubeCalibContainer::size
unsigned int size() const
Definition: MdtTubeCalibContainer.h:48
IMuonIdHelperSvc.h
MuonCalib::MdtTubeCalibContainer::idHelperSvc
const Muon::IMuonIdHelperSvc * idHelperSvc() const
Definition: MdtTubeCalibContainer.cxx:52
MuonCalib::MdtTubeCalibContainer::m_nLayers
unsigned int m_nLayers
number of layer
Definition: MdtTubeCalibContainer.h:67
Identifier
Definition: IdentifierFieldParser.cxx:14