Belle II Software development
CKFResult< ASeed, AHit > Class Template Reference

Object for temporary storage of a CKF tree search result. More...

#include <CKFResult.h>

Public Types

using Seed = ASeed
 Copy seed definition.
 
using Hit = AHit
 Copy hit definition.
 

Public Member Functions

template<class AState >
 CKFResult (const std::vector< TrackFindingCDC::WithWeight< const AState * > > &path, const genfit::MeasuredStateOnPlane &mSoP)
 Constructor from the path of the result and the final mSoP, which defines the track position of the resulting track.
 
const std::vector< const AHit * > & getHits () const
 Getter for the stored hits.
 
const ASeed * getSeed () const
 Getter for the stored seeds.
 
double getChi2 () const
 Getter for the chi2.
 
double getMaximalChi2 () const
 Getter for the maximal chi2 of all stored hits. NAN means there is no valid chi2 at all.
 
double getMinimalChi2 () const
 Getter for the minimal chi2 of all stored hits. NAN means there is no valid chi2 at all.
 
const ROOT::Math::XYZVector & getPosition () const
 Get the position this track should start at.
 
const ROOT::Math::XYZVector & getMomentum () const
 Get the momentum this track should start at (defined at the position)
 
short getCharge () const
 Set the charge of the track.
 
double getWeightSum () const
 Getter for the sum of weights.
 
const genfit::MeasuredStateOnPlane & getSeedMSoP () const
 Getter for the mSoP of the seed associated with this result.
 
const genfit::MeasuredStateOnPlane & getMSoP () const
 Getter for the mSoP associated with this result.
 

Private Attributes

const ASeed * m_seed
 The stored seed.
 
std::vector< const AHit * > m_hits
 The stored hits.
 
double m_chi2 = 0
 The stored chi2.
 
double m_maximalChi2 = NAN
 The maximal chi2 of the single states. NAN means there is no valid chi2 at all.
 
double m_minimalChi2 = NAN
 The minimal chi2 of the single states NAN means there is no valid chi2 at all.
 
ROOT::Math::XYZVector m_trackPosition
 The position this track should start at.
 
ROOT::Math::XYZVector m_trackMomentum
 The momentum this track should start at (defined at the position)
 
short m_trackCharge = 0
 The charge of the track.
 
TrackFindingCDC::Weight m_weightSum = 0
 The stored sum of weights.
 
genfit::MeasuredStateOnPlane m_seedMSoP
 The measured state on plane, which was used from the seed.
 
genfit::MeasuredStateOnPlane m_mSoP
 The measured state on plane, which this result was initialized with.
 

Detailed Description

template<class ASeed, class AHit>
class Belle2::CKFResult< ASeed, AHit >

Object for temporary storage of a CKF tree search result.

It stores the seed together with the associated hits and a chi2 value. This object will not be stored to the DataStore, but is only for internal usage.

All sub-detector CKFs should inherit their own object from this.

Definition at line 30 of file CKFResult.h.

Member Typedef Documentation

◆ Hit

using Hit = AHit

Copy hit definition.

Definition at line 36 of file CKFResult.h.

◆ Seed

using Seed = ASeed

Copy seed definition.

Definition at line 34 of file CKFResult.h.

Constructor & Destructor Documentation

◆ CKFResult()

CKFResult ( const std::vector< TrackFindingCDC::WithWeight< const AState * > > &  path,
const genfit::MeasuredStateOnPlane &  mSoP 
)
inline

Constructor from the path of the result and the final mSoP, which defines the track position of the resulting track.

Definition at line 40 of file CKFResult.h.

41 : m_seed(path.front()->getSeed()),
42 m_trackPosition(mSoP.getPos()),
43 m_trackMomentum(mSoP.getMom()),
44 m_trackCharge(static_cast<short>(mSoP.getCharge())),
45 m_seedMSoP(path.front()->getMeasuredStateOnPlane()),
46 m_mSoP(mSoP)
47 {
48 m_hits.reserve(path.size());
49
50 for (const TrackFindingCDC::WithWeight<const AState*> state : path) {
51 const Hit* hit = state->getHit();
52 if (hit) {
53 m_hits.push_back(hit);
54 }
55
56 if (state->isFitted()) {
57 const double stateChi2 = state->getChi2();
58 m_chi2 += stateChi2;
59
60 // The initial value of the maximal and minimal chi2 is NAN, so we always override this default value.
61 if (stateChi2 > m_maximalChi2 or std::isnan(m_maximalChi2)) {
62 m_maximalChi2 = stateChi2;
63 }
64
65 if (stateChi2 < m_minimalChi2 or std::isnan(m_minimalChi2)) {
66 m_minimalChi2 = stateChi2;
67 }
68 }
69
70 m_weightSum += state.getWeight();
71 }
72 }
AHit Hit
Copy hit definition.
Definition: CKFResult.h:36
genfit::MeasuredStateOnPlane m_mSoP
The measured state on plane, which this result was initialized with.
Definition: CKFResult.h:162
ROOT::Math::XYZVector m_trackMomentum
The momentum this track should start at (defined at the position)
Definition: CKFResult.h:154
std::vector< const AHit * > m_hits
The stored hits.
Definition: CKFResult.h:144
TrackFindingCDC::Weight m_weightSum
The stored sum of weights.
Definition: CKFResult.h:158
short m_trackCharge
The charge of the track.
Definition: CKFResult.h:156
double m_chi2
The stored chi2.
Definition: CKFResult.h:146
const ASeed * m_seed
The stored seed.
Definition: CKFResult.h:142
double m_maximalChi2
The maximal chi2 of the single states. NAN means there is no valid chi2 at all.
Definition: CKFResult.h:148
ROOT::Math::XYZVector m_trackPosition
The position this track should start at.
Definition: CKFResult.h:152
genfit::MeasuredStateOnPlane m_seedMSoP
The measured state on plane, which was used from the seed.
Definition: CKFResult.h:160
double m_minimalChi2
The minimal chi2 of the single states NAN means there is no valid chi2 at all.
Definition: CKFResult.h:150

Member Function Documentation

◆ getCharge()

short getCharge ( ) const
inline

Set the charge of the track.

Definition at line 117 of file CKFResult.h.

118 {
119 return m_trackCharge;
120 }

◆ getChi2()

double getChi2 ( ) const
inline

Getter for the chi2.

Definition at line 87 of file CKFResult.h.

88 {
89 return m_chi2;
90 }

◆ getHits()

const std::vector< const AHit * > & getHits ( ) const
inline

Getter for the stored hits.

Definition at line 75 of file CKFResult.h.

76 {
77 return m_hits;
78 }

◆ getMaximalChi2()

double getMaximalChi2 ( ) const
inline

Getter for the maximal chi2 of all stored hits. NAN means there is no valid chi2 at all.

Definition at line 93 of file CKFResult.h.

94 {
95 return m_maximalChi2;
96 }

◆ getMinimalChi2()

double getMinimalChi2 ( ) const
inline

Getter for the minimal chi2 of all stored hits. NAN means there is no valid chi2 at all.

Definition at line 99 of file CKFResult.h.

100 {
101 return m_minimalChi2;
102 }

◆ getMomentum()

const ROOT::Math::XYZVector & getMomentum ( ) const
inline

Get the momentum this track should start at (defined at the position)

Definition at line 111 of file CKFResult.h.

112 {
113 return m_trackMomentum;
114 }

◆ getMSoP()

const genfit::MeasuredStateOnPlane & getMSoP ( ) const
inline

Getter for the mSoP associated with this result.

Definition at line 135 of file CKFResult.h.

136 {
137 return m_mSoP;
138 }

◆ getPosition()

const ROOT::Math::XYZVector & getPosition ( ) const
inline

Get the position this track should start at.

Definition at line 105 of file CKFResult.h.

106 {
107 return m_trackPosition;
108 }

◆ getSeed()

const ASeed * getSeed ( ) const
inline

Getter for the stored seeds.

Definition at line 81 of file CKFResult.h.

82 {
83 return m_seed;
84 }

◆ getSeedMSoP()

const genfit::MeasuredStateOnPlane & getSeedMSoP ( ) const
inline

Getter for the mSoP of the seed associated with this result.

Definition at line 129 of file CKFResult.h.

130 {
131 return m_seedMSoP;
132 }

◆ getWeightSum()

double getWeightSum ( ) const
inline

Getter for the sum of weights.

Definition at line 123 of file CKFResult.h.

124 {
125 return m_weightSum;
126 }

Member Data Documentation

◆ m_chi2

double m_chi2 = 0
private

The stored chi2.

Definition at line 146 of file CKFResult.h.

◆ m_hits

std::vector<const AHit*> m_hits
private

The stored hits.

Definition at line 144 of file CKFResult.h.

◆ m_maximalChi2

double m_maximalChi2 = NAN
private

The maximal chi2 of the single states. NAN means there is no valid chi2 at all.

Definition at line 148 of file CKFResult.h.

◆ m_minimalChi2

double m_minimalChi2 = NAN
private

The minimal chi2 of the single states NAN means there is no valid chi2 at all.

Definition at line 150 of file CKFResult.h.

◆ m_mSoP

genfit::MeasuredStateOnPlane m_mSoP
private

The measured state on plane, which this result was initialized with.

Definition at line 162 of file CKFResult.h.

◆ m_seed

const ASeed* m_seed
private

The stored seed.

Definition at line 142 of file CKFResult.h.

◆ m_seedMSoP

genfit::MeasuredStateOnPlane m_seedMSoP
private

The measured state on plane, which was used from the seed.

Definition at line 160 of file CKFResult.h.

◆ m_trackCharge

short m_trackCharge = 0
private

The charge of the track.

Definition at line 156 of file CKFResult.h.

◆ m_trackMomentum

ROOT::Math::XYZVector m_trackMomentum
private

The momentum this track should start at (defined at the position)

Definition at line 154 of file CKFResult.h.

◆ m_trackPosition

ROOT::Math::XYZVector m_trackPosition
private

The position this track should start at.

Definition at line 152 of file CKFResult.h.

◆ m_weightSum

TrackFindingCDC::Weight m_weightSum = 0
private

The stored sum of weights.

Definition at line 158 of file CKFResult.h.


The documentation for this class was generated from the following file: