ATLAS Offline Software
Loading...
Searching...
No Matches
BFieldCorFunc.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4#ifndef MuonCalib_BFieldCorFuncH
5#define MuonCalib_BFieldCorFuncH
6namespace MuonCalib {
7
8}
9
10
11// STL //
12#include <string>
13#include <vector>
14#include <limits>
15
16// CLHEP //
18
19// MuonCalib //
22
23namespace MuonCalib {
24
25 class IRtRelation;
26
27
48 public:
49 // Constructors //
50 explicit BFieldCorFunc(const std::string &quality, const CalibFunc::ParVec &parameters, const IRtRelation *rt);
60 explicit BFieldCorFunc(const CalibFunc::ParVec &parameters, const IRtRelation *rt);
64
65 // Methods //
66 // get-methods //
67
69 double epsilon() const;
70
71 // set-methods //
73 // void setEpsilon(const double eps);
74
77 void setRtRelationship(const IRtRelation &rt);
78
79 // methods required by the base class "IMdtBFieldCorFunc" //
80 std::string name() const;
81
88 double correction(double t, double B_wire, double B_mu) const;
89
96 double correction_to_B(double t, double B_wire, double B_mu, double B_factor = -1.0) const;
97
98 private:
99 // data //
100
101 // parameters (copy of m_parameter in the base class, needed to enable overwriting)
102 std::vector<double> m_param{};
103
104 // quality setting //
105 std::string m_quality{}; // quality string ("high", "medium", "low")
106 double m_step_size{0.}; // integration step size steering the quality
107
108 // correction function //
109 Amg::VectorX m_alpha; // parameter of the fit function describing the
110 // integral part of the correction function
111
112
113 // information about r(t) used to calculate the correction function //
114
115 // minimum and maximum drift times allowed by the r-t relationship
116 double m_t_min{-std::numeric_limits<double>::max()};
117 double m_t_max{std::numeric_limits<double>::max()};
118 // minimum and maximum drift radius
119 double m_r_min{-std::numeric_limits<double>::max()};
120 double m_r_max{std::numeric_limits<double>::max()};
121
122 // private methods //
123 // initialization method, parameters are the parameters passed to constructor of this class
124 void init(const std::string &quality, const CalibFunc::ParVec &params, const IRtRelation *rt);
125
126 // get t(r) for the relationship "rt", the method is auxiliary and not optimized;
127 // it will disappear when the t(r) will be available in the MuonCalib framework
128 double t_from_r(const double r, const IRtRelation *rt) const;
129
130 // get the integral in the correction function from r_min to r_max; rt contains the drift
131 // velocity needed to calculate the integral
132 double integral(const double r_min, const double r_max, const IRtRelation *rt) const;
133 };
134
135} // namespace MuonCalib
136
137#endif
double t_from_r(const double r, const IRtRelation *rt) const
void setRtRelationship(const IRtRelation &rt)
< set the parameter of the B-field correction function = eps
double integral(const double r_min, const double r_max, const IRtRelation *rt) const
std::vector< double > m_param
double correction(double t, double B_wire, double B_mu) const
get t(r, !=0)-t(r, =0); t = drift time t [ns] for B=0; B_wire = magnetic field parallel to the anode ...
std::string name() const
get the class name
BFieldCorFunc(const std::string &quality, const CalibFunc::ParVec &parameters, const IRtRelation *rt)
Constructor: quality = "high", slow but accurate initialization initialization of the correction func...
void init(const std::string &quality, const CalibFunc::ParVec &params, const IRtRelation *rt)
double epsilon() const
< get the parameter of the B-field correction function
double correction_to_B(double t, double B_wire, double B_mu, double B_factor=-1.0) const
const ParVec & parameters() const
Definition CalibFunc.h:40
std::vector< double > ParVec
Definition CalibFunc.h:35
IMdtBFieldCorFunc(const CalibFunc::ParVec &vec)
generic interface for a rt-relation
Definition IRtRelation.h:19
int r
Definition globals.cxx:22
Eigen::Matrix< double, Eigen::Dynamic, 1 > VectorX
Dynamic Vector - dynamic allocation.
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.