Belle II Software development
CDCAxialStereoFusion Class Reference

Utility class implementing the Kalmanesk combination of to two dimensional trajectories to one three dimensional trajectory. More...

#include <CDCAxialStereoFusion.h>

Public Member Functions

 CDCAxialStereoFusion (bool reestimateDriftLength=true)
 Constructor setting up the options of the fit.
 
void reconstructFuseTrajectories (const CDCSegmentPair &segmentPair)
 Combine the two trajectories of the segments in the pair and assign the resulting three dimensional trajectory to the segment pair.
 
void fusePreliminary (const CDCSegmentPair &segmentPair)
 Fit the given segment pair using the preliminary helix fit without proper covariance matrix.
 
CDCTrajectory3D reconstructFuseTrajectories (const CDCSegment2D &fromSegment2D, const CDCSegment2D &toSegment2D)
 Combine the trajectories of the two given segments to a full helix trajectory.
 
CDCTrajectory3D fusePreliminary (const CDCSegment2D &fromSegment2D, const CDCSegment2D &toSegment2D)
 Fit the two given segments together using the preliminary helix fit without proper covariance matrix.
 
CDCTrajectory3D reconstructFuseTrajectories (const CDCSegment2D &fromSegment2D, const CDCSegment2D &toSegment2D, const CDCTrajectory3D &preliminaryTrajectory3D)
 Combine the two segments given a prelimiary reference trajectory to which a creation is applied.
 
PerigeeHelixAmbiguity calcAmbiguity (const CDCSegment3D &segment3D, const CDCTrajectory2D &trajectory2D)
 Calculate the ambiguity of the helix parameters relative to the three circle parameters given the hit content of the segment and their stereo displacement.
 

Private Attributes

bool m_reestimateDriftLength
 Swtich to reestimate the drift length.
 
DriftLengthEstimator m_driftLengthEstimator
 Helper object to carry out the drift length estimation.
 

Detailed Description

Utility class implementing the Kalmanesk combination of to two dimensional trajectories to one three dimensional trajectory.

Definition at line 30 of file CDCAxialStereoFusion.h.

Constructor & Destructor Documentation

◆ CDCAxialStereoFusion()

CDCAxialStereoFusion ( bool  reestimateDriftLength = true)
inlineexplicit

Constructor setting up the options of the fit.

Definition at line 34 of file CDCAxialStereoFusion.h.

35 : m_reestimateDriftLength(reestimateDriftLength)
36 {
37 }
bool m_reestimateDriftLength
Swtich to reestimate the drift length.

Member Function Documentation

◆ calcAmbiguity()

PerigeeHelixAmbiguity calcAmbiguity ( const CDCSegment3D segment3D,
const CDCTrajectory2D trajectory2D 
)

Calculate the ambiguity of the helix parameters relative to the three circle parameters given the hit content of the segment and their stereo displacement.

Definition at line 170 of file CDCAxialStereoFusion.cc.

172{
173 size_t nHits = segment3D.size();
174
175 const Vector2D& localOrigin2D = trajectory2D.getLocalOrigin();
176 const UncertainPerigeeCircle& localCircle = trajectory2D.getLocalCircle();
177
178 double zeta = 0;
179 for (const CDCRecoHit3D& recoHit3D : segment3D) {
180 const Vector2D& recoPos2D = recoHit3D.getRecoPos2D();
181 const Vector2D localRecoPos2D = recoPos2D - localOrigin2D;
182 const Vector2D normal = localCircle->normal(localRecoPos2D);
183 const CDCWire& wire = recoHit3D.getWire();
184 zeta += wire.getWireLine().sagMovePerZ(recoHit3D.getRecoZ()).dot(normal);
185 }
186 zeta /= nHits;
187
189
190 using namespace NHelixParameterIndices;
191 result(c_Curv, c_Curv) = 1.0;
192 result(c_Phi0, c_Phi0) = 1.0;
193 result(c_I, c_I) = 1.0;
194
195 result(c_Phi0, c_TanL) = zeta;
196 result(c_I, c_Z0) = - zeta;
197
198 return result;
199}
Class representing a three dimensional reconstructed hit.
Definition: CDCRecoHit3D.h:52
const Vector2D & getLocalOrigin() const
Getter for the origin of the local coordinate system.
const UncertainPerigeeCircle & getLocalCircle() const
Getter for the cirlce in local coordinates.
Class representing a sense wire in the central drift chamber.
Definition: CDCWire.h:58
const WireLine & getWireLine() const
Getter for the wire line represenation of the wire.
Definition: CDCWire.h:188
Vector2D normal(const Vector2D &point) const
Unit normal vector from the circle to the given point.
A matrix implementation to be used as an interface typ through out the track finder.
Definition: PlainMatrix.h:40
Adds an uncertainty matrix to the circle in perigee parameterisation.
A two dimensional vector which is equipped with functions for correct handeling of orientation relat...
Definition: Vector2D.h:32
double dot(const Vector2D &rhs) const
Calculates the two dimensional dot product.
Definition: Vector2D.h:158
Vector2D sagMovePerZ(const double z) const
Gives the two dimensional position with wire sag effect of the line at the given z value.
Definition: WireLine.h:75
static PerigeeAmbiguity defaultPerigeeAmbiguity()
Initialse a default covariance matrix to zero.

◆ fusePreliminary() [1/2]

CDCTrajectory3D fusePreliminary ( const CDCSegment2D fromSegment2D,
const CDCSegment2D toSegment2D 
)

Fit the two given segments together using the preliminary helix fit without proper covariance matrix.

The fit is used as the expansion point for the least square fuse fit with proper covariance.

Definition at line 92 of file CDCAxialStereoFusion.cc.

94{
95 if (fromSegment2D.empty()) {
96 B2WARNING("From segment is empty.");
97 return CDCTrajectory3D();
98 }
99
100 if (toSegment2D.empty()) {
101 B2WARNING("To segment is empty.");
102 return CDCTrajectory3D();
103 }
104
105 bool fromIsAxial = fromSegment2D.isAxial();
106 const CDCSegment2D& axialSegment2D = fromIsAxial ? fromSegment2D : toSegment2D;
107 const CDCSegment2D& stereoSegment2D = not fromIsAxial ? fromSegment2D : toSegment2D;
108
109 CDCTrajectory2D axialTrajectory2D = axialSegment2D.getTrajectory2D();
110
111 Vector2D localOrigin2D = (fromIsAxial ? fromSegment2D.back() : toSegment2D.front()).getRecoPos2D();
112 axialTrajectory2D.setLocalOrigin(localOrigin2D);
113
114 CDCSegment3D stereoSegment3D = CDCSegment3D::reconstruct(stereoSegment2D, axialTrajectory2D);
115
116 CDCTrajectorySZ trajectorySZ;
117
119 trajectorySZ = szFitter.fit(stereoSegment3D);
120 if (not trajectorySZ.isFitted()) {
121 CDCTrajectory3D result;
122 result.setChi2(NAN);
123 return result;
124 }
125
126 CDCTrajectory3D preliminaryTrajectory3D(axialTrajectory2D, trajectorySZ);
127 Vector3D localOrigin3D(localOrigin2D, 0.0);
128 preliminaryTrajectory3D.setLocalOrigin(localOrigin3D);
129 return preliminaryTrajectory3D;
130}
Class implementing the z coordinate over travel distance line fit.
Definition: CDCSZFitter.h:27
static const CDCSZFitter & getFitter()
Getter for a standard sz line fitter instance.
Definition: CDCSZFitter.cc:36
CDCTrajectorySZ fit(const CDCSegment2D &stereoSegment, const CDCTrajectory2D &axialTrajectory2D) const
Returns a fitted trajectory.
Definition: CDCSZFitter.cc:139
A reconstructed sequence of two dimensional hits in one super layer.
Definition: CDCSegment2D.h:39
A segment consisting of three dimensional reconstructed hits.
Definition: CDCSegment3D.h:26
static CDCSegment3D reconstruct(const CDCSegment2D &segment2D, const CDCTrajectory2D &trajectory2D)
Reconstructs a two dimensional stereo segment by shifting each hit onto the given two dimensional tra...
Definition: CDCSegment3D.cc:20
bool isAxial() const
Indicator if the underlying wires are axial.
Definition: CDCSegment.h:45
CDCTrajectory2D & getTrajectory2D() const
Getter for the two dimensional trajectory fitted to the segment.
Definition: CDCSegment.h:69
Particle trajectory as it is seen in xy projection represented as a circle.
double setLocalOrigin(const Vector2D &localOrigin)
Setter for the origin of the local coordinate system.
Particle full three dimensional trajectory.
Linear trajectory in sz space.
bool isFitted() const
Indicates if the line has been fitted.
A three dimensional vector.
Definition: Vector3D.h:33

◆ fusePreliminary() [2/2]

void fusePreliminary ( const CDCSegmentPair segmentPair)

Fit the given segment pair using the preliminary helix fit without proper covariance matrix.

Updates the contained trajectory.

Definition at line 63 of file CDCAxialStereoFusion.cc.

64{
65 const CDCSegment2D* ptrFromSegment = segmentPair.getFromSegment();
66 const CDCSegment2D* ptrToSegment = segmentPair.getToSegment();
67
68 if (not ptrFromSegment) {
69 B2WARNING("From segment unset.");
70 return;
71 }
72
73 if (not ptrToSegment) {
74 B2WARNING("To segment unset.");
75 return;
76 }
77 const CDCSegment2D& fromSegment = *ptrFromSegment;
78 const CDCSegment2D& toSegment = *ptrToSegment;
79
80 CDCTrajectory3D trajectory3D = fusePreliminary(fromSegment, toSegment);
81 segmentPair.setTrajectory3D(trajectory3D);
82}
void fusePreliminary(const CDCSegmentPair &segmentPair)
Fit the given segment pair using the preliminary helix fit without proper covariance matrix.
const CDCSegment2D * getToSegment() const
Getter for the to segment.
void setTrajectory3D(const CDCTrajectory3D &trajectory3D) const
Setter for the three dimensional trajectory.
const CDCSegment2D * getFromSegment() const
Getter for the from segment.

◆ reconstructFuseTrajectories() [1/3]

CDCTrajectory3D reconstructFuseTrajectories ( const CDCSegment2D fromSegment2D,
const CDCSegment2D toSegment2D 
)

Combine the trajectories of the two given segments to a full helix trajectory.

Definition at line 85 of file CDCAxialStereoFusion.cc.

87{
88 CDCTrajectory3D preliminaryTrajectory3D = fusePreliminary(fromSegment2D, toSegment2D);
89 return reconstructFuseTrajectories(fromSegment2D, toSegment2D, preliminaryTrajectory3D);
90}
void reconstructFuseTrajectories(const CDCSegmentPair &segmentPair)
Combine the two trajectories of the segments in the pair and assign the resulting three dimensional t...

◆ reconstructFuseTrajectories() [2/3]

CDCTrajectory3D reconstructFuseTrajectories ( const CDCSegment2D fromSegment2D,
const CDCSegment2D toSegment2D,
const CDCTrajectory3D preliminaryTrajectory3D 
)

Combine the two segments given a prelimiary reference trajectory to which a creation is applied.

Definition at line 132 of file CDCAxialStereoFusion.cc.

135{
136 Vector3D localOrigin3D = preliminaryTrajectory3D.getLocalOrigin();
137 Vector2D localOrigin2D = localOrigin3D.xy();
138
139 CDCRiemannFitter riemannFitter;
140 //riemannFitter.useOnlyOrientation();
141 riemannFitter.useOnlyPosition();
142
143 CDCSegment3D fromSegment3D = reconstruct(fromSegment2D, preliminaryTrajectory3D);
144 CDCSegment3D toSegment3D = reconstruct(toSegment2D, preliminaryTrajectory3D);
145
147 double tanLambda = preliminaryTrajectory3D.getTanLambda();
148 m_driftLengthEstimator.updateDriftLength(fromSegment3D, tanLambda);
149 m_driftLengthEstimator.updateDriftLength(toSegment3D, tanLambda);
150 }
151
152 CDCTrajectory2D fromTrajectory2D = riemannFitter.fit(fromSegment3D);
153 CDCTrajectory2D toTrajectory2D = riemannFitter.fit(toSegment3D);
154
155 fromTrajectory2D.setLocalOrigin(localOrigin2D);
156 toTrajectory2D.setLocalOrigin(localOrigin2D);
157
158 SZParameters refSZ = preliminaryTrajectory3D.getLocalSZLine().szParameters();
159
160 const UncertainPerigeeCircle& fromCircle = fromTrajectory2D.getLocalCircle();
161 const UncertainPerigeeCircle& toCircle = toTrajectory2D.getLocalCircle();
162
163 JacobianMatrix<3, 5> fromH = calcAmbiguity(fromSegment3D, fromTrajectory2D);
164 JacobianMatrix<3, 5> toH = calcAmbiguity(toSegment3D, toTrajectory2D);
165
166 UncertainHelix resultHelix = UncertainHelix::average(fromCircle, fromH, toCircle, toH, refSZ);
167 return CDCTrajectory3D(localOrigin3D, resultHelix);
168}
DriftLengthEstimator m_driftLengthEstimator
Helper object to carry out the drift length estimation.
PerigeeHelixAmbiguity calcAmbiguity(const CDCSegment3D &segment3D, const CDCTrajectory2D &trajectory2D)
Calculate the ambiguity of the helix parameters relative to the three circle parameters given the hit...
CDCTrajectory2D fit(const CDCObservations2D &observations2D) const
Fits a collection of observation drift circles.
void useOnlyPosition()
Setup the fitter to use only the reconstructed positions of the hits.
Class implementing the Riemann fit for two dimensional trajectory circle.
UncertainSZLine getLocalSZLine() const
Getter for the sz line starting from the local origin.
double getTanLambda() const
Getter for the slope of z over the transverse travel distance s.
const Vector3D & getLocalOrigin() const
Getter for the origin of the local coordinate system.
static UncertainHelix average(const UncertainHelix &fromHelix, const UncertainHelix &toHelix)
Construct the averages of the two given helices by properly considering their covariance matrix.
SZParameters szParameters() const
Getter for the sz parameters in the order defined by ESZParameter.h.
const Vector2D & xy() const
Getter for the xy projected vector ( reference ! )
Definition: Vector3D.h:508
This class represents an ideal helix in perigee parameterization including the covariance matrix of t...
double updateDriftLength(CDCRecoHit2D &recoHit2D)
Update the drift length of the reconstructed hit in place.

◆ reconstructFuseTrajectories() [3/3]

void reconstructFuseTrajectories ( const CDCSegmentPair segmentPair)

Combine the two trajectories of the segments in the pair and assign the resulting three dimensional trajectory to the segment pair.

Definition at line 41 of file CDCAxialStereoFusion.cc.

42{
43 const CDCSegment2D* ptrFromSegment = segmentPair.getFromSegment();
44 const CDCSegment2D* ptrToSegment = segmentPair.getToSegment();
45
46 if (not ptrFromSegment) {
47 B2WARNING("From segment unset.");
48 return;
49 }
50
51 if (not ptrToSegment) {
52 B2WARNING("To segment unset.");
53 return;
54 }
55
56 const CDCSegment2D& fromSegment = *ptrFromSegment;
57 const CDCSegment2D& toSegment = *ptrToSegment;
58
59 CDCTrajectory3D trajectory3D = reconstructFuseTrajectories(fromSegment, toSegment);
60 segmentPair.setTrajectory3D(trajectory3D);
61}

Member Data Documentation

◆ m_driftLengthEstimator

DriftLengthEstimator m_driftLengthEstimator
private

Helper object to carry out the drift length estimation.

Definition at line 86 of file CDCAxialStereoFusion.h.

◆ m_reestimateDriftLength

bool m_reestimateDriftLength
private

Swtich to reestimate the drift length.

Definition at line 83 of file CDCAxialStereoFusion.h.


The documentation for this class was generated from the following files: