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

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

#include <SimplePXDStateFilter.h>

Inheritance diagram for SimplePXDStateFilter:
Collaboration diagram for SimplePXDStateFilter:

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.
 
 SimplePXDStateFilter ()=default
 default constructor to silence the cppcheck warnings
 
TrackFindingCDC::Weight operator() (const BasePXDStateFilter::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[2][3]
 Shortcut for a 2x3 array.
 
using Super = ProcessingSignalListener
 Type of the base class.
 

Private Attributes

double m_cachedBField
 Cache for the B field at the IP.
 
PXDKalmanStepper m_kalmanStepper
 Kalman stepper (CKF) for PXD.
 
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_maximumHelixDistanceXY
 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 2. Numbers calculated on MC. More...
 
static constexpr const MaximalValueArray m_param_maximumChi2
 Maximum chi^2 in filter 3. Numbers calculated on MC. More...
 

Detailed Description

A very simple filter for all space points.

Definition at line 19 of file SimplePXDStateFilter.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 BasePXDStateFilter::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 SimplePXDStateFilter.cc.

47 {
48  const std::vector<TrackFindingCDC::WithWeight<const CKFToPXDState*>>& previousStates = pair.first;
49  CKFToPXDState* 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  double valueToCheck;
71  const MaximalValueArray* maximumValues;
72 
73  if (not currentState->isFitted() and not currentState->mSoPSet()) {
74  // Filter 1
75  const RecoTrack* cdcTrack = previousStates.front()->getSeed();
76 
77  B2ASSERT("A path without a seed?", cdcTrack);
78 
79  const CDCTrajectory3D trajectory(position, 0, momentum, cdcTrack->getChargeSeed(), m_cachedBField);
80 
81  const double arcLength = trajectory.calcArcLength2D(hitPosition);
82  const Vector2D& trackPositionAtHit2D = trajectory.getTrajectory2D().getPos2DAtArcLength2D(arcLength);
83  const double trackPositionAtHitZ = trajectory.getTrajectorySZ().mapSToZ(arcLength);
84  const Vector3D trackPositionAtHit(trackPositionAtHit2D, trackPositionAtHitZ);
85  const Vector3D differenceHelix = trackPositionAtHit - hitPosition;
86 
87  valueToCheck = differenceHelix.xy().norm();
88  maximumValues = &m_param_maximumHelixDistanceXY;
89  } else if (not currentState->isFitted()) {
90  // Filter 2
91  const double residual = m_kalmanStepper.calculateResidual(firstMeasurement, *currentState);
92 
93  valueToCheck = residual;
94  maximumValues = &m_param_maximumResidual;
95  } else {
96  // Filter 3
97  valueToCheck = currentState->getChi2();
98  maximumValues = &m_param_maximumChi2;
99  }
100 
101  const unsigned int layer = currentState->getGeometricalLayer();
102  if (valueToCheck > (*maximumValues)[layer - 1][getPTRange(momentum)]) {
103  return NAN;
104  }
105 
106  return valueToCheck;
107 }
double getChi2() const
Return the chi2 set during fitting. Is only valid after fitting.
Definition: CKFState.h:72
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 PXD.
Definition: CKFToPXDState.h:27
unsigned int getGeometricalLayer() const
Extract the real layer this state sits on.
double calculateResidual(genfit::MeasuredStateOnPlane &measuredStateOnPlane, const CKFToPXDState &state)
Calculate the residual between the mSoP and the measurement in the state.
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
static constexpr const MaximalValueArray m_param_maximumHelixDistanceXY
Maximum distance calculated with helix extrapolation in filter 1. Numbers calculated on MC.
static constexpr const MaximalValueArray m_param_maximumChi2
Maximum chi^2 in filter 3. Numbers calculated on MC.
static constexpr const MaximalValueArray m_param_maximumResidual
Maximum distance calculated with normal extrapolation in filter 2. Numbers calculated on MC.
PXDKalmanStepper m_kalmanStepper
Kalman stepper (CKF) for PXD.
double m_cachedBField
Cache for the B field at the IP.
double[2][3] MaximalValueArray
Shortcut for a 2x3 array.
Particle full three dimensional trajectory.
A two dimensional vector which is equipped with functions for correct handeling of orientation relat...
Definition: Vector2D.h:35
double norm() const
Calculates the length of the vector.
Definition: Vector2D.h:187
A three dimensional vector.
Definition: Vector3D.h:33
const Vector2D & xy() const
Getter for the xy projected vector ( reference ! )
Definition: Vector3D.h:508
double phi() const
Getter for the azimuth angle.
Definition: Vector3D.h:540
#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_maximumChi2

constexpr const SimplePXDStateFilter::MaximalValueArray m_param_maximumChi2
staticconstexprprivate
Initial value:
= {
{10, 50, 125},
{20, 60, 85}
}

Maximum chi^2 in filter 3. Numbers calculated on MC.

Definition at line 52 of file SimplePXDStateFilter.h.

◆ m_param_maximumHelixDistanceXY

constexpr const SimplePXDStateFilter::MaximalValueArray m_param_maximumHelixDistanceXY
staticconstexprprivate
Initial value:
= {
{0.295060, 0.295060, 0.295060},
{0.295060, 0.295060, 0.295060}
}

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

Definition at line 40 of file SimplePXDStateFilter.h.

◆ m_param_maximumResidual

constexpr const SimplePXDStateFilter::MaximalValueArray m_param_maximumResidual
staticconstexprprivate
Initial value:
= {
{0.679690, 0.677690, 0.427060},
{1.006930, 0.926120, 0.687030}
}

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

Definition at line 46 of file SimplePXDStateFilter.h.


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