Belle II Software development
CDCRecoHit3D Class Reference

Class representing a three dimensional reconstructed hit. More...

#include <CDCRecoHit3D.h>

Public Member Functions

 CDCRecoHit3D ()=default
 Default constructor for ROOT.
 
 CDCRecoHit3D (const CDCRLWireHit &rlWireHit, const Vector3D &recoPos3D, double arcLength2D=0)
 Constructor taking all stored variables of the reconstructed hit.
 
void reverse ()
 Turns the orientation in place.
 
CDCRecoHit3D reversed () const
 Returns the recohit with the opposite right left information.
 
 operator const Belle2::CDCHit * () const
 Make the wire hit automatically castable to its underlying cdcHit.
 
bool operator== (const CDCRecoHit3D &other) const
 Equality comparison based on wire hit, right left passage information and reconstructed position.
 
bool operator< (const CDCRecoHit3D &other) const
 Total ordering relation based on wire hit, right left passage information and position information in this order of importance.
 
EStereoKind getStereoKind () const
 Getter for the stereo type of the underlying wire.
 
bool isAxial () const
 Indicator if the underlying wire is axial.
 
ISuperLayer getISuperLayer () const
 Getter for the superlayer id.
 
const CDCWiregetWire () const
 Getter for the wire.
 
bool isOnWire (const CDCWire &wire) const
 Checks if the reconstructed hit is associated with the give wire.
 
const CDCWireHitgetWireHit () const
 Getter for the wire hit.
 
bool hasWireHit (const CDCWireHit &wireHit) const
 Checks if the reconstructed hit is associated with the give wire hit.
 
const CDCRLWireHitgetRLWireHit () const
 Getter for the oriented wire hit.
 
void setRLWireHit (const CDCRLWireHit &rlWireHit)
 Setter for the oriented wire hit associated with the reconstructed hit.
 
ERightLeft getRLInfo () const
 Getter for the right left passage information.
 
void setRLInfo (ERightLeft rlInfo)
 Setter the right left passage information.
 
const Vector2DgetRefPos2D () const
 Getter for the reference position of the wire.
 
const Vector3DgetRecoPos3D () const
 Getter for the 3d position of the hit.
 
void setRecoPos3D (const Vector3D &recoPos3D)
 Setter for the 3d position of the hit.
 
const Vector2DgetRecoPos2D () const
 Getter for the 2d position of the hit.
 
double getRecoZ () const
 Getter for the z coordinate of the reconstructed position.
 
Vector2D getRecoDisp2D () const
 Gets the displacement from the wire position in the xy plain at the reconstructed position.
 
Vector2D getFlightDirection2D () const
 Getter for the direction of flight.
 
double getAlpha () const
 Getter for the direction of flight relative to the position.
 
CDCRecoHit2D getRecoHit2D () const
 Constructs a two dimensional reconstructed hit by carrying out the stereo ! projection to the wire reference position.
 
CDCRecoHit2D stereoProjectToRef () const
 Constructs a two dimensional reconstructed hit by carrying out the stereo ! projection to the wire reference position.
 
Vector2D getRecoWirePos2D () const
 Returns the position of the wire in the xy plain the reconstructed position is located in.
 
void snapToDriftCircle (bool switchSide=false)
 Scales the displacement vector in place to lie on the drift circle.
 
double getSignedRecoDriftLength () const
 Returns the drift length next to the reconstructed position.
 
void setRecoDriftLength (double driftLength, bool snapRecoPos)
 Setter to update the drift length of the hit.
 
double getRecoDriftLengthVariance () const
 Returns the drift length variance next to the reconstructed position.
 
void shiftArcLength2D (double arcLength2DOffSet)
 Adjust the travel distance by the given value.
 
double getArcLength2D () const
 Getter for the travel distance in the xy projection.
 
void setArcLength2D (const double arcLength2D)
 Setter for the travel distance in the xy projection.
 
bool isInCellZBounds (const double factor=1) const
 Indicator if the hit is in the cdc (scaled by the factor) or already outside its boundaries.
 

Static Public Member Functions

static CDCRecoHit3D fromSimHit (const CDCWireHit *wireHit, const CDCSimHit &simHit)
 Constructs a three dimensional reconstructed hit from a sim hit and the associated wirehit.
 
static CDCRecoHit3D reconstruct (const CDCRecoHit2D &recoHit2D, const CDCTrajectory2D &trajectory2D)
 Reconstructs the three dimensional hit from the two dimensional and the two dimensional trajectory.
 
static CDCRecoHit3D reconstruct (const CDCRLWireHit &rlWireHit, const CDCTrajectory2D &trajectory2D)
 Reconstructs the three dimensional hit from the wire hit and the given right left passage information by shifting it to a z coordinate, where it touches the two dimensional trajectory from the side indicated by the right left passage.
 
static CDCRecoHit3D reconstruct (const CDCWireHit *wireHit, ERightLeft rlInfo, const CDCTrajectory2D &trajectory2D)
 Reconstructs the three dimensional hit from the wire hit and the given right left passage information by shifting it to a z coordinate, where it touches the two dimensional trajectory from the side indicated by the right left passage.
 
static CDCRecoHit3D reconstructNearest (const CDCWireHit *axialWireHit, const CDCTrajectory2D &trajectory2D)
 Reconstruct a three dimensional hit from a wire hit (as in reconstruct(rlWireHit, trajectory2D)), but this time use a wire hit without a right-left information as an input.
 
static CDCRecoHit3D reconstruct (const CDCRecoHit2D &recoHit, const CDCTrajectory3D &trajectory3D)
 Convenience function to call the other reconstruct method with the sz- and 2d-trajectory contained in the 3d one.
 
static CDCRecoHit3D reconstruct (const CDCRecoHit2D &recoHit2D, const CDCTrajectory2D &trajectory2D, const CDCTrajectorySZ &trajectorySZ)
 Deprecated - try to use the method above for the same purpose.
 
static CDCRecoHit3D average (const CDCRecoHit3D &first, const CDCRecoHit3D &second)
 Constructs the average of two reconstructed hit positions.
 

Private Attributes

CDCRLWireHit m_rlWireHit
 Memory for the oriented wire hit reference.
 
Vector3D m_recoPos3D
 Memory for the reconstructed hit position.
 
double m_arcLength2D = 0
 Memory for the travel distance as see in the xy projection.
 

Friends

bool operator< (const CDCRecoHit3D &recoHit3D, const CDCWire &wire)
 Defines wires and the three dimensional reconstructed hits as coaligned.
 
bool operator< (const CDCWire &wire, const CDCRecoHit3D &recoHit3D)
 Defines wires and the three dimensional reconstructed hits as coaligned.
 
bool operator< (const CDCRecoHit3D &recoHit3D, const CDCWireHit &wireHit)
 Defines wire hits and the three dimensional reconstructed hits as coaligned.
 
bool operator< (const CDCWireHit &wireHit, const CDCRecoHit3D &recoHit3D)
 Defines wire hits and the three dimensional reconstructed hits as coaligned.
 

Detailed Description

Class representing a three dimensional reconstructed hit.

A recohit represents a likely point where the particle went through. It is always associated with a wire hit it seeks to reconstruct. The reconstructed point is stored as an absolute position from the origin / interaction point. In addition the reconstructed hit takes a right left passage information which indicates if the hit wire lies to the right or to the left of the particle trajectory causing the hit. The later readily indicates a flight direction from the reconstructed hit, if a tangential approach of the trajectory to the drift circle is assumed.

Finally we want to estimate the travel distance to z coordinate relation of the particle trajectory. Therefore the three dimensional reconstructed hit stores the travel distance as seen from the xy projection ( arcLength2D ) it took to get to hit. This variable can be calculated from the trajectory circle fitted in the two dimensional tracking as the arc length.

Definition at line 52 of file CDCRecoHit3D.h.

Constructor & Destructor Documentation

◆ CDCRecoHit3D()

CDCRecoHit3D ( const CDCRLWireHit rlWireHit,
const Vector3D recoPos3D,
double  arcLength2D = 0 
)

Constructor taking all stored variables of the reconstructed hit.

Definition at line 37 of file CDCRecoHit3D.cc.

40 : m_rlWireHit(rlWireHit)
41 , m_recoPos3D(recoPos3D)
42 , m_arcLength2D(arcLength2D)
43{
44}
double m_arcLength2D
Memory for the travel distance as see in the xy projection.
Definition: CDCRecoHit3D.h:395
CDCRLWireHit m_rlWireHit
Memory for the oriented wire hit reference.
Definition: CDCRecoHit3D.h:389
Vector3D m_recoPos3D
Memory for the reconstructed hit position.
Definition: CDCRecoHit3D.h:392

Member Function Documentation

◆ average()

CDCRecoHit3D average ( const CDCRecoHit3D first,
const CDCRecoHit3D second 
)
static

Constructs the average of two reconstructed hit positions.

Averages the hit positions and the travel distance. The function averages only reconstructed hits associated with the same wire hit. If not all reconstructed hits are on the same wire hit, the first hit is returned unchanged. Also averages the right left passage information with averageInfo().

Definition at line 139 of file CDCRecoHit3D.cc.

140{
141 if (first.getRLWireHit() == second.getRLWireHit()) {
142 return CDCRecoHit3D(first.getRLWireHit(),
143 Vector3D::average(first.getRecoPos3D(), second.getRecoPos3D()),
144 (first.getArcLength2D() + second.getArcLength2D()) / 2);
145 } else {
146 B2ERROR("Averaging three dimensional hits which are on different oriented wire hits. Return "
147 "first one unchanged");
148 return first;
149 }
150}
CDCRecoHit3D()=default
Default constructor for ROOT.

◆ fromSimHit()

CDCRecoHit3D fromSimHit ( const CDCWireHit wireHit,
const CDCSimHit simHit 
)
static

Constructs a three dimensional reconstructed hit from a sim hit and the associated wirehit.

This translates the sim hit to a reconstructed hit mainly to be able to compare the reconstructed values from the algorithm with the Monte Carlo information. It merely takes the position from the sim hit and calculates the right left passage information. Since only the time is present in the sim hit but not the travel distance this parameter is just set NAN!

Definition at line 46 of file CDCRecoHit3D.cc.

47{
48 // arc length cannot be deduced from the flightTime in this context
49 double arcLength2D = std::numeric_limits<double>::quiet_NaN();
50
51 return CDCRecoHit3D(CDCRLWireHit::fromSimHit(wireHit, simHit),
52 Vector3D{simHit.getPosTrack()},
53 arcLength2D);
54}
B2Vector3D getPosTrack() const
The method to get position on the track.
Definition: CDCSimHit.h:217
static CDCRLWireHit fromSimHit(const CDCWireHit *wirehit, const CDCSimHit &simhit)
Constructs an oriented wire hit from a CDCSimHit and the associated wirehit.
A three dimensional vector.
Definition: Vector3D.h:33

◆ getAlpha()

double getAlpha ( ) const
inline

Getter for the direction of flight relative to the position.

Definition at line 319 of file CDCRecoHit3D.h.

320 {
322 }
const Vector2D & getRecoPos2D() const
Getter for the 2d position of the hit.
Definition: CDCRecoHit3D.h:297
Vector2D getFlightDirection2D() const
Getter for the direction of flight.
Definition: CDCRecoHit3D.h:312
double angleWith(const Vector2D &rhs) const
The angle between this and rhs.
Definition: Vector2D.h:197

◆ getArcLength2D()

double getArcLength2D ( ) const
inline

Getter for the travel distance in the xy projection.

Definition at line 370 of file CDCRecoHit3D.h.

371 {
372 return m_arcLength2D;
373 }

◆ getFlightDirection2D()

Vector2D getFlightDirection2D ( ) const
inline

Getter for the direction of flight.

Definition at line 312 of file CDCRecoHit3D.h.

313 {
314 ERotation rotation = static_cast<ERotation>(-getRLInfo());
315 return getRecoDisp2D().orthogonal(rotation);
316 }
ERightLeft getRLInfo() const
Getter for the right left passage information.
Definition: CDCRecoHit3D.h:267
Vector2D getRecoDisp2D() const
Gets the displacement from the wire position in the xy plain at the reconstructed position.
Vector2D orthogonal() const
Orthogonal vector to the counterclockwise direction.
Definition: Vector2D.h:289
ERotation
Enumeration to represent the distinct possibilities of the right left passage information.
Definition: ERotation.h:25

◆ getISuperLayer()

ISuperLayer getISuperLayer ( ) const
inline

Getter for the superlayer id.

Definition at line 220 of file CDCRecoHit3D.h.

221 {
222 return getRLWireHit().getISuperLayer();
223 }
ISuperLayer getISuperLayer() const
Getter for the superlayer id.
const CDCRLWireHit & getRLWireHit() const
Getter for the oriented wire hit.
Definition: CDCRecoHit3D.h:250

◆ getRecoDisp2D()

Vector2D getRecoDisp2D ( ) const

Gets the displacement from the wire position in the xy plain at the reconstructed position.

Definition at line 152 of file CDCRecoHit3D.cc.

153{
154 const CDCWire& wire = getWire();
155 const double recoPosZ = getRecoPos3D().z();
156
157 Vector2D wirePos = wire.getWirePos2DAtZ(recoPosZ);
158 Vector2D disp2D = getRecoPos3D().xy() - wirePos;
159 return disp2D;
160}
const Vector3D & getRecoPos3D() const
Getter for the 3d position of the hit.
Definition: CDCRecoHit3D.h:285
const CDCWire & getWire() const
Getter for the wire.
Definition: CDCRecoHit3D.h:226
Class representing a sense wire in the central drift chamber.
Definition: CDCWire.h:58
Vector2D getWirePos2DAtZ(const double z) const
Gives the xy projected position of the wire at the given z coordinate.
Definition: CDCWire.h:192
A two dimensional vector which is equipped with functions for correct handling of orientation relate...
Definition: Vector2D.h:32
const Vector2D & xy() const
Getter for the xy projected vector ( reference ! )
Definition: Vector3D.h:508
double z() const
Getter for the z coordinate.
Definition: Vector3D.h:496

◆ getRecoDriftLengthVariance()

double getRecoDriftLengthVariance ( ) const
inline

Returns the drift length variance next to the reconstructed position.

Dummy implemented as the reference drift length.

Definition at line 358 of file CDCRecoHit3D.h.

359 {
361 }
double getRefDriftLengthVariance() const
Getter for the variance of the drift length at the reference position of the wire.
Definition: CDCRLWireHit.h:222

◆ getRecoHit2D()

CDCRecoHit2D getRecoHit2D ( ) const

Constructs a two dimensional reconstructed hit by carrying out the stereo ! projection to the wire reference position.

Definition at line 197 of file CDCRecoHit3D.cc.

198{
200}
Class representing a two dimensional reconstructed hit in the central drift chamber.
Definition: CDCRecoHit2D.h:47

◆ getRecoPos2D()

const Vector2D & getRecoPos2D ( ) const
inline

Getter for the 2d position of the hit.

Definition at line 297 of file CDCRecoHit3D.h.

298 {
299 return getRecoPos3D().xy();
300 }

◆ getRecoPos3D()

const Vector3D & getRecoPos3D ( ) const
inline

Getter for the 3d position of the hit.

Definition at line 285 of file CDCRecoHit3D.h.

286 {
287 return m_recoPos3D;
288 }

◆ getRecoWirePos2D()

Vector2D getRecoWirePos2D ( ) const

Returns the position of the wire in the xy plain the reconstructed position is located in.

Definition at line 207 of file CDCRecoHit3D.cc.

208{
209 return getWire().getWirePos2DAtZ(getRecoZ());
210}
double getRecoZ() const
Getter for the z coordinate of the reconstructed position.
Definition: CDCRecoHit3D.h:303

◆ getRecoZ()

double getRecoZ ( ) const
inline

Getter for the z coordinate of the reconstructed position.

Definition at line 303 of file CDCRecoHit3D.h.

304 {
305 return getRecoPos3D().z();
306 }

◆ getRefPos2D()

const Vector2D & getRefPos2D ( ) const
inline

Getter for the reference position of the wire.

Definition at line 279 of file CDCRecoHit3D.h.

280 {
281 return getRLWireHit().getRefPos2D();
282 }
const Vector2D & getRefPos2D() const
The two dimensional reference position of the underlying wire.

◆ getRLInfo()

ERightLeft getRLInfo ( ) const
inline

Getter for the right left passage information.

Returns the right left passage information as see in the xy projection. It gives if the wire lies on the right or on the left side of the track
as you at the xy projection.

Definition at line 267 of file CDCRecoHit3D.h.

268 {
269 return getRLWireHit().getRLInfo();
270 }
ERightLeft getRLInfo() const
Getter for the right left passage information.
Definition: CDCRLWireHit.h:234

◆ getRLWireHit()

const CDCRLWireHit & getRLWireHit ( ) const
inline

Getter for the oriented wire hit.

Definition at line 250 of file CDCRecoHit3D.h.

251 {
252 return m_rlWireHit;
253 }

◆ getSignedRecoDriftLength()

double getSignedRecoDriftLength ( ) const
inline

Returns the drift length next to the reconstructed position.

Dummy implemented as the reference drift length.

Definition at line 346 of file CDCRecoHit3D.h.

347 {
349 }
double getSignedRefDriftLength() const
Getter for the drift length at the reference position of the wire.
Definition: CDCRLWireHit.h:216

◆ getStereoKind()

EStereoKind getStereoKind ( ) const
inline

Getter for the stereo type of the underlying wire.

Definition at line 208 of file CDCRecoHit3D.h.

209 {
210 return getRLWireHit().getStereoKind();
211 }
EStereoKind getStereoKind() const
Getter for the stereo type of the underlying wire.

◆ getWire()

const CDCWire & getWire ( ) const
inline

Getter for the wire.

Definition at line 226 of file CDCRecoHit3D.h.

227 {
228 return getRLWireHit().getWire();
229 }
const CDCWire & getWire() const
Getter for the wire the oriented hit associated to.

◆ getWireHit()

const CDCWireHit & getWireHit ( ) const
inline

Getter for the wire hit.

Definition at line 238 of file CDCRecoHit3D.h.

239 {
240 return getRLWireHit().getWireHit();
241 }
const CDCWireHit & getWireHit() const
Getter for the wire hit associated with the oriented hit.
Definition: CDCRLWireHit.h:192

◆ hasWireHit()

bool hasWireHit ( const CDCWireHit wireHit) const
inline

Checks if the reconstructed hit is associated with the give wire hit.

Definition at line 244 of file CDCRecoHit3D.h.

245 {
246 return getRLWireHit().hasWireHit(wireHit);
247 }
bool hasWireHit(const CDCWireHit &wirehit) const
Checks if the oriented hit is associated with the give wire hit.
Definition: CDCRLWireHit.h:198

◆ isAxial()

bool isAxial ( ) const
inline

Indicator if the underlying wire is axial.

Definition at line 214 of file CDCRecoHit3D.h.

215 {
216 return getRLWireHit().isAxial();
217 }
bool isAxial() const
Indicator if the underlying wire is axial.

◆ isInCellZBounds()

bool isInCellZBounds ( const double  factor = 1) const

Indicator if the hit is in the cdc (scaled by the factor) or already outside its boundaries.

Checks for z to be in the range of the wire.

Definition at line 212 of file CDCRecoHit3D.cc.

213{
214 return getWire().isInCellZBounds(getRecoPos3D(), factor);
215}
bool isInCellZBounds(const Vector3D &pos3D, const double factor=1) const
Checks whether the position is in the z bounds of the drift cell (scaled by the factor) surrounding t...
Definition: CDCWire.h:295

◆ isOnWire()

bool isOnWire ( const CDCWire wire) const
inline

Checks if the reconstructed hit is associated with the give wire.

Definition at line 232 of file CDCRecoHit3D.h.

233 {
234 return getRLWireHit().isOnWire(wire);
235 }
bool isOnWire(const CDCWire &wire) const
Checks if the oriented hit is associated with the give wire.
Definition: CDCRLWireHit.h:168

◆ operator const Belle2::CDCHit *()

operator const Belle2::CDCHit * ( ) const
inline

Make the wire hit automatically castable to its underlying cdcHit.

Definition at line 159 of file CDCRecoHit3D.h.

160 {
161 return static_cast<const CDCHit*>(getRLWireHit());
162 }

◆ operator<()

bool operator< ( const CDCRecoHit3D other) const
inline

Total ordering relation based on wire hit, right left passage information and position information in this order of importance.

Definition at line 176 of file CDCRecoHit3D.h.

177 {
178 return (getRLWireHit() < other.getRLWireHit() or
179 (getRLWireHit() == other.getRLWireHit() and
180 getRecoPos3D() < other.getRecoPos3D()));
181 }

◆ operator==()

bool operator== ( const CDCRecoHit3D other) const
inline

Equality comparison based on wire hit, right left passage information and reconstructed position.

Definition at line 165 of file CDCRecoHit3D.h.

166 {
167 return getRLWireHit() == other.getRLWireHit() and
168 getRLInfo() == other.getRLInfo() and
169 getRecoPos3D() == other.getRecoPos3D();
170 }

◆ reconstruct() [1/5]

CDCRecoHit3D reconstruct ( const CDCRecoHit2D recoHit,
const CDCTrajectory3D trajectory3D 
)
static

Convenience function to call the other reconstruct method with the sz- and 2d-trajectory contained in the 3d one.

Definition at line 82 of file CDCRecoHit3D.cc.

84{
85 // This this is quite legacy behaviour - do something smarter.
86 CDCTrajectory2D trajectory2D = trajectory3D.getTrajectory2D();
87 CDCTrajectorySZ trajectorySZ = trajectory3D.getTrajectorySZ();
88
89 return reconstruct(recoHit, trajectory2D, trajectorySZ);
90}
static CDCRecoHit3D reconstruct(const CDCRecoHit2D &recoHit2D, const CDCTrajectory2D &trajectory2D)
Reconstructs the three dimensional hit from the two dimensional and the two dimensional trajectory.
Definition: CDCRecoHit3D.cc:56
Particle trajectory as it is seen in xy projection represented as a circle.
CDCTrajectory2D getTrajectory2D() const
Getter for the two dimensional trajectory.
CDCTrajectorySZ getTrajectorySZ() const
Getter for the sz trajectory.
Linear trajectory in sz space.

◆ reconstruct() [2/5]

CDCRecoHit3D reconstruct ( const CDCRecoHit2D recoHit2D,
const CDCTrajectory2D trajectory2D 
)
static

Reconstructs the three dimensional hit from the two dimensional and the two dimensional trajectory.

For two dimensional reconstructed hits on axial wires this reconstructs the xy position and the transverse travel distance. The z coordinate cannot be determined since the projection can not show any information about it. It is always set to NAN for axial hits.

For two dimensional reconstructed hits on stereo wires however the deviation of the xy position can be used to get z information. The reconstructed hit lies exactly on the fitted trajectory as seen from the xy plane. Hence also xy position and transverse travel distance are available. Only the stereo hits have then the full information to go head and make the sz trajectory.

Definition at line 56 of file CDCRecoHit3D.cc.

58{
59 Vector3D recoPos3D = recoHit2D.reconstruct3D(trajectory2D);
60 double arcLength2D = trajectory2D.calcArcLength2D(recoPos3D.xy());
61 return CDCRecoHit3D(recoHit2D.getRLWireHit(), recoPos3D, arcLength2D);
62}
const CDCRLWireHit & getRLWireHit() const
Getter for the oriented wire hit associated with the reconstructed hit.
Definition: CDCRecoHit2D.h:281
Vector3D reconstruct3D(const CDCTrajectory2D &trajectory2D, const double z=0) const
Reconstruct the three dimensional position (especially of stereo hits) by determining the z coordinat...
double calcArcLength2D(const Vector2D &point) const
Calculate the travel distance from the start position of the trajectory.

◆ reconstruct() [3/5]

CDCRecoHit3D reconstruct ( const CDCRecoHit2D recoHit2D,
const CDCTrajectory2D trajectory2D,
const CDCTrajectorySZ trajectorySZ 
)
static

Deprecated - try to use the method above for the same purpose.

Reconstructs the three dimensional hit from the two dimensional, the two dimensional trajectory and sz trajectory. For two dimensional reconstructed hits on axial wires this reconstructs

the xy position and the transverse travel distance. The z coordinate is then determined by evaluating the sz trajectory at the just calculated travel distance. Note that it is important that both circle trajectory and sz trajectory share a common reference point.

For two dimensional reconstructed hits on stereo wires the transverse travel distance is obtained as in the reconstruct() method before. However the z coordinate is set to the value of the sz trajectory at just calculated the transverse travel distance, since the trajectory should be more exact than the shifting along the wire.

Definition at line 92 of file CDCRecoHit3D.cc.

95{
96 EStereoKind stereoKind = recoHit2D.getStereoKind();
97
98 double arcLength2D = 0;
99 if (stereoKind == EStereoKind::c_StereoU or stereoKind == EStereoKind::c_StereoV) {
100 //the closest approach of a wire line to a helix
101 //( in this case represented by the two trajectories )
102 //can not be solved as a closed expression
103 //in the common case the z fit has been derived from the reconstructed points generated
104 //with the reconstruct method above in the other reconstruct method.
105 //sticking to that method but using the average z from the sz fit
106 Vector3D recoPos3D = recoHit2D.reconstruct3D(trajectory2D);
107 arcLength2D = trajectory2D.calcArcLength2D(recoPos3D.xy());
108
109 } else { /* if (stereoKind == EStereoKind::c_Axial)*/
110 Vector2D recoPos2D = trajectory2D.getClosest(recoHit2D.getRecoPos2D());
111 arcLength2D = trajectory2D.calcArcLength2D(recoPos2D);
112
113 }
114
115 const double z = trajectorySZ.mapSToZ(arcLength2D);
116
117 // Reevaluating the z position eventually accounts for wire sag.
118 const CDCWire& wire = recoHit2D.getWire();
119 const Vector2D recoWirePos2D = wire.getWirePos2DAtZ(z);
120 const Vector2D correctedRecoPos2D = trajectory2D.getClosest(recoWirePos2D);
121 const double correctedPerpS = trajectory2D.calcArcLength2D(correctedRecoPos2D);
122 const double correctedZ = trajectorySZ.mapSToZ(correctedPerpS);
123 const Vector3D correctedRecoPos3D(correctedRecoPos2D, correctedZ);
124
125 CDCRecoHit3D result(recoHit2D.getRLWireHit(), correctedRecoPos3D, correctedPerpS);
126 result.snapToDriftCircle();
127 return result;
128}
const CDCWire & getWire() const
Getter for the wire the reconstructed hit associated to.
Definition: CDCRecoHit2D.h:175
Vector2D getRecoPos2D() const
Getter for the position in the reference plane.
Definition: CDCRecoHit2D.h:238
EStereoKind getStereoKind() const
Getter for the stereo type of the underlying wire.
Definition: CDCRecoHit2D.h:157
Class representing a three dimensional reconstructed hit.
Definition: CDCRecoHit3D.h:52
Vector2D getClosest(const Vector2D &point) const
Calculates the closest approach on the trajectory to the given point.
double mapSToZ(const double s=0) const
Translates the travel distance to the z coordinate.

◆ reconstruct() [4/5]

CDCRecoHit3D reconstruct ( const CDCRLWireHit rlWireHit,
const CDCTrajectory2D trajectory2D 
)
static

Reconstructs the three dimensional hit from the wire hit and the given right left passage information by shifting it to a z coordinate, where it touches the two dimensional trajectory from the side indicated by the right left passage.

Definition at line 74 of file CDCRecoHit3D.cc.

76{
77 Vector3D recoPos3D = rlWireHit.reconstruct3D(trajectory2D);
78 double arcLength2D = trajectory2D.calcArcLength2D(recoPos3D.xy());
79 return CDCRecoHit3D(rlWireHit, recoPos3D, arcLength2D);
80}
Vector3D reconstruct3D(const CDCTrajectory2D &trajectory2D, double z=0) const
Attempts to reconstruct a three dimensional position (especially of stereo hits).

◆ reconstruct() [5/5]

CDCRecoHit3D reconstruct ( const CDCWireHit wireHit,
ERightLeft  rlInfo,
const CDCTrajectory2D trajectory2D 
)
static

Reconstructs the three dimensional hit from the wire hit and the given right left passage information by shifting it to a z coordinate, where it touches the two dimensional trajectory from the side indicated by the right left passage.

Definition at line 64 of file CDCRecoHit3D.cc.

67{
68 Vector3D recoPos3D = wireHit->reconstruct3D(trajectory2D, rlInfo);
69 double arcLength2D = trajectory2D.calcArcLength2D(recoPos3D.xy());
70 CDCRLWireHit rlWireHit(wireHit, rlInfo);
71 return CDCRecoHit3D(rlWireHit, recoPos3D, arcLength2D);
72}
Class representing an oriented hit wire including a hypotheses whether the causing track passes left ...
Definition: CDCRLWireHit.h:41

◆ reconstructNearest()

CDCRecoHit3D reconstructNearest ( const CDCWireHit axialWireHit,
const CDCTrajectory2D trajectory2D 
)
static

Reconstruct a three dimensional hit from a wire hit (as in reconstruct(rlWireHit, trajectory2D)), but this time use a wire hit without a right-left information as an input.

The right-left information is chosen to be consistent with the reference position of the wire and the trajectory passed in to that function (by checking the sign of trackTrajectory2D.getDist2D(wireHit.getRefPos2D())).

This function is only sensible for axial hits (and asserts this).

Definition at line 130 of file CDCRecoHit3D.cc.

132{
133 B2ASSERT("This function can only be used with axial hits.", axialWireHit->isAxial());
134 ERightLeft rlInfo = trajectory2D.isRightOrLeft(axialWireHit->getRefPos2D());
135 CDCRLWireHit rlWireHit(axialWireHit, rlInfo);
136 return CDCRecoHit3D::reconstruct(rlWireHit, trajectory2D);
137}
ERightLeft isRightOrLeft(const Vector2D &point) const
Checks if the given point is to the right or to the left of the trajectory.
ERightLeft
Enumeration to represent the distinct possibilities of the right left passage.
Definition: ERightLeft.h:25

◆ reverse()

void reverse ( )

Turns the orientation in place.

Changes the sign of the right left passage information, since the position remains the same by this reversion.

Definition at line 162 of file CDCRecoHit3D.cc.

163{
165}
void reverse()
Switches the right left passage to its opposite in place.
Definition: CDCRLWireHit.h:98

◆ reversed()

CDCRecoHit3D reversed ( ) const

Returns the recohit with the opposite right left information.

Definition at line 167 of file CDCRecoHit3D.cc.

168{
170}
double getArcLength2D() const
Getter for the travel distance in the xy projection.
Definition: CDCRecoHit3D.h:370
CDCRecoHit3D reversed() const
Returns the recohit with the opposite right left information.

◆ setArcLength2D()

void setArcLength2D ( const double  arcLength2D)
inline

Setter for the travel distance in the xy projection.

Definition at line 376 of file CDCRecoHit3D.h.

377 {
378 m_arcLength2D = arcLength2D;
379 }

◆ setRecoDriftLength()

void setRecoDriftLength ( double  driftLength,
bool  snapRecoPos 
)

Setter to update the drift length of the hit.

Definition at line 187 of file CDCRecoHit3D.cc.

188{
189 double oldDriftLength = m_rlWireHit.getRefDriftLength();
190 m_rlWireHit.setRefDriftLength(driftLength);
191 if (snapRecoPos) {
192 bool switchSide = sign(oldDriftLength) != sign(driftLength);
193 snapToDriftCircle(switchSide);
194 }
195}
double getRefDriftLength() const
Getter for the drift length at the reference position of the wire.
Definition: CDCRLWireHit.h:204
void setRefDriftLength(double driftLength)
Setter for the drift length at the reference position of the wire.
Definition: CDCRLWireHit.h:210
void snapToDriftCircle(bool switchSide=false)
Scales the displacement vector in place to lie on the drift circle.

◆ setRecoPos3D()

void setRecoPos3D ( const Vector3D recoPos3D)
inline

Setter for the 3d position of the hit.

Definition at line 291 of file CDCRecoHit3D.h.

292 {
293 m_recoPos3D = recoPos3D;
294 }

◆ setRLInfo()

void setRLInfo ( ERightLeft  rlInfo)
inline

Setter the right left passage information.

Definition at line 273 of file CDCRecoHit3D.h.

274 {
275 m_rlWireHit.setRLInfo(rlInfo);
276 }
void setRLInfo(const ERightLeft rlInfo)
Setter for the right left passage information.
Definition: CDCRLWireHit.h:240

◆ setRLWireHit()

void setRLWireHit ( const CDCRLWireHit rlWireHit)
inline

Setter for the oriented wire hit associated with the reconstructed hit.

Definition at line 256 of file CDCRecoHit3D.h.

257 {
258 m_rlWireHit = rlWireHit;
259 }

◆ shiftArcLength2D()

void shiftArcLength2D ( double  arcLength2DOffSet)
inline

Adjust the travel distance by the given value.

Definition at line 364 of file CDCRecoHit3D.h.

365 {
366 m_arcLength2D += arcLength2DOffSet;
367 }

◆ snapToDriftCircle()

void snapToDriftCircle ( bool  switchSide = false)

Scales the displacement vector in place to lie on the drift circle.

Definition at line 172 of file CDCRecoHit3D.cc.

173{
174 const CDCWire& wire = getWire();
175 const double recoPosZ = getRecoPos3D().z();
176
177 Vector2D wirePos = wire.getWirePos2DAtZ(recoPosZ);
178 Vector2D disp2D = getRecoPos3D().xy() - wirePos;
179
181 if (switchSide) {
182 disp2D = -disp2D;
183 }
184 m_recoPos3D = Vector3D(wirePos + disp2D, recoPosZ);
185}
double getSignedRecoDriftLength() const
Returns the drift length next to the reconstructed position.
Definition: CDCRecoHit3D.h:346
double normalizeTo(const double toLength)
Normalizes the vector to the given length.
Definition: Vector2D.h:313

◆ stereoProjectToRef()

CDCRecoHit2D stereoProjectToRef ( ) const

Constructs a two dimensional reconstructed hit by carrying out the stereo ! projection to the wire reference position.

Definition at line 202 of file CDCRecoHit3D.cc.

203{
204 return getRecoHit2D();
205}
CDCRecoHit2D getRecoHit2D() const
Constructs a two dimensional reconstructed hit by carrying out the stereo ! projection to the wire re...

Friends And Related Function Documentation

◆ operator< [1/4]

bool operator< ( const CDCRecoHit3D recoHit3D,
const CDCWire wire 
)
friend

Defines wires and the three dimensional reconstructed hits as coaligned.

Definition at line 184 of file CDCRecoHit3D.h.

185 {
186 return recoHit3D.getRLWireHit() < wire;
187 }

◆ operator< [2/4]

bool operator< ( const CDCRecoHit3D recoHit3D,
const CDCWireHit wireHit 
)
friend

Defines wire hits and the three dimensional reconstructed hits as coaligned.

Definition at line 196 of file CDCRecoHit3D.h.

197 {
198 return recoHit3D.getRLWireHit() < wireHit;
199 }

◆ operator< [3/4]

bool operator< ( const CDCWire wire,
const CDCRecoHit3D recoHit3D 
)
friend

Defines wires and the three dimensional reconstructed hits as coaligned.

Definition at line 190 of file CDCRecoHit3D.h.

191 {
192 return wire < recoHit3D.getRLWireHit();
193 }

◆ operator< [4/4]

bool operator< ( const CDCWireHit wireHit,
const CDCRecoHit3D recoHit3D 
)
friend

Defines wire hits and the three dimensional reconstructed hits as coaligned.

Definition at line 202 of file CDCRecoHit3D.h.

203 {
204 return wireHit < recoHit3D.getRLWireHit();
205 }

Member Data Documentation

◆ m_arcLength2D

double m_arcLength2D = 0
private

Memory for the travel distance as see in the xy projection.

Definition at line 395 of file CDCRecoHit3D.h.

◆ m_recoPos3D

Vector3D m_recoPos3D
private

Memory for the reconstructed hit position.

Definition at line 392 of file CDCRecoHit3D.h.

◆ m_rlWireHit

CDCRLWireHit m_rlWireHit
private

Memory for the oriented wire hit reference.

Definition at line 389 of file CDCRecoHit3D.h.


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