9#include <tracking/ckf/pxd/filters/states/PXDStateBasicVarSet.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>
19#include <pxd/dataobjects/PXDCluster.h>
22using namespace TrackFindingCDC;
26 const std::vector<TrackFindingCDC::WithWeight<const CKFToPXDState*>>& previousStates = pair->first;
29 const RecoTrack* seedTrack = previousStates.front()->getSeed();
30 B2ASSERT(
"Path without seed?", seedTrack);
33 B2ASSERT(
"Path without hit?", spacePoint);
35 genfit::MeasuredStateOnPlane firstMeasurement;
39 firstMeasurement = previousStates.back()->getMeasuredStateOnPlane();
53 Vector3D trackPositionAtHit(trackPositionAtHit2D, trackPositionAtHitZ);
54 Vector3D distance = trackPositionAtHit - hitPosition;
56 var<
named(
"distance")>() =
static_cast<Float_t
>(distance.norm());
57 var<
named(
"xy_distance")>() =
static_cast<Float_t
>(distance.xy().norm());
58 var<
named(
"z_distance")>() =
static_cast<Float_t
>(distance.z());
60 Vector3D mSoP_distance = position - hitPosition;
62 var<
named(
"mSoP_distance")>() =
static_cast<Float_t
>(mSoP_distance.norm());
63 var<
named(
"mSoP_xy_distance")>() =
static_cast<Float_t
>(mSoP_distance.xy().norm());
64 var<
named(
"mSoP_z_distance")>() =
static_cast<Float_t
>(mSoP_distance.z());
66 var<
named(
"same_hemisphere")>() = fabs(position.phi() - hitPosition.phi()) < TMath::PiOver2();
72 var<
named(
"number")>() = previousStates.size();
74 var<
named(
"pt")>() =
static_cast<Float_t
>(momentum.xy().norm());
76 var<
named(
"phi")>() =
static_cast<Float_t
>(momentum.phi());
80 var<
named(
"ladder")>() = sensorInfo.getLadderNumber();
81 var<
named(
"sensor")>() = sensorInfo.getSensorNumber();
82 var<
named(
"segment")>() = sensorInfo.getSegmentNumber();
83 var<
named(
"id")>() = sensorInfo.getID();
86 B2ASSERT(
"Must be related to exactly 1 cluster", clusters.size() == 1);
87 var<
named(
"cluster_charge")>() = clusters[0]->getCharge();
88 var<
named(
"cluster_seed_charge")>() = clusters[0]->getSeedCharge();
89 var<
named(
"cluster_size")>() = clusters[0]->getSize();
90 var<
named(
"cluster_size_u")>() = clusters[0]->getUSize();
91 var<
named(
"cluster_size_v")>() = clusters[0]->getVSize();
98 var<
named(
"last_cluster_charge")>() = 0;
99 var<
named(
"last_cluster_seed_charge")>() = 0;
100 var<
named(
"last_cluster_size")>() = 0;
101 var<
named(
"last_cluster_size_u")>() = 0;
102 var<
named(
"last_cluster_size_v")>() = 0;
105 const SpacePoint* parentSpacePoint = parent->getHit();
106 if (parentSpacePoint) {
107 const VxdID& parentSensorInfo = parentSpacePoint->
getVxdID();
116 B2ASSERT(
"Must be related to exactly 1 cluster", parentclusters.size() == 1);
117 var<
named(
"last_cluster_charge")>() = parentclusters[0]->getCharge();
118 var<
named(
"last_cluster_seed_charge")>() = parentclusters[0]->getSeedCharge();
119 var<
named(
"last_cluster_size")>() = parentclusters[0]->getSize();
120 var<
named(
"last_cluster_size_u")>() = parentclusters[0]->getUSize();
121 var<
named(
"last_cluster_size_v")>() = parentclusters[0]->getVSize();
125 var<
named(
"residual")>() = residual;
133 const TMatrixDSym& cov5 = firstMeasurement.getCov();
134 const Float_t sigmaUV = std::sqrt(std::max(cov5(4, 4), cov5(3, 3)));
136 var<
named(
"residual_over_sigma")>() = residual / sigmaUV;
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 PXD.
The PXD Cluster class This class stores all information about reconstructed PXD clusters The position...
double calculateResidual(genfit::MeasuredStateOnPlane &measuredStateOnPlane, const CKFToPXDState &state)
Calculate the residual between the mSoP and the measurement in the state.
virtual bool extract(const BasePXDStateFilter::Object *pair) override
Generate and assign the variables from the VXD-CDC-pair.
PXDKalmanStepper m_kalmanStepper
Kalmap update filter used in this var set.
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.
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
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.
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...
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
Abstract base class for different kinds of events.