Belle II Software development
FitSegmentPairRelationVarSet.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/filters/segmentPairRelation/FitSegmentPairRelationVarSet.h>
9
10#include <tracking/trackingUtilities/eventdata/tracks/CDCSegmentPair.h>
11
12using namespace Belle2;
13using namespace TrackFindingCDC;
14using namespace TrackingUtilities;
15
17{
18 if (not ptrSegmentPairRelation) return false;
19
20 const CDCSegmentPair* fromSegmentPair = ptrSegmentPairRelation->first;
21 const CDCSegmentPair* toSegmentPair = ptrSegmentPairRelation->second;
22
23 CDCTrajectory3D fromFit = fromSegmentPair->getTrajectory3D();
24 CDCTrajectory3D toFit = toSegmentPair->getTrajectory3D();
25
26 Vector3D commonOrigin = fromFit.getSupport();
27
28 fromFit.setLocalOrigin(commonOrigin);
29 toFit.setLocalOrigin(commonOrigin);
30
31 const UncertainHelix& fromHelix = fromFit.getLocalHelix();
32 const UncertainHelix& toHelix = toFit.getLocalHelix();
33 UncertainHelix commonHelix = UncertainHelix::average(fromHelix, toHelix);
34
35 finitevar<named("is_fitted")>() = not commonHelix->isInvalid();
36 finitevar<named("curv")>() = commonHelix->curvatureXY();
37 finitevar<named("tanl")>() = commonHelix->tanLambda();
38 finitevar<named("z0")>() = commonOrigin.z();
39
40 using namespace NHelixParameterIndices;
41 finitevar<named("curv_var")>() = commonHelix.variance(c_Curv);
42 finitevar<named("tanl_var")>() = commonHelix.variance(c_TanL);
43 finitevar<named("z0_var")>() = commonHelix.variance(c_Z0);
44
45 finitevar<named("chi2")>() = std::fabs(commonHelix.chi2());
46 finitevar<named("ndf")>() = commonHelix.ndf();
47 finitevar<named("chi2_per_ndf")>() = std::fabs(commonHelix.chi2()) / commonHelix.ndf();
48 finitevar<named("p_value")>() = TMath::Prob(commonHelix.chi2(), commonHelix.ndf());
49 return true;
50}
bool extract(const TrackingUtilities::Relation< const TrackingUtilities::CDCSegmentPair > *ptrSegmentPairRelation) final
Generate and assign the contained variables.
Class representing a pair of one reconstructed axial segment and one stereo segment in adjacent super...
CDCTrajectory3D & getTrajectory3D() const
Getter for the three dimensional trajectory.
Particle full three dimensional trajectory.
const UncertainHelix & getLocalHelix() const
Getter for the helix in local coordinates.
double setLocalOrigin(const Vector3D &localOrigin)
Setter for the origin of the local coordinate system.
Vector3D getSupport() const
Getter for the support point of the trajectory in global coordinates, where arcLength2D = 0.
Type for two related objects.
Definition Relation.h:21
static UncertainHelix average(const UncertainHelix &fromHelix, const UncertainHelix &toHelix)
Construct the averages of the two given helices by properly considering their covariance matrix.
double z() const
Getter for the z coordinate.
Definition Vector3D.h:501
This class represents an ideal helix in perigee parameterization including the covariance matrix of t...
HepGeom::Vector3D< double > Vector3D
3D Vector
Definition Cell.h:34
Namespace to hide the contained enum constants.
Abstract base class for different kinds of events.