Belle II Software development
CKFToSVDState Class Reference

Specialized CKF State for extrapolating into the SVD. More...

#include <CKFToSVDState.h>

Inheritance diagram for CKFToSVDState:
CKFState< RecoTrack, SpacePoint >

Public Types

using Seed = RecoTrack
 Copy the class of the seed track.
 
using Hit = SpacePoint
 Copy the class of the hits.
 

Public Member Functions

 CKFToSVDState (const SpacePoint *hit)
 When constructed by a hit, set the reco hit.
 
 CKFToSVDState (const RecoTrack *seed, bool reversed=false)
 Constructor setting the state to the position of the first CDC track seed hit.
 
unsigned int getGeometricalLayer () const
 Extract the real layer this state sits on.
 
genfit::SharedPlanePtr getPlane (const genfit::MeasuredStateOnPlane &state) const
 Return the plane of the first SVD cluster.
 
const SVDRecoHitgetRecoHit () const
 Helper function for getting the already created reco hit (runtime reasons)
 
const std::vector< SVDRecoHit > & getRecoHits () const
 Helper function for getting the already created reco hits (runtime reasons)
 
const RecoTrackgetRelatedSVDTrack () const
 Return the related SVD track, if we go along one of them (or a nullptr)
 
void setRelatedSVDTrack (const RecoTrack *relatedSVDTrack)
 Set the related SVD track, if we go along one of them (or a nullptr)
 
const struct stateCache & getStateCache () const
 Get the cached data of this state.
 
const SeedgetSeed () const
 Return the track this state is related to.
 
const HitgetHit () const
 Return the SP this state is related to. May be nullptr.
 
double getChi2 () const
 Return the chi2 set during fitting. Is only valid after fitting.
 
void setChi2 (double chi2)
 Set the chi2 of this state during fitting.
 
void setMeasuredStateOnPlane (const genfit::MeasuredStateOnPlane &mSoP)
 Set the mSoP.
 
const genfit::MeasuredStateOnPlane & getMeasuredStateOnPlane () const
 Get the mSoP if already set during extrapolation (or fitting)
 
bool isFitted () const
 Check if state was already fitted.
 
bool mSoPSet () const
 Is the mSoP already set? (= state was already extrapolated)
 
void reset ()
 Reset the state to be seen as "new".
 
TrackFindingCDC::AutomatonCellgetAutomatonCell ()
 Getter for the automaton cell.
 

Protected Attributes

stateCache m_stateCache
 Cache the most important data of this state for better runtime performance.
 

Private Attributes

std::vector< SVDRecoHitm_recoHits
 Precache the PXDRecoHits for runtime performance reasons.
 
const RecoTrackm_relatedSVDTrack = nullptr
 The related SVD track, if we go along one of them (or a nullptr)
 
const Seedm_seed
 The seed this state is related with.
 
const Hitm_hit
 The hit object this state is attached to.
 
double m_chi2
 Chi2 of this special state with this hit and this reco track. Will only be set after fitting state.
 
genfit::MeasuredStateOnPlane m_measuredStateOnPlane
 MSoP after advancing. Is undetermined before extrapolating!
 
TrackFindingCDC::AutomatonCell m_automatonCell
 Memory for the automaton cell.
 
bool m_isFitted
 Flag, if this state was already fitted.
 
bool m_hasMSoP
 Flag, if this state has a valid mSoP.
 

Detailed Description

Specialized CKF State for extrapolating into the SVD.

Definition at line 27 of file CKFToSVDState.h.

Member Typedef Documentation

◆ Hit

using Hit = SpacePoint
inherited

Copy the class of the hits.

Definition at line 34 of file CKFState.h.

◆ Seed

using Seed = RecoTrack
inherited

Copy the class of the seed track.

Definition at line 32 of file CKFState.h.

Constructor & Destructor Documentation

◆ CKFToSVDState() [1/2]

CKFToSVDState ( const SpacePoint hit)
explicit

When constructed by a hit, set the reco hit.

Definition at line 60 of file CKFToSVDState.cc.

61{
62 m_recoHits.reserve(2);
63 for (const SVDCluster& svdCluster : hit->getRelationsTo<SVDCluster>()) {
64 m_recoHits.emplace_back(&svdCluster);
65 }
66 m_stateCache.isHitState = true;
67 m_stateCache.sensorID = hit->getVxdID();
68 m_stateCache.geoLayer = this->getGeometricalLayer();
69 m_stateCache.ladder = m_stateCache.sensorID.getLadderNumber();
70 const VXD::SensorInfoBase& sensorInfo = VXD::GeoCache::getInstance().getSensorInfo(hit->getVxdID());
71 m_stateCache.sensorCenterPhi = sensorInfo.pointToGlobal(ROOT::Math::XYZVector(0., 0., 0.), true).Phi();
72 m_stateCache.phi = hit->getPosition().Phi();
73 m_stateCache.theta = hit->getPosition().Theta();
74 m_stateCache.localNormalizedu = hit->getNormalizedLocalU();
75 m_stateCache.localNormalizedv = hit->getNormalizedLocalV();
76}
State object to store one step in the CKF algorithm together with its parent (the state before),...
Definition: CKFState.h:29
stateCache m_stateCache
Cache the most important data of this state for better runtime performance.
Definition: CKFState.h:154
unsigned int getGeometricalLayer() const
Extract the real layer this state sits on.
std::vector< SVDRecoHit > m_recoHits
Precache the PXDRecoHits for runtime performance reasons.
Definition: CKFToSVDState.h:60
The SVD Cluster class This class stores all information about reconstructed SVD clusters.
Definition: SVDCluster.h:29
const SensorInfoBase & getSensorInfo(Belle2::VxdID id) const
Return a referecne to the SensorInfo of a given SensorID.
Definition: GeoCache.cc:67
static GeoCache & getInstance()
Return a reference to the singleton instance.
Definition: GeoCache.cc:214
Base class to provide Sensor Information for PXD and SVD.
ROOT::Math::XYZVector pointToGlobal(const ROOT::Math::XYZVector &local, bool reco=false) const
Convert a point from local to global coordinates.

◆ CKFToSVDState() [2/2]

CKFToSVDState ( const RecoTrack seed,
bool  reversed = false 
)
explicit

Constructor setting the state to the position of the first CDC track seed hit.

Definition at line 18 of file CKFToSVDState.cc.

18 : CKFState(seed)
19{
20 if (reversed) {
21 setMeasuredStateOnPlane(seed->getMeasuredStateOnPlaneFromLastHit());
22 } else {
23 setMeasuredStateOnPlane(seed->getMeasuredStateOnPlaneFromFirstHit());
24 }
25 m_stateCache.isHitState = false;
26 m_stateCache.phi = this->getMeasuredStateOnPlane().getPos().Phi();
27 m_stateCache.theta = this->getMeasuredStateOnPlane().getPos().Theta();
28 m_stateCache.geoLayer = this->getGeometricalLayer();
29}
CKFState()=default
Default constructor needed for STL containers.
const genfit::MeasuredStateOnPlane & getMeasuredStateOnPlane() const
Get the mSoP if already set during extrapolation (or fitting)
Definition: CKFState.h:93
void setMeasuredStateOnPlane(const genfit::MeasuredStateOnPlane &mSoP)
Set the mSoP.
Definition: CKFState.h:86

Member Function Documentation

◆ getAutomatonCell()

TrackFindingCDC::AutomatonCell & getAutomatonCell ( )
inlineinherited

Getter for the automaton cell.

Definition at line 119 of file CKFState.h.

120 {
121 return m_automatonCell;
122 }
TrackFindingCDC::AutomatonCell m_automatonCell
Memory for the automaton cell.
Definition: CKFState.h:167

◆ getChi2()

double getChi2 ( ) const
inlineinherited

Return the chi2 set during fitting. Is only valid after fitting.

Definition at line 72 of file CKFState.h.

73 {
74 B2ASSERT("Chi2 is not set", isFitted());
75 return m_chi2;
76 }
double m_chi2
Chi2 of this special state with this hit and this reco track. Will only be set after fitting state.
Definition: CKFState.h:163
bool isFitted() const
Check if state was already fitted.
Definition: CKFState.h:100

◆ getGeometricalLayer()

unsigned int getGeometricalLayer ( ) const

Extract the real layer this state sits on.

Definition at line 31 of file CKFToSVDState.cc.

32{
33 const SpacePoint* spacePoint = getHit();
34 if (not spacePoint) {
35 // return number of layer (6) + 1 -> we fake the 7th layer as the CDC
36 return 7;
37 }
38
39 return spacePoint->getVxdID().getLayerNumber();
40}
const Hit * getHit() const
Return the SP this state is related to. May be nullptr.
Definition: CKFState.h:66
SpacePoint typically is build from 1 PXDCluster or 1-2 SVDClusters.
Definition: SpacePoint.h:42

◆ getHit()

const Hit * getHit ( ) const
inlineinherited

Return the SP this state is related to. May be nullptr.

Definition at line 66 of file CKFState.h.

67 {
68 return m_hit;
69 }
const Hit * m_hit
The hit object this state is attached to.
Definition: CKFState.h:161

◆ getMeasuredStateOnPlane()

const genfit::MeasuredStateOnPlane & getMeasuredStateOnPlane ( ) const
inlineinherited

Get the mSoP if already set during extrapolation (or fitting)

Definition at line 93 of file CKFState.h.

94 {
95 B2ASSERT("You are asking for an invalid variable!", mSoPSet());
97 }
bool mSoPSet() const
Is the mSoP already set? (= state was already extrapolated)
Definition: CKFState.h:106
genfit::MeasuredStateOnPlane m_measuredStateOnPlane
MSoP after advancing. Is undetermined before extrapolating!
Definition: CKFState.h:165

◆ getPlane()

genfit::SharedPlanePtr getPlane ( const genfit::MeasuredStateOnPlane &  state) const

Return the plane of the first SVD cluster.

Definition at line 42 of file CKFToSVDState.cc.

43{
44 const SVDRecoHit& recoHit = getRecoHit();
45 return recoHit.constructPlane(state);
46}
const SVDRecoHit & getRecoHit() const
Helper function for getting the already created reco hit (runtime reasons)
SVDRecoHit - an extended form of SVDHit containing geometry information.
Definition: SVDRecoHit.h:47

◆ getRecoHit()

const SVDRecoHit & getRecoHit ( ) const

Helper function for getting the already created reco hit (runtime reasons)

Definition at line 48 of file CKFToSVDState.cc.

49{
50 B2ASSERT("You are asking for the reco hit, although no hit is present.", not m_recoHits.empty());
51 return m_recoHits.front();
52}

◆ getRecoHits()

const std::vector< SVDRecoHit > & getRecoHits ( ) const

Helper function for getting the already created reco hits (runtime reasons)

Definition at line 54 of file CKFToSVDState.cc.

55{
56 B2ASSERT("You are asking for reco hits, although no hit is present.", not m_recoHits.empty());
57 return m_recoHits;
58}

◆ getRelatedSVDTrack()

const RecoTrack * getRelatedSVDTrack ( ) const

Return the related SVD track, if we go along one of them (or a nullptr)

Definition at line 78 of file CKFToSVDState.cc.

79{
80 return m_relatedSVDTrack;
81}
const RecoTrack * m_relatedSVDTrack
The related SVD track, if we go along one of them (or a nullptr)
Definition: CKFToSVDState.h:63

◆ getSeed()

const Seed * getSeed ( ) const
inlineinherited

Return the track this state is related to.

Definition at line 60 of file CKFState.h.

61 {
62 return m_seed;
63 }
const Seed * m_seed
The seed this state is related with.
Definition: CKFState.h:159

◆ getStateCache()

const struct stateCache & getStateCache ( ) const
inline

Get the cached data of this state.

Definition at line 54 of file CKFToSVDState.h.

54 {
55 return m_stateCache;
56 }

◆ isFitted()

bool isFitted ( ) const
inlineinherited

Check if state was already fitted.

Definition at line 100 of file CKFState.h.

101 {
102 return m_isFitted;
103 }
bool m_isFitted
Flag, if this state was already fitted.
Definition: CKFState.h:169

◆ mSoPSet()

bool mSoPSet ( ) const
inlineinherited

Is the mSoP already set? (= state was already extrapolated)

Definition at line 106 of file CKFState.h.

107 {
108 return m_hasMSoP;
109 }
bool m_hasMSoP
Flag, if this state has a valid mSoP.
Definition: CKFState.h:171

◆ reset()

void reset ( )
inlineinherited

Reset the state to be seen as "new".

Definition at line 112 of file CKFState.h.

113 {
114 m_isFitted = false;
115 m_hasMSoP = false;
116 }

◆ setChi2()

void setChi2 ( double  chi2)
inlineinherited

Set the chi2 of this state during fitting.

Definition at line 79 of file CKFState.h.

80 {
81 m_chi2 = chi2;
82 m_isFitted = true;
83 }

◆ setMeasuredStateOnPlane()

void setMeasuredStateOnPlane ( const genfit::MeasuredStateOnPlane &  mSoP)
inlineinherited

Set the mSoP.

Definition at line 86 of file CKFState.h.

87 {
89 m_hasMSoP = true;
90 }

◆ setRelatedSVDTrack()

void setRelatedSVDTrack ( const RecoTrack relatedSVDTrack)

Set the related SVD track, if we go along one of them (or a nullptr)

Definition at line 83 of file CKFToSVDState.cc.

84{
85 if (m_relatedSVDTrack and m_relatedSVDTrack != relatedSVDTrack) {
86 B2FATAL("You are resetting the related track to a different value!");
87 }
88 m_relatedSVDTrack = relatedSVDTrack;
89}

Member Data Documentation

◆ m_automatonCell

TrackFindingCDC::AutomatonCell m_automatonCell
privateinherited

Memory for the automaton cell.

Definition at line 167 of file CKFState.h.

◆ m_chi2

double m_chi2
privateinherited

Chi2 of this special state with this hit and this reco track. Will only be set after fitting state.

Definition at line 163 of file CKFState.h.

◆ m_hasMSoP

bool m_hasMSoP
privateinherited

Flag, if this state has a valid mSoP.

Definition at line 171 of file CKFState.h.

◆ m_hit

const Hit* m_hit
privateinherited

The hit object this state is attached to.

Definition at line 161 of file CKFState.h.

◆ m_isFitted

bool m_isFitted
privateinherited

Flag, if this state was already fitted.

Definition at line 169 of file CKFState.h.

◆ m_measuredStateOnPlane

genfit::MeasuredStateOnPlane m_measuredStateOnPlane
privateinherited

MSoP after advancing. Is undetermined before extrapolating!

Definition at line 165 of file CKFState.h.

◆ m_recoHits

std::vector<SVDRecoHit> m_recoHits
private

Precache the PXDRecoHits for runtime performance reasons.

Definition at line 60 of file CKFToSVDState.h.

◆ m_relatedSVDTrack

const RecoTrack* m_relatedSVDTrack = nullptr
private

The related SVD track, if we go along one of them (or a nullptr)

Definition at line 63 of file CKFToSVDState.h.

◆ m_seed

const Seed* m_seed
privateinherited

The seed this state is related with.

Definition at line 159 of file CKFState.h.

◆ m_stateCache

stateCache m_stateCache
protectedinherited

Cache the most important data of this state for better runtime performance.

Definition at line 154 of file CKFState.h.


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