Belle II Software development
FitSegmentPairVarSet.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/segmentPair/FitSegmentPairVarSet.h>
9
10#include <tracking/trackFindingCDC/fitting/CDCAxialStereoFusion.h>
11
12#include <tracking/trackingUtilities/eventdata/tracks/CDCSegmentPair.h>
13#include <tracking/trackingUtilities/eventdata/trajectories/CDCTrajectory3D.h>
14#include <tracking/trackingUtilities/geometry/HelixParameters.h>
15#include <tracking/trackingUtilities/geometry/Vector3D.h>
16
17using namespace Belle2;
18using namespace TrackFindingCDC;
19using namespace TrackingUtilities;
20
22 : Super()
23 , m_preliminaryFit(preliminaryFit)
24{
25}
26
28{
29 if (not ptrSegmentPair) return false;
30
31 const CDCSegmentPair& segmentPair = *ptrSegmentPair;
32
33 CDCAxialStereoFusion axialStereoFusion;
34 if (m_preliminaryFit) {
35 axialStereoFusion.fusePreliminary(segmentPair);
36 } else {
37 axialStereoFusion.reconstructFuseTrajectories(segmentPair);
38 }
39 CDCTrajectory3D fit = segmentPair.getTrajectory3D();
40 Vector3D support3D = fit.getSupport();
41
42 finitevar<named("ndf")>() = fit.isFitted() ? fit.getNDF() : NAN;
43 finitevar<named("chi2")>() = fit.getChi2();
44 finitevar<named("p_value")>() = fit.getPValue();
45
46 finitevar<named("curv")>() = fit.isFitted() ? fit.getCurvatureXY() : NAN;
47 finitevar<named("z0")>() = support3D.z();
48 finitevar<named("tanl")>() = fit.getTanLambda();
49
50 using namespace NHelixParameterIndices;
51 finitevar<named("curv_var")>() = fit.getLocalVariance(c_Curv);
52 finitevar<named("z0_var")>() = fit.getLocalVariance(c_Z0);
53 finitevar<named("tanl_var")>() = fit.getLocalVariance(c_TanL);
54
55 return true;
56}
57
58std::vector<Named<Float_t*> > FitSegmentPairVarSet::getNamedVariables(const std::string& prefix)
59{
60 return m_preliminaryFit ?
61 Super::getNamedVariables(prefix + "pre_") :
63}
Utility class implementing the Kalmanesk combination of to two dimensional trajectories to one three ...
void reconstructFuseTrajectories(const TrackingUtilities::CDCSegmentPair &segmentPair)
Combine the two trajectories of the segments in the pair and assign the resulting three dimensional t...
void fusePreliminary(const TrackingUtilities::CDCSegmentPair &segmentPair)
Fit the given segment pair using the preliminary helix fit without proper covariance matrix.
TrackingUtilities::VarSet< FitSegmentPairVarNames > Super
Type of the base class.
bool extract(const TrackingUtilities::CDCSegmentPair *ptrSegmentPair) final
Generate and assign the contained variables.
FitSegmentPairVarSet(bool preliminaryFit=false)
Construct the varset with a switch to only do the prelimiary axial stereo fusion fit.
bool m_preliminaryFit
Indicator that only the prelimiary fit should be used.
std::vector< Named< Float_t * > > getNamedVariables()
Getter for the named references to the individual variables.
Definition BaseVarSet.h:74
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.
static constexpr int named(const char *name)
Definition VarSet.h:78
double z() const
Getter for the z coordinate.
Definition Vector3D.h:501
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.