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/trackingUtilities/geometry/UncertainSZLine.h>
11
12#include <Math/Vector2D.h>
13
14#include <TMath.h>
15
16namespace Belle2 {
21 namespace TrackingUtilities {
22
33
34 public:
36 static SZCovariance getBasicSZCovariance();
37
38 public:
41
43 explicit CDCTrajectorySZ(const UncertainSZLine& szLine)
44 : m_szLine(szLine)
45 {}
46
48 CDCTrajectorySZ(const double tanLambda, const double z0)
49 : m_szLine(tanLambda, z0, getBasicSZCovariance())
50 {}
51
54
56 double mapSToZ(const double s = 0) const
57 { return getSZLine()->map(s); }
58
65 double mapPtToPz(const double pt) const
66 { return getSZLine()->slope() * pt; }
67
69 double getZDist(const double s, const double z) const
70 { return mapSToZ(s) - z; }
71
81 double getSZDist(const double s, const double z) const
82 { return getSZLine()->distance(ROOT::Math::XYVector(s, z)) ; }
83
93 void passiveMoveS(const double deltaS)
94 { m_szLine.passiveMoveBy(ROOT::Math::XYVector(deltaS, 0)); }
95
97 bool isFitted() const
98 { return not m_szLine->isInvalid(); }
99
101 void clear()
102 { m_szLine.invalidate(); }
103
105 double getTanLambda() const
106 { return getSZLine()->slope(); }
107
109 double getZ0() const
110 { return getSZLine()->intercept(); }
111
113 double getPValue() const
114 { return TMath::Prob(getChi2(), getNDF()); }
115
117 double getChi2() const
118 { return getSZLine().chi2(); }
119
121 void setChi2(const double chi2)
122 { return m_szLine.setChi2(chi2); }
123
125 size_t getNDF() const
126 { return getSZLine().ndf(); }
127
129 void setNDF(std::size_t ndf)
130 { return m_szLine.setNDF(ndf); }
131
134 { return m_szLine; }
135
137 void setSZLine(const UncertainSZLine& szLine)
138 { m_szLine = szLine; }
139
140 private:
143 };
144 }
146}
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()
Constructs a basic assumption, what the z0 start position and the sz slope are, including some broad ...
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 transverse 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 at 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.
double slope() const
Getter for the slope in the sz space which is equivalent to tan lambda.
Definition SZLine.h:60
double intercept() const
Getter for the intercept in the sz space which is equivalent to z0.
Definition SZLine.h:90
double map(double s) const
Maps the two dimensional arc length s to z.
Definition SZLine.h:118
double distance(const ROOT::Math::XYVector &szPoint) const
Calculates the signed distance of the point to the line.
Definition SZLine.h:167
A line in sz where s is the transverse travel distance as seen in the xy projection with uncertaintie...
double chi2() const
Getter 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.
Abstract base class for different kinds of events.