Belle II Software development
SegmentTripleCreator Class Referenceabstract

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

#include <SegmentTripleCreator.h>

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

 SegmentTripleCreator ()
 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, const std::vector< CDCAxialSegmentPair > &inputAxialSegmentPairs, std::vector< CDCSegmentTriple > &segmentTriples) 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, const CDCAxialSegmentPair, CDCSegmentTriple >
 Type of the base class.
 

Private Member Functions

void create (const CDCAxialSegmentPair &axialSegmentPair, const std::vector< const CDCSegment2D * > &middleSegments, std::vector< CDCSegmentTriple > &segmentTriples)
 Creates segment triples by adding the middle segment to the axial segments and filter out the valuable combinations.
 

Private Attributes

std::array< std::vector< const CDCSegment2D * >, ISuperLayerUtil::c_Nm_segmentsBySuperLayer
 Structure for the segments grouped by super layer id.
 
ChooseableSegmentTripleFilter m_segmentTripleFilter
 The filter to be used for the segment triple 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 33 of file SegmentTripleCreator.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

Type of the base class.

Definition at line 38 of file SegmentTripleCreator.h.

◆ ToVector

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

Short hand for ToRangeImpl.

Definition at line 49 of file Findlet.h.

Constructor & Destructor Documentation

◆ SegmentTripleCreator()

Constructor adding the filter as a subordinary processing signal listener.

Definition at line 26 of file SegmentTripleCreator.cc.

27{
29}
void addProcessingSignalListener(ProcessingSignalListener *psl)
Register a processing signal listener to be notified.
ChooseableSegmentTripleFilter m_segmentTripleFilter
The filter to be used for the segment triple generation.

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,
const std::vector< CDCAxialSegmentPair > &  inputAxialSegmentPairs,
std::vector< CDCSegmentTriple > &  segmentTriples 
)
final

Main method constructing pairs in adjacent super layers.

Definition at line 42 of file SegmentTripleCreator.cc.

45{
46 // Group the segments by their super layer id
47 for (std::vector<const CDCSegment2D*>& segementsInSuperLayer : m_segmentsBySuperLayer) {
48 segementsInSuperLayer.clear();
49 }
50
51 for (const CDCSegment2D& segment : inputSegments) {
52 ISuperLayer iSuperLayer = segment.getISuperLayer();
53 const CDCSegment2D* ptrSegment = &segment;
54 m_segmentsBySuperLayer[iSuperLayer].push_back(ptrSegment);
55 }
56
57 for (const CDCAxialSegmentPair& axialSegmentPair : inputAxialSegmentPairs) {
58 const CDCSegment2D* startSegment = axialSegmentPair.getStartSegment();
59 const CDCSegment2D* endSegment = axialSegmentPair.getEndSegment();
60
61 ISuperLayer startISuperLayer = startSegment->getISuperLayer();
62 ISuperLayer endISuperLayer = endSegment->getISuperLayer();
63
64 B2ASSERT("Invalid start ISuperLayer", ISuperLayerUtil::isAxial(startISuperLayer));
65 B2ASSERT("Invalid end ISuperLayer", ISuperLayerUtil::isAxial(endISuperLayer));
66
67 if (startISuperLayer != endISuperLayer) {
68 ISuperLayer middleISuperLayer = (startISuperLayer + endISuperLayer) / 2;
69
70 B2ASSERT("Middle ISuperLayer is not stereo", not ISuperLayerUtil::isAxial(middleISuperLayer));
71
72 const std::vector<const CDCSegment2D*>& middleSegments = m_segmentsBySuperLayer[middleISuperLayer];
73 create(axialSegmentPair, middleSegments, segmentTriples);
74 } else {
75 // Case where start and end super layer are the same
76 // Look for stereo segments in the adjacent super layer
77 ISuperLayer middleISuperLayerIn = ISuperLayerUtil::getNextInwards(startISuperLayer);
78 ISuperLayer middleISuperLayerOut = ISuperLayerUtil::getNextOutwards(startISuperLayer);
79 for (ISuperLayer middleISuperLayer : {middleISuperLayerIn, middleISuperLayerOut}) {
80 if (ISuperLayerUtil::isInCDC(middleISuperLayer)) {
81 const std::vector<const CDCSegment2D*>& middleSegments = m_segmentsBySuperLayer[middleISuperLayer];
82 create(axialSegmentPair, middleSegments, segmentTriples);
83 }
84 }
85 }
86 }
87 std::sort(segmentTriples.begin(), segmentTriples.end());
88}
Class representing a pair of reconstructed axial segments in adjacent superlayer.
A reconstructed sequence of two dimensional hits in one super layer.
Definition: CDCSegment2D.h:39
void create(const CDCAxialSegmentPair &axialSegmentPair, const std::vector< const CDCSegment2D * > &middleSegments, std::vector< CDCSegmentTriple > &segmentTriples)
Creates segment triples by adding the middle segment to the axial segments and filter out the valuabl...
std::array< std::vector< const CDCSegment2D * >, ISuperLayerUtil::c_N > m_segmentsBySuperLayer
Structure for the segments grouped by super layer id.
static bool isAxial(ISuperLayer iSuperLayer)
Returns if the super layer with the given id is axial.
Definition: ISuperLayer.cc:21
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 CDCAxialSegmentPair axialSegmentPair,
const std::vector< const CDCSegment2D * > &  middleSegments,
std::vector< CDCSegmentTriple > &  segmentTriples 
)
private

Creates segment triples by adding the middle segment to the axial segments and filter out the valuable combinations.

Definition at line 90 of file SegmentTripleCreator.cc.

93{
94 CDCSegmentTriple segmentTriple(axialSegmentPair);
95 for (const CDCSegment2D* middleSegment : middleSegments) {
96 segmentTriple.setMiddleSegment(middleSegment);
97 segmentTriple.clearTrajectory3D();
98
99 // Ask the filter to assess this triple
100 Weight weight = m_segmentTripleFilter(segmentTriple);
101
102 if (not std::isnan(weight)) {
103 segmentTriple.getAutomatonCell().setCellWeight(weight);
104 segmentTriples.insert(segmentTriples.end(), segmentTriple);
105 }
106 }
107}
Class representing a triple of reconstructed segments in adjacent superlayer.

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

Definition at line 37 of file SegmentTripleCreator.cc.

38{
39 m_segmentTripleFilter.exposeParameters(moduleParamList, prefix);
40}
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, const CDCAxialSegmentPair, CDCSegmentTriple >.

Definition at line 31 of file SegmentTripleCreator.cc.

32{
33 return "Creates segment triples from a set of middle segments and already combined axial "
34 "segment pairs filtered by some acceptance criterion";
35}

◆ 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_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 63 of file SegmentTripleCreator.h.

◆ m_segmentTripleFilter

ChooseableSegmentTripleFilter m_segmentTripleFilter
private

The filter to be used for the segment triple generation.

Definition at line 66 of file SegmentTripleCreator.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: