Belle II Software development
SegmentLinker Class Referenceabstract

Links segments in the same super cluster by linking paths of segments in a cellular automaton. More...

#include <SegmentLinker.h>

Inheritance diagram for SegmentLinker:
Findlet< const CDCSegment2D, CDCSegment2D > 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

 SegmentLinker ()
 Constructor adding the filter as a subordinary processing signal listener.
 
std::string getDescription () final
 Short description of the findlet.
 
void exposeParameters (ModuleParamList *moduleParamList, const std::string &prefix) final
 Expose the parameters to a module.
 
void apply (const std::vector< CDCSegment2D > &inputSegment2Ds, std::vector< CDCSegment2D > &outputSegment2Ds) final
 Main algorithm.
 
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 = Findlet< const CDCSegment2D, CDCSegment2D >
 Type of the base class.
 

Private Attributes

bool m_param_wholeSuperLayer = false
 Parameter : Switch to activate segment linking in the whole superlayer instead of only the super cluster.
 
bool m_param_dealiasLinked = false
 Parameter : Switch to block hits that appear in linked segments such that unlinked reverse and aliases are excluded.
 
bool m_param_onlyLinked = false
 Parameter : Switch to construct only segments that have a linked partner.
 
WeightedRelationCreator< const CDCSegment2D, ChooseableSegmentRelationFilterm_segment2DRelationCreator
 Creator of the segment relations for linking.
 
MultipassCellularPathFinder< const CDCSegment2Dm_cellularPathFinder
 Instance of the cellular automaton path finder.
 
std::vector< WeightedRelation< const CDCSegment2D > > m_segment2DRelations
 Memory for the relations between segments to be followed on linking.
 
std::vector< Path< const CDCSegment2D > > m_segment2DPaths
 Memory for the segment paths generated from the graph.
 
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

Links segments in the same super cluster by linking paths of segments in a cellular automaton.

Definition at line 31 of file SegmentLinker.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 = Findlet<const CDCSegment2D, CDCSegment2D>
private

Type of the base class.

Definition at line 35 of file SegmentLinker.h.

◆ ToVector

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

Short hand for ToRangeImpl.

Definition at line 49 of file Findlet.h.

Constructor & Destructor Documentation

◆ SegmentLinker()

Constructor adding the filter as a subordinary processing signal listener.

Definition at line 23 of file SegmentLinker.cc.

24{
26}
void addProcessingSignalListener(ProcessingSignalListener *psl)
Register a processing signal listener to be notified.
WeightedRelationCreator< const CDCSegment2D, ChooseableSegmentRelationFilter > m_segment2DRelationCreator
Creator of the segment relations for linking.
Definition: SegmentLinker.h:64

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 ( const std::vector< CDCSegment2D > &  inputSegment2Ds,
std::vector< CDCSegment2D > &  outputSegment2Ds 
)
final

Main algorithm.

Definition at line 53 of file SegmentLinker.cc.

55{
57 for (const CDCSegment2D& segment2D : inputSegment2Ds) {
58 segment2D.setISuperCluster(-1);
59 }
60 }
61
62 // Obtain the segments as pointers
63 std::vector<const CDCSegment2D*> segment2DPtrs = as_pointers<const CDCSegment2D>(inputSegment2Ds);
64
65 // Create linking relations
68
69 // Find linking paths
70 m_segment2DPaths.clear();
72
73 // Unmasked hits in case the blocking logic is requested
74 const bool toHits = true;
75 for (const CDCSegment2D& segment : inputSegment2Ds) {
76 segment.unsetAndForwardMaskedFlag(toHits);
77 }
78
79 // Put the linked segments together
80 std::vector<CDCSegment2D> tempOutputSegment2Ds;
81 tempOutputSegment2Ds.reserve(m_segment2DPaths.size());
82 for (const Path<const CDCSegment2D>& segment2DPath : m_segment2DPaths) {
83 if (m_param_onlyLinked and segment2DPath.size() == 1) continue;
84
85 // Do not use the single segments blocked in the dealiasing
86 if (m_param_dealiasLinked and segment2DPath.size() == 1 and
87 (*segment2DPath[0])->hasMaskedFlag()) {
88 continue;
89 }
90
91 tempOutputSegment2Ds.push_back(CDCSegment2D::condense(segment2DPath));
92
93 // If two segments are linked odds are that it is the correct alias
94 // Block the used hits.
95 if (m_param_dealiasLinked and segment2DPath.size() > 1) {
96 tempOutputSegment2Ds.back().setAndForwardMaskedFlag(toHits);
97 for (const CDCSegment2D& otherSegment : inputSegment2Ds) {
98 otherSegment.receiveMaskedFlag(toHits);
99 }
100 }
101
102 }
103 outputSegment2Ds = std::move(tempOutputSegment2Ds);
104}
Implements a path consisting of Module and/or Path objects.
Definition: Path.h:38
A reconstructed sequence of two dimensional hits in one super layer.
Definition: CDCSegment2D.h:39
static CDCSegment2D condense(const CDCTangentSegment &tangentSegment)
Averages the reconstructed positions from hits that overlap in adjacent tangents in the given tangent...
std::vector< WeightedRelation< const CDCSegment2D > > m_segment2DRelations
Memory for the relations between segments to be followed on linking.
Definition: SegmentLinker.h:70
MultipassCellularPathFinder< const CDCSegment2D > m_cellularPathFinder
Instance of the cellular automaton path finder.
Definition: SegmentLinker.h:67
bool m_param_wholeSuperLayer
Parameter : Switch to activate segment linking in the whole superlayer instead of only the super clus...
Definition: SegmentLinker.h:54
bool m_param_dealiasLinked
Parameter : Switch to block hits that appear in linked segments such that unlinked reverse and aliase...
Definition: SegmentLinker.h:57
bool m_param_onlyLinked
Parameter : Switch to construct only segments that have a linked partner.
Definition: SegmentLinker.h:60
std::vector< Path< const CDCSegment2D > > m_segment2DPaths
Memory for the segment paths generated from the graph.
Definition: SegmentLinker.h:73

◆ 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 to a module.

Reimplemented from Findlet< const CDCSegment2D, CDCSegment2D >.

Definition at line 33 of file SegmentLinker.cc.

34{
35 m_segment2DRelationCreator.exposeParameters(moduleParamList, prefix);
36
37 moduleParamList->addParameter(prefixed(prefix, "wholeSuperLayer"),
39 "Link segment in the whole superlayer instead of inside the super cluster.",
41
42 moduleParamList->addParameter(prefixed(prefix, "dealiasLinked"),
44 "Block hits that appear in linked segments such that unlinked reverse and aliases are excluded.",
46
47 moduleParamList->addParameter(prefixed(prefix, "onlyLinked"),
49 "Switch to construct only segments that have a linked partner.",
51}
void addParameter(const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module list.

◆ getDescription()

std::string getDescription ( )
finalvirtual

Short description of the findlet.

Reimplemented from Findlet< const CDCSegment2D, CDCSegment2D >.

Definition at line 28 of file SegmentLinker.cc.

29{
30 return "Links segments by extraction of segment paths in a cellular automaton.";
31}

◆ 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_cellularPathFinder

MultipassCellularPathFinder<const CDCSegment2D> m_cellularPathFinder
private

Instance of the cellular automaton path finder.

Definition at line 67 of file SegmentLinker.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_param_dealiasLinked

bool m_param_dealiasLinked = false
private

Parameter : Switch to block hits that appear in linked segments such that unlinked reverse and aliases are excluded.

Definition at line 57 of file SegmentLinker.h.

◆ m_param_onlyLinked

bool m_param_onlyLinked = false
private

Parameter : Switch to construct only segments that have a linked partner.

Definition at line 60 of file SegmentLinker.h.

◆ m_param_wholeSuperLayer

bool m_param_wholeSuperLayer = false
private

Parameter : Switch to activate segment linking in the whole superlayer instead of only the super cluster.

Definition at line 54 of file SegmentLinker.h.

◆ m_segment2DPaths

std::vector<Path<const CDCSegment2D> > m_segment2DPaths
private

Memory for the segment paths generated from the graph.

Definition at line 73 of file SegmentLinker.h.

◆ m_segment2DRelationCreator

WeightedRelationCreator<const CDCSegment2D, ChooseableSegmentRelationFilter> m_segment2DRelationCreator
private

Creator of the segment relations for linking.

Definition at line 64 of file SegmentLinker.h.

◆ m_segment2DRelations

std::vector<WeightedRelation<const CDCSegment2D> > m_segment2DRelations
private

Memory for the relations between segments to be followed on linking.

Definition at line 70 of file SegmentLinker.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.


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