Belle II Software development
SimpleSVDStateFilter Class Reference

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

#include <SimpleSVDStateFilter.h>

Inheritance diagram for SimpleSVDStateFilter:
Filter< std::pair< const std::vector< TrackFindingCDC::WithWeight< const CKFToSVDState * > >, CKFToSVDState * > > CompositeProcessingSignalListener ProcessingSignalListener

Public Types

using Object
 Type of the object to be analysed.
 
using Object
 Type of the object to be analysed.
 
using Interface
 Mark this class as the basic interface.
 
using Interface
 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 bool needsTruthInformation ()
 Indicates if the filter requires Monte Carlo information.
 
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.
 
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 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.
 
virtual void exposeParameters (ModuleParamList *moduleParamList, const std::string &prefix)
 Expose the set of parameters of the filter to the module parameter list.
 

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
 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
 Flag to keep track whether initialization happened before.
 
bool m_terminated
 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 [1/2]

using Interface
inherited

Mark this class as the basic interface.

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

◆ Interface [2/2]

using Interface
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 [1/2]

using Object
inherited

Type of the object to be analysed.

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

◆ Object [2/2]

using Object
inherited

Type of the object to be analysed.

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

◆ Super

using Super
privateinherited

Type of the base class.

Definition at line 26 of file CompositeProcessingSignalListener.h.

Member Function Documentation

◆ addProcessingSignalListener()

void addProcessingSignalListener ( ProcessingSignalListener * psl)
protectedinherited

Register a processing signal listener to be notified.

Definition at line 53 of file CompositeProcessingSignalListener.cc.

56{
58}
Base class for filters on a generic object type.
Definition Filter.dcl.h:31

◆ beginEvent()

void beginEvent ( )
overrideinherited

Receive and dispatch signal for the start of a new event.

Definition at line 36 of file CompositeProcessingSignalListener.cc.

32{
35 psl->beginEvent();
36 }
37}
void beginEvent() override
Receive and dispatch signal for the start of a new event.
virtual void beginEvent()
Receive signal for the start of a new event.

◆ beginRun()

void beginRun ( )
finalvirtual

Set the cached B field.

Reimplemented from CompositeProcessingSignalListener.

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

Receive and dispatch signal for the end of the run.

Definition at line 39 of file CompositeProcessingSignalListener.cc.

40{
42 psl->endRun();
43 }
45}
void endRun() override
Receive and dispatch signal for the end of the run.
virtual void endRun()
Receive signal for the end of the run.

◆ exposeParameters()

virtual void exposeParameters ( ModuleParamList * moduleParamList,
const std::string & prefix )
inlinevirtualinherited

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

Parameters
moduleParamListModule parameter list to add the new parameters to
prefixPrefix (or sometimes postfix) to be added to all nely added parameters.

Definition at line 47 of file CompositeProcessingSignalListener.h.

49 {};

◆ getNProcessingSignalListener()

int getNProcessingSignalListener ( )
protectedinherited

Get the number of currently registered listeners.

Definition at line 56 of file CompositeProcessingSignalListener.cc.

61{
63}

◆ initialize()

void initialize ( )
overrideinherited

Receive and dispatch signal before the start of the event processing.

Definition at line 30 of file CompositeProcessingSignalListener.cc.

16{
19 psl->initialize();
20 }
21}
void initialize() override
Receive and dispatch signal before the start of the event processing.
virtual void initialize()
Receive signal before the start of the event processing.

◆ needsTruthInformation()

bool needsTruthInformation ( )
virtualinherited

Indicates if the filter requires Monte Carlo information.

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

41 {
42 return false;
43 }

◆ operator()() [1/6]

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< std::pair< const std::vector< TrackFindingCDC::WithWeight< const CKFToSVDState * > >, CKFToSVDState * > >.

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
unsigned int getGeometricalLayer() const
Extract the real layer this state sits on.
short int getChargeSeed() const
Return the charge seed stored in the reco track. ATTENTION: This is not the fitted charge.
Definition RecoTrack.h:508
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.
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/6]

Weight operator() ( const Object & obj)
virtualinherited

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.

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

47 {
48 return 1;
49 }

◆ operator()() [3/6]

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.

◆ operator()() [4/6]

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 69 of file Filter.icc.h.

53 {
54 return obj ? operator()(*obj) : NAN;
55 }

◆ operator()() [5/6]

virtual 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

◆ operator()() [6/6]

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 77 of file Filter.icc.h.

59 {
60 std::vector<float> out;
61 for (const auto& obj : objs) {
62 out.push_back(operator()(obj));
63 }
64 return out;
65 }

◆ terminate()

void terminate ( )
overrideinherited

Receive and dispatch Signal for termination of the event processing.

Definition at line 42 of file CompositeProcessingSignalListener.cc.

48{
50 psl->terminate();
51 }
53}
void terminate() override
Receive and dispatch Signal for termination of the event processing.
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
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

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.

40 {
41 // high pt, middle pt, low pt
42 {1.38532, 1.44346, 1.53386}, // layer 3
43 {1.96701, 2.17819, 2.19784}, // layer 4
44 {2.33064, 2.67768, 2.67174}, // layer 5
45 {6, 6, 6}, // layer 6
46 };

◆ m_param_maximumResidual

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.

49 {
50 {1.52328, 1.57714, 1.63069}, // layer 3
51 {1.61301, 1.78301, 1.75973}, // layer 4
52 {1.85188, 2.19571, 2.38167}, // layer 5
53 {5.5, 5, 5}, // layer 6
54 };

◆ m_param_maximumResidual2

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.

57 {
58 {0.69713, 0.39872, 0.41854}, // layer 3
59 {0.72737, 0.40816, 0.53138}, // layer 4
60 {0.35624, 0.12846, 0.22516}, // layer 5
61 {0.00975, 0.06432, 0.5969}, // layer 6
62 };

◆ m_subordinaryProcessingSignalListeners

std::vector<ProcessingSignalListener*> m_subordinaryProcessingSignalListeners
privateinherited

References to subordinary signal processing listener contained in this findlet.

Definition at line 60 of file CompositeProcessingSignalListener.h.

◆ m_terminated

bool m_terminated
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: