Belle II Software development
CDCCKFState Class Reference

Define states for CKF algorithm, which can be seed track or CDC wire hit. More...

#include <CDCCKFState.h>

Public Member Functions

 CDCCKFState (const RecoTrack *seed, const genfit::MeasuredStateOnPlane &trackState)
 constructor from the seed recoTrack and genfit trackState
 
 CDCCKFState (const TrackFindingCDC::CDCWireHit *wireHit)
 constructor from the CDC wireHit
 
const TrackFindingCDC::CDCWireHitgetWireHit () const
 Get CDCWireHit corresponding to the state.
 
const RecoTrackgetSeed () const
 Get RecoTrack seed corresponding to the state.
 
const RecoTrackgetMCRecoTrack (const std::string &mcRecoTrackStoreArrayName="MCRecoTracks") const
 Match seed to the MC track, return it. Works for seed-states only.
 
bool isSeed () const
 Returns true if the state corresponds to the seed track.
 
const genfit::MeasuredStateOnPlane & getTrackState () const
 Get genfit track state (but first check if already present)
 
void setTrackState (const genfit::MeasuredStateOnPlane &trackState)
 Store genfit Measured state on plane.
 
void setRLinfo (const TrackFindingCDC::ERightLeft &rl)
 Set right-left info for the hit.
 
TrackFindingCDC::ERightLeft getRLinfo () const
 Return right-left info (check if present first)
 
void setArcLength (double arcLength)
 Set the arc-length along the tracjectory to the hit.
 
double getArcLength () const
 Return the arc-length along the tracjectory to the hit.
 
void setHitDistance (double hitDistance)
 Set hit distance to the trajectory.
 
double getHitDistance () const
 Return hit distance to the trajectory.
 
void setWeight (double weight)
 Set state weight.
 
double getWeight () const
 Get state weight.
 
void setChi2 (double chi2)
 Set set chi2.
 
double getChi2 () const
 Get state chi2.
 
void setReconstructedZ (double reconstructedZ)
 Set state Z information.
 
double getReconstructedZ () const
 Get state Z information.
 
TrackFindingCDC::CDCTrajectory3D getTrajectory () const
 Helper method to get trajectory from the trackState.
 

Private Attributes

std::optional< const RecoTrack * > m_seed
 (optional) pointer to the seed track
 
std::optional< const TrackFindingCDC::CDCWireHit * > m_cdcWireHit
 (optional) pointer to the wire hit
 
std::optional< genfit::MeasuredStateOnPlane > m_trackState
 (optional) genfit MeasuredStateOnPlane
 
double m_arcLength = 0
 arc length along the trajectory to the hit
 
double m_hitDistance = 0
 distance from the trajectory to the hit
 
double m_weight = 0
 state weight
 
double m_chi2 = 0
 state chi2 (using genfit extrapolation)
 
double m_reconstructedZ = 0
 reconstructed Z coordinate
 
TrackFindingCDC::ERightLeft m_rl = TrackFindingCDC::ERightLeft::c_Unknown
 Store if the track is on the right or left side of the hit.
 

Detailed Description

Define states for CKF algorithm, which can be seed track or CDC wire hit.

Definition at line 24 of file CDCCKFState.h.

Constructor & Destructor Documentation

◆ CDCCKFState() [1/2]

CDCCKFState ( const RecoTrack * seed,
const genfit::MeasuredStateOnPlane & trackState )
inline

constructor from the seed recoTrack and genfit trackState

Definition at line 27 of file CDCCKFState.h.

27 :
28 m_seed(seed), m_trackState(trackState) {}

◆ CDCCKFState() [2/2]

CDCCKFState ( const TrackFindingCDC::CDCWireHit * wireHit)
inlineexplicit

constructor from the CDC wireHit

Definition at line 31 of file CDCCKFState.h.

31: m_cdcWireHit(wireHit) {}

Member Function Documentation

◆ getArcLength()

double getArcLength ( ) const
inline

Return the arc-length along the tracjectory to the hit.

Definition at line 93 of file CDCCKFState.h.

94 {
95 return m_arcLength;
96 }

◆ getChi2()

double getChi2 ( ) const
inline

Get state chi2.

Definition at line 129 of file CDCCKFState.h.

130 {
131 return m_chi2;
132 }

◆ getHitDistance()

double getHitDistance ( ) const
inline

Return hit distance to the trajectory.

Definition at line 105 of file CDCCKFState.h.

106 {
107 return m_hitDistance;
108 }

◆ getMCRecoTrack()

const RecoTrack * getMCRecoTrack ( const std::string & mcRecoTrackStoreArrayName = "MCRecoTracks") const
inline

Match seed to the MC track, return it. Works for seed-states only.

Definition at line 48 of file CDCCKFState.h.

49 {
50 const RecoTrack* seed = getSeed();
51 return seed->getRelated<RecoTrack>(mcRecoTrackStoreArrayName);
52 }

◆ getReconstructedZ()

double getReconstructedZ ( ) const
inline

Get state Z information.

Definition at line 141 of file CDCCKFState.h.

142 {
143 return m_reconstructedZ;
144 }

◆ getRLinfo()

TrackFindingCDC::ERightLeft getRLinfo ( ) const
inline

Return right-left info (check if present first)

Definition at line 80 of file CDCCKFState.h.

81 {
82 B2ASSERT("LR info is not present yet", m_rl != TrackFindingCDC::ERightLeft::c_Unknown);
83 return m_rl;
84 }

◆ getSeed()

const RecoTrack * getSeed ( ) const
inline

Get RecoTrack seed corresponding to the state.

Definition at line 41 of file CDCCKFState.h.

42 {
43 B2ASSERT("State does not represent a seed", static_cast<bool>(m_seed));
44 return *m_seed;
45 }

◆ getTrackState()

const genfit::MeasuredStateOnPlane & getTrackState ( ) const
inline

Get genfit track state (but first check if already present)

Definition at line 61 of file CDCCKFState.h.

62 {
63 B2ASSERT("State does not have a track state (yet)", static_cast<bool>(m_trackState));
64 return *m_trackState;
65 }

◆ getTrajectory()

TrackFindingCDC::CDCTrajectory3D getTrajectory ( ) const
inline

Helper method to get trajectory from the trackState.

Definition at line 147 of file CDCCKFState.h.

148 {
149 const auto& trackState = getTrackState();
150 const TrackFindingCDC::Vector3D trackPosition(trackState.getPos());
151 const TrackFindingCDC::Vector3D trackMomentum(trackState.getMom());
152 return TrackFindingCDC::CDCTrajectory3D(trackPosition, trackState.getTime(),
153 trackMomentum, trackState.getCharge());
154 }

◆ getWeight()

double getWeight ( ) const
inline

Get state weight.

Definition at line 117 of file CDCCKFState.h.

118 {
119 return m_weight;
120 }

◆ getWireHit()

const TrackFindingCDC::CDCWireHit * getWireHit ( ) const
inline

Get CDCWireHit corresponding to the state.

Definition at line 34 of file CDCCKFState.h.

35 {
36 B2ASSERT("State does not represent a wire hit", static_cast<bool>(m_cdcWireHit));
37 return *m_cdcWireHit;
38 }

◆ isSeed()

bool isSeed ( ) const
inline

Returns true if the state corresponds to the seed track.

Definition at line 55 of file CDCCKFState.h.

56 {
57 return static_cast<bool>(m_seed);
58 }

◆ setArcLength()

void setArcLength ( double arcLength)
inline

Set the arc-length along the tracjectory to the hit.

Definition at line 87 of file CDCCKFState.h.

88 {
89 m_arcLength = arcLength;
90 }

◆ setChi2()

void setChi2 ( double chi2)
inline

Set set chi2.

Definition at line 123 of file CDCCKFState.h.

124 {
125 m_chi2 = chi2;
126 }

◆ setHitDistance()

void setHitDistance ( double hitDistance)
inline

Set hit distance to the trajectory.

Definition at line 99 of file CDCCKFState.h.

100 {
101 m_hitDistance = hitDistance;
102 }

◆ setReconstructedZ()

void setReconstructedZ ( double reconstructedZ)
inline

Set state Z information.

Definition at line 135 of file CDCCKFState.h.

136 {
137 m_reconstructedZ = reconstructedZ;
138 }

◆ setRLinfo()

void setRLinfo ( const TrackFindingCDC::ERightLeft & rl)
inline

Set right-left info for the hit.

Definition at line 74 of file CDCCKFState.h.

75 {
76 m_rl = rl;
77 }

◆ setTrackState()

void setTrackState ( const genfit::MeasuredStateOnPlane & trackState)
inline

Store genfit Measured state on plane.

Definition at line 68 of file CDCCKFState.h.

69 {
70 m_trackState = trackState;
71 }

◆ setWeight()

void setWeight ( double weight)
inline

Set state weight.

Definition at line 111 of file CDCCKFState.h.

112 {
113 m_weight = weight;
114 }

Member Data Documentation

◆ m_arcLength

double m_arcLength = 0
private

arc length along the trajectory to the hit

Definition at line 166 of file CDCCKFState.h.

◆ m_cdcWireHit

std::optional<const TrackFindingCDC::CDCWireHit*> m_cdcWireHit
private

(optional) pointer to the wire hit

Definition at line 160 of file CDCCKFState.h.

◆ m_chi2

double m_chi2 = 0
private

state chi2 (using genfit extrapolation)

Definition at line 175 of file CDCCKFState.h.

◆ m_hitDistance

double m_hitDistance = 0
private

distance from the trajectory to the hit

Definition at line 169 of file CDCCKFState.h.

◆ m_reconstructedZ

double m_reconstructedZ = 0
private

reconstructed Z coordinate

Definition at line 178 of file CDCCKFState.h.

◆ m_rl

TrackFindingCDC::ERightLeft m_rl = TrackFindingCDC::ERightLeft::c_Unknown
private

Store if the track is on the right or left side of the hit.

Definition at line 181 of file CDCCKFState.h.

◆ m_seed

std::optional<const RecoTrack*> m_seed
private

(optional) pointer to the seed track

Definition at line 158 of file CDCCKFState.h.

◆ m_trackState

std::optional<genfit::MeasuredStateOnPlane> m_trackState
private

(optional) genfit MeasuredStateOnPlane

Definition at line 163 of file CDCCKFState.h.

◆ m_weight

double m_weight = 0
private

state weight

Definition at line 172 of file CDCCKFState.h.


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