ATLAS Offline Software
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
6 namespace MuonCalib {
7 
8 }
9 
10 
11 // STL //
12 #include <string>
13 #include <vector>
14 #include <limits>
15 
16 // CLHEP //
18 
19 // MuonCalib //
22 
23 namespace 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
118  // minimum and maximum drift radius
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
MuonCalib::BFieldCorFunc::m_r_max
double m_r_max
Definition: BFieldCorFunc.h:120
beamspotman.r
def r
Definition: beamspotman.py:676
MuonCalib::BFieldCorFunc::correction
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 ...
Definition: BFieldCorFunc.cxx:182
MuonCalib::BFieldCorFunc::m_t_max
double m_t_max
Definition: BFieldCorFunc.h:117
Amg::VectorX
Eigen::Matrix< double, Eigen::Dynamic, 1 > VectorX
Dynamic Vector - dynamic allocation.
Definition: EventPrimitives.h:30
MuonCalib::BFieldCorFunc::m_t_min
double m_t_min
Definition: BFieldCorFunc.h:116
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
MuonCalib::BFieldCorFunc::init
void init(const std::string &quality, const CalibFunc::ParVec &params, const IRtRelation *rt)
Definition: BFieldCorFunc.cxx:30
MuonCalib::BFieldCorFunc
Definition: BFieldCorFunc.h:47
MuonCalib::BFieldCorFunc::correction_to_B
double correction_to_B(double t, double B_wire, double B_mu, double B_factor=-1.0) const
Definition: BFieldCorFunc.cxx:225
MuonCalib::IMdtBFieldCorFunc
generic interface for b-field correction functions
Definition: IMdtBFieldCorFunc.h:14
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
MuonCalib::BFieldCorFunc::name
std::string name() const
get the class name
Definition: BFieldCorFunc.cxx:180
MuonCalib::BFieldCorFunc::BFieldCorFunc
BFieldCorFunc(const std::string &quality, const CalibFunc::ParVec &parameters, const IRtRelation *rt)
Constructor: quality = "high", slow but accurate initialization initialization of the correction func...
Definition: BFieldCorFunc.cxx:20
MuonCalib::BFieldCorFunc::epsilon
double epsilon() const
< get the parameter of the B-field correction function
Definition: BFieldCorFunc.cxx:175
MuonCalib::BFieldCorFunc::t_from_r
double t_from_r(const double r, const IRtRelation *rt) const
Definition: BFieldCorFunc.cxx:112
MuonCalib
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.
Definition: CscCalcPed.cxx:22
MuonCalib::CalibFunc::ParVec
std::vector< double > ParVec
Definition: CalibFunc.h:35
MuonCalib::BFieldCorFunc::m_alpha
Amg::VectorX m_alpha
Definition: BFieldCorFunc.h:109
EventPrimitives.h
MuonCalib::BFieldCorFunc::m_step_size
double m_step_size
Definition: BFieldCorFunc.h:106
MuonCalib::BFieldCorFunc::m_r_min
double m_r_min
Definition: BFieldCorFunc.h:119
MuonCalib::CalibFunc::parameters
const ParVec & parameters() const
Definition: CalibFunc.h:40
IRtRelation.h
IMdtBFieldCorFunc.h
MuonCalib::BFieldCorFunc::m_param
std::vector< double > m_param
Definition: BFieldCorFunc.h:102
MuonCalib::BFieldCorFunc::setRtRelationship
void setRtRelationship(const IRtRelation &rt)
< set the parameter of the B-field correction function = eps
Definition: BFieldCorFunc.cxx:176
MuonCalib::BFieldCorFunc::m_quality
std::string m_quality
Definition: BFieldCorFunc.h:105
MuonCalib::BFieldCorFunc::integral
double integral(const double r_min, const double r_max, const IRtRelation *rt) const
Definition: BFieldCorFunc.cxx:140
PowhegControl_ttFCNC_NLO.params
params
Definition: PowhegControl_ttFCNC_NLO.py:226
MuonCalib::IRtRelation
generic interface for a rt-relation
Definition: IRtRelation.h:15