ATLAS Offline Software
FitParameters.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 /************************************************************************************
6  local parameter values used during fitter iterations
7  note the extra parameters for handling detector misalignment and Coulomb
8 scattering for brevity (mis-)named alignment and scatterer
9 *************************************************************************************/
10 
11 #ifndef TRKIPATFITTERUTILS_FITPARAMETERS_H
12 #define TRKIPATFITTERUTILS_FITPARAMETERS_H
13 
14 #include <utility>
15 #include <vector>
16 
22 
23 class MsgStream;
24 
25 namespace Trk {
26 class Surface;
27 class TrackSurfaceIntersection;
28 
30  public:
32 
33  FitParameters(double d0, double z0, double cosPhi, double sinPhi,
34  double cotTheta, double ptInv0, const PerigeeSurface& surface);
35 
40  ~FitParameters(void) = default;
41 
42  void addAlignment(bool constrained, double localAngle, double localOffset);
43  void addScatterer(double phi, double theta);
44  double alignmentAngle(int alignment) const;
45  double alignmentAngleConstraint(int alignment) const;
46  double alignmentOffset(int alignment) const;
47  double alignmentOffsetConstraint(int alignment) const;
48  const Surface* associatedSurface(void) const;
49  double cosPhi(void) const;
50  double cosTheta(void) const;
51  double cotTheta(void) const;
54  double d0(void) const;
55  void d0(double value);
56  double difference(int param) const;
57  const Amg::VectorX& differences(void) const;
58  Amg::Vector3D direction(void) const;
59  bool extremeMomentum(void) const;
60  void extremeMomentum(bool value);
61  const Amg::MatrixX* finalCovariance(void) const;
62  int firstAlignmentParameter(void) const;
64  int firstScatteringParameter(void) const;
66  bool fitEnergyDeposit(void) const;
67  void fitEnergyDeposit(double minEnergyDeposit);
68  bool fitMomentum(void) const;
69  void fitMomentum(bool value);
70  const Amg::MatrixX* fullCovariance(void) const;
72  int numberAlignments(void) const;
74  int numberOscillations(void) const;
75  int numberParameters(void) const;
77  int numberScatterers(void) const;
79  void performCutStep(double cutStep);
80  bool phiInstability(void) const;
81  double ptInv0(void) const;
83  Perigee* perigee(void) const;
84  const Amg::Vector3D& position(void) const;
85  void print(MsgStream& log) const;
86  void printCovariance(MsgStream& log) const;
87  void printVerbose(MsgStream& log) const;
88  double qOverP(void) const;
89  void qOverP(double value);
90  double qOverP1(void) const;
91  void qOverP1(double value);
92  void reset(const FitParameters& parameters);
93  void resetOscillations(void);
94  double scattererPhi(int scatterer) const;
95  double scattererTheta(int scatterer) const;
96  ScatteringAngles scatteringAngles(const FitMeasurement& fitMeasurement,
97  int scatterer = -1) const;
98  void setPhiInstability(void);
99  double sinPhi(void) const;
100  double sinTheta(void) const;
101  Perigee* startingPerigee(void) const;
102  // The following can update parameters
103  TrackParameters* trackParameters(MsgStream& log,
104  const FitMeasurement& measurement,
105  bool withCovariance = false);
106  void update(const Amg::VectorX& differences);
108  const Amg::MatrixX& leadingCovariance);
109  const Amg::Vector3D& vertex(void) const;
110  double z0(void) const;
111 
112  private:
113  std::vector<double> m_alignmentAngle;
114  std::vector<double> m_alignmentAngleConstraint;
115  std::vector<double> m_alignmentOffset;
116  std::vector<double> m_alignmentOffsetConstraint;
117  double m_cosPhi;
118  double m_cosPhi1;
119  double m_cosTheta;
120  double m_cosTheta1;
121  double m_cotTheta;
122  double m_d0;
124  bool m_eigen{};
126  Amg::MatrixX* m_finalCovariance;//not owning plain ptr
131  const Amg::MatrixX* m_fullCovariance;//not owning plain ptr
138  const Perigee* m_perigee; //not owning plain ptr
141  double m_qOverP;
142  double m_qOverP1;
143  std::vector<double> m_scattererPhi;
144  std::vector<double> m_scattererTheta;
145  double m_sinPhi;
146  double m_sinPhi1;
147  double m_sinTheta;
148  double m_sinTheta1;
149  const Surface* m_surface; //not owning plain ptr
151  double m_z0;
152 };
153 
154 //<<<<<< INLINE PUBLIC MEMBER FUNCTIONS >>>>>>
155 
156 inline double FitParameters::alignmentAngle(int alignment) const {
157  return m_alignmentAngle[alignment];
158 }
159 
162 }
163 
164 inline double FitParameters::alignmentOffset(int alignment) const {
166 }
167 
170 }
171 
172 inline double FitParameters::cosPhi(void) const {
173  return m_cosPhi;
174 }
175 
176 inline double FitParameters::cosTheta(void) const {
177  return m_cosTheta;
178 }
179 
180 inline double FitParameters::cotTheta(void) const {
181  return m_cotTheta;
182 }
183 
184 inline double FitParameters::d0(void) const {
185  return m_d0;
186 }
187 
188 inline double FitParameters::difference(int param) const {
189  if (m_differences.size() == 0) {
190  return 0.;
191  }
193  return std::as_const(m_differences)(param);
194 }
195 
196 inline const Amg::VectorX& FitParameters::differences(void) const {
197  return m_differences;
198 }
199 
202  m_cosTheta);
203 }
204 
205 inline bool FitParameters::extremeMomentum(void) const {
206  return m_extremeMomentum;
207 }
208 
209 inline const Amg::MatrixX* FitParameters::finalCovariance(void) const {
210  return m_finalCovariance;
211 }
212 
215 }
216 
219 }
220 
221 inline bool FitParameters::fitEnergyDeposit(void) const {
222  return m_fitEnergyDeposit;
223 }
224 
225 inline bool FitParameters::fitMomentum(void) const {
226  return m_fitMomentum;
227 }
228 
229 inline const Amg::MatrixX* FitParameters::fullCovariance(void) const {
230  return m_fullCovariance;
231 }
232 
233 inline int FitParameters::numberAlignments(void) const {
234  return m_numberAlignments;
235 }
236 
237 inline int FitParameters::numberOscillations(void) const {
238  return m_numberOscillations;
239 }
240 
241 inline int FitParameters::numberParameters(void) const {
242  return m_numberParameters;
243 }
244 
245 inline int FitParameters::numberScatterers(void) const {
246  return m_numberScatterers;
247 }
248 
249 inline double FitParameters::ptInv0(void) const {
250  return m_qOverP / m_sinTheta;
251 }
252 
253 inline const Amg::Vector3D& FitParameters::position(void) const {
254  return m_position;
255 }
256 
257 inline double FitParameters::qOverP(void) const {
258  return m_qOverP;
259 }
260 
261 inline double FitParameters::qOverP1(void) const {
262  return m_qOverP1;
263 }
264 
265 inline double FitParameters::scattererPhi(int scatterer) const {
266  return m_scattererPhi[scatterer];
267 }
268 
269 inline double FitParameters::scattererTheta(int scatterer) const {
270  return m_scattererTheta[scatterer];
271 }
272 
273 inline double FitParameters::sinPhi(void) const {
274  return m_sinPhi;
275 }
276 
277 inline double FitParameters::sinTheta(void) const {
278  return m_sinTheta;
279 }
280 
283 }
284 
285 inline const Amg::Vector3D& FitParameters::vertex(void) const {
286  return m_vertex;
287 }
288 
289 inline double FitParameters::z0(void) const {
290  return m_position.z();
291 }
292 
293 } // namespace Trk
294 
295 #endif // TRKIPATFITTERUTILS_FITPARAMETERS_H
Trk::FitParameters::m_perigee
const Perigee * m_perigee
Definition: FitParameters.h:138
Trk::FitParameters::m_cosTheta
double m_cosTheta
Definition: FitParameters.h:119
Trk::FitParameters::m_firstAlignmentParameter
int m_firstAlignmentParameter
Definition: FitParameters.h:127
Trk::FitParameters::alignmentAngleConstraint
double alignmentAngleConstraint(int alignment) const
Definition: FitParameters.h:160
Trk::FitParameters::m_scattererTheta
std::vector< double > m_scattererTheta
Definition: FitParameters.h:144
Trk::FitParameters::m_alignmentAngle
std::vector< double > m_alignmentAngle
Definition: FitParameters.h:113
Trk::FitParameters::~FitParameters
~FitParameters(void)=default
ScatteringAngles.h
Trk::FitParameters::m_numberParameters
int m_numberParameters
Definition: FitParameters.h:135
Trk::FitParameters::m_scattererPhi
std::vector< double > m_scattererPhi
Definition: FitParameters.h:143
Trk::FitParameters::z0
double z0(void) const
Definition: FitParameters.h:289
Amg::VectorX
Eigen::Matrix< double, Eigen::Dynamic, 1 > VectorX
Dynamic Vector - dynamic allocation.
Definition: EventPrimitives.h:30
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:27
Trk::FitParameters::m_alignmentOffsetConstraint
std::vector< double > m_alignmentOffsetConstraint
Definition: FitParameters.h:116
Trk::FitParameters::m_vertex
Amg::Vector3D m_vertex
Definition: FitParameters.h:150
TrackParameters.h
Trk::FitParameters::m_sinTheta1
double m_sinTheta1
Definition: FitParameters.h:148
Trk::FitParameters::m_cosPhi1
double m_cosPhi1
Definition: FitParameters.h:118
Trk::FitParameters::firstAlignmentParameter
void firstAlignmentParameter(int value)
Trk::FitParameters::alignmentAngle
double alignmentAngle(int alignment) const
Definition: FitParameters.h:156
Trk::FitParameters::fitMomentum
bool fitMomentum(void) const
Definition: FitParameters.h:225
Trk::FitParameters::direction
Amg::Vector3D direction(void) const
Definition: FitParameters.h:200
Trk::FitParameters::m_fitMomentum
bool m_fitMomentum
Definition: FitParameters.h:130
Trk::FitParameters::m_fullCovariance
const Amg::MatrixX * m_fullCovariance
Definition: FitParameters.h:131
Trk::FitParameters::firstScatteringParameter
int firstScatteringParameter(void) const
Definition: FitParameters.h:217
Trk::PerigeeSurface
Definition: PerigeeSurface.h:43
Trk::FitParameters::m_z0
double m_z0
Definition: FitParameters.h:151
Trk::ParametersT
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
Definition: EMErrorDetail.h:25
Trk::FitParameters::fitEnergyDeposit
bool fitEnergyDeposit(void) const
Definition: FitParameters.h:221
Trk::FitParameters::print
void print(MsgStream &log) const
Definition: FitParameters.cxx:248
Trk::FitParameters::alignmentOffsetConstraint
double alignmentOffsetConstraint(int alignment) const
Definition: FitParameters.h:168
Surface
Definition: Trigger/TrigAccel/TrigCudaFitter/src/Surface.h:8
Trk::FitParameters::m_sinPhi
double m_sinPhi
Definition: FitParameters.h:145
Trk::FitParameters::sinTheta
double sinTheta(void) const
Definition: FitParameters.h:277
Trk::ScatteringAngles
represents a deflection of the track caused through multiple scattering in material.
Definition: ScatteringAngles.h:26
athena.value
value
Definition: athena.py:124
Trk::FitParameters::vertex
const Amg::Vector3D & vertex(void) const
Definition: FitParameters.h:285
Trk::FitParameters::m_sinPhi1
double m_sinPhi1
Definition: FitParameters.h:146
Trk::TrackSurfaceIntersection
Definition: TrackSurfaceIntersection.h:32
Trk::FitParameters::m_cosTheta1
double m_cosTheta1
Definition: FitParameters.h:120
Trk::FitParameters::m_eigen
bool m_eigen
Definition: FitParameters.h:124
Trk::FitParameters::scattererTheta
double scattererTheta(int scatterer) const
Definition: FitParameters.h:269
Trk::FitParameters::setPhiInstability
void setPhiInstability(void)
Definition: FitParameters.cxx:469
Trk::FitParameters::FitParameters
FitParameters(const FitParameters &parameters)=default
Trk::FitParameters::ptInv0
double ptInv0(void) const
Definition: FitParameters.h:249
Trk::FitParameters::perigee
Perigee * perigee(void) const
Definition: FitParameters.cxx:225
Trk::FitParameters::m_minEnergyDeposit
double m_minEnergyDeposit
Definition: FitParameters.h:132
Trk::FitParameters::alignmentOffset
double alignmentOffset(int alignment) const
Definition: FitParameters.h:164
Trk::FitParameters::qOverP1
double qOverP1(void) const
Definition: FitParameters.h:261
Trk::FitParameters::m_qOverP
double m_qOverP
Definition: FitParameters.h:141
Trk::FitParameters::numberScatterers
int numberScatterers(void) const
Definition: FitParameters.h:245
GeoPrimitives.h
Trk::FitParameters::extremeMomentum
bool extremeMomentum(void) const
Definition: FitParameters.h:205
Trk::FitParameters::finalCovariance
const Amg::MatrixX * finalCovariance(void) const
Definition: FitParameters.h:209
Trk::FitParameters::numberParameters
int numberParameters(void) const
Definition: FitParameters.h:241
Trk::FitParameters::operator=
FitParameters & operator=(const FitParameters &)=default
Trk::FitParameters::intersection
TrackSurfaceIntersection intersection(void) const
Definition: FitParameters.cxx:154
Trk::FitParameters::m_differences
Amg::VectorX m_differences
Definition: FitParameters.h:123
Trk::FitParameters::m_fitEnergyDeposit
bool m_fitEnergyDeposit
Definition: FitParameters.h:129
Trk::FitParameters::m_surface
const Surface * m_surface
Definition: FitParameters.h:149
Trk::FitParameters::printCovariance
void printCovariance(MsgStream &log) const
Definition: FitParameters.cxx:259
Trk::FitParameters::m_position
Amg::Vector3D m_position
Definition: FitParameters.h:140
Trk::FitParameters::m_numberScatterers
int m_numberScatterers
Definition: FitParameters.h:136
Trk::theta
@ theta
Definition: ParamDefs.h:66
Trk::FitMeasurement
Definition: FitMeasurement.h:40
Trk::FitParameters::m_d0
double m_d0
Definition: FitParameters.h:122
Trk::FitParameters::update
void update(const Amg::VectorX &differences)
Definition: FitParameters.cxx:603
Trk::FitParameters::position
const Amg::Vector3D & position(void) const
Definition: FitParameters.h:253
Trk::FitParameters::startingPerigee
Perigee * startingPerigee(void) const
Definition: FitParameters.cxx:473
Trk::FitParameters::difference
double difference(int param) const
Definition: FitParameters.h:188
Trk::FitParameters::qOverP
double qOverP(void) const
Definition: FitParameters.h:257
Trk::ParametersBase
Definition: ParametersBase.h:55
Trk::FitParameters::m_cosPhi
double m_cosPhi
Definition: FitParameters.h:117
Trk::FitParameters::cosPhi
double cosPhi(void) const
Definition: FitParameters.h:172
Trk::FitParameters::covariance
void covariance(Amg::MatrixX *finalCovariance, const Amg::MatrixX *fullCovariance)
Definition: FitParameters.cxx:128
Trk::FitParameters::m_sinTheta
double m_sinTheta
Definition: FitParameters.h:147
Trk::FitParameters::cosTheta
double cosTheta(void) const
Definition: FitParameters.h:176
Trk::FitParameters::m_alignmentOffset
std::vector< double > m_alignmentOffset
Definition: FitParameters.h:115
Trk::FitParameters::trackParameters
TrackParameters * trackParameters(MsgStream &log, const FitMeasurement &measurement, bool withCovariance=false)
Definition: FitParameters.cxx:484
Trk::FitParameters::firstAlignmentParameter
int firstAlignmentParameter(void) const
Definition: FitParameters.h:213
EventPrimitives.h
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Trk::FitParameters::numberOscillations
int numberOscillations(void) const
Definition: FitParameters.h:237
Trk::FitParameters::operator=
FitParameters & operator=(FitParameters &&)=default
Trk::FitParameters::m_extremeMomentum
bool m_extremeMomentum
Definition: FitParameters.h:125
Trk::FitParameters::m_numberAlignments
int m_numberAlignments
Definition: FitParameters.h:133
Trk::FitParameters::scatteringAngles
ScatteringAngles scatteringAngles(const FitMeasurement &fitMeasurement, int scatterer=-1) const
Definition: FitParameters.cxx:454
Trk::FitParameters::fullCovariance
const Amg::MatrixX * fullCovariance(void) const
Definition: FitParameters.h:229
Trk::FitParameters::parameterDifference
const Amg::MatrixX parameterDifference(const Amg::VectorX &parameters) const
Definition: FitParameters.cxx:186
Trk::FitParameters::d0
double d0(void) const
Definition: FitParameters.h:184
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Trk::FitParameters::cotTheta
double cotTheta(void) const
Definition: FitParameters.h:180
Trk::FitParameters::m_oldDifference
double m_oldDifference
Definition: FitParameters.h:137
FitMeasurement.h
Trk::FitParameters::m_firstScatteringParameter
int m_firstScatteringParameter
Definition: FitParameters.h:128
Trk::FitParameters::m_alignmentAngleConstraint
std::vector< double > m_alignmentAngleConstraint
Definition: FitParameters.h:114
Trk::FitParameters::m_numberOscillations
int m_numberOscillations
Definition: FitParameters.h:134
Trk::FitParameters::printVerbose
void printVerbose(MsgStream &log) const
Definition: FitParameters.cxx:296
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
Trk::FitParameters::resetOscillations
void resetOscillations(void)
Definition: FitParameters.h:281
Trk::FitParameters::sinPhi
double sinPhi(void) const
Definition: FitParameters.h:273
Trk::FitParameters::m_phiInstability
bool m_phiInstability
Definition: FitParameters.h:139
physics_parameters.parameters
parameters
Definition: physics_parameters.py:144
Trk::FitParameters::addAlignment
void addAlignment(bool constrained, double localAngle, double localOffset)
Definition: FitParameters.cxx:105
Trk::FitParameters::numberAlignments
int numberAlignments(void) const
Definition: FitParameters.h:233
Trk::phi
@ phi
Definition: ParamDefs.h:75
Trk::FitParameters::firstScatteringParameter
void firstScatteringParameter(int value)
Trk::FitParameters::m_qOverP1
double m_qOverP1
Definition: FitParameters.h:142
Trk::FitParameters::scattererPhi
double scattererPhi(int scatterer) const
Definition: FitParameters.h:265
Trk::FitParameters
Definition: FitParameters.h:29
Trk::FitParameters::FitParameters
FitParameters(const Perigee &perigee)
Definition: FitParameters.cxx:28
Trk::FitParameters::FitParameters
FitParameters(FitParameters &&)=default
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
Trk::FitParameters::addScatterer
void addScatterer(double phi, double theta)
Definition: FitParameters.cxx:116
Trk::FitParameters::m_finalCovariance
Amg::MatrixX * m_finalCovariance
Definition: FitParameters.h:126
Trk::FitParameters::associatedSurface
const Surface * associatedSurface(void) const
Definition: FitParameters.cxx:122
Trk::FitParameters::phiInstability
bool phiInstability(void) const
Definition: FitParameters.cxx:244
Trk::alignment
@ alignment
Definition: MeasurementType.h:33
Trk::FitParameters::reset
void reset(const FitParameters &parameters)
Definition: FitParameters.cxx:397
Trk::FitParameters::m_cotTheta
double m_cotTheta
Definition: FitParameters.h:121
Trk::FitParameters::differences
const Amg::VectorX & differences(void) const
Definition: FitParameters.h:196
Trk::FitParameters::performCutStep
void performCutStep(double cutStep)
Definition: FitParameters.cxx:201