Belle II Software development
CKFToPXDFindlet Class Referenceabstract

Combinatorial Kalman Filter to extrapolate CDC Reco Tracks into the VXD (PXD) and collect space points. More...

#include <CKFToPXDFindlet.h>

Inheritance diagram for CKFToPXDFindlet:
Findlet<> CompositeProcessingSignalListener ProcessingSignalListener

Public Types

using IOTypes = std::tuple< AIOTypes... >
 Types that should be served to apply on invokation.
 
using IOVectors = std::tuple< std::vector< AIOTypes >... >
 Vector types that should be served to apply on invokation.
 

Public Member Functions

 CKFToPXDFindlet ()
 Constructor, for setting module description and parameters.
 
 ~CKFToPXDFindlet ()
 Default desctructor.
 
void exposeParameters (ModuleParamList *moduleParamList, const std::string &prefix) override
 Expose the parameters of the sub findlets.
 
void apply () override
 Do the tree search.
 
void beginEvent () override
 Clear the object pools.
 
virtual std::string getDescription ()
 Brief description of the purpose of the concret findlet.
 
virtual void apply (ToVector< AIOTypes > &... ioVectors)=0
 Main function executing the algorithm.
 
void initialize () override
 Receive and dispatch signal before the start of the event processing.
 
void beginRun () override
 Receive and dispatch signal for the beginning of a new run.
 
void endRun () override
 Receive and dispatch signal for the end of the run.
 
void terminate () override
 Receive and dispatch Signal for termination of the event processing.
 

Protected Types

using ToVector = typename ToVectorImpl< T >::Type
 Short hand for ToRangeImpl.
 

Protected Member Functions

void addProcessingSignalListener (ProcessingSignalListener *psl)
 Register a processing signal listener to be notified.
 
int getNProcessingSignalListener ()
 Get the number of currently registered listeners.
 

Private Types

using Super = TrackFindingCDC::Findlet<>
 Parent class.
 

Private Attributes

unsigned int m_param_minimalHitRequirement = 1
 Minimal hit requirement for the results (counted in number of space points)
 
bool m_param_onlyUseTracksWithSVD = true
 Cut away tracks without SVD hits or not.
 
bool m_param_reverseSeed = false
 Reverse the seed.
 
TrackLoader m_dataHandler
 Findlet for retrieving the cdc tracks and writing the result out.
 
SpacePointLoader m_hitsLoader
 Findlet for loading the space points.
 
StateCreatorWithReversal< CKFToPXDStatem_stateCreatorFromTracks
 Findlet for creating states out of tracks.
 
StateCreator< const SpacePoint, CKFToPXDStatem_stateCreatorFromHits
 Findlet for creating states out of hits.
 
CKFRelationCreator< CKFToPXDState, ChooseablePXDRelationFilterm_relationCreator
 Findlet for creating relations between states.
 
TreeSearcher< CKFToPXDState, PXDStateRejecter, CKFToPXDResultm_treeSearchFindlet
 Findlet doing the main work: the tree finding.
 
OverlapResolver< ChooseablePXDResultFilterm_overlapResolver
 Findlet for resolving overlaps.
 
SpacePointTagger< CKFToPXDResult, PXDClusterm_spacePointTagger
 Findlet for tagging the used space points.
 
ResultStorer< CKFToPXDResultm_resultStorer
 Findlet for storing the results.
 
std::vector< RecoTrack * > m_recoTracksVector
 Pointers to the Reco tracks as a vector.
 
std::vector< const SpacePoint * > m_spacePointVector
 Pointers to the (const) SpacePoints as a vector.
 
std::vector< CKFToPXDStatem_seedStates
 States for the tracks.
 
std::vector< CKFToPXDStatem_states
 States for the hits.
 
std::vector< TrackFindingCDC::WeightedRelation< CKFToPXDState > > m_relations
 Relations between states.
 
std::vector< CKFToPXDResultm_results
 Vector for storing the results.
 
std::vector< CKFToPXDResultm_filteredResults
 Vector for storing the filtered results.
 
std::vector< ProcessingSignalListener * > m_subordinaryProcessingSignalListeners
 References to subordinary signal processing listener contained in this findlet.
 
bool m_initialized = false
 Flag to keep track whether initialization happend before.
 
bool m_terminated = false
 Flag to keep track whether termination happend before.
 
std::string m_initializedAs
 Name of the type during initialisation.
 

Detailed Description

Combinatorial Kalman Filter to extrapolate CDC Reco Tracks into the VXD (PXD) and collect space points.

The implementation is split up in four parts and factored out into five parts.

  • Fetch the SpacePoints and the reco tracks from the data store
  • Construct all possible two-state-relations between hits and seeds or hits and hits.
  • Construct all possible candidates starting from a RecoTrack and going through the layers of the VXD collecting space points.
  • Find a non-overlapping set of results (only one candidate per seed) (OverlapResolverFindlet, quality is determined by a filter)
  • Write the results out to the data store

Definition at line 57 of file CKFToPXDFindlet.h.

Member Typedef Documentation

◆ IOTypes

using IOTypes = std::tuple<AIOTypes...>
inherited

Types that should be served to apply on invokation.

Definition at line 30 of file Findlet.h.

◆ IOVectors

using IOVectors = std::tuple< std::vector<AIOTypes>... >
inherited

Vector types that should be served to apply on invokation.

Definition at line 53 of file Findlet.h.

◆ Super

using Super = TrackFindingCDC::Findlet<>
private

Parent class.

Definition at line 59 of file CKFToPXDFindlet.h.

◆ ToVector

using ToVector = typename ToVectorImpl<T>::Type
protectedinherited

Short hand for ToRangeImpl.

Definition at line 49 of file Findlet.h.

Constructor & Destructor Documentation

◆ CKFToPXDFindlet()

Constructor, for setting module description and parameters.

Definition at line 34 of file CKFToPXDFindlet.cc.

35{
45}
CKFRelationCreator< CKFToPXDState, ChooseablePXDRelationFilter > m_relationCreator
Findlet for creating relations between states.
TrackLoader m_dataHandler
Findlet for retrieving the cdc tracks and writing the result out.
StateCreatorWithReversal< CKFToPXDState > m_stateCreatorFromTracks
Findlet for creating states out of tracks.
TreeSearcher< CKFToPXDState, PXDStateRejecter, CKFToPXDResult > m_treeSearchFindlet
Findlet doing the main work: the tree finding.
SpacePointLoader m_hitsLoader
Findlet for loading the space points.
ResultStorer< CKFToPXDResult > m_resultStorer
Findlet for storing the results.
SpacePointTagger< CKFToPXDResult, PXDCluster > m_spacePointTagger
Findlet for tagging the used space points.
StateCreator< const SpacePoint, CKFToPXDState > m_stateCreatorFromHits
Findlet for creating states out of hits.
OverlapResolver< ChooseablePXDResultFilter > m_overlapResolver
Findlet for resolving overlaps.
void addProcessingSignalListener(ProcessingSignalListener *psl)
Register a processing signal listener to be notified.

Member Function Documentation

◆ addProcessingSignalListener()

void addProcessingSignalListener ( ProcessingSignalListener psl)
protectedinherited

Register a processing signal listener to be notified.

Definition at line 55 of file CompositeProcessingSignalListener.cc.

56{
58}
std::vector< ProcessingSignalListener * > m_subordinaryProcessingSignalListeners
References to subordinary signal processing listener contained in this findlet.

◆ apply()

void apply ( )
override

Do the tree search.

Definition at line 109 of file CKFToPXDFindlet.cc.

110{
113
114 if (m_spacePointVector.empty() or m_recoTracksVector.empty()) {
115 return;
116 }
117
118 // Delete stuff not from the PXD
119 const auto notFromPXD = [](const SpacePoint * spacePoint) {
120 return spacePoint->getType() != VXD::SensorInfoBase::PXD;
121 };
122 TrackFindingCDC::erase_remove_if(m_spacePointVector, notFromPXD);
123
125 const auto hasNoSVD = [this](const RecoTrack * recoTrack) {
126 const auto& svdHitList = recoTrack->getSortedSVDHitList();
127 if (svdHitList.empty()) return true;
128 // Require at least one hit in layer 3 or 4
129 return m_param_reverseSeed ? svdHitList.back()->getSensorID().getLayerNumber() > 4
130 : svdHitList.front()->getSensorID().getLayerNumber() > 4;
131 };
132 TrackFindingCDC::erase_remove_if(m_recoTracksVector, hasNoSVD);
133 }
134
135 B2DEBUG(29, "Now have " << m_spacePointVector.size() << " hits.");
136
140
141 B2DEBUG(29, "Created " << m_relations.size() << " relations.");
142
144
145 B2DEBUG(29, "Having found " << m_results.size() << " results before overlap check");
146
147 const auto hasLowHitNumber = [this](const CKFResult<RecoTrack, SpacePoint>& result) {
148 return result.getHits().size() < m_param_minimalHitRequirement;
149 };
150 TrackFindingCDC::erase_remove_if(m_results, hasLowHitNumber);
151
153
154 B2DEBUG(29, "Having found " << m_filteredResults.size() << " results");
155
158}
Object for temporary storage of a CKF tree search result.
Definition: CKFResult.h:30
std::vector< CKFToPXDResult > m_results
Vector for storing the results.
std::vector< CKFToPXDResult > m_filteredResults
Vector for storing the filtered results.
std::vector< TrackFindingCDC::WeightedRelation< CKFToPXDState > > m_relations
Relations between states.
unsigned int m_param_minimalHitRequirement
Minimal hit requirement for the results (counted in number of space points)
std::vector< const SpacePoint * > m_spacePointVector
Pointers to the (const) SpacePoints as a vector.
bool m_param_onlyUseTracksWithSVD
Cut away tracks without SVD hits or not.
std::vector< CKFToPXDState > m_states
States for the hits.
bool m_param_reverseSeed
Reverse the seed.
std::vector< CKFToPXDState > m_seedStates
States for the tracks.
std::vector< RecoTrack * > m_recoTracksVector
Pointers to the Reco tracks as a vector.
This is the Reconstruction Event-Data Model Track.
Definition: RecoTrack.h:79
void apply(std::vector< const SpacePoint * > &spacePoints) final
Do the space point retrieval.
SpacePoint typically is build from 1 PXDCluster or 1-2 SVDClusters.
Definition: SpacePoint.h:42
void apply(std::vector< RecoTrack * > &seeds) override
Load in the reco tracks and the hits.
Definition: TrackLoader.cc:68

◆ beginEvent()

void beginEvent ( )
overridevirtual

Clear the object pools.

Reimplemented from ProcessingSignalListener.

Definition at line 89 of file CKFToPXDFindlet.cc.

90{
92
93 // If the capacity of a std::vector is very large without being used, it just allocates RAM for no reason, increasing the RAM
94 // usage unnecessarily. In this case, start with a fresh one.
95 // Since std::vector.shrink() or std::vector.shrink_to_fit() not necessarily reduce the capacity in the desired way, create a
96 // temporary vector of the same type, swap them to use the vector at the new location afterwards, and clear the tempoary vector.
97 m_recoTracksVector.clear();
98 checkResizeClear<const SpacePoint*>(m_spacePointVector, 2000);
99
100 m_seedStates.clear();
101 checkResizeClear<CKFToPXDState>(m_states, 2000);
102
103 checkResizeClear<TrackFindingCDC::WeightedRelation<CKFToPXDState>>(m_relations, 2000);
104
105 m_results.clear();
106 m_filteredResults.clear();
107}
void beginEvent() override
Receive and dispatch signal for the start of a new event.

◆ beginRun()

void beginRun ( )
overridevirtualinherited

Receive and dispatch signal for the beginning of a new run.

Reimplemented from ProcessingSignalListener.

Reimplemented in LayerRelationFilter< AFilter >, FourHitFilter, QualityIndicatorFilter, ThreeHitFilter, TwoHitVirtualIPFilter, TwoHitVirtualIPQIFilter, RecoTrackStorer, ROIFinder, SpacePointLoaderAndPreparer, and TrackCandidateResultRefiner.

Definition at line 23 of file CompositeProcessingSignalListener.cc.

24{
27 psl->beginRun();
28 }
29}
Interface for an algorithm part that needs to receive the module processing signals.
virtual void beginRun()
Receive signal for the beginning of a new run.

◆ endRun()

void endRun ( )
overridevirtualinherited

Receive and dispatch signal for the end of the run.

Reimplemented from ProcessingSignalListener.

Definition at line 39 of file CompositeProcessingSignalListener.cc.

40{
42 psl->endRun();
43 }
45}
virtual void endRun()
Receive signal for the end of the run.

◆ exposeParameters()

void exposeParameters ( ModuleParamList moduleParamList,
const std::string &  prefix 
)
overridevirtual

Expose the parameters of the sub findlets.

Reimplemented from Findlet<>.

Definition at line 47 of file CKFToPXDFindlet.cc.

48{
49 Super::exposeParameters(moduleParamList, prefix);
50
51 m_dataHandler.exposeParameters(moduleParamList, prefix);
52 m_hitsLoader.exposeParameters(moduleParamList, prefix);
53 m_stateCreatorFromTracks.exposeParameters(moduleParamList, prefix);
54 m_stateCreatorFromHits.exposeParameters(moduleParamList, prefix);
55 m_relationCreator.exposeParameters(moduleParamList, prefix);
56 m_treeSearchFindlet.exposeParameters(moduleParamList, prefix);
57 m_overlapResolver.exposeParameters(moduleParamList, prefix);
58 m_spacePointTagger.exposeParameters(moduleParamList, prefix);
59 m_resultStorer.exposeParameters(moduleParamList, prefix);
60
61 moduleParamList->addParameter("minimalHitRequirement", m_param_minimalHitRequirement,
62 "Minimal Hit requirement for the results (counted in space points)",
64 moduleParamList->addParameter("onlyUseTracksWithSVD", m_param_onlyUseTracksWithSVD,
65 "Only use tracks which have an SVD hit associated.",
67 moduleParamList->addParameter("reverseSeedState", m_param_reverseSeed, "Reverse the seed.", m_param_reverseSeed);
68
69 // Default values
70 moduleParamList->getParameter<std::string>("advanceHighFilter").setDefaultValue("advance");
71 moduleParamList->getParameter<std::string>("updateHighFilter").setDefaultValue("fit");
72
73 moduleParamList->getParameter<std::string>("firstHighFilter").setDefaultValue("mva_with_direction_check");
74 moduleParamList->getParameter<std::string>("secondHighFilter").setDefaultValue("mva");
75 moduleParamList->getParameter<std::string>("thirdHighFilter").setDefaultValue("mva");
76
77 moduleParamList->getParameter<bool>("useAssignedHits").setDefaultValue(false);
78
79 moduleParamList->getParameter<std::string>("hitFilter").setDefaultValue("sensor");
80 moduleParamList->getParameter<std::string>("seedFilter").setDefaultValue("sensor");
81 moduleParamList->getParameter<std::string>("preSeedFilter").setDefaultValue("loose");
82 moduleParamList->getParameter<std::string>("preHitFilter").setDefaultValue("loose");
83
84 moduleParamList->getParameter<std::string>("hitsSpacePointsStoreArrayName").setDefaultValue("PXDSpacePoints");
85
86 moduleParamList->getParameter<std::string>("filter").setDefaultValue("mva");
87}
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) override
Expose the parameters of the sub findlets.
virtual void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix)
Forward prefixed parameters of this findlet to the module parameter list.
Definition: Findlet.h:69
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) override
Expose the parameters of the sub findlets.
Definition: TrackLoader.cc:24
ModuleParam< T > & getParameter(const std::string &name) const
Returns a reference to a parameter.
void addParameter(const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module list.

◆ getDescription()

virtual std::string getDescription ( )
inlinevirtualinherited

Brief description of the purpose of the concret findlet.

Reimplemented in CosmicsTrackMergerFindlet, TrackFinderCosmics, TrackFinder, TrackFinderAutomaton, and FindletStoreArrayInput< TWrappedFindlet >.

Definition at line 60 of file Findlet.h.

61 {
62 return "(no description)";
63 }

◆ getNProcessingSignalListener()

int getNProcessingSignalListener ( )
protectedinherited

Get the number of currently registered listeners.

Definition at line 60 of file CompositeProcessingSignalListener.cc.

61{
63}

◆ initialize()

void initialize ( )
overridevirtualinherited

Receive and dispatch signal before the start of the event processing.

Reimplemented from ProcessingSignalListener.

Reimplemented in UnionVarSet< AObject >, UnionVarSet< Object >, VariadicUnionVarSet< AVarSets >, ResultStorer< Belle2::CKFToPXDResult >, ResultStorer< Belle2::CKFToSVDResult >, BaseEventTimeExtractor< RecoTrack * >, BaseEventTimeExtractor< TrackFindingCDC::CDCWireHit & >, StereoHitTrackQuadTreeMatcher< Belle2::TrackFindingCDC::HyperHough >, StereoHitTrackQuadTreeMatcher< Belle2::TrackFindingCDC::QuadraticLegendre >, StereoHitTrackQuadTreeMatcher< Belle2::TrackFindingCDC::Z0TanLambdaLegendre >, OnVarSet< Filter< ATruthVarSet::Object > >, OnVarSet< Filter< AVarSet::Object > >, OnVarSet< BaseFacetFilter >, OnVarSet< BaseFacetRelationFilter >, OnVarSet< BaseAxialSegmentPairFilter >, OnVarSet< BaseSegmentRelationFilter >, OnVarSet< BaseTrackRelationFilter >, OnVarSet< BaseSegmentPairRelationFilter >, MCSymmetric< BaseAxialSegmentPairFilter >, MCSymmetric< BaseFacetFilter >, MCSymmetric< BaseFacetRelationFilter >, MCSymmetric< BaseSegmentPairFilter >, MCSymmetric< BaseSegmentPairRelationFilter >, MCSymmetric< BaseSegmentRelationFilter >, MCSymmetric< BaseSegmentTripleFilter >, MCSymmetric< BaseSegmentTripleRelationFilter >, MCSymmetric< BaseTrackRelationFilter >, StoreArrayLoader< const Belle2::SpacePoint >, StoreArrayLoader< DataStoreInputTypeRefType >, StoreVectorSwapper< Belle2::TrackFindingCDC::CDCFacet >, StoreVectorSwapper< Belle2::TrackFindingCDC::CDCWireHit, true >, StoreVectorSwapper< Belle2::TrackFindingCDC::CDCSegment2D >, StoreVectorSwapper< Belle2::TrackFindingCDC::CDCTrack >, StoreVectorSwapper< Belle2::TrackFindingCDC::CDCSegmentPair >, StoreVectorSwapper< Belle2::TrackFindingCDC::CDCSegmentTriple >, RelationVarSet< ABaseVarSet >, QualityIndicatorFilter, TwoHitVirtualIPQIFilter, MultiHoughSpaceFastInterceptFinder, RawTrackCandCleaner< AHit >, RawTrackCandCleaner< Belle2::vxdHoughTracking::VXDHoughState >, RecoTrackStorer, ROIFinder, SingleHoughSpaceFastInterceptFinder, SpacePointLoaderAndPreparer, TrackCandidateOverlapResolver, and TrackCandidateResultRefiner.

Definition at line 15 of file CompositeProcessingSignalListener.cc.

16{
19 psl->initialize();
20 }
21}
virtual void initialize()
Receive signal before the start of the event processing.

◆ terminate()

void terminate ( )
overridevirtualinherited

Receive and dispatch Signal for termination of the event processing.

Reimplemented from ProcessingSignalListener.

Reimplemented in StereoHitTrackQuadTreeMatcher< Belle2::TrackFindingCDC::HyperHough >, StereoHitTrackQuadTreeMatcher< Belle2::TrackFindingCDC::QuadraticLegendre >, and StereoHitTrackQuadTreeMatcher< Belle2::TrackFindingCDC::Z0TanLambdaLegendre >.

Definition at line 47 of file CompositeProcessingSignalListener.cc.

48{
50 psl->terminate();
51 }
53}
virtual void terminate()
Receive Signal for termination of the event processing.

Member Data Documentation

◆ m_dataHandler

TrackLoader m_dataHandler
private

Findlet for retrieving the cdc tracks and writing the result out.

Definition at line 88 of file CKFToPXDFindlet.h.

◆ m_filteredResults

std::vector<CKFToPXDResult> m_filteredResults
private

Vector for storing the filtered results.

Definition at line 120 of file CKFToPXDFindlet.h.

◆ m_hitsLoader

SpacePointLoader m_hitsLoader
private

Findlet for loading the space points.

Definition at line 90 of file CKFToPXDFindlet.h.

◆ m_initialized

bool m_initialized = false
privateinherited

Flag to keep track whether initialization happend before.

Definition at line 52 of file ProcessingSignalListener.h.

◆ m_initializedAs

std::string m_initializedAs
privateinherited

Name of the type during initialisation.

Definition at line 58 of file ProcessingSignalListener.h.

◆ m_overlapResolver

OverlapResolver<ChooseablePXDResultFilter> m_overlapResolver
private

Findlet for resolving overlaps.

Definition at line 100 of file CKFToPXDFindlet.h.

◆ m_param_minimalHitRequirement

unsigned int m_param_minimalHitRequirement = 1
private

Minimal hit requirement for the results (counted in number of space points)

Definition at line 80 of file CKFToPXDFindlet.h.

◆ m_param_onlyUseTracksWithSVD

bool m_param_onlyUseTracksWithSVD = true
private

Cut away tracks without SVD hits or not.

Definition at line 82 of file CKFToPXDFindlet.h.

◆ m_param_reverseSeed

bool m_param_reverseSeed = false
private

Reverse the seed.

Definition at line 84 of file CKFToPXDFindlet.h.

◆ m_recoTracksVector

std::vector<RecoTrack*> m_recoTracksVector
private

Pointers to the Reco tracks as a vector.

Definition at line 108 of file CKFToPXDFindlet.h.

◆ m_relationCreator

Findlet for creating relations between states.

Definition at line 96 of file CKFToPXDFindlet.h.

◆ m_relations

std::vector<TrackFindingCDC::WeightedRelation<CKFToPXDState> > m_relations
private

Relations between states.

Definition at line 116 of file CKFToPXDFindlet.h.

◆ m_results

std::vector<CKFToPXDResult> m_results
private

Vector for storing the results.

Definition at line 118 of file CKFToPXDFindlet.h.

◆ m_resultStorer

ResultStorer<CKFToPXDResult> m_resultStorer
private

Findlet for storing the results.

Definition at line 104 of file CKFToPXDFindlet.h.

◆ m_seedStates

std::vector<CKFToPXDState> m_seedStates
private

States for the tracks.

Definition at line 112 of file CKFToPXDFindlet.h.

◆ m_spacePointTagger

SpacePointTagger<CKFToPXDResult, PXDCluster> m_spacePointTagger
private

Findlet for tagging the used space points.

Definition at line 102 of file CKFToPXDFindlet.h.

◆ m_spacePointVector

std::vector<const SpacePoint*> m_spacePointVector
private

Pointers to the (const) SpacePoints as a vector.

Definition at line 110 of file CKFToPXDFindlet.h.

◆ m_stateCreatorFromHits

StateCreator<const SpacePoint, CKFToPXDState> m_stateCreatorFromHits
private

Findlet for creating states out of hits.

Definition at line 94 of file CKFToPXDFindlet.h.

◆ m_stateCreatorFromTracks

StateCreatorWithReversal<CKFToPXDState> m_stateCreatorFromTracks
private

Findlet for creating states out of tracks.

Definition at line 92 of file CKFToPXDFindlet.h.

◆ m_states

std::vector<CKFToPXDState> m_states
private

States for the hits.

Definition at line 114 of file CKFToPXDFindlet.h.

◆ m_subordinaryProcessingSignalListeners

std::vector<ProcessingSignalListener*> m_subordinaryProcessingSignalListeners
privateinherited

References to subordinary signal processing listener contained in this findlet.

Definition at line 52 of file CompositeProcessingSignalListener.h.

◆ m_terminated

bool m_terminated = false
privateinherited

Flag to keep track whether termination happend before.

Definition at line 55 of file ProcessingSignalListener.h.

◆ m_treeSearchFindlet

Findlet doing the main work: the tree finding.

Definition at line 98 of file CKFToPXDFindlet.h.


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