8#include <tracking/ckf/svd/filters/states/SimpleSVDStateFilter.h>
10#include <tracking/trackingUtilities/eventdata/trajectories/CDCTrajectory3D.h>
11#include <tracking/trackingUtilities/eventdata/trajectories/CDCTrajectory2D.h>
12#include <tracking/trackingUtilities/eventdata/trajectories/CDCTrajectorySZ.h>
14#include <tracking/trackingUtilities/eventdata/trajectories/CDCBFieldUtil.h>
15#include <tracking/spacePointCreation/SpacePoint.h>
16#include <tracking/dataobjects/RecoTrack.h>
18#include <Math/Vector2D.h>
19#include <Math/Vector3D.h>
22using namespace TrackingUtilities;
26 unsigned int getPTRange(
const ROOT::Math::XYZVector& momentum)
28 const double pT = momentum.Rho();
31 }
else if (pT > 0.2) {
50 const std::vector<TrackingUtilities::WithWeight<const CKFToSVDState*>>& previousStates = pair.first;
53 const auto* spacePoint = currentState->
getHit();
55 genfit::MeasuredStateOnPlane firstMeasurement;
59 firstMeasurement = previousStates.back()->getMeasuredStateOnPlane();
62 const ROOT::Math::XYZVector position = ROOT::Math::XYZVector(firstMeasurement.getPos());
63 const ROOT::Math::XYZVector momentum = ROOT::Math::XYZVector(firstMeasurement.getMom());
65 const ROOT::Math::XYZVector& hitPosition = spacePoint->getPosition();
67 const bool sameHemisphere = fabs(position.Phi() - hitPosition.Phi()) < TMath::PiOver2();
68 if (not sameHemisphere) {
78 const RecoTrack* cdcTrack = previousStates.front()->getSeed();
80 B2ASSERT(
"A path without a seed?", cdcTrack);
87 const ROOT::Math::XYZVector trackPositionAtHit(trackPositionAtHit2D.X(), trackPositionAtHit2D.Y(), trackPositionAtHitZ);
88 const ROOT::Math::XYZVector differenceHelix = trackPositionAtHit - hitPosition;
90 valueToCheck = differenceHelix.R();
94 const double residual =
m_kalmanStepper.calculateResidual(firstMeasurement, *currentState);
95 valueToCheck = residual;
104 if (valueToCheck > (*maximumValues)[layer - 3][getPTRange(momentum)]) {
const genfit::MeasuredStateOnPlane & getMeasuredStateOnPlane() const
Get the mSoP if already set during extrapolation (or fitting)
const Hit * getHit() const
Return the SP this state is related to. May be nullptr.
bool isFitted() const
Check if state was already fitted.
bool mSoPSet() const
Is the mSoP already set? (= state was already extrapolated)
Specialized CKF State for extrapolating into the SVD.
unsigned int getGeometricalLayer() const
Extract the real layer this state sits on.
This is the Reconstruction Event-Data Model Track.
short int getChargeSeed() const
Return the charge seed stored in the reco track. ATTENTION: This is not the fitted charge.
static constexpr const MaximalValueArray m_param_maximumResidual
Maximum distance calculated with normal extrapolation in filter 3. Numbers calculated on MC.
void beginRun() final
Set the cached B field.
TrackingUtilities::Weight operator()(const BaseSVDStateFilter::Object &pair) final
Function to evaluate the object.
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.
static double getBFieldZ()
Getter for the signed magnetic field strength in z direction at the origin ( in Tesla )
ROOT::Math::XYVector getPos2DAtArcLength2D(double arcLength2D)
Getter for the position at a given two dimensional arc length.
Particle full three dimensional trajectory.
CDCTrajectory2D getTrajectory2D() const
Getter for the two dimensional trajectory.
CDCTrajectorySZ getTrajectorySZ() const
Getter for the sz trajectory.
double calcArcLength2D(const ROOT::Math::XYZVector &point) const
Calculate the travel distance from the start position of the trajectory.
double mapSToZ(const double s=0) const
Translates the travel distance to the z coordinate.
std::pair< const std::vector< TrackingUtilities::WithWeight< const CKFToSVDState * > >, CKFToSVDState * > Object
Abstract base class for different kinds of events.