ATLAS Offline Software
MdtAsBuiltPar.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 MUONALIGNMENTDATA_MDTASBUILTPAR_H
6 #define MUONALIGNMENTDATA_MDTASBUILTPAR_H
7 
8 #include <string>
9 #include <array>
10 
12 
19 public:
20  // Default constructor
21  MdtAsBuiltPar() = default;
22  // destructor
23  virtual ~MdtAsBuiltPar() override = default;
24 
28  enum class multilayer_t { ML1 = 0, ML2, NMLTYPES };
29 
33  enum class tubeSide_t {
34  POS = 0, // s>0 side
35  NEG, // s<0 side
37  };
38 
42  void setAlignmentParameters(multilayer_t iML, tubeSide_t iTubeSide, float y0, float z0, float alpha, float ypitch, float zpitch,
43  int stagg);
44 
45 
46  // Getters
47  double y0(multilayer_t iML, tubeSide_t iTubeSide) const { return meas(iML, iTubeSide).y0; }
48  double z0(multilayer_t iML, tubeSide_t iTubeSide) const { return meas(iML, iTubeSide).z0; }
49  double alpha(multilayer_t iML, tubeSide_t iTubeSide) const { return meas(iML, iTubeSide).alpha; }
50  double ypitch(multilayer_t iML, tubeSide_t iTubeSide) const { return meas(iML, iTubeSide).ypitch; }
51  double zpitch(multilayer_t iML, tubeSide_t iTubeSide) const { return meas(iML, iTubeSide).zpitch; }
52  int stagg(multilayer_t iML, tubeSide_t iTubeSide) const { return meas(iML, iTubeSide).stagg; }
53 
54 
55  // Alignment parameters
57  AlignmentParameters() = default;
58  float y0{0.f}; // y position of first wire w.r.t. reference point
59  float z0{0.f}; // z position of first wire w.r.t. reference point
60  float alpha{0.f}; // rotation around tube axis
61  float ypitch{0.f}; // y pitch
62  float zpitch{0.f}; // z pitch
63  int stagg{1}; // is tube staggering ATLAS-standard or reversed?
64  };
65 private:
66  static constexpr unsigned int NMEAS = static_cast<unsigned int>(multilayer_t::NMLTYPES) *
67  static_cast<unsigned int>(tubeSide_t::NTUBESIDETYPES);
68  std::array<AlignmentParameters, NMEAS> m_meas{}; // in this order: ML1_HV, ML1_RO, ML2_HV, ML2_RO
69 
71  const unsigned int idx = static_cast<unsigned int>(tubeSide_t::NTUBESIDETYPES) *
72  static_cast<unsigned int>(iML) + static_cast<unsigned>(iTubeSide);
73  return m_meas.at(idx);
74  }
75  const AlignmentParameters& meas(multilayer_t iML, tubeSide_t iTubeSide) const {
76  const unsigned int idx = static_cast<unsigned int>(tubeSide_t::NTUBESIDETYPES) *
77  static_cast<unsigned int>(iML) + static_cast<unsigned>(iTubeSide);
78  return m_meas.at(idx);
79  }
80 };
81 
82 std::ostream& operator<<(std::ostream& ostr, const MdtAsBuiltPar& par);
83 #endif // MUONALIGNMENTDATA_MDTASBUILTPAR_H
MdtAsBuiltPar::setAlignmentParameters
void setAlignmentParameters(multilayer_t iML, tubeSide_t iTubeSide, float y0, float z0, float alpha, float ypitch, float zpitch, int stagg)
Set the alignment parameters for a ML and a tube side.
Definition: MdtAsBuiltPar.cxx:32
MdtAsBuiltPar::AlignmentParameters::y0
float y0
Definition: MdtAsBuiltPar.h:58
MdtAsBuiltPar::meas
AlignmentParameters & meas(multilayer_t iML, tubeSide_t iTubeSide)
Definition: MdtAsBuiltPar.h:70
MdtAsBuiltPar::z0
double z0(multilayer_t iML, tubeSide_t iTubeSide) const
Definition: MdtAsBuiltPar.h:48
MdtAsBuiltPar::NMEAS
static constexpr unsigned int NMEAS
Definition: MdtAsBuiltPar.h:66
MdtAsBuiltPar::AlignmentParameters
Definition: MdtAsBuiltPar.h:56
MdtAsBuiltPar::AlignmentParameters::alpha
float alpha
Definition: MdtAsBuiltPar.h:60
MdtAsBuiltPar::AlignmentParameters::z0
float z0
Definition: MdtAsBuiltPar.h:59
MdtAsBuiltPar::multilayer_t::ML1
@ ML1
MdtAsBuiltPar::m_meas
std::array< AlignmentParameters, NMEAS > m_meas
Definition: MdtAsBuiltPar.h:68
MdtAsBuiltPar::multilayer_t
multilayer_t
MDT multi-layer index.
Definition: MdtAsBuiltPar.h:28
MdtAsBuiltPar::ypitch
double ypitch(multilayer_t iML, tubeSide_t iTubeSide) const
Definition: MdtAsBuiltPar.h:50
MdtAsBuiltPar::multilayer_t::NMLTYPES
@ NMLTYPES
MdtAsBuiltPar::AlignmentParameters::zpitch
float zpitch
Definition: MdtAsBuiltPar.h:62
MdtAsBuiltPar::AlignmentParameters::ypitch
float ypitch
Definition: MdtAsBuiltPar.h:61
MdtAsBuiltPar::stagg
int stagg(multilayer_t iML, tubeSide_t iTubeSide) const
Definition: MdtAsBuiltPar.h:52
operator<<
std::ostream & operator<<(std::ostream &ostr, const MdtAsBuiltPar &par)
Definition: MdtAsBuiltPar.cxx:7
MdtAsBuiltPar::AlignmentParameters::AlignmentParameters
AlignmentParameters()=default
MdtAsBuiltPar::zpitch
double zpitch(multilayer_t iML, tubeSide_t iTubeSide) const
Definition: MdtAsBuiltPar.h:51
MdtAsBuiltPar::tubeSide_t::NEG
@ NEG
MdtAsBuiltPar::meas
const AlignmentParameters & meas(multilayer_t iML, tubeSide_t iTubeSide) const
Definition: MdtAsBuiltPar.h:75
MuonAlignmentPar.h
MdtAsBuiltPar::~MdtAsBuiltPar
virtual ~MdtAsBuiltPar() override=default
MdtAsBuiltPar::multilayer_t::ML2
@ ML2
MdtAsBuiltPar::tubeSide_t
tubeSide_t
MDT tube side.
Definition: MdtAsBuiltPar.h:33
MuonAlignmentPar
Basic class to map the MuonAlignment parameters to the different subdetectors inside the muon system.
Definition: MuonAlignmentPar.h:15
MdtAsBuiltPar::MdtAsBuiltPar
MdtAsBuiltPar()=default
createCoolChannelIdFile.par
par
Definition: createCoolChannelIdFile.py:29
MdtAsBuiltPar::alpha
double alpha(multilayer_t iML, tubeSide_t iTubeSide) const
Definition: MdtAsBuiltPar.h:49
MdtAsBuiltPar
Container classifier the MDT as-built parameters See parameter description in http://atlas-muon-align...
Definition: MdtAsBuiltPar.h:18
MdtAsBuiltPar::tubeSide_t::NTUBESIDETYPES
@ NTUBESIDETYPES
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
MdtAsBuiltPar::tubeSide_t::POS
@ POS
MdtAsBuiltPar::y0
double y0(multilayer_t iML, tubeSide_t iTubeSide) const
Definition: MdtAsBuiltPar.h:47
MdtAsBuiltPar::AlignmentParameters::stagg
int stagg
Definition: MdtAsBuiltPar.h:63