Belle II Software development
SimpleSVDStateFilter Class Reference

A very simple filter for all space points. More...

#include <SimpleSVDStateFilter.h>

Inheritance diagram for SimpleSVDStateFilter:
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

void beginRun () final
 Set the cached B field.
 
 SimpleSVDStateFilter ()=default
 default constructor to silence cppcheck warnings
 
TrackFindingCDC::Weight operator() (const BaseSVDStateFilter::Object &pair) final
 Function to evaluate the object.
 
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.
 
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 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 MaximalValueArray = double[4][3]
 Shortcut for a 4x3 array.
 
using Super = ProcessingSignalListener
 Type of the base class.
 

Private Attributes

double m_cachedBField
 Cache for the B field at the IP.
 
SVDKalmanStepper m_kalmanStepper
 Kalman stepper (CKF) for SVD.
 
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.
 

Static Private Attributes

static constexpr const MaximalValueArray m_param_maximumHelixDistance
 Maximum distance calculated with helix extrapolation in filter 1. Numbers calculated on MC.
 
static constexpr const MaximalValueArray m_param_maximumResidual
 Maximum distance calculated with normal extrapolation in filter 3. Numbers calculated on MC.
 
static constexpr const MaximalValueArray m_param_maximumResidual2
 Maximum distance calculated with normal extrapolation in filter 2. Numbers calculated on MC.
 

Detailed Description

A very simple filter for all space points.

Definition at line 19 of file SimpleSVDStateFilter.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.

◆ MaximalValueArray

using MaximalValueArray = double[4][3]
private

Shortcut for a 4x3 array.

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

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

Set the cached B field.

Reimplemented from ProcessingSignalListener.

Definition at line 41 of file SimpleSVDStateFilter.cc.

42{
44}
double m_cachedBField
Cache for the B field at the IP.
static double getBFieldZ()
Getter for the signed magnetic field strength in z direction at the origin ( in Tesla )

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

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

◆ needsTruthInformation()

◆ operator()() [1/3]

Weight operator() ( const BaseSVDStateFilter::Object obj)
finalvirtual

Function to evaluate the object.

Base implementation accepts all objects.

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

Reimplemented from Filter< AObject >.

Definition at line 46 of file SimpleSVDStateFilter.cc.

47{
48 const std::vector<TrackFindingCDC::WithWeight<const CKFToSVDState*>>& previousStates = pair.first;
49 CKFToSVDState* currentState = pair.second;
50
51 const auto* spacePoint = currentState->getHit();
52
53 genfit::MeasuredStateOnPlane firstMeasurement;
54 if (currentState->mSoPSet()) {
55 firstMeasurement = currentState->getMeasuredStateOnPlane();
56 } else {
57 firstMeasurement = previousStates.back()->getMeasuredStateOnPlane();
58 }
59
60 Vector3D position = Vector3D(firstMeasurement.getPos());
61 Vector3D momentum = Vector3D(firstMeasurement.getMom());
62
63 const Vector3D hitPosition = static_cast<Vector3D>(spacePoint->getPosition());
64
65 const bool sameHemisphere = fabs(position.phi() - hitPosition.phi()) < TMath::PiOver2();
66 if (not sameHemisphere) {
67 return NAN;
68 }
69
70
71 double valueToCheck;
72 const MaximalValueArray* maximumValues;
73
74 if (not currentState->isFitted() and not currentState->mSoPSet()) {
75 // Filter 1
76 const RecoTrack* cdcTrack = previousStates.front()->getSeed();
77
78 B2ASSERT("A path without a seed?", cdcTrack);
79
80 const CDCTrajectory3D trajectory(position, 0, momentum, cdcTrack->getChargeSeed(), m_cachedBField);
81
82 const double arcLength = trajectory.calcArcLength2D(hitPosition);
83 const Vector2D& trackPositionAtHit2D = trajectory.getTrajectory2D().getPos2DAtArcLength2D(arcLength);
84 const double trackPositionAtHitZ = trajectory.getTrajectorySZ().mapSToZ(arcLength);
85 const Vector3D trackPositionAtHit(trackPositionAtHit2D, trackPositionAtHitZ);
86 const Vector3D differenceHelix = trackPositionAtHit - hitPosition;
87
88 valueToCheck = differenceHelix.norm();
89 maximumValues = &m_param_maximumHelixDistance;
90 } else {
91 // Filter 2 + 3
92 const double residual = m_kalmanStepper.calculateResidual(firstMeasurement, *currentState);
93 valueToCheck = residual;
94 if (currentState->isFitted()) {
95 maximumValues = &m_param_maximumResidual2;
96 } else {
97 maximumValues = &m_param_maximumResidual;
98 }
99 }
100
101 const unsigned int layer = currentState->getGeometricalLayer();
102 if (valueToCheck > (*maximumValues)[layer - 3][getPTRange(momentum)]) {
103 return NAN;
104 }
105
106 return valueToCheck;
107}
const genfit::MeasuredStateOnPlane & getMeasuredStateOnPlane() const
Get the mSoP if already set during extrapolation (or fitting)
Definition: CKFState.h:93
const Hit * getHit() const
Return the SP this state is related to. May be nullptr.
Definition: CKFState.h:66
bool isFitted() const
Check if state was already fitted.
Definition: CKFState.h:100
bool mSoPSet() const
Is the mSoP already set? (= state was already extrapolated)
Definition: CKFState.h:106
Specialized CKF State for extrapolating into the SVD.
Definition: CKFToSVDState.h:27
unsigned int getGeometricalLayer() const
Extract the real layer this state sits on.
This is the Reconstruction Event-Data Model Track.
Definition: RecoTrack.h:79
short int getChargeSeed() const
Return the charge seed stored in the reco track. ATTENTION: This is not the fitted charge.
Definition: RecoTrack.h:508
double calculateResidual(genfit::MeasuredStateOnPlane &measuredStateOnPlane, const CKFToSVDState &state)
Calculate the residual between the mSoP and the measurement in the state.
static constexpr const MaximalValueArray m_param_maximumResidual
Maximum distance calculated with normal extrapolation in filter 3. Numbers calculated on MC.
static constexpr const MaximalValueArray m_param_maximumHelixDistance
Maximum distance calculated with helix extrapolation in filter 1. Numbers calculated on MC.
double[4][3] MaximalValueArray
Shortcut for a 4x3 array.
SVDKalmanStepper m_kalmanStepper
Kalman stepper (CKF) for SVD.
static constexpr const MaximalValueArray m_param_maximumResidual2
Maximum distance calculated with normal extrapolation in filter 2. Numbers calculated on MC.
Particle full three dimensional trajectory.
A two dimensional vector which is equipped with functions for correct handling of orientation relate...
Definition: Vector2D.h:32
A three dimensional vector.
Definition: Vector3D.h:33
double phi() const
Getter for the azimuth angle.
Definition: Vector3D.h:540
double norm() const
Calculates the length of the vector.
Definition: Vector3D.h:212
HepGeom::Vector3D< double > Vector3D
3D Vector
Definition: Cell.h:34

◆ operator()() [2/3]

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()() [3/3]

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_cachedBField

double m_cachedBField
private

Cache for the B field at the IP.

Definition at line 31 of file SimpleSVDStateFilter.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_kalmanStepper

SVDKalmanStepper m_kalmanStepper
private

Kalman stepper (CKF) for SVD.

Definition at line 34 of file SimpleSVDStateFilter.h.

◆ m_param_maximumHelixDistance

constexpr const double m_param_maximumHelixDistance
staticconstexprprivate
Initial value:
= {
{1.38532, 1.44346, 1.53386},
{1.96701, 2.17819, 2.19784},
{2.33064, 2.67768, 2.67174},
{6, 6, 6},
}

Maximum distance calculated with helix extrapolation in filter 1. Numbers calculated on MC.

Definition at line 40 of file SimpleSVDStateFilter.h.

◆ m_param_maximumResidual

constexpr const double m_param_maximumResidual
staticconstexprprivate
Initial value:
= {
{1.52328, 1.57714, 1.63069},
{1.61301, 1.78301, 1.75973},
{1.85188, 2.19571, 2.38167},
{5.5, 5, 5},
}

Maximum distance calculated with normal extrapolation in filter 3. Numbers calculated on MC.

Definition at line 49 of file SimpleSVDStateFilter.h.

◆ m_param_maximumResidual2

constexpr const double m_param_maximumResidual2
staticconstexprprivate
Initial value:
= {
{0.69713, 0.39872, 0.41854},
{0.72737, 0.40816, 0.53138},
{0.35624, 0.12846, 0.22516},
{0.00975, 0.06432, 0.5969},
}

Maximum distance calculated with normal extrapolation in filter 2. Numbers calculated on MC.

Definition at line 57 of file SimpleSVDStateFilter.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: