Belle II Software  release-05-01-25
FitSegmentPairVarSet.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2015 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Oliver Frost *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #include <tracking/trackFindingCDC/filters/segmentPair/FitSegmentPairVarSet.h>
11 
12 #include <tracking/trackFindingCDC/fitting/CDCAxialStereoFusion.h>
13 
14 #include <tracking/trackFindingCDC/eventdata/tracks/CDCSegmentPair.h>
15 #include <tracking/trackFindingCDC/eventdata/trajectories/CDCTrajectory3D.h>
16 #include <tracking/trackFindingCDC/geometry/HelixParameters.h>
17 #include <tracking/trackFindingCDC/geometry/Vector3D.h>
18 
19 using namespace Belle2;
20 using namespace TrackFindingCDC;
21 
23  : Super()
24  , m_preliminaryFit(preliminaryFit)
25 {
26 }
27 
28 bool FitSegmentPairVarSet::extract(const CDCSegmentPair* ptrSegmentPair)
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  Vector3D 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 
59 std::vector<Named<Float_t*> > FitSegmentPairVarSet::getNamedVariables(const std::string& prefix)
60 {
61  return m_preliminaryFit ?
62  Super::getNamedVariables(prefix + "pre_") :
64 }
Belle2::TrackFindingCDC::CDCSegmentPair
Class representing a pair of one reconstructed axial segement and one stereo segment in adjacent supe...
Definition: CDCSegmentPair.h:44
Belle2::TrackFindingCDC::CDCAxialStereoFusion::reconstructFuseTrajectories
void reconstructFuseTrajectories(const CDCSegmentPair &segmentPair)
Combine the two trajectories of the segments in the pair and assign the resulting three dimensional t...
Definition: CDCAxialStereoFusion.cc:43
Belle2::TrackFindingCDC::VarSet< FitSegmentPairVarNames >::finitevar
AssignFinite< Float_t > finitevar()
Reference getter for the value of the ith variable. Transforms non-finite values to finite value.
Definition: VarSet.h:140
Belle2::TrackFindingCDC::BaseVarSet< FitSegmentPairVarNames ::Object >::getNamedVariables
std::vector< Named< Float_t * > > getNamedVariables()
Getter for the named references to the individual variables.
Definition: BaseVarSet.h:80
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackFindingCDC::FitSegmentPairVarSet::FitSegmentPairVarSet
FitSegmentPairVarSet(bool preliminaryFit=false)
Construct the varset with a switch to only do the prelimiary axial stereo fusion fit.
Definition: FitSegmentPairVarSet.cc:22
Belle2::TrackFindingCDC::Vector3D
A three dimensional vector.
Definition: Vector3D.h:34
Belle2::TrackFindingCDC::CDCAxialStereoFusion
Utility class implementing the Kalmanesk combination of to two dimensional trajectories to one three ...
Definition: CDCAxialStereoFusion.h:40
Belle2::TrackFindingCDC::FitSegmentPairVarSet::m_preliminaryFit
bool m_preliminaryFit
Indicator that only the prelimiary fit should be used.
Definition: FitSegmentPairVarSet.h:80
Belle2::TrackFindingCDC::FitSegmentPairVarSet::extract
bool extract(const CDCSegmentPair *ptrSegmentPair) final
Generate and assign the contained variables.
Definition: FitSegmentPairVarSet.cc:28
Belle2::TrackFindingCDC::CDCSegmentPair::getTrajectory3D
CDCTrajectory3D & getTrajectory3D() const
Getter for the three dimensional trajectory.
Definition: CDCSegmentPair.h:213
Belle2::TrackFindingCDC::VarSet< FitSegmentPairVarNames >::named
constexpr static int named(const char *name)
Getter for the index from the name.
Definition: VarSet.h:88
Belle2::TrackFindingCDC::CDCAxialStereoFusion::fusePreliminary
void fusePreliminary(const CDCSegmentPair &segmentPair)
Fit the given segment pair using the preliminary helix fit without proper covariance matrix.
Definition: CDCAxialStereoFusion.cc:65
Belle2::TrackFindingCDC::VarSet< FitSegmentPairVarNames >
Belle2::TrackFindingCDC::Vector3D::z
double z() const
Getter for the z coordinate.
Definition: Vector3D.h:488
Belle2::TrackFindingCDC::CDCTrajectory3D
Particle full three dimensional trajectory.
Definition: CDCTrajectory3D.h:47