Belle II Software development
RawTrackCandCleaner< AHit > Class Template Referenceabstract

Findlet for rejecting wrong SpacePointTrackCands and for removing bad hits. More...

#include <RawTrackCandCleaner.dcl.h>

Inheritance diagram for RawTrackCandCleaner< AHit >:
Findlet< std::vector< AHit * >, SpacePointTrackCand > CompositeProcessingSignalListener ProcessingSignalListener

Public Types

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

Public Member Functions

 RawTrackCandCleaner ()
 Find intercepts in the 2D Hough space.
 
 ~RawTrackCandCleaner ()
 Default destructor.
 
void exposeParameters (ModuleParamList *moduleParamList, const std::string &prefix) override
 Expose the parameters of the sub findlets.
 
void initialize () override
 Create the store arrays.
 
void apply (std::vector< std::vector< AHit * > > &rawTrackCandidates, std::vector< SpacePointTrackCand > &trackCandidates) override
 Reject bad SpacePointTrackCands and bad hits inside the remaining.
 
virtual std::string getDescription ()
 Brief description of the purpose of the concrete findlet.
 
virtual void apply (ToVector< AIOTypes > &... ioVectors)=0
 Main function executing the algorithm.
 
void beginRun () override
 Receive and dispatch signal for the beginning of a new run.
 
void beginEvent () override
 Receive and dispatch signal for the start of a new event.
 
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< std::vector< AHit * >, SpacePointTrackCand >
 Parent class.
 
using Result = std::vector< TrackFindingCDC::WithWeight< const AHit * > >
 Shortcut definition for Result.
 

Private Attributes

RelationCreator< AHit, ChooseableRelationFilterm_relationCreator
 create relations between the hits in each raw track candidate
 
SVDHoughTrackingTreeSearcher< AHit, ChooseablePathFilter, Resultm_treeSearcher
 perform a tree search using a cellular automaton for all the hits and relations of each raw track candidate
 
TrackCandidateResultRefiner m_resultRefiner
 sort and refine the results for each raw track cand, performing a fit and a basic overlap check
 
std::vector< TrackFindingCDC::WeightedRelation< AHit > > m_relations
 vector containing the relations between the hits in the raw track candidate
 
std::vector< Resultm_results
 vector containing track candidates after tree search
 
std::vector< SpacePointTrackCandm_unfilteredResults
 vector containing unfiltered results, i.e.
 
std::vector< SpacePointTrackCandm_filteredResults
 vector containing the filtered and pruned results the filtered results of each raw track candidate will be collected and given back to the caller
 
uint m_maxRelations = 100
 maximum number of relations that can be created per track candidate
 
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 happened before.
 
bool m_terminated = false
 Flag to keep track whether termination happened before.
 
std::string m_initializedAs
 Name of the type during initialisation.
 

Detailed Description

template<class AHit>
class Belle2::vxdHoughTracking::RawTrackCandCleaner< AHit >

Findlet for rejecting wrong SpacePointTrackCands and for removing bad hits.

Definition at line 33 of file RawTrackCandCleaner.dcl.h.

Member Typedef Documentation

◆ IOTypes

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

Types that should be served to apply on invocation.

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 invocation.

Definition at line 53 of file Findlet.h.

◆ Result

using Result = std::vector<TrackFindingCDC::WithWeight<const AHit*> >
private

Shortcut definition for Result.

Definition at line 38 of file RawTrackCandCleaner.dcl.h.

◆ Super

using Super = TrackFindingCDC::Findlet<std::vector<AHit*>, SpacePointTrackCand>
private

Parent class.

Definition at line 35 of file RawTrackCandCleaner.dcl.h.

◆ ToVector

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

Short hand for ToRangeImpl.

Definition at line 49 of file Findlet.h.

Constructor & Destructor Documentation

◆ RawTrackCandCleaner()

Find intercepts in the 2D Hough space.

Definition at line 28 of file RawTrackCandCleaner.icc.h.

28 : Super()
29 {
33 }
void addProcessingSignalListener(ProcessingSignalListener *psl)
Register a processing signal listener to be notified.
SVDHoughTrackingTreeSearcher< AHit, ChooseablePathFilter, Result > m_treeSearcher
perform a tree search using a cellular automaton for all the hits and relations of each raw track can...
TrackCandidateResultRefiner m_resultRefiner
sort and refine the results for each raw track cand, performing a fit and a basic overlap check
RelationCreator< AHit, ChooseableRelationFilter > m_relationCreator
create relations between the hits in each raw track candidate
TrackFindingCDC::Findlet< std::vector< AHit * >, SpacePointTrackCand > Super
Parent class.

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 ( std::vector< std::vector< AHit * > > &  rawTrackCandidates,
std::vector< SpacePointTrackCand > &  trackCandidates 
)
override

Reject bad SpacePointTrackCands and bad hits inside the remaining.

Definition at line 54 of file RawTrackCandCleaner.icc.h.

56 {
57 uint family = 0; // family of the SpacePointTrackCands
58 for (auto& rawTrackCand : rawTrackCandidates) {
59
60 // If the capacity of a std::vector is too large, start with a fresh one.
61 // Since std::vector.shrink() or std::vector.shrink_to_fit() not necessarily reduce the capacity in the desired way,
62 // create a temporary vector of the same type and swap them to use the vector at the new location afterwards.
63 checkResizeClear<TrackFindingCDC::WeightedRelation<AHit>>(m_relations, 8192);
64 checkResizeClear<Result>(m_results, 8192);
65 checkResizeClear<SpacePointTrackCand>(m_unfilteredResults, 8192);
66 checkResizeClear<SpacePointTrackCand>(m_filteredResults, 8192);
67
68 m_relationCreator.apply(rawTrackCand, m_relations);
69
70 if (m_relations.size() > m_maxRelations) {
71 m_relations.clear();
72 continue;
73 }
74
75 m_treeSearcher.apply(rawTrackCand, m_relations, m_results);
76
77 m_unfilteredResults.reserve(m_results.size());
78 for (const std::vector<TrackFindingCDC::WithWeight<const AHit*>>& result : m_results) {
79 std::vector<const SpacePoint*> spacePointsInResult;
80 spacePointsInResult.reserve(result.size());
81 for (const TrackFindingCDC::WithWeight<const AHit*>& hit : result) {
82 spacePointsInResult.emplace_back(hit->getHit());
83 }
84 std::sort(spacePointsInResult.begin(), spacePointsInResult.end(), [](const SpacePoint * a, const SpacePoint * b) {
85 return
86 (a->getVxdID().getLayerNumber() < b->getVxdID().getLayerNumber()) or
87 (a->getVxdID().getLayerNumber() == b->getVxdID().getLayerNumber()
88 and a->getPosition().Perp() < b->getPosition().Perp());
89 });
90 m_unfilteredResults.emplace_back(spacePointsInResult);
91 }
92
93 for (auto aTC : m_unfilteredResults) {
94 aTC.setFamily(family);
95 }
96
98
99 for (const SpacePointTrackCand& trackCand : m_filteredResults) {
100 trackCandidates.emplace_back(trackCand);
101 }
102
103 family++;
104 }
105 }
uint m_maxRelations
maximum number of relations that can be created per track candidate
std::vector< SpacePointTrackCand > m_unfilteredResults
vector containing unfiltered results, i.e.
std::vector< TrackFindingCDC::WeightedRelation< AHit > > m_relations
vector containing the relations between the hits in the raw track candidate
std::vector< Result > m_results
vector containing track candidates after tree search
std::vector< SpacePointTrackCand > m_filteredResults
vector containing the filtered and pruned results the filtered results of each raw track candidate wi...
void apply(std::vector< SpacePointTrackCand > &unrefinedResults, std::vector< SpacePointTrackCand > &refinedResults) override
Reject bad SpacePointTrackCands and bad hits inside the remaining.

◆ beginEvent()

void beginEvent ( )
overridevirtualinherited

Receive and dispatch signal for the start of a new event.

Reimplemented from ProcessingSignalListener.

Reimplemented in SpacePointTagger< Belle2::CKFToPXDResult, Belle2::PXDCluster >, SpacePointTagger< Belle2::CKFToSVDResult, Belle2::SVDCluster >, BaseEventTimeExtractor< RecoTrack * >, BaseEventTimeExtractor< TrackFindingCDC::CDCWireHit & >, SharingHitsMatcher< Belle2::TrackFindingCDC::CDCTrack, Belle2::TrackFindingCDC::CDCSegment2D >, MCSymmetric< BaseAxialSegmentPairFilter >, MCSymmetric< BaseFacetFilter >, MCSymmetric< BaseFacetRelationFilter >, MCSymmetric< BaseSegmentPairFilter >, MCSymmetric< BaseSegmentPairRelationFilter >, MCSymmetric< BaseSegmentRelationFilter >, MCSymmetric< BaseSegmentTripleFilter >, MCSymmetric< BaseSegmentTripleRelationFilter >, MCSymmetric< BaseTrackRelationFilter >, 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 >, RecoTrackStorer, ROIFinder, and SVDHoughTracking.

Definition at line 31 of file CompositeProcessingSignalListener.cc.

32{
35 psl->beginEvent();
36 }
37}
Interface for an algorithm part that needs to receive the module processing signals.
virtual void beginEvent()
Receive 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}
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< std::vector< AHit * >, SpacePointTrackCand >.

Definition at line 36 of file RawTrackCandCleaner.icc.h.

37 {
38 Super::exposeParameters(moduleParamList, prefix);
39 m_relationCreator.exposeParameters(moduleParamList, prefix);
40 m_treeSearcher.exposeParameters(moduleParamList, prefix);
41 m_resultRefiner.exposeParameters(moduleParamList, prefix);
42
43 moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "maxRelations"), m_maxRelations,
44 "Maximum number of relations allowed for entering tree search.", m_maxRelations);
45 }
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.

◆ getDescription()

virtual std::string getDescription ( )
inlinevirtualinherited

Brief description of the purpose of the concrete findlet.

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
overridevirtual

Create the store arrays.

Reimplemented from CompositeProcessingSignalListener.

Definition at line 48 of file RawTrackCandCleaner.icc.h.

49 {
51 }
void initialize() override
Receive and dispatch 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_filteredResults

std::vector<SpacePointTrackCand> m_filteredResults
private

vector containing the filtered and pruned results the filtered results of each raw track candidate will be collected and given back to the caller

Definition at line 77 of file RawTrackCandCleaner.dcl.h.

◆ m_initialized

bool m_initialized = false
privateinherited

Flag to keep track whether initialization happened 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_maxRelations

uint m_maxRelations = 100
private

maximum number of relations that can be created per track candidate

Definition at line 80 of file RawTrackCandCleaner.dcl.h.

◆ m_relationCreator

RelationCreator<AHit, ChooseableRelationFilter> m_relationCreator
private

create relations between the hits in each raw track candidate

Definition at line 59 of file RawTrackCandCleaner.dcl.h.

◆ m_relations

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

vector containing the relations between the hits in the raw track candidate

Definition at line 68 of file RawTrackCandCleaner.dcl.h.

◆ m_resultRefiner

TrackCandidateResultRefiner m_resultRefiner
private

sort and refine the results for each raw track cand, performing a fit and a basic overlap check

Definition at line 65 of file RawTrackCandCleaner.dcl.h.

◆ m_results

std::vector<Result> m_results
private

vector containing track candidates after tree search

Definition at line 71 of file RawTrackCandCleaner.dcl.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 happened before.

Definition at line 55 of file ProcessingSignalListener.h.

◆ m_treeSearcher

perform a tree search using a cellular automaton for all the hits and relations of each raw track candidate

Definition at line 62 of file RawTrackCandCleaner.dcl.h.

◆ m_unfilteredResults

std::vector<SpacePointTrackCand> m_unfilteredResults
private

vector containing unfiltered results, i.e.

SpacePointTrackCands containing only the SpacePoins of the hits in m_results

Definition at line 74 of file RawTrackCandCleaner.dcl.h.


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