Generate and assign the contained variables.
28{
29 if (not ptrSegmentPair) return false;
30
31 const CDCSegmentPair& segmentPair = *ptrSegmentPair;
32
34 const CDCSegment2D* ptrToSegment = segmentPair.
getToSegment();
35
36 const CDCSegment2D& fromSegment = *ptrFromSegment;
37 const CDCSegment2D& toSegment = *ptrToSegment;
38
39 const CDCRecoHit2D& fromFirstHit = fromSegment.front();
40 const CDCRecoHit2D& fromLastHit = fromSegment.back();
41
42 const CDCRecoHit2D& toFirstHit = toSegment.front();
43 const CDCRecoHit2D& toLastHit = toSegment.back();
44
45 const ROOT::Math::XYVector fromLastHitPos = fromLastHit.
getRecoPos2D();
46 const ROOT::Math::XYVector fromFirstHitPos = fromFirstHit.
getRecoPos2D();
47
48 const ROOT::Math::XYVector toFirstHitPos = toFirstHit.
getRecoPos2D();
49 const ROOT::Math::XYVector toLastHitPos = toLastHit.
getRecoPos2D();
50
51 const ROOT::Math::XYVector hitPosGap = toFirstHitPos - fromLastHitPos;
52 const ROOT::Math::XYVector longHitPosGap = toLastHitPos - fromFirstHitPos;
53
54 const double hitDistance = hitPosGap.R();
55 const double longHitDistance = longHitPosGap.R();
56
59
60 finitevar<
named(
"delta_hit_pos_phi")>() = ROOT::Math::VectorUtil::DeltaPhi(fromLastHitPos, toFirstHitPos);
61 finitevar<
named(
"delta_hit_mom_phi")>() = ROOT::Math::VectorUtil::DeltaPhi(fromLastHitMom, toFirstHitMom);
62
63 double fromLastHitAlpha = fromLastHit.
getAlpha();
64 double toFirstHitAlpha = toFirstHit.
getAlpha();
66
69
70 finitevar<
named(
"delta_hit_distance")>() = longHitDistance - hitDistance;
71
72 finitevar<
named(
"from_hit_forward")>() = hitPosGap.Dot(fromLastHitMom);
73 finitevar<
named(
"to_hit_forward")>() = hitPosGap.Dot(toFirstHitMom);
74 finitevar<
named(
"hit_forward")>() = hitPosGap.Dot(VectorUtil::average(fromLastHitMom, toFirstHitMom));
75
76 const CDCRecoHit2D& axialHit = toFirstHit.
isAxial() ? toFirstHit : fromLastHit;
77 const CDCRecoHit2D& stereoHit = not toFirstHit.
isAxial() ? toFirstHit : fromLastHit;
78
79 const ROOT::Math::XYVector axialHitPos = axialHit.
getRecoPos2D();
81
82 const CDCWire& stereoWire = stereoHit.
getWire();
83 const WireLine& wireLine = stereoWire.
getWireLine();
84
85
86 ROOT::Math::XYVector relRefPos = wireLine.
refPos2D() - axialHitPos;
88
89 double z = VectorUtil::Cross(-relRefPos, axialHitMom) / VectorUtil::Cross(movePerZ, axialHitMom);
90 ROOT::Math::XYVector stereoHitPos = stereoHit.
getRecoPos2D() + movePerZ * z;
91
94 double arcLengthGap = (stereoHitPos - axialHitPos).Dot(axialHitMom);
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112 return true;
113}
const WireLine & getWireLine() const
Getter for the wire line representation of the wire.
const ROOT::Math::XYVector & nominalMovePerZ() const
Gives the positional move in the xy projection per unit z.
double outOfZBoundsFactor(double z) const
Returns the amount how much the given z position is outside the bounds in units of the wire length.
const ROOT::Math::XYVector & refPos2D() const
Returns the xy vector of the reference position.
bool isAxial() const
Indicator if the underlying wire is axial.
ROOT::Math::XYVector getFlightDirection2D() const
Getter for the direction of flight.
ROOT::Math::XYVector getRecoPos2D() const
Getter for the position in the reference plane.
const CDC::CDCWire & getWire() const
Getter for the wire the reconstructed hit associated to.
double getAlpha() const
Getter for the direction of flight relative to the position.
const CDCSegment2D * getToSegment() const
Getter for the to segment.
const CDCSegment2D * getFromSegment() const
Getter for the from segment.
AssignFinite< Float_t > finitevar()
static constexpr int named(const char *name)
static double normalised(const double angle)
Normalise an angle to lie in the range from [-pi, pi].