ATLAS Offline Software
Loading...
Searching...
No Matches
BLinePar.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 MUONALIGNMENTDATA_BLINEPAR_H
6#define MUONALIGNMENTDATA_BLINEPAR_H
7
9#include <array>
10#include <limits>
11#include <iostream>
12#include <algorithm>
13
14class BLinePar : public MuonAlignmentPar {
15public:
16 // Default constructor
17 BLinePar() = default;
18 // destructor
19 virtual ~BLinePar() override = default;
20
21 enum class Parameter{
22 bz=0, // tube bow in plane,
23 bp, // tube bow out of plane,
24 bn, // tube bow out of plane
25 sp, // cross plate sag out of plane
26 sn, // cross plate sag out of plane
27 tw, // twist
28 pg, // parallelogram
29 tr, // trapezoid
30 eg, // global expansion
31 ep, // local expansion
32 en, // local expansion
34 };
35 static constexpr double expansionScale = 1.e-3;
37 void setParameters(float bz, float bp, float bn, float sp, float sn, float tw, float pg, float tr, float eg, float ep, float en);
38
40 float getParameter(const Parameter p) const {
41 return m_payload[static_cast<unsigned int>(p)];
42 }
43
44 operator bool () const {
45 return std::find_if(m_payload.begin(),
46 m_payload.end(),[](const float par){
47 return std::abs(par) > std::numeric_limits<float>::epsilon();
48 }) != m_payload.end();
49 }
50
51private:
52 std::array<float, static_cast<unsigned int>(Parameter::numPars)> m_payload{};
53};
54
55std::ostream& operator<<(std::ostream& ostr, const BLinePar& par);
56
57
58#endif // MUONALIGNMENTDATA_BLINEPAR_H
std::ostream & operator<<(std::ostream &ostr, const BLinePar &par)
Definition BLinePar.cxx:6
float getParameter(const Parameter p) const
Returns a given parameter.
Definition BLinePar.h:40
virtual ~BLinePar() override=default
std::array< float, static_cast< unsigned int >(Parameter::numPars)> m_payload
Definition BLinePar.h:52
void setParameters(float bz, float bp, float bn, float sp, float sn, float tw, float pg, float tr, float eg, float ep, float en)
Cast the parameter to an unsigned int.
Definition BLinePar.cxx:26
BLinePar()=default
static constexpr double expansionScale
Definition BLinePar.h:35
MuonAlignmentPar()=default