9 #include <tracking/ckf/svd/filters/states/SVDStateBasicVarSet.h>
11 #include <tracking/trackFindingCDC/eventdata/trajectories/CDCTrajectory3D.h>
12 #include <tracking/trackFindingCDC/eventdata/trajectories/CDCTrajectory2D.h>
13 #include <tracking/trackFindingCDC/eventdata/trajectories/CDCTrajectorySZ.h>
14 #include <tracking/trackFindingCDC/geometry/Vector3D.h>
16 #include <tracking/spacePointCreation/SpacePoint.h>
17 #include <tracking/dataobjects/RecoTrack.h>
20 using namespace TrackFindingCDC;
24 const std::vector<TrackFindingCDC::WithWeight<const CKFToSVDState*>>& previousStates = pair->first;
27 const RecoTrack* cdcTrack = previousStates.front()->getSeed();
28 B2ASSERT(
"Path without seed?", cdcTrack);
31 B2ASSERT(
"Path without hit?", spacePoint);
37 B2ASSERT(
"Previous state was not fitted?", previousStates.back()->mSoPSet());
38 firstMeasurement = previousStates.back()->getMeasuredStateOnPlane();
52 Vector3D trackPositionAtHit(trackPositionAtHit2D, trackPositionAtHitZ);
53 Vector3D distance = trackPositionAtHit - hitPosition;
55 var<named(
"distance")>() =
static_cast<Float_t
>(distance.norm());
56 var<named(
"xy_distance")>() =
static_cast<Float_t
>(distance.xy().norm());
57 var<named(
"z_distance")>() =
static_cast<Float_t
>(distance.z());
59 Vector3D mSoP_distance = position - hitPosition;
61 var<named(
"mSoP_distance")>() =
static_cast<Float_t
>(mSoP_distance.norm());
62 var<named(
"mSoP_xy_distance")>() =
static_cast<Float_t
>(mSoP_distance.xy().norm());
63 var<named(
"mSoP_z_distance")>() =
static_cast<Float_t
>(mSoP_distance.z());
65 var<named(
"same_hemisphere")>() = fabs(position.phi() - hitPosition.phi()) < TMath::PiOver2();
67 var<named(
"arcLengthOfHitPosition")>() =
static_cast<Float_t
>(trajectory.
calcArcLength2D(hitPosition));
68 var<named(
"arcLengthOfCenterPosition")>() =
static_cast<Float_t
>(trajectory.
calcArcLength2D(
Vector3D(0, 0, 0)));
71 var<named(
"number")>() = previousStates.size();
73 var<named(
"pt")>() =
static_cast<Float_t
>(momentum.xy().norm());
74 var<named(
"tan_lambda")>() =
static_cast<Float_t
>(trajectory.
getTanLambda());
75 var<named(
"phi")>() =
static_cast<Float_t
>(momentum.phi());
79 var<named(
"ladder")>() = sensorInfo.getLadderNumber();
80 var<named(
"sensor")>() = sensorInfo.getSensorNumber();
81 var<named(
"segment")>() = sensorInfo.getSegmentNumber();
82 var<named(
"id")>() = sensorInfo.getID();
84 var<named(
"last_layer")>() = 0;
85 var<named(
"last_ladder")>() = 0;
86 var<named(
"last_sensor")>() = 0;
87 var<named(
"last_segment")>() = 0;
88 var<named(
"last_id")>() = 0;
91 const SpacePoint* parentSpacePoint = parent->getHit();
92 if (parentSpacePoint) {
99 var<named(
"last_id")>() = parentSensorInfo.
getID();
102 const double residual = m_kalmanStepper.calculateResidual(firstMeasurement, *state);
103 var<named(
"residual")>() = residual;
106 var<named(
"chi2")>() =
static_cast<Float_t
>(state->
getChi2());
108 var<named(
"chi2")>() = -999;
111 const TMatrixDSym& cov5 = firstMeasurement.getCov();
112 const Float_t sigmaUV =
std::sqrt(std::max(cov5(4, 4), cov5(3, 3)));
113 var<named(
"sigma_uv")>() = sigmaUV;
114 var<named(
"residual_over_sigma")>() = residual / sigmaUV;
double getChi2() const
Return the chi2 set during fitting. Is only valid after fitting.
bool isFitted() const
Check if state was already fitted.
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 mSoPSet() const
Is the mSoP already set? (= state was already extrapolated)
Specialized CKF State for extrapolating into the SVD.
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.
virtual bool extract(const BaseSVDStateFilter::Object *pair) override
Generate and assign the variables from the VXD-CDC-pair.
SpacePoint typically is build from 1 PXDCluster or 1-2 SVDClusters.
const B2Vector3< double > & getPosition() const
return the position vector in global coordinates
VxdID getVxdID() const
Return the VxdID of the sensor on which the the cluster of the SpacePoint lives.
Vector2D getPos2DAtArcLength2D(double arcLength2D)
Getter for the position at a given two dimensional arc length.
Particle full three dimensional trajectory.
double calcArcLength2D(const Vector3D &point) const
Calculate the travel distance from the start position of the trajectory.
CDCTrajectory2D getTrajectory2D() const
Getter for the two dimensional trajectory.
CDCTrajectorySZ getTrajectorySZ() const
Getter for the sz trajectory.
double getTanLambda() const
Getter for the slope of z over the transverse travel distance s.
double mapSToZ(const double s=0) const
Translates the travel distance to the z coordinate.
AObject Object
Type of the object to be analysed.
A two dimensional vector which is equipped with functions for correct handeling of orientation relat...
Class to uniquely identify a any structure of the PXD and SVD.
baseType getID() const
Get the unique id.
baseType getSensorNumber() const
Get the sensor id.
baseType getSegmentNumber() const
Get the sensor segment.
baseType getLadderNumber() const
Get the ladder id.
baseType getLayerNumber() const
Get the layer id.
#StateOnPlane with additional covariance matrix.
double sqrt(double a)
sqrt for double
HepGeom::Vector3D< double > Vector3D
3D Vector
Abstract base class for different kinds of events.