Generate and assign the variables from the VXD-CDC-pair.
23{
24 const std::vector<TrackFindingCDC::WithWeight<const CKFToSVDState*>>& previousStates = pair->first;
26
27 const RecoTrack* cdcTrack = previousStates.front()->getSeed();
28 B2ASSERT("Path without seed?", cdcTrack);
29
31 B2ASSERT("Path without hit?", spacePoint);
32
33 genfit::MeasuredStateOnPlane firstMeasurement;
36 } else {
37 B2ASSERT("Previous state was not fitted?", previousStates.back()->mSoPSet());
38 firstMeasurement = previousStates.back()->getMeasuredStateOnPlane();
39 }
40
43
45
47
48 const double arcLength = trajectory.calcArcLength2D(hitPosition);
49 const Vector2D& trackPositionAtHit2D = trajectory.getTrajectory2D().getPos2DAtArcLength2D(arcLength);
50 double trackPositionAtHitZ = trajectory.getTrajectorySZ().mapSToZ(arcLength);
51
52 Vector3D trackPositionAtHit(trackPositionAtHit2D, trackPositionAtHitZ);
53 Vector3D distance = trackPositionAtHit - hitPosition;
54
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());
58
59 Vector3D mSoP_distance = position - hitPosition;
60
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());
64
65 var<
named(
"same_hemisphere")>() = fabs(position.
phi() - hitPosition.phi()) < TMath::PiOver2();
66
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)));
69
70 var<
named(
"pt")>() =
static_cast<Float_t
>(momentum.xy().norm());
71 var<
named(
"tan_lambda")>() =
static_cast<Float_t
>(trajectory.getTanLambda());
72 var<
named(
"phi")>() =
static_cast<Float_t
>(momentum.phi());
73
75 var<
named(
"layer")>() = sensorInfo.getLayerNumber();
76 var<
named(
"number")>() = previousStates.size();
77 var<
named(
"ladder")>() = sensorInfo.getLadderNumber();
78 var<
named(
"sensor")>() = sensorInfo.getSensorNumber();
79 var<
named(
"segment")>() = sensorInfo.getSegmentNumber();
80 var<
named(
"id")>() = sensorInfo.getID();
81
82
84 B2ASSERT("Must be related to exactly 2 clusters", clusters.size() == 2);
89
95 var<
named(
"last_cluster_1_time")>() = -999.9;
96 var<
named(
"last_cluster_2_time")>() = -999.9;
97
99 const SpacePoint* parentSpacePoint = parent->getHit();
100 if (parentSpacePoint) {
101 const VxdID& parentSensorInfo = parentSpacePoint->
getVxdID();
102
108
110 B2ASSERT("Must be related to exactly 2 clusters", parentclusters.size() == 2);
111 const SVDCluster* parentfirstCluster = parentclusters[0];
112 const SVDCluster* parentsecondCluster = parentclusters[1];
115 }
116
118 var<
named(
"residual")>() = residual;
119
122 } else {
124 }
125
126 const TMatrixDSym& cov5 = firstMeasurement.getCov();
127 const Float_t sigmaUV = std::sqrt(std::max(cov5(4, 4), cov5(3, 3)));
129 var<
named(
"residual_over_sigma")>() = residual / sigmaUV;
130
131 return true;
132}
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.
double getChi2() const
Return the chi2 set during fitting. Is only valid after fitting.
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.
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.
RelationVector< TO > getRelationsTo(const std::string &name="", const std::string &namedRelation="") const
Get the relations that point from this object to another store array.
The SVD Cluster class This class stores all information about reconstructed SVD clusters.
float getClsTime() const
Get average of waveform maximum times of cluster strip signals.
double calculateResidual(genfit::MeasuredStateOnPlane &measuredStateOnPlane, const CKFToSVDState &state)
Calculate the residual between the mSoP and the measurement in the state.
SVDKalmanStepper m_kalmanStepper
Kalman stepper (CKF) for SVD.
SpacePoint typically is build from 1 PXDCluster or 1-2 SVDClusters.
VxdID getVxdID() const
Return the VxdID of the sensor on which the the cluster of the SpacePoint lives.
const B2Vector3D & getPosition() const
return the position vector in global coordinates
Particle full three dimensional trajectory.
static constexpr int named(const char *name)
Getter for the index from the name.
Float_t & var()
Reference getter for the value of the ith variable. Static version.
A two dimensional vector which is equipped with functions for correct handling of orientation relate...
double norm() const
Calculates the length of the vector.
A three dimensional vector.
const Vector2D & xy() const
Getter for the xy projected vector ( reference ! )
double phi() const
Getter for the azimuth angle.
double norm() const
Calculates the length of the vector.
double z() const
Getter for the z coordinate.
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.
HepGeom::Vector3D< double > Vector3D
3D Vector