Belle II Software  release-08-01-10
SimpleSVDStateFilter Class Reference

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

#include <SimpleSVDStateFilter.h>

Inheritance diagram for SimpleSVDStateFilter:
Collaboration diagram for SimpleSVDStateFilter:

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. More...
 
virtual void exposeParameters (ModuleParamList *moduleParamList, const std::string &prefix)
 Expose the set of parameters of the filter to the module parameter list. More...
 
virtual bool needsTruthInformation ()
 Indicates if the filter requires Monte Carlo information.
 
Weight operator() (const Object *obj)
 Function to evaluate the object. More...
 
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 happend before.
 
bool m_terminated = false
 Flag to keep track whether termination happend 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. More...
 
static constexpr const MaximalValueArray m_param_maximumResidual
 Maximum distance calculated with normal extrapolation in filter 3. Numbers calculated on MC. More...
 
static constexpr const MaximalValueArray m_param_maximumResidual2
 Maximum distance calculated with normal extrapolation in filter 2. Numbers calculated on MC. More...
 

Detailed Description

A very simple filter for all space points.

Definition at line 19 of file SimpleSVDStateFilter.h.

Member Function Documentation

◆ 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 SimpleRelationFilter, AngleAndTimeRelationFilter, TwoHitVirtualIPQIFilter, TwoHitVirtualIPFilter, ThreeHitFilter, QualityIndicatorFilter, FourHitFilter, FiveHitFilter, BridgingWireHitRelationFilter, PhiTrackRelationFilter, SimpleFacetRelationFilter, Chi2FacetRelationFilter, Recording< Filter< AVarSet::Object > >, MVA< Filter< AVarSet::Object > >, MCSymmetric< BaseAxialSegmentPairFilter >, MCSymmetric< BaseSegmentPairFilter >, MCSymmetric< BaseSegmentTripleRelationFilter >, MCSymmetric< BaseSegmentPairRelationFilter >, MCSymmetric< BaseTrackRelationFilter >, MCSymmetric< BaseSegmentTripleFilter >, MCSymmetric< BaseSegmentRelationFilter >, MCSymmetric< BaseFacetRelationFilter >, MCSymmetric< BaseFacetFilter >, PhiRecoTrackRelationFilter, ResidualSVDStateFilter, SensorSVDPairFilter, LooseSVDPairFilter, SensorPXDPairFilter, LoosePXDPairFilter, LayerPXDRelationFilter< AFilter, APrefilter >, AdvanceFilter< AState, AnAdvancer >, RoughCDCStateFilter, RoughCDCfromEclStateFilter, ExtrapolateAndUpdateCDCStateFilter, DistanceCDCStateFilter, DuplicateCDCPathPairFilter, LayerRelationFilter< AFilter >, WholeWireHitRelationFilter, MCSegmentTripleRelationFilter, MCSegmentTripleFilter, MCSegmentRelationFilter, MCSegmentPairRelationFilter, MCSegmentPairFilter, MCFacetRelationFilter, SimpleFacetFilter, RealisticFacetFilter, FeasibleRLFacetFilter, Chi2FacetFilter, MCAxialSegmentPairFilter, SectorMapBasedSVDPairFilter, and LayerSVDRelationFilter< AFilter, APrefilter >.

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

◆ operator()() [1/2]

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 }
bool isFitted() const
Check if state was already fitted.
Definition: CKFState.h:100
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 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.
double m_cachedBField
Cache for the B field at the IP.
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 handeling of orientation relat...
Definition: Vector2D.h:35
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
#StateOnPlane with additional covariance matrix.
HepGeom::Vector3D< double > Vector3D
3D Vector
Definition: Cell.h:34

◆ operator()() [2/2]

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.

Member Data Documentation

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


The documentation for this class was generated from the following files: