Belle II Software development
UncertainPerigeeCircle.cc
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#include <tracking/trackFindingCDC/geometry/UncertainPerigeeCircle.h>
9
10#include <tracking/trackFindingCDC/geometry/PerigeeCircle.h>
11#include <tracking/trackFindingCDC/geometry/PerigeeParameters.h>
12
13#include <ostream>
14
15using namespace Belle2;
16using namespace TrackFindingCDC;
17
20 const UncertainPerigeeCircle& toPerigeeCircle)
21{
22 const PerigeeParameters& fromPar = fromPerigeeCircle.perigeeParameters();
23 const PerigeeCovariance& fromCov = fromPerigeeCircle.perigeeCovariance();
24
25 const PerigeeParameters& toPar = toPerigeeCircle.perigeeParameters();
26 const PerigeeCovariance& toCov = toPerigeeCircle.perigeeCovariance();
27
28 PerigeeParameters avgPar;
29 PerigeeCovariance avgCov;
30
31 double chi2 = PerigeeUtil::average(fromPar, fromCov, toPar, toCov, avgPar, avgCov);
32
33 // Calculating 3 parameters from 6 input parameters. 3 NDF remaining.
34 size_t ndf = 3;
35
36 return UncertainPerigeeCircle(avgPar, avgCov, chi2, ndf);
37}
38
39std::ostream& TrackFindingCDC::operator<<(std::ostream& output, const UncertainPerigeeCircle& circle)
40{
41 return output << "UncertainPerigeeCircle("
42 << "curvature=" << circle->curvature() << ","
43 << "phi0=" << circle->phi0() << ","
44 << "impact=" << circle->impact() << ")";
45}
double phi0() const
Getter for the azimuth angle of the direction of flight at the perigee.
double impact() const
Getter for the signed distance of the origin to the circle.
double curvature() const
Getter for the signed curvature.
A matrix implementation to be used as an interface typ through out the track finder.
Definition: PlainMatrix.h:40
Adds an uncertainty matrix to the circle in perigee parameterisation.
UncertainPerigeeCircle()
Default constructor for ROOT compatibility.
PerigeeParameters perigeeParameters() const
Getter for the perigee parameters in the order defined by EPerigeeParameter.h.
double chi2() const
Getter for the chi square value of the circle fit.
const PerigeeCovariance & perigeeCovariance() const
Getter for the whole covariance matrix of the perigee parameters.
std::size_t ndf() const
Getter for the number of degrees of freediom used in the circle fit.
static UncertainPerigeeCircle average(const UncertainPerigeeCircle &fromPerigeeCircle, const UncertainPerigeeCircle &toPerigeeCircle)
Average the parameters of the two given perigee circles properly considering their covariance matrix.
Abstract base class for different kinds of events.
static double average(const PerigeeUtil::ParameterVector &fromPar, const PerigeeUtil::CovarianceMatrix &fromCov, const PerigeeUtil::ParameterVector &toPar, const PerigeeUtil::CovarianceMatrix &toCov, PerigeeUtil::ParameterVector &avgPar, PerigeeUtil::CovarianceMatrix &avgCov)
Calculates the weighted average between two perigee parameter sets with their respective covariance m...