Belle II Software development
AxialSegmentPairCreator Class Referenceabstract

Class providing construction combinatorics for the axial stereo segment pairs. More...

#include <AxialSegmentPairCreator.h>

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

 AxialSegmentPairCreator ()
 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 > &inputSegments, std::vector< CDCAxialSegmentPair > &axialSegmentPairs) final
 Main method constructing pairs in adjacent super layers.
 
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, CDCAxialSegmentPair >
 Type of the base class.
 

Private Member Functions

void create (const std::vector< const CDCSegment2D * > &startSegments, const std::vector< const CDCSegment2D * > &endSegments, std::vector< CDCAxialSegmentPair > &axialSegmentPairs)
 Creates segment pairs from a combination of start segments and end segments.
 

Private Attributes

std::array< std::vector< const CDCSegment2D * >, ISuperLayerUtil::c_Nm_segmentsBySuperLayer
 Structure for the segments grouped by super layer id.
 
ChooseableAxialSegmentPairFilter m_axialSegmentPairFilter
 The filter to be used for the segment pair generation.
 
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

Class providing construction combinatorics for the axial stereo segment pairs.

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

Type of the base class.

Definition at line 35 of file AxialSegmentPairCreator.h.

◆ ToVector

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

Short hand for ToRangeImpl.

Definition at line 49 of file Findlet.h.

Constructor & Destructor Documentation

◆ AxialSegmentPairCreator()

Constructor adding the filter as a subordinary processing signal listener.

Definition at line 19 of file AxialSegmentPairCreator.cc.

20{
22}
ChooseableAxialSegmentPairFilter m_axialSegmentPairFilter
The filter to be used for the segment pair generation.
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 ( const std::vector< CDCSegment2D > &  inputSegments,
std::vector< CDCAxialSegmentPair > &  axialSegmentPairs 
)
final

Main method constructing pairs in adjacent super layers.

Definition at line 34 of file AxialSegmentPairCreator.cc.

36{
37 // Group the segments by their super layer id
38 for (std::vector<const CDCSegment2D*>& segementsInSuperLayer : m_segmentsBySuperLayer) {
39 segementsInSuperLayer.clear();
40 }
41
42 for (const CDCSegment2D& segment : inputSegments) {
43 ISuperLayer iSuperLayer = segment.getISuperLayer();
44 const CDCSegment2D* ptrSegment = &segment;
45 m_segmentsBySuperLayer[iSuperLayer].push_back(ptrSegment);
46 }
47
48 // Make pairs of closeby superlayers
49 for (ISuperLayer iSuperLayer = 0; iSuperLayer < ISuperLayerUtil::c_N; ++iSuperLayer) {
50 if (not ISuperLayerUtil::isAxial(iSuperLayer)) continue;
51
52 const std::vector<const CDCSegment2D*>& startSegments = m_segmentsBySuperLayer[iSuperLayer];
53
54 // Make pairs of this superlayer and the superlayer more to the inside
55 {
56 ISuperLayer iStereoSuperLayerIn = ISuperLayerUtil::getNextInwards(iSuperLayer);
57 ISuperLayer iAxialSuperLayerIn = ISuperLayerUtil::getNextInwards(iStereoSuperLayerIn);
58 if (ISuperLayerUtil::isInCDC(iAxialSuperLayerIn)) {
59 const std::vector<const CDCSegment2D*>& endSegments = m_segmentsBySuperLayer[iAxialSuperLayerIn];
60 create(startSegments, endSegments, axialSegmentPairs);
61 }
62 }
63
64 // Make pairs with the same super layer
65 create(startSegments, startSegments, axialSegmentPairs);
66
67 // Make pairs of this superlayer and the superlayer more to the outside
68 {
69 ISuperLayer iStereoSuperLayerOut = ISuperLayerUtil::getNextOutwards(iSuperLayer);
70 ISuperLayer iAxialSuperLayerOut = ISuperLayerUtil::getNextOutwards(iStereoSuperLayerOut);
71 if (ISuperLayerUtil::isInCDC(iAxialSuperLayerOut)) {
72 const std::vector<const CDCSegment2D*>& endSegments = m_segmentsBySuperLayer[iAxialSuperLayerOut];
73 create(startSegments, endSegments, axialSegmentPairs);
74 }
75 }
76
77 } // end for iSuperLayer
78
79 std::sort(axialSegmentPairs.begin(), axialSegmentPairs.end());
80}
void create(const std::vector< const CDCSegment2D * > &startSegments, const std::vector< const CDCSegment2D * > &endSegments, std::vector< CDCAxialSegmentPair > &axialSegmentPairs)
Creates segment pairs from a combination of start segments and end segments.
std::array< std::vector< const CDCSegment2D * >, ISuperLayerUtil::c_N > m_segmentsBySuperLayer
Structure for the segments grouped by super layer id.
A reconstructed sequence of two dimensional hits in one super layer.
Definition: CDCSegment2D.h:39
static bool isAxial(ISuperLayer iSuperLayer)
Returns if the super layer with the given id is axial.
Definition: ISuperLayer.cc:21
static const ISuperLayer c_N
Constant representing the total number of cdc superlayers.
Definition: ISuperLayer.h:56
static ISuperLayer getNextInwards(ISuperLayer iSuperLayer)
Returns the super layer that is inside of the given super layer.
Definition: ISuperLayer.cc:63
static ISuperLayer getNextOutwards(ISuperLayer iSuperLayer)
Returns the super layer that is outside of the given super layer.
Definition: ISuperLayer.cc:72
static bool isInCDC(ISuperLayer iSuperLayer)
Indicates if the given number corresponds to a true cdc superlayer - excludes the logic ids for inner...
Definition: ISuperLayer.cc:43

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

◆ create()

void create ( const std::vector< const CDCSegment2D * > &  startSegments,
const std::vector< const CDCSegment2D * > &  endSegments,
std::vector< CDCAxialSegmentPair > &  axialSegmentPairs 
)
private

Creates segment pairs from a combination of start segments and end segments.

Definition at line 82 of file AxialSegmentPairCreator.cc.

85{
86 CDCAxialSegmentPair axialSegmentPair;
87 for (const CDCSegment2D* ptrStartSegment : startSegments) {
88 for (const CDCSegment2D* ptrEndSegment : endSegments) {
89
90 if (ptrStartSegment == ptrEndSegment) continue; // Just for safety
91 axialSegmentPair.setSegments(ptrStartSegment, ptrEndSegment);
92 axialSegmentPair.clearTrajectory2D();
93
94 Weight pairWeight = m_axialSegmentPairFilter(axialSegmentPair);
95 if (not std::isnan(pairWeight)) {
96 axialSegmentPair.getAutomatonCell().setCellWeight(pairWeight);
97 axialSegmentPairs.push_back(axialSegmentPair);
98 }
99 }
100 }
101}
void setCellWeight(Weight weight)
Setter for the cell weight.
Class representing a pair of reconstructed axial segments in adjacent superlayer.
void clearTrajectory2D() const
Invalidates the currently stored trajectory information.
AutomatonCell & getAutomatonCell() const
Mutable getter for the automaton cell.
void setSegments(const CDCSegment2D *startSegment, const CDCSegment2D *endSegment)
Setter for both segments simultaneously.

◆ 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, CDCAxialSegmentPair >.

Definition at line 29 of file AxialSegmentPairCreator.cc.

30{
31 m_axialSegmentPairFilter.exposeParameters(moduleParamList, prefix);
32}
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) final
Expose the set of parameters of the filter to the module parameter list.

◆ getDescription()

std::string getDescription ( )
finalvirtual

Short description of the findlet.

Reimplemented from Findlet< const CDCSegment2D, CDCAxialSegmentPair >.

Definition at line 24 of file AxialSegmentPairCreator.cc.

25{
26 return "Creates axial axial segment pairs from a set of segments filtered by some acceptance criterion";
27}

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

ChooseableAxialSegmentPairFilter m_axialSegmentPairFilter
private

The filter to be used for the segment pair generation.

Definition at line 62 of file AxialSegmentPairCreator.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_segmentsBySuperLayer

std::array<std::vector<const CDCSegment2D*>, ISuperLayerUtil::c_N> m_segmentsBySuperLayer
private

Structure for the segments grouped by super layer id.

Definition at line 59 of file AxialSegmentPairCreator.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: