Generate and assign the contained variables.
23{
24 if (not ptrSegmentPair) return false;
25
26 const CDCSegmentPair& segmentPair = *ptrSegmentPair;
27
29 const CDCSegment2D* ptrToSegment = segmentPair.
getToSegment();
30
31 const CDCSegment2D& fromSegment = *ptrFromSegment;
32 const CDCSegment2D& toSegment = *ptrToSegment;
33
35 const CDCSegment2D& axialSegment = *ptrAxialSegment;
36
38 const CDCSegment2D& stereoSegment = *ptrStereoSegment;
39
40
44
45
48
51
54
55
56 using namespace NPerigeeParameterIndices;
59
62
63 const double deltaCurvVar = fromCurvVar + toCurvVar;
64 const double avgPrecision = 1 / fromCurvVar + 1 / toCurvVar;
65 const double deltaCurvSigma = std::sqrt(deltaCurvVar);
66
67 finitevar<
named(
"abs_avg_curv")>() = std::fabs(toCurv / toCurvVar + fromCurv / fromCurvVar) / avgPrecision;
70 finitevar<
named(
"delta_curv_pull")>() = (toCurv - fromCurv) / deltaCurvSigma;
71
72
73 const CDCRecoHit2D& fromFirstHit = fromSegment.front();
74 const CDCRecoHit2D& fromLastHit = fromSegment.back();
75 const CDCRecoHit2D& toFirstHit = toSegment.front();
76 const CDCRecoHit2D& toLastHit = toSegment.back();
77
80
81
82 const Vector2D fromFitPos = fromFit.
getClosest(fromHitPos);
83 const Vector2D toFitPos = toFit.
getClosest(toHitPos);
86
89
90 const double deltaPosPhi = fromFitPos.
angleWith(toFitPos);
91 const double deltaMomPhi = fromFitMom.
angleWith(toFitMom);
93
96
100
101
102
103 const CDCRecoHit2D& nearAxialHit = toFirstHit.
isAxial() ? toFirstHit : fromLastHit;
104 const CDCRecoHit2D& farStereoHit = not fromFirstHit.
isAxial() ? fromFirstHit : toLastHit;
105 const CDCRecoHit2D& nearStereoHit = not toFirstHit.
isAxial() ? toFirstHit : fromLastHit;
106
107 const CDCWire& farStereoWire = farStereoHit.
getWire();
108 const WireLine& farWireLine = farStereoWire.
getWireLine();
109
110 const CDCWire& nearStereoWire = nearStereoHit.
getWire();
111 const WireLine& nearWireLine = nearStereoWire.
getWireLine();
112
113 const Vector3D nearAxialRecoPos = nearAxialHit.reconstruct3D(axialFit);
115 const double farZ = farStereoRecoPos.
z();
116
118 const double nearZ = nearStereoRecoPos.
z();
119
120 const double stereoArcLength2D =
122 farStereoRecoPos.
xy());
123
124 const double arcLength2DGap =
126 nearStereoRecoPos.
xy());
127
129 finitevar<
named(
"stereo_arc_length")>() = fabs(stereoArcLength2D);
130
133
136
137 finitevar<
named(
"coarse_tanl")>() = (farZ - nearZ) / stereoArcLength2D;
138
139 finitevar<
named(
"stereo_rel_size")>() = fabs(stereoSegment.size() / stereoArcLength2D);
140
144
148
151
155
156 return true;
157}
const WireLine & getWireLine() const
Getter for the wire line representation of the wire.
double outOfZBoundsFactor(double z) const
Returns the amount how much the given z position is outside the bounds in units of the wire length.
bool isAxial() const
Indicator if the underlying wire is axial.
Vector3D reconstruct3D(const CDCTrajectory2D &trajectory2D, const double z=0) const
Reconstruct the three dimensional position (especially of stereo hits) by determining the z coordinat...
const CDC::CDCWire & getWire() const
Getter for the wire the reconstructed hit associated to.
Vector2D getRecoPos2D() const
Getter for the position in the reference plane.
const CDCSegment2D * getAxialSegment() const
Getter for the axial segment.
const CDCSegment2D * getToSegment() const
Getter for the to segment.
const CDCSegment2D * getStereoSegment() const
Getter for the stereo segment.
const CDCSegment2D * getFromSegment() const
Getter for the from segment.
CDCTrajectory2D & getTrajectory2D() const
Getter for the two dimensional trajectory fitted to the segment.
double getTotalArcLength2D(const AHits &hits) const
Calculates the perpendicular travel distance from the first position of the hits to the last position...
double getChi2() const
Getter for the chi2 value of the circle fit.
double calcArcLength2DBetween(const Vector2D &fromPoint, const Vector2D &toPoint) const
Calculate the travel distance between the two given positions Returns the travel distance on the traj...
double getPValue() const
Getter for p-value.
bool isFitted() const
Checks if the circle is already set to a valid value.
double getLocalVariance(EPerigeeParameter i) const
Getter for an individual diagonal element of the covariance matrix of the local helix parameters.
double getArcLength2DGap(const AFromHits &fromHits, const AToHits &toHits) const
Calculates the perpendicular travel distance from the last position of the fromHits to the first posi...
Vector2D getClosest(const Vector2D &point) const
Calculates the closest approach on the trajectory to the given point.
double getArcLength2DBackOffset(const AFromHits &fromHits, const AToHits &toHits) const
Calculates the perpendicular travel distance from the last position of the fromHits to the last posit...
Vector2D getFlightDirection2D(const Vector2D &point) const
Get the unit direction of flight at the given point, where arcLength2D = 0.
double getArcLength2DFrontOffset(const AFromHits &fromHits, const AToHits &toHits) const
Calculates the perpendicular travel distance from the first position of the fromHits to the first pos...
size_t getNDF() const
Getter for the number of degrees of freedom of the circle fit.
double getCurvature() const
Getter for the curvature as seen from the xy projection.
AssignFinite< Float_t > finitevar()
static constexpr int named(const char *name)
double angleWith(const Vector2D &rhs) const
The angle between this and rhs.
const Vector2D & xy() const
Getter for the xy projected vector ( reference ! )
double z() const
Getter for the z coordinate.
HepGeom::Vector3D< double > Vector3D
3D Vector
static double normalised(const double angle)
Normalise an angle to lie in the range from [-pi, pi].