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/trackFindingCDC/eventdata/tracks/CDCSegmentPair.h>
13#include <tracking/trackFindingCDC/eventdata/trajectories/CDCTrajectory3D.h>
14#include <tracking/trackFindingCDC/geometry/HelixParameters.h>
15#include <tracking/trackFindingCDC/geometry/Vector3D.h>
16
17using namespace Belle2;
18using namespace TrackFindingCDC;
19
21 : Super()
22 , m_preliminaryFit(preliminaryFit)
23{
24}
25
27{
28 if (not ptrSegmentPair) return false;
29
30 const CDCSegmentPair& segmentPair = *ptrSegmentPair;
31
32 CDCAxialStereoFusion axialStereoFusion;
33 if (m_preliminaryFit) {
34 axialStereoFusion.fusePreliminary(segmentPair);
35 } else {
36 axialStereoFusion.reconstructFuseTrajectories(segmentPair);
37 }
38 CDCTrajectory3D fit = segmentPair.getTrajectory3D();
39 Vector3D support3D = fit.getSupport();
40
41 finitevar<named("ndf")>() = fit.isFitted() ? fit.getNDF() : NAN;
42 finitevar<named("chi2")>() = fit.getChi2();
43 finitevar<named("p_value")>() = fit.getPValue();
44
45 finitevar<named("curv")>() = fit.isFitted() ? fit.getCurvatureXY() : NAN;
46 finitevar<named("z0")>() = support3D.z();
47 finitevar<named("tanl")>() = fit.getTanLambda();
48
49 using namespace NHelixParameterIndices;
50 finitevar<named("curv_var")>() = fit.getLocalVariance(c_Curv);
51 finitevar<named("z0_var")>() = fit.getLocalVariance(c_Z0);
52 finitevar<named("tanl_var")>() = fit.getLocalVariance(c_TanL);
53
54 return true;
55}
56
57std::vector<Named<Float_t*> > FitSegmentPairVarSet::getNamedVariables(const std::string& prefix)
58{
59 return m_preliminaryFit ?
60 Super::getNamedVariables(prefix + "pre_") :
62}
std::vector< Named< Float_t * > > getNamedVariables()
Getter for the named references to the individual variables.
Definition: BaseVarSet.h:73
Utility class implementing the Kalmanesk combination of to two dimensional trajectories to one three ...
void fusePreliminary(const CDCSegmentPair &segmentPair)
Fit the given segment pair using the preliminary helix fit without proper covariance matrix.
void reconstructFuseTrajectories(const CDCSegmentPair &segmentPair)
Combine the two trajectories of the segments in the pair and assign the resulting three dimensional t...
Class representing a pair of one reconstructed axial segement and one stereo segment in adjacent supe...
CDCTrajectory3D & getTrajectory3D() const
Getter for the three dimensional trajectory.
Particle full three dimensional trajectory.
bool extract(const 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.
AssignFinite< Float_t > finitevar()
Reference getter for the value of the ith variable. Transforms non-finite values to finite value.
Definition: VarSet.h:130
static constexpr int named(const char *name)
Getter for the index from the name.
Definition: VarSet.h:78
A three dimensional vector.
Definition: Vector3D.h:33
double z() const
Getter for the z coordinate.
Definition: Vector3D.h:496
Abstract base class for different kinds of events.