Belle II Software development
SVDHoughTrackingTreeSearcher< AHit, APathFilter, AResult > Class Template Referenceabstract

Findlet for constructing result paths out of a list of hits, which are connected with weighted relations. More...

#include <SVDHoughTrackingTreeSearcher.dcl.h>

Inheritance diagram for SVDHoughTrackingTreeSearcher< AHit, APathFilter, AResult >:
Findlet< AHit *, const TrackFindingCDC::WeightedRelation< AHit >, AResult > 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

 SVDHoughTrackingTreeSearcher ()
 Construct this findlet and add the subfindlet as listener.
 
void exposeParameters (ModuleParamList *moduleParamList, const std::string &prefix) final
 Expose the parameters of the subfindlet.
 
void apply (std::vector< AHit * > &hits, const std::vector< TrackFindingCDC::WeightedRelation< AHit > > &relations, std::vector< AResult > &results) final
 Main function of this findlet: traverse a tree starting from a given seed hits.
 
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 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 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< AHit *, const TrackFindingCDC::WeightedRelation< AHit >, AResult >
 Parent class.
 

Private Member Functions

void traverseTree (std::vector< TrackFindingCDC::WithWeight< const AHit * > > &path, const std::vector< TrackFindingCDC::WeightedRelation< AHit > > &relations, std::vector< AResult > &results)
 Implementation of the traverseTree function.
 

Private Attributes

APathFilter m_pathFilter
 State rejecter to decide which available continuations should be traversed next.
 
TrackFindingCDC::CellularAutomaton< AHit > m_automaton
 Findlet for adding a recursion cell state to the hits.
 
uint m_applyTwoHitFilterIfMoreChildStates = 50
 TwoHitFilter activarion cut.
 
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 APathFilter, class AResult>
class Belle2::vxdHoughTracking::SVDHoughTrackingTreeSearcher< AHit, APathFilter, AResult >

Findlet for constructing result paths out of a list of hits, which are connected with weighted relations.

At each step, the hits are again tested using a state rejector, which also knows the current path of hits.

This rejector is allowed to alter the hits, so using a cellular automaton it is assured, that the hits are traversed in the correct order without overriding each other. It is however crucial, that the relations do not create cycles in the graph!

Definition at line 37 of file SVDHoughTrackingTreeSearcher.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.

◆ Super

using Super = TrackFindingCDC::Findlet<AHit*, const TrackFindingCDC::WeightedRelation<AHit>, AResult>
private

Parent class.

Definition at line 41 of file SVDHoughTrackingTreeSearcher.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

◆ SVDHoughTrackingTreeSearcher()

Construct this findlet and add the subfindlet as listener.

Definition at line 26 of file SVDHoughTrackingTreeSearcher.icc.h.

26 : Super()
27 {
29 };
void addProcessingSignalListener(ProcessingSignalListener *psl)
Register a processing signal listener to be notified.
TrackFindingCDC::Findlet< AHit *, const TrackFindingCDC::WeightedRelation< AHit >, AResult > Super
Parent class.
APathFilter m_pathFilter
State rejecter to decide which available continuations should be traversed next.

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< AHit * > &  hits,
const std::vector< TrackFindingCDC::WeightedRelation< AHit > > &  relations,
std::vector< AResult > &  results 
)
final

Main function of this findlet: traverse a tree starting from a given seed hits.

ATTENTION: As described above, the hits themselves can be altered during the tree traversal.

Definition at line 44 of file SVDHoughTrackingTreeSearcher.icc.h.

47 {
48 B2ASSERT("Expected relation to be sorted", std::is_sorted(relations.begin(), relations.end()));
49
50 m_automaton.applyTo(hits, relations);
51
52 std::vector<const AHit*> seedHits;
53 for (const AHit* hit : hits) {
54 if (hit->getDataCache().layer >= 5) {
55 seedHits.emplace_back(hit);
56 }
57 }
58
59 std::vector<TrackFindingCDC::WithWeight<const AHit*>> path;
60 for (const AHit* seedHit : seedHits) {
61 B2DEBUG(29, "Starting with new seed...");
62
63 path.emplace_back(seedHit, 0);
64 traverseTree(path, relations, results);
65 path.pop_back();
66 B2ASSERT("Something went wrong during the path traversal", path.empty());
67
68 B2DEBUG(29, "... finished with seed");
69 }
70 }
ACellHolder * applyTo(const std::vector< ACellHolder * > &cellHolders, const std::vector< WeightedRelation< ACellHolder > > &cellHolderRelations) const
Applies the cellular automaton to the collection of cells and its neighborhood.
TrackFindingCDC::CellularAutomaton< AHit > m_automaton
Findlet for adding a recursion cell state to the hits.
void traverseTree(std::vector< TrackFindingCDC::WithWeight< const AHit * > > &path, const std::vector< TrackFindingCDC::WeightedRelation< AHit > > &relations, std::vector< AResult > &results)
Implementation of the traverseTree function.

◆ 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 
)
finalvirtual

Expose the parameters of the subfindlet.

Reimplemented from Findlet< AHit *, const TrackFindingCDC::WeightedRelation< AHit >, AResult >.

Definition at line 32 of file SVDHoughTrackingTreeSearcher.icc.h.

34 {
35 m_pathFilter.exposeParameters(moduleParamList, prefix);
36
37 moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "twoHitFilterLimit"),
39 "Use the TwoHitFilter (path length == 1) if there are more child states than this value.",
41 }

◆ 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 ( )
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.

◆ traverseTree()

void traverseTree ( std::vector< TrackFindingCDC::WithWeight< const AHit * > > &  path,
const std::vector< TrackFindingCDC::WeightedRelation< AHit > > &  relations,
std::vector< AResult > &  results 
)
private

Implementation of the traverseTree function.

Definition at line 73 of file SVDHoughTrackingTreeSearcher.icc.h.

77 {
78 // Implement only graph traversal logic and leave the extrapolation and selection to the
79 // rejecter.
80 const AHit* currentHit = path.back();
81 auto continuations =
82 TrackFindingCDC::asRange(std::equal_range(relations.begin(), relations.end(), currentHit));
83
84 std::vector<TrackFindingCDC::WithWeight<AHit*>> childHits;
85 for (const TrackFindingCDC::WeightedRelation<AHit>& continuation : continuations) {
86 AHit* childHit = continuation.getTo();
87 TrackFindingCDC::Weight weight = continuation.getWeight();
88 // the state may still include information from an other round of processing, so lets set it back
89
90 if (std::count(path.begin(), path.end(), childHit)) {
91 // Cycle detected -- is this the best handling?
92 // Other options: Raise an exception and bail out of this seed
93 B2FATAL("Cycle detected!");
94 }
95
96 childHits.emplace_back(childHit, weight);
97 }
98
99 // Do everything with child states, linking, extrapolation, teaching, discarding, what have you.
100 const std::vector<TrackFindingCDC::WithWeight<const AHit*>>& constPath = path;
101 if (path.size() > 1 or childHits.size() > m_applyTwoHitFilterIfMoreChildStates) {
102 m_pathFilter.apply(constPath, childHits);
103 }
104
105 if (childHits.empty()) {
106 B2DEBUG(29, "Terminating this route, as there are no possible child states.");
107 if (path.size() >= 3) {
108 results.emplace_back(path);
109 }
110 return;
111 }
112
113 // Traverse the tree from each new state on
114 std::sort(childHits.begin(), childHits.end(), TrackFindingCDC::GreaterOf<TrackFindingCDC::GetWeight>());
115
116 B2DEBUG(29, "Having found " << childHits.size() << " child states.");
117
118 for (const TrackFindingCDC::WithWeight<AHit*>& childHit : childHits) {
119 path.emplace_back(childHit, childHit.getWeight());
120 traverseTree(path, relations, results);
121 path.pop_back();
122 }
123 }

Member Data Documentation

◆ m_applyTwoHitFilterIfMoreChildStates

uint m_applyTwoHitFilterIfMoreChildStates = 50
private

TwoHitFilter activarion cut.

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

◆ m_automaton

TrackFindingCDC::CellularAutomaton<AHit> m_automaton
private

Findlet for adding a recursion cell state to the hits.

Definition at line 71 of file SVDHoughTrackingTreeSearcher.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_pathFilter

APathFilter m_pathFilter
private

State rejecter to decide which available continuations should be traversed next.

Definition at line 68 of file SVDHoughTrackingTreeSearcher.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.


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