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
16#include <Math/Vector3D.h>
17
18using namespace Belle2;
19using namespace TrackFindingCDC;
20using namespace TrackingUtilities;
21
23 : Super()
24 , m_preliminaryFit(preliminaryFit)
25{
26}
27
29{
30 if (not ptrSegmentPair) return false;
31
32 const CDCSegmentPair& segmentPair = *ptrSegmentPair;
33
34 CDCAxialStereoFusion axialStereoFusion;
35 if (m_preliminaryFit) {
36 axialStereoFusion.fusePreliminary(segmentPair);
37 } else {
38 axialStereoFusion.reconstructFuseTrajectories(segmentPair);
39 }
40 CDCTrajectory3D fit = segmentPair.getTrajectory3D();
41 ROOT::Math::XYZVector support3D = fit.getSupport();
42
43 finitevar<named("ndf")>() = fit.isFitted() ? fit.getNDF() : NAN;
44 finitevar<named("chi2")>() = fit.getChi2();
45 finitevar<named("p_value")>() = fit.getPValue();
46
47 finitevar<named("curv")>() = fit.isFitted() ? fit.getCurvatureXY() : NAN;
48 finitevar<named("z0")>() = support3D.z();
49 finitevar<named("tanl")>() = fit.getTanLambda();
50
51 using namespace NHelixParameterIndices;
52 finitevar<named("curv_var")>() = fit.getLocalVariance(c_Curv);
53 finitevar<named("z0_var")>() = fit.getLocalVariance(c_Z0);
54 finitevar<named("tanl_var")>() = fit.getLocalVariance(c_TanL);
55
56 return true;
57}
58
59std::vector<Named<Float_t*> > FitSegmentPairVarSet::getNamedVariables(const std::string& prefix)
60{
61 return m_preliminaryFit ?
62 Super::getNamedVariables(prefix + "pre_") :
64}
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
Namespace to hide the contained enum constants.
Abstract base class for different kinds of events.