Belle II Software  release-05-01-25
CDCTrajectorySZ.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2012 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Oliver Frost *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #pragma once
11 
12 #include <tracking/trackFindingCDC/geometry/UncertainSZLine.h>
13 #include <tracking/trackFindingCDC/geometry/Vector2D.h>
14 
15 #include <TMath.h>
16 
17 namespace Belle2 {
22  namespace TrackFindingCDC {
23 
33  class CDCTrajectorySZ {
34 
35  public:
37  static SZCovariance getBasicSZCovariance();
38 
39  public:
42 
44  explicit CDCTrajectorySZ(const UncertainSZLine& szLine)
45  : m_szLine(szLine)
46  {}
47 
49  CDCTrajectorySZ(const double tanLambda, const double z0)
50  : m_szLine(tanLambda, z0, getBasicSZCovariance())
51  {}
52 
55 
57  double mapSToZ(const double s = 0) const
58  { return getSZLine()->map(s); }
59 
66  double mapPtToPz(const double pt) const
67  { return getSZLine()->slope() * pt; }
68 
70  double getZDist(const double s, const double z) const
71  { return mapSToZ(s) - z; }
72 
82  double getSZDist(const double s, const double z) const
83  { return getSZLine()->distance(Vector2D(s, z)) ; }
84 
94  void passiveMoveS(const double deltaS)
95  { m_szLine.passiveMoveBy(Vector2D(deltaS, 0)); }
96 
98  bool isFitted() const
99  { return not m_szLine->isInvalid(); }
100 
102  void clear()
103  { m_szLine.invalidate(); }
104 
106  double getTanLambda() const
107  { return getSZLine()->slope(); }
108 
110  double getZ0() const
111  { return getSZLine()->intercept(); }
112 
114  double getPValue() const
115  { return TMath::Prob(getChi2(), getNDF()); }
116 
118  double getChi2() const
119  { return getSZLine().chi2(); }
120 
122  void setChi2(const double chi2)
123  { return m_szLine.setChi2(chi2); }
124 
126  size_t getNDF() const
127  { return getSZLine().ndf(); }
128 
130  void setNDF(std::size_t ndf)
131  { return m_szLine.setNDF(ndf); }
132 
134  const UncertainSZLine& getSZLine() const
135  { return m_szLine; }
136 
138  void setSZLine(const UncertainSZLine& szLine)
139  { m_szLine = szLine; }
140 
141  private:
144  };
145  }
147 }
Belle2::TrackFindingCDC::CDCTrajectorySZ::getPValue
double getPValue() const
Getter for p-value.
Definition: CDCTrajectorySZ.h:122
Belle2::TrackFindingCDC::CDCTrajectorySZ::getNDF
size_t getNDF() const
Getter for the number of degrees of freedom of the line fit.
Definition: CDCTrajectorySZ.h:134
Belle2::TrackFindingCDC::UncertainSZLine::passiveMoveBy
void passiveMoveBy(const Vector2D &bySZ)
Moves the coordinate system by the vector by and calculates the new sz line and its covariance matrix...
Definition: UncertainSZLine.h:193
Belle2::TrackFindingCDC::CDCTrajectorySZ::isFitted
bool isFitted() const
Indicates if the line has been fitted.
Definition: CDCTrajectorySZ.h:106
Belle2::TrackFindingCDC::UncertainSZLine
A line in sz where s is the transverse travel distance as seen in the xy projection with uncertaintie...
Definition: UncertainSZLine.h:38
Belle2::TrackFindingCDC::CDCTrajectorySZ::setSZLine
void setSZLine(const UncertainSZLine &szLine)
Setter for the line in sz space.
Definition: CDCTrajectorySZ.h:146
Belle2::TrackFindingCDC::UncertainSZLine::setNDF
void setNDF(std::size_t ndf)
Setter for the number of degrees of freediom used in the line fit.
Definition: UncertainSZLine.h:162
Belle2::TrackFindingCDC::UncertainSZLine::ndf
std::size_t ndf() const
Getter for the number of degrees of freediom used in the line fit.
Definition: UncertainSZLine.h:156
Belle2::TrackFindingCDC::UncertainSZLine::chi2
double chi2() const
Getter for the chi square value of the line fit.
Definition: UncertainSZLine.h:144
Belle2::TrackFindingCDC::SZLine::isInvalid
bool isInvalid() const
Indicates if the line parameters do not represent a valid line.
Definition: SZLine.h:152
Belle2::TrackFindingCDC::CDCTrajectorySZ::getSZDist
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...
Definition: CDCTrajectorySZ.h:90
Belle2::TrackFindingCDC::CDCTrajectorySZ::getChi2
double getChi2() const
Getter for the chi square value of the line fit.
Definition: CDCTrajectorySZ.h:126
Belle2::TrackFindingCDC::CDCTrajectorySZ::basicAssumption
static CDCTrajectorySZ basicAssumption()
Constucts a basic assumption, what the z0 start position and the sz slope are, including some broad v...
Definition: CDCTrajectorySZ.cc:29
Belle2::TrackFindingCDC::CDCTrajectorySZ::CDCTrajectorySZ
CDCTrajectorySZ()
Default constructor for ROOT compatibility.
Definition: CDCTrajectorySZ.h:49
Belle2::TrackFindingCDC::CDCTrajectorySZ::getBasicSZCovariance
static SZCovariance getBasicSZCovariance()
Getter for a default assumption about the parameter covariances.
Definition: CDCTrajectorySZ.cc:17
Belle2::TrackFindingCDC::CDCTrajectorySZ
Linear trajectory in sz space.
Definition: CDCTrajectorySZ.h:41
Belle2::TrackFindingCDC::CDCTrajectorySZ::setNDF
void setNDF(std::size_t ndf)
Setter for the number of degrees of freedom of the line fit.
Definition: CDCTrajectorySZ.h:138
Belle2::TrackFindingCDC::CDCTrajectorySZ::clear
void clear()
Clears all information from this trajectory line.
Definition: CDCTrajectorySZ.h:110
Belle2::TrackFindingCDC::CDCTrajectorySZ::mapSToZ
double mapSToZ(const double s=0) const
Translates the travel distance to the z coordinate.
Definition: CDCTrajectorySZ.h:65
Belle2::TrackFindingCDC::UncertainSZLine::setChi2
void setChi2(const double chi2)
Setter for the chi square value of the line fit.
Definition: UncertainSZLine.h:150
Belle2::TrackFindingCDC::UncertainSZLine::invalidate
void invalidate()
Sets all line parameters to zero including the covariance matrix.
Definition: UncertainSZLine.h:168
Belle2::TrackFindingCDC::CDCTrajectorySZ::getZ0
double getZ0() const
Getter for the z coordinate at zero travel distance.
Definition: CDCTrajectorySZ.h:118
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackFindingCDC::CDCTrajectorySZ::m_szLine
UncertainSZLine m_szLine
Memory for the line representation.
Definition: CDCTrajectorySZ.h:151
Belle2::TrackFindingCDC::CDCTrajectorySZ::passiveMoveS
void passiveMoveS(const double deltaS)
Passively Shift the s coordinate by the amount given.
Definition: CDCTrajectorySZ.h:102
Belle2::TrackFindingCDC::SZLine::map
double map(double s) const
Maps the two dimensional arc length s to z.
Definition: SZLine.h:126
Belle2::TrackFindingCDC::SZLine::distance
double distance(const Vector2D &szPoint) const
Calculates the signed distance of the point to the line.
Definition: SZLine.h:175
Belle2::TrackFindingCDC::CDCTrajectorySZ::mapPtToPz
double mapPtToPz(const double pt) const
Translates the absolute value of the transvers momentum to the momentum in z direction.
Definition: CDCTrajectorySZ.h:74
Belle2::TrackFindingCDC::CDCTrajectorySZ::getZDist
double getZDist(const double s, const double z) const
Calculates the distance along between the given point an the sz trajectory.
Definition: CDCTrajectorySZ.h:78
Belle2::TrackFindingCDC::SZLine::slope
double slope() const
Getter for the slope in the sz space which is equivalent to tan lambda.
Definition: SZLine.h:68
Belle2::TrackFindingCDC::CDCTrajectorySZ::getSZLine
const UncertainSZLine & getSZLine() const
Getter for the line in sz space.
Definition: CDCTrajectorySZ.h:142
Belle2::TrackFindingCDC::CDCTrajectorySZ::getTanLambda
double getTanLambda() const
Getter for the slope over the travel distance coordinate.
Definition: CDCTrajectorySZ.h:114
Belle2::TrackFindingCDC::CDCTrajectorySZ::setChi2
void setChi2(const double chi2)
Setter for the chi square value of the line fit.
Definition: CDCTrajectorySZ.h:130
Belle2::TrackFindingCDC::SZLine::intercept
double intercept() const
Getter for the intercept in the sz space which is equivalent to z0.
Definition: SZLine.h:98