ATLAS Offline Software
Loading...
Searching...
No Matches
ResidualWithSegment.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef DCMATH_RESIDUALWITHSEGMENT_H
6#define DCMATH_RESIDUALWITHSEGMENT_H
7
14
15namespace TrkDriftCircleMath {
16
21 public:
22 ResidualWithSegment(const Segment& segment) :
23 ResidualWithLine(segment.line()),
24 m_line(segment.line()),
25 m_errorY02(segment.dy0() * segment.dy0()),
26 m_errorPhi2(segment.dtheta() * segment.dtheta()) {}
27
29 double trackError2(const DriftCircle& dc) const {
30 LocVec2D posInLineFrame = m_transToLine.toLine(dc.position());
31 return m_errorY02 + posInLineFrame.x() * m_errorPhi2;
32 }
33
35 double trackError2(const Cluster& cl) const {
36 double yDistToSegment = cl.position().y() - m_line.position().y();
37
38 double sinPhi = m_transToLine.toLineRotation().sinphi();
39 if (sinPhi < 1e-13) sinPhi = 1e-13;
40 double invSinPhi2 = sinPhi * sinPhi;
41 invSinPhi2 = 1. / invSinPhi2;
42
43 return m_errorY02 * invSinPhi2 + yDistToSegment * yDistToSegment * invSinPhi2 * m_errorPhi2;
44 }
45
46 private:
48 double m_errorY02;
50 };
51
52} // namespace TrkDriftCircleMath
53
54#endif
This class represents a drift time measurement.
Definition DriftCircle.h:22
const LocVec2D & position() const
access to local position
Definition DriftCircle.h:74
Implementation of 2 dimensional vector class.
Definition LocVec2D.h:16
double x() const
Returns the x coordinate of the vector.
Definition LocVec2D.h:27
double trackError2(const DriftCircle &dc) const
calculate the track error at the position of a drift circle
double trackError2(const Cluster &cl) const
calculate the track error at the position of a cluster
Function object to check whether two Segments are sub/super sets or different.