Belle II Software development
CDCTrajectorySZ.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8#pragma once
9
10#include <tracking/trackFindingCDC/geometry/UncertainSZLine.h>
11#include <tracking/trackFindingCDC/geometry/Vector2D.h>
12
13#include <TMath.h>
14
15namespace Belle2 {
20 namespace TrackFindingCDC {
21
32
33 public:
36
37 public:
40
42 explicit CDCTrajectorySZ(const UncertainSZLine& szLine)
43 : m_szLine(szLine)
44 {}
45
47 CDCTrajectorySZ(const double tanLambda, const double z0)
48 : m_szLine(tanLambda, z0, getBasicSZCovariance())
49 {}
50
53
55 double mapSToZ(const double s = 0) const
56 { return getSZLine()->map(s); }
57
64 double mapPtToPz(const double pt) const
65 { return getSZLine()->slope() * pt; }
66
68 double getZDist(const double s, const double z) const
69 { return mapSToZ(s) - z; }
70
80 double getSZDist(const double s, const double z) const
81 { return getSZLine()->distance(Vector2D(s, z)) ; }
82
92 void passiveMoveS(const double deltaS)
93 { m_szLine.passiveMoveBy(Vector2D(deltaS, 0)); }
94
96 bool isFitted() const
97 { return not m_szLine->isInvalid(); }
98
100 void clear()
101 { m_szLine.invalidate(); }
102
104 double getTanLambda() const
105 { return getSZLine()->slope(); }
106
108 double getZ0() const
109 { return getSZLine()->intercept(); }
110
112 double getPValue() const
113 { return TMath::Prob(getChi2(), getNDF()); }
114
116 double getChi2() const
117 { return getSZLine().chi2(); }
118
120 void setChi2(const double chi2)
121 { return m_szLine.setChi2(chi2); }
122
124 size_t getNDF() const
125 { return getSZLine().ndf(); }
126
128 void setNDF(std::size_t ndf)
129 { return m_szLine.setNDF(ndf); }
130
133 { return m_szLine; }
134
136 void setSZLine(const UncertainSZLine& szLine)
137 { m_szLine = szLine; }
138
139 private:
142 };
143 }
145}
Linear trajectory in sz space.
CDCTrajectorySZ(const UncertainSZLine &szLine)
Constructs the trajectory from the given two dimensional sz line.
double mapSToZ(const double s=0) const
Translates the travel distance to the z coordinate.
static CDCTrajectorySZ basicAssumption()
Constucts a basic assumption, what the z0 start position and the sz slope are, including some broad v...
double getChi2() const
Getter for the chi square value of the line fit.
double getPValue() const
Getter for p-value.
bool isFitted() const
Indicates if the line has been fitted.
CDCTrajectorySZ(const double tanLambda, const double z0)
Constructs the trajectory with the given slope and start z.
double mapPtToPz(const double pt) const
Translates the absolute value of the transvers momentum to the momentum in z direction.
UncertainSZLine m_szLine
Memory for the line representation.
double getSZDist(const double s, const double z) const
Gets the signed distance of the sz point to the line in the sz plane This gives the signed distance o...
double getTanLambda() const
Getter for the slope over the travel distance coordinate.
double getZDist(const double s, const double z) const
Calculates the distance along between the given point an the sz trajectory.
CDCTrajectorySZ()
Default constructor for ROOT compatibility.
void setSZLine(const UncertainSZLine &szLine)
Setter for the line in sz space.
void setNDF(std::size_t ndf)
Setter for the number of degrees of freedom of the line fit.
double getZ0() const
Getter for the z coordinate at zero travel distance.
static SZCovariance getBasicSZCovariance()
Getter for a default assumption about the parameter covariances.
void clear()
Clears all information from this trajectory line.
const UncertainSZLine & getSZLine() const
Getter for the line in sz space.
void setChi2(const double chi2)
Setter for the chi square value of the line fit.
void passiveMoveS(const double deltaS)
Passively Shift the s coordinate by the amount given.
size_t getNDF() const
Getter for the number of degrees of freedom of the line fit.
A matrix implementation to be used as an interface typ through out the track finder.
Definition: PlainMatrix.h:40
bool isInvalid() const
Indicates if the line parameters do not represent a valid line.
Definition: SZLine.h:142
double slope() const
Getter for the slope in the sz space which is equivalent to tan lambda.
Definition: SZLine.h:58
double intercept() const
Getter for the intercept in the sz space which is equivalent to z0.
Definition: SZLine.h:88
double map(double s) const
Maps the two dimensional arc length s to z.
Definition: SZLine.h:116
double distance(const Vector2D &szPoint) const
Calculates the signed distance of the point to the line.
Definition: SZLine.h:165
A line in sz where s is the transverse travel distance as seen in the xy projection with uncertaintie...
void invalidate()
Sets all line parameters to zero including the covariance matrix.
void passiveMoveBy(const Vector2D &bySZ)
Moves the coordinate system by the vector by and calculates the new sz line and its covariance matrix...
double chi2() const
Getter for the chi square value of the line fit.
void setNDF(std::size_t ndf)
Setter for the number of degrees of freediom used in the line fit.
void setChi2(const double chi2)
Setter for the chi square value of the line fit.
std::size_t ndf() const
Getter for the number of degrees of freediom used in the line fit.
A two dimensional vector which is equipped with functions for correct handeling of orientation relat...
Definition: Vector2D.h:32
Abstract base class for different kinds of events.