Belle II Software development
SimpleAxialSegmentPairFilter Class Reference

Filter for the construction of axial to axial segment pairs based on simple criteria. More...

#include <SimpleAxialSegmentPairFilter.h>

Inheritance diagram for SimpleAxialSegmentPairFilter:
Filter< AObject > CompositeProcessingSignalListener ProcessingSignalListener

Public Types

using Object = AObject
 Type of the object to be analysed.
 
using Interface = Filter< AObject >
 Mark this class as the basic interface.
 

Public Member Functions

 SimpleAxialSegmentPairFilter ()
 Constructor.
 
Weight operator() (const CDCAxialSegmentPair &axialSegmentPair) final
 Checks if a pair of axial segments is a good combination.
 
const CDCTrajectory2DgetFittedTrajectory2D (const CDCAxialSegment2D &segment) const
 Returns the trajectory of the axial segment. Also fits it if necessary.
 
const CDCTrajectory2DgetFittedTrajectory2D (const CDCAxialSegmentPair &axialSegmentPair) const
 Returns the trajectory of the axial to axial segment pair. Also fits it if necessary.
 
const CDCRiemannFittergetRiemannFitter () const
 Returns the xy fitter instance that is used by this filter.
 
virtual void exposeParameters (ModuleParamList *moduleParamList, const std::string &prefix)
 Expose the set of parameters of the filter to the module parameter list.
 
virtual bool needsTruthInformation ()
 Indicates if the filter requires Monte Carlo information.
 
virtual Weight operator() (const Object &obj)
 Function to evaluate the object.
 
Weight operator() (const Object *obj)
 Function to evaluate the object.
 
virtual std::vector< float > operator() (const std::vector< Object * > &objs)
 Function to evaluate a vector of objects Base implementation applies the function to each object.
 
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 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 = ProcessingSignalListener
 Type of the base class.
 

Private Attributes

CDCRiemannFitter m_riemannFitter
 Memory of the Riemann fitter for the circle fits.
 
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

Filter for the construction of axial to axial segment pairs based on simple criteria.

Definition at line 23 of file SimpleAxialSegmentPairFilter.h.

Member Typedef Documentation

◆ Interface

using Interface = Filter<AObject>
inherited

Mark this class as the basic interface.

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

◆ Object

using Object = AObject
inherited

Type of the object to be analysed.

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

◆ Super

using Super = ProcessingSignalListener
privateinherited

Type of the base class.

Definition at line 25 of file CompositeProcessingSignalListener.h.

Constructor & Destructor Documentation

◆ SimpleAxialSegmentPairFilter()

Constructor.

Definition at line 16 of file SimpleAxialSegmentPairFilter.cc.

17{
19}
void useOnlyOrientation()
Setup the fitter to use only reference position and the drift length with right left orientation.
CDCRiemannFitter m_riemannFitter
Memory of the Riemann fitter for the circle fits.

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.

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

Expose the set of parameters of the filter to the module parameter list.

Note that not all filters have yet exposed their parameters in this way.

This method is deprecated as the exposeParams below uses a less compile heavy equivalent.

Reimplemented in LayerSVDRelationFilter< AFilter, APrefilter >, SectorMapBasedSVDPairFilter, MCAxialSegmentPairFilter, Chi2FacetFilter, FeasibleRLFacetFilter, RealisticFacetFilter, SimpleFacetFilter, MCFacetRelationFilter, MCSegmentPairFilter, MCSegmentPairRelationFilter, MCSegmentRelationFilter, MCSegmentTripleFilter, MCSegmentTripleRelationFilter, WholeWireHitRelationFilter, LayerRelationFilter< AFilter >, DuplicateCDCPathPairFilter, DistanceCDCStateFilter, ExtrapolateAndUpdateCDCStateFilter, RoughCDCfromEclStateFilter, RoughCDCStateFilter, AdvanceFilter< AState, AnAdvancer >, AngularDistancePXDPairFilter, CylinderDistancePXDPairFilter, InterceptDistancePXDPairFilter, LayerPXDRelationFilter< AFilter, APrefilter >, LoosePXDPairFilter, SensorPXDPairFilter, LooseSVDPairFilter, SensorSVDPairFilter, ResidualSVDStateFilter, PhiRecoTrackRelationFilter, MCSymmetric< BaseAxialSegmentPairFilter >, MCSymmetric< BaseFacetFilter >, MCSymmetric< BaseFacetRelationFilter >, MCSymmetric< BaseSegmentPairFilter >, MCSymmetric< BaseSegmentPairRelationFilter >, MCSymmetric< BaseSegmentRelationFilter >, MCSymmetric< BaseSegmentTripleFilter >, MCSymmetric< BaseSegmentTripleRelationFilter >, MCSymmetric< BaseTrackRelationFilter >, Chi2FacetRelationFilter, SimpleFacetRelationFilter, PhiTrackRelationFilter, BridgingWireHitRelationFilter, FiveHitFilter, FourHitFilter, QualityIndicatorFilter, ThreeHitFilter, TwoHitVirtualIPFilter, TwoHitVirtualIPQIFilter, AngleAndTimeRelationFilter, and SimpleRelationFilter.

Definition at line 40 of file Filter.icc.h.

42 {
43 }

◆ getFittedTrajectory2D() [1/2]

const CDCTrajectory2D & getFittedTrajectory2D ( const CDCAxialSegment2D segment) const

Returns the trajectory of the axial segment. Also fits it if necessary.

Definition at line 90 of file SimpleAxialSegmentPairFilter.cc.

91{
92
93 CDCTrajectory2D& trajectory2D = segment.getTrajectory2D();
94 if (not trajectory2D.isFitted()) {
95 getRiemannFitter().update(trajectory2D, segment);
96 }
97 return trajectory2D;
98
99}
void update(CDCTrajectory2D &trajectory2D, const CDCObservations2D &observations2D) const
Update the trajectory with a fit to the observations.
Particle trajectory as it is seen in xy projection represented as a circle.
bool isFitted() const
Checks if the circle is already set to a valid value.
const CDCRiemannFitter & getRiemannFitter() const
Returns the xy fitter instance that is used by this filter.

◆ getFittedTrajectory2D() [2/2]

const CDCTrajectory2D & getFittedTrajectory2D ( const CDCAxialSegmentPair axialSegmentPair) const

Returns the trajectory of the axial to axial segment pair. Also fits it if necessary.

Definition at line 103 of file SimpleAxialSegmentPairFilter.cc.

105{
106 CDCTrajectory2D& trajectory2D = axialSegmentPair.getTrajectory2D();
107 if (not trajectory2D.isFitted()) {
108 getRiemannFitter().update(trajectory2D, axialSegmentPair);
109 }
110 return trajectory2D;
111}
CDCTrajectory2D & getTrajectory2D() const
Getter for the trajectory of the two dimensional trajectory.

◆ getNProcessingSignalListener()

int getNProcessingSignalListener ( )
protectedinherited

Get the number of currently registered listeners.

Definition at line 60 of file CompositeProcessingSignalListener.cc.

61{
63}

◆ getRiemannFitter()

const CDCRiemannFitter & getRiemannFitter ( ) const
inline

Returns the xy fitter instance that is used by this filter.

Definition at line 40 of file SimpleAxialSegmentPairFilter.h.

41 { return m_riemannFitter; }

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

◆ needsTruthInformation()

◆ operator()() [1/4]

Weight operator() ( const CDCAxialSegmentPair axialSegmentPair)
final

Checks if a pair of axial segments is a good combination.

Definition at line 21 of file SimpleAxialSegmentPairFilter.cc.

22{
23 const CDCAxialSegment2D* ptrStartSegment = axialSegmentPair.getStartSegment();
24 const CDCAxialSegment2D* ptrEndSegment = axialSegmentPair.getEndSegment();
25
26 assert(ptrStartSegment);
27 assert(ptrEndSegment);
28
29 const CDCAxialSegment2D& startSegment = *ptrStartSegment;
30 const CDCAxialSegment2D& endSegment = *ptrEndSegment;
31
32 // Do fits
33 const CDCTrajectory2D& startFit = getFittedTrajectory2D(startSegment);
34 const CDCTrajectory2D& endFit = getFittedTrajectory2D(endSegment);
35
36 // Check if segments are coaligned
37 bool endSegmentIsCoaligned = startFit.getTotalArcLength2D(endSegment) >= 0.0;
38 bool startSegmentIsCoaligned = endFit.getTotalArcLength2D(startSegment) >= 0.0;
39
40 if (not endSegmentIsCoaligned or not startSegmentIsCoaligned) {
41 return NAN;
42 }
43
44 // Check if there is a positive gap between start and end segment
45 double startFitGap = startFit.getArcLength2DGap(startSegment, endSegment);
46 double endFitGap = endFit.getArcLength2DGap(startSegment, endSegment);
47
48 if (startFitGap < 0 or startFitGap > 100 or endFitGap < 0 or endFitGap > 100) {
49 return NAN;
50 }
51
52 double startFitFrontOffset = startFit.getArcLength2DFrontOffset(startSegment, endSegment);
53 double endFitBackOffset = endFit.getArcLength2DBackOffset(startSegment, endSegment);
54
55 if (startFitFrontOffset < 0 or endFitBackOffset < 0) {
56 return NAN;
57 }
58
59 Vector2D startBackRecoPos2D = startSegment.back().getRecoPos2D();
60 Vector2D endFrontRecoPos2D = endSegment.front().getRecoPos2D();
61
62 // Momentum agreement cut
63 Vector2D startMom2DAtStartBack = startFit.getFlightDirection2D(startBackRecoPos2D);
64 Vector2D endMom2DAtEndFront = endFit.getFlightDirection2D(endFrontRecoPos2D);
65
66 Vector2D startMom2DAtEndFront = startFit.getFlightDirection2D(endFrontRecoPos2D);
67 Vector2D endMom2DAtStartBack = endFit.getFlightDirection2D(startBackRecoPos2D);
68
69 double momAngleAtStartBack = startMom2DAtStartBack.angleWith(endMom2DAtStartBack);
70 double momAngleAtEndFront = endMom2DAtEndFront.angleWith(startMom2DAtEndFront);
71
72 if (fabs(momAngleAtEndFront) > 2.0 or fabs(momAngleAtStartBack) > 2.0) {
73 return NAN;
74 }
75
76 // Proximity cut
77 double startFit_dist2DToFront_endSegment = startFit.getDist2D(endFrontRecoPos2D);
78 double endFit_dist2DToBack_startSegment = endFit.getDist2D(startBackRecoPos2D);
79
80 if (startFit_dist2DToFront_endSegment < 6 and endFit_dist2DToBack_startSegment < 6) {
81 return startSegment.size() + endSegment.size();
82 } else {
83 return NAN;
84 }
85
86}
const CDCAxialSegment2D * getEndSegment() const
Getter for the end segment.
const CDCAxialSegment2D * getStartSegment() const
Getter for the start segment.
A reconstructed sequence of two dimensional hits in one super layer.
Definition: CDCSegment2D.h:39
double getTotalArcLength2D(const AHits &hits) const
Calculates the perpendicular travel distance from the first position of the hits to the last position...
double getArcLength2DGap(const AFromHits &fromHits, const AToHits &toHits) const
Calculates the perpendicular travel distance from the last position of the fromHits to the first posi...
double getArcLength2DBackOffset(const AFromHits &fromHits, const AToHits &toHits) const
Calculates the perpendicular travel distance from the last position of the fromHits to the last posit...
Vector2D getFlightDirection2D(const Vector2D &point) const
Get the unit direction of flight at the given point, where arcLength2D = 0.
double getArcLength2DFrontOffset(const AFromHits &fromHits, const AToHits &toHits) const
Calculates the perpendicular travel distance from the first position of the fromHits to the first pos...
double getDist2D(const Vector2D &point) const
Calculates the distance from the point to the trajectory as seen from the xy projection.
const CDCTrajectory2D & getFittedTrajectory2D(const CDCAxialSegment2D &segment) const
Returns the trajectory of the axial segment. Also fits it if necessary.
A two dimensional vector which is equipped with functions for correct handling of orientation relate...
Definition: Vector2D.h:32
double angleWith(const Vector2D &rhs) const
The angle between this and rhs.
Definition: Vector2D.h:197

◆ operator()() [2/4]

◆ operator()() [3/4]

Weight operator() ( const Object obj)
inherited

Function to evaluate the object.

Base implementation accepts all objects, except nullptr.

Parameters
objThe object to be accepted or rejected.
Returns
A finit float value if the object is accepted. NAN if the object is rejected. Nullptr is always rejected.

Definition at line 58 of file Filter.icc.h.

59 {
60 return obj ? operator()(*obj) : NAN;
61 }
virtual Weight operator()(const Object &obj)
Function to evaluate the object.
Definition: Filter.icc.h:52

◆ operator()() [4/4]

std::vector< float > operator() ( const std::vector< Object * > &  objs)
virtualinherited

Function to evaluate a vector of objects Base implementation applies the function to each object.

Can be optimized for MVA filters

Parameters
objsA vector of pointers to objects
Returns
A vector of float or NAN values. See above

Definition at line 64 of file Filter.icc.h.

65 {
66 std::vector<float> out;
67 for (const auto& obj : objs) {
68 out.push_back(operator()(obj));
69 }
70 return out;
71 }

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

CDCRiemannFitter m_riemannFitter
private

Memory of the Riemann fitter for the circle fits.

Definition at line 45 of file SimpleAxialSegmentPairFilter.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: