Belle II Software development
CKFToSVDFindlet Class Referenceabstract

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

#include <CKFToSVDFindlet.h>

Inheritance diagram for CKFToSVDFindlet:
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

 CKFToSVDFindlet ()
 Constructor, for setting module description and parameters.
 
 ~CKFToSVDFindlet () override
 Default desctructor.
 
void exposeParameters (ModuleParamList *moduleParamList, const std::string &prefix) override
 Expose the parameters of the sub findlets.
 
void apply () override
 Do the track/hit finding/merging.
 
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)
 
TrackLoader m_dataHandler
 Findlet for retrieving the cdc tracks and writing the result out.
 
SpacePointLoader m_hitsLoader
 Findlet for loading the space points.
 
StateCreatorWithReversal< CKFToSVDStatem_stateCreatorFromTracks
 Findlet for creating states out of tracks.
 
StateCreator< const SpacePoint, CKFToSVDStatem_stateCreatorFromHits
 Findlet for creating states out of hits.
 
CKFRelationCreator< CKFToSVDState, ChooseableSVDRelationFilterm_relationCreator
 Findlet for creating relations between states.
 
TreeSearcher< CKFToSVDState, SVDStateRejecter, CKFToSVDResultm_treeSearchFindlet
 Findlet doing the main work: the tree finding.
 
OverlapResolver< ChooseableSVDResultFilterm_overlapResolver
 Findlet for resolving overlaps.
 
SpacePointTagger< CKFToSVDResult, SVDClusterm_spacePointTagger
 Findlet for tagging the used space points.
 
ResultStorer< CKFToSVDResultm_resultStorer
 Findlet for storing the results.
 
std::vector< RecoTrack * > m_cdcRecoTrackVector
 Pointers to the CDC Reco tracks as a vector.
 
std::vector< const SpacePoint * > m_spacePointVector
 Pointers to the (const) SpacePoints as a vector.
 
std::vector< CKFToSVDStatem_seedStates
 States for the tracks.
 
std::vector< CKFToSVDStatem_states
 States for the hits.
 
std::vector< TrackFindingCDC::WeightedRelation< CKFToSVDState > > m_relations
 Relations between states.
 
std::vector< CKFToSVDResultm_results
 Vector for storing the results.
 
std::vector< CKFToSVDResultm_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 (SVD) and collect space points.

The implementation is split up in four parts and factored out into three sub findlets.

  • Fetch the SpacePoints and the reco tracks from the data store (CDCTrackSpacePointStoreArrayHandler)
  • Construct all possible candidates starting from a RecoTrack and going through the layers of the VXD collecting space points (this is handles by the TreeSearchFindlet, which works on States. The selection of space points is handled by the CDCToSpacePointHitSelector)
  • Find a non-overlapping set of results (only one candidate per space point and seed) (OverlapResolverFindlet, quality is determined by a filter)
  • Write the results out to the data store (again the CDCTrackSpacePointStoreArrayHandler)

If you want to reimplement this algorithm for a different purpose, you probably only have to implement a new state class and a new hit selector (and maybe the store array handling). The rest should be taken care by the framework.

Definition at line 56 of file CKFToSVDFindlet.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 58 of file CKFToSVDFindlet.h.

◆ ToVector

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

Short hand for ToRangeImpl.

Definition at line 49 of file Findlet.h.

Constructor & Destructor Documentation

◆ CKFToSVDFindlet()

Constructor, for setting module description and parameters.

Definition at line 31 of file CKFToSVDFindlet.cc.

32{
42}
ResultStorer< CKFToSVDResult > m_resultStorer
Findlet for storing the results.
SpacePointTagger< CKFToSVDResult, SVDCluster > m_spacePointTagger
Findlet for tagging the used space points.
TrackLoader m_dataHandler
Findlet for retrieving the cdc tracks and writing the result out.
TreeSearcher< CKFToSVDState, SVDStateRejecter, CKFToSVDResult > m_treeSearchFindlet
Findlet doing the main work: the tree finding.
StateCreatorWithReversal< CKFToSVDState > m_stateCreatorFromTracks
Findlet for creating states out of tracks.
SpacePointLoader m_hitsLoader
Findlet for loading the space points.
OverlapResolver< ChooseableSVDResultFilter > m_overlapResolver
Findlet for resolving overlaps.
CKFRelationCreator< CKFToSVDState, ChooseableSVDRelationFilter > m_relationCreator
Findlet for creating relations between states.
StateCreator< const SpacePoint, CKFToSVDState > m_stateCreatorFromHits
Findlet for creating states out of hits.
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 track/hit finding/merging.

Definition at line 100 of file CKFToSVDFindlet.cc.

101{
104
105 B2DEBUG(29, "Now have " << m_spacePointVector.size() << " hits.");
106
107 if (m_spacePointVector.empty() or m_cdcRecoTrackVector.empty()) {
108 return;
109 }
110
114
115 B2DEBUG(29, "Created " << m_relations.size() << " relations.");
117
118 B2DEBUG(29, "Having found " << m_results.size() << " results before overlap check");
119
120 const auto hasLowHitNumber = [this](const CKFResult<RecoTrack, SpacePoint>& result) {
121 return result.getHits().size() < m_param_minimalHitRequirement;
122 };
123 TrackFindingCDC::erase_remove_if(m_results, hasLowHitNumber);
124
126
127 B2DEBUG(29, "Having found " << m_filteredResults.size() << " results");
128
131}
Object for temporary storage of a CKF tree search result.
Definition: CKFResult.h:30
std::vector< CKFToSVDResult > m_filteredResults
Vector for storing the filtered results.
unsigned int m_param_minimalHitRequirement
Minimal hit requirement for the results (counted in number of space points)
std::vector< CKFToSVDState > m_states
States for the hits.
std::vector< const SpacePoint * > m_spacePointVector
Pointers to the (const) SpacePoints as a vector.
std::vector< RecoTrack * > m_cdcRecoTrackVector
Pointers to the CDC Reco tracks as a vector.
std::vector< CKFToSVDResult > m_results
Vector for storing the results.
std::vector< CKFToSVDState > m_seedStates
States for the tracks.
std::vector< TrackFindingCDC::WeightedRelation< CKFToSVDState > > m_relations
Relations between states.
void apply(std::vector< const SpacePoint * > &spacePoints) final
Do the space point retrieval.
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 80 of file CKFToSVDFindlet.cc.

81{
83
84 // If the capacity of a std::vector is very large without being used, it just allocates RAM for no reason, increasing the RAM
85 // usage unnecessarily. In this case, start with a fresh one.
86 // Since std::vector.shrink() or std::vector.shrink_to_fit() not necessarily reduce the capacity in the desired way, create a
87 // temporary vector of the same type, swap them to use the vector at the new location afterwards, and clear the tempoary vector.
89 checkResizeClear<const SpacePoint*>(m_spacePointVector, 40000);
90
91 m_seedStates.clear();
92 checkResizeClear<CKFToSVDState>(m_states, 40000);
93
94 checkResizeClear<TrackFindingCDC::WeightedRelation<CKFToSVDState>>(m_relations, 100000);
95
96 m_results.clear();
97 m_filteredResults.clear();
98}
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 44 of file CKFToSVDFindlet.cc.

45{
46 Super::exposeParameters(moduleParamList, prefix);
47
48 m_dataHandler.exposeParameters(moduleParamList, prefix);
49 m_hitsLoader.exposeParameters(moduleParamList, prefix);
50 m_stateCreatorFromTracks.exposeParameters(moduleParamList, prefix);
51 m_stateCreatorFromHits.exposeParameters(moduleParamList, prefix);
52 m_relationCreator.exposeParameters(moduleParamList, prefix);
53 m_treeSearchFindlet.exposeParameters(moduleParamList, prefix);
54 m_overlapResolver.exposeParameters(moduleParamList, prefix);
55 m_spacePointTagger.exposeParameters(moduleParamList, prefix);
56 m_resultStorer.exposeParameters(moduleParamList, prefix);
57
58 moduleParamList->addParameter("minimalHitRequirement", m_param_minimalHitRequirement,
59 "Minimal Hit requirement for the results (counted in space points)",
61
62 moduleParamList->getParameter<std::string>("firstHighFilter").setDefaultValue("mva_with_direction_check");
63 moduleParamList->getParameter<std::string>("advanceHighFilter").setDefaultValue("advance");
64 moduleParamList->getParameter<std::string>("secondHighFilter").setDefaultValue("mva");
65 moduleParamList->getParameter<std::string>("updateHighFilter").setDefaultValue("fit");
66 moduleParamList->getParameter<std::string>("thirdHighFilter").setDefaultValue("mva");
67
68 moduleParamList->getParameter<std::string>("filter").setDefaultValue("mva");
69
70 moduleParamList->getParameter<std::string>("hitFilter").setDefaultValue("sensor");
71 moduleParamList->getParameter<std::string>("seedFilter").setDefaultValue("all");
72 moduleParamList->getParameter<std::string>("preSeedFilter").setDefaultValue("loose");
73 moduleParamList->getParameter<std::string>("preHitFilter").setDefaultValue("loose");
74
75 moduleParamList->getParameter<std::string>("hitsSpacePointsStoreArrayName").setDefaultValue("SVDSpacePoints");
76
77 moduleParamList->getParameter<bool>("useAssignedHits").setDefaultValue(false);
78}
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_cdcRecoTrackVector

std::vector<RecoTrack*> m_cdcRecoTrackVector
private

Pointers to the CDC Reco tracks as a vector.

Definition at line 103 of file CKFToSVDFindlet.h.

◆ m_dataHandler

TrackLoader m_dataHandler
private

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

Definition at line 83 of file CKFToSVDFindlet.h.

◆ m_filteredResults

std::vector<CKFToSVDResult> m_filteredResults
private

Vector for storing the filtered results.

Definition at line 115 of file CKFToSVDFindlet.h.

◆ m_hitsLoader

SpacePointLoader m_hitsLoader
private

Findlet for loading the space points.

Definition at line 85 of file CKFToSVDFindlet.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<ChooseableSVDResultFilter> m_overlapResolver
private

Findlet for resolving overlaps.

Definition at line 95 of file CKFToSVDFindlet.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 79 of file CKFToSVDFindlet.h.

◆ m_relationCreator

Findlet for creating relations between states.

Definition at line 91 of file CKFToSVDFindlet.h.

◆ m_relations

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

Relations between states.

Definition at line 111 of file CKFToSVDFindlet.h.

◆ m_results

std::vector<CKFToSVDResult> m_results
private

Vector for storing the results.

Definition at line 113 of file CKFToSVDFindlet.h.

◆ m_resultStorer

ResultStorer<CKFToSVDResult> m_resultStorer
private

Findlet for storing the results.

Definition at line 99 of file CKFToSVDFindlet.h.

◆ m_seedStates

std::vector<CKFToSVDState> m_seedStates
private

States for the tracks.

Definition at line 107 of file CKFToSVDFindlet.h.

◆ m_spacePointTagger

SpacePointTagger<CKFToSVDResult, SVDCluster> m_spacePointTagger
private

Findlet for tagging the used space points.

Definition at line 97 of file CKFToSVDFindlet.h.

◆ m_spacePointVector

std::vector<const SpacePoint*> m_spacePointVector
private

Pointers to the (const) SpacePoints as a vector.

Definition at line 105 of file CKFToSVDFindlet.h.

◆ m_stateCreatorFromHits

StateCreator<const SpacePoint, CKFToSVDState> m_stateCreatorFromHits
private

Findlet for creating states out of hits.

Definition at line 89 of file CKFToSVDFindlet.h.

◆ m_stateCreatorFromTracks

StateCreatorWithReversal<CKFToSVDState> m_stateCreatorFromTracks
private

Findlet for creating states out of tracks.

Definition at line 87 of file CKFToSVDFindlet.h.

◆ m_states

std::vector<CKFToSVDState> m_states
private

States for the hits.

Definition at line 109 of file CKFToSVDFindlet.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 93 of file CKFToSVDFindlet.h.


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