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
 Types that should be served to apply on invocation.
 
using IOVectors
 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 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
 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
 Flag to keep track whether initialization happened before.
 
bool m_terminated
 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
inherited

Types that should be served to apply on invocation.

Definition at line 30 of file Findlet.h.

◆ IOVectors

using IOVectors
inherited

Vector types that should be served to apply on invocation.

Definition at line 53 of file Findlet.h.

◆ Result

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

Shortcut definition for Result.

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

◆ Super

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

Parent class.

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

◆ ToVector

using ToVector
protectedinherited

Short hand for ToRangeImpl.

Definition at line 49 of file Findlet.h.

Constructor & Destructor Documentation

◆ RawTrackCandCleaner()

template<class AHit>
RawTrackCandCleaner ( )

Find intercepts in the 2D Hough space.

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

28 : Super()
29 {
30 Super::addProcessingSignalListener(&m_relationCreator);
31 Super::addProcessingSignalListener(&m_treeSearcher);
32 Super::addProcessingSignalListener(&m_resultRefiner);
33 }

Member Function Documentation

◆ addProcessingSignalListener()

void addProcessingSignalListener ( ProcessingSignalListener * psl)
protectedinherited

Register a processing signal listener to be notified.

Definition at line 53 of file CompositeProcessingSignalListener.cc.

56{
58}
Interface for a minimal algorithm part that wants to expose some parameters to a module.
Definition Findlet.h:26

◆ apply()

template<class AHit>
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
97 m_resultRefiner.apply(m_unfilteredResults, m_filteredResults);
98
99 for (const SpacePointTrackCand& trackCand : m_filteredResults) {
100 trackCandidates.emplace_back(trackCand);
101 }
102
103 family++;
104 }
105 }

◆ beginEvent()

void beginEvent ( )
overrideinherited

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

Definition at line 36 of file CompositeProcessingSignalListener.cc.

32{
35 psl->beginEvent();
36 }
37}
void beginEvent() override
Receive and dispatch signal for the start of a new event.
virtual void beginEvent()
Receive signal for the start of a new event.

◆ beginRun()

void beginRun ( )
overrideinherited

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

Definition at line 33 of file CompositeProcessingSignalListener.cc.

24{
27 psl->beginRun();
28 }
29}
void beginRun() override
Receive and dispatch signal for the beginning of a new run.
virtual void beginRun()
Receive signal for the beginning of a new run.

◆ endRun()

void endRun ( )
overrideinherited

Receive and dispatch signal for the end of the run.

Definition at line 39 of file CompositeProcessingSignalListener.cc.

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

◆ exposeParameters()

template<class AHit>
void exposeParameters ( ModuleParamList * moduleParamList,
const std::string & prefix )
overridevirtual

Expose the parameters of the sub findlets.

Reimplemented from CompositeProcessingSignalListener.

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 }

◆ getDescription() [1/2]

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 }

◆ getDescription() [2/2]

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 56 of file CompositeProcessingSignalListener.cc.

61{
63}

◆ initialize()

template<class AHit>
void initialize ( )
overridevirtual

Create the store arrays.

Reimplemented from CompositeProcessingSignalListener.

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

49 {
50 Super::initialize();
51 }

◆ terminate()

void terminate ( )
overrideinherited

Receive and dispatch Signal for termination of the event processing.

Definition at line 42 of file CompositeProcessingSignalListener.cc.

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

Member Data Documentation

◆ m_filteredResults

template<class AHit>
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
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

template<class AHit>
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

template<class AHit>
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

template<class AHit>
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

template<class AHit>
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

template<class AHit>
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 60 of file CompositeProcessingSignalListener.h.

◆ m_terminated

bool m_terminated
privateinherited

Flag to keep track whether termination happened before.

Definition at line 55 of file ProcessingSignalListener.h.

◆ m_treeSearcher

template<class AHit>
SVDHoughTrackingTreeSearcher<AHit, ChooseablePathFilter, Result> m_treeSearcher
private

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

template<class AHit>
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: