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.
 
CDC::EStereoKind getStereoKind () const
 Getter for the stereo type of the underlying wire.
 
bool isAxial () const
 Indicator if the underlying wire is axial.
 
CDC::ISuperLayer getISuperLayer () const
 Getter for the superlayer id.
 
const CDC::CDCWiregetWire () const
 Getter for the wire.
 
bool isOnWire (const CDC::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 ROOT::Math::XYVector & getRefPos2D () 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 !
 
CDCRecoHit2D stereoProjectToRef () const
 Constructs a two dimensional reconstructed hit by carrying out the stereo !
 
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 CDC::CDCWire &wire)
 Defines wires and the three dimensional reconstructed hits as coaligned.
 
bool operator< (const CDC::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 55 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 38 of file CDCRecoHit3D.cc.

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

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 140 of file CDCRecoHit3D.cc.

141{
142 if (first.getRLWireHit() == second.getRLWireHit()) {
143 return CDCRecoHit3D(first.getRLWireHit(),
144 Vector3D::average(first.getRecoPos3D(), second.getRecoPos3D()),
145 (first.getArcLength2D() + second.getArcLength2D()) / 2);
146 } else {
147 B2ERROR("Averaging three dimensional hits which are on different oriented wire hits. Return "
148 "first one unchanged");
149 return first;
150 }
151}
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 47 of file CDCRecoHit3D.cc.

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

◆ getAlpha()

double getAlpha ( ) const
inline

Getter for the direction of flight relative to the position.

Definition at line 322 of file CDCRecoHit3D.h.

323 {
324 return getRecoPos2D().angleWith(getFlightDirection2D());
325 }

◆ getArcLength2D()

double getArcLength2D ( ) const
inline

Getter for the travel distance in the xy projection.

Definition at line 373 of file CDCRecoHit3D.h.

374 {
375 return m_arcLength2D;
376 }

◆ getFlightDirection2D()

Vector2D getFlightDirection2D ( ) const
inline

Getter for the direction of flight.

Definition at line 315 of file CDCRecoHit3D.h.

316 {
317 ERotation rotation = static_cast<ERotation>(-getRLInfo());
318 return getRecoDisp2D().orthogonal(rotation);
319 }
ERotation
Enumeration to represent the distinct possibilities of the right left passage information.
Definition ERotation.h:25

◆ getISuperLayer()

CDC::ISuperLayer getISuperLayer ( ) const
inline

Getter for the superlayer id.

Definition at line 223 of file CDCRecoHit3D.h.

224 {
225 return getRLWireHit().getISuperLayer();
226 }

◆ getRecoDisp2D()

Vector2D getRecoDisp2D ( ) const

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

Definition at line 153 of file CDCRecoHit3D.cc.

154{
155 const CDCWire& wire = getWire();
156 const double recoPosZ = getRecoPos3D().z();
157
158 Vector2D wirePos = wire.getWirePos2DAtZ(recoPosZ);
159 Vector2D disp2D = getRecoPos3D().xy() - wirePos;
160 return disp2D;
161}
ROOT::Math::XYVector getWirePos2DAtZ(const double z) const
Gives the xy projected position of the wire at the given z coordinate.
Definition CDCWire.h:184
const Vector3D & getRecoPos3D() const
Getter for the 3d position of the hit.
const CDC::CDCWire & getWire() const
Getter for the wire.
const Vector2D & xy() const
Getter for the xy projected vector ( reference ! )
Definition Vector3D.h:511
double z() const
Getter for the z coordinate.
Definition Vector3D.h:499

◆ 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 361 of file CDCRecoHit3D.h.

362 {
363 return getRLWireHit().getRefDriftLengthVariance();
364 }

◆ getRecoHit2D()

CDCRecoHit2D getRecoHit2D ( ) const

Constructs a two dimensional reconstructed hit by carrying out the stereo !

projection to the wire reference position.

Definition at line 198 of file CDCRecoHit3D.cc.

199{
200 return CDCRecoHit2D(m_rlWireHit, getRecoDisp2D());
201}
Vector2D getRecoDisp2D() const
Gets the displacement from the wire position in the xy plain at the reconstructed position.

◆ getRecoPos2D()

const Vector2D & getRecoPos2D ( ) const
inline

Getter for the 2d position of the hit.

Definition at line 300 of file CDCRecoHit3D.h.

301 {
302 return getRecoPos3D().xy();
303 }

◆ getRecoPos3D()

const Vector3D & getRecoPos3D ( ) const
inline

Getter for the 3d position of the hit.

Definition at line 288 of file CDCRecoHit3D.h.

289 {
290 return m_recoPos3D;
291 }

◆ getRecoWirePos2D()

Vector2D getRecoWirePos2D ( ) const

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

Definition at line 208 of file CDCRecoHit3D.cc.

209{
210 return getWire().getWirePos2DAtZ(getRecoZ());
211}
double getRecoZ() const
Getter for the z coordinate of the reconstructed position.

◆ getRecoZ()

double getRecoZ ( ) const
inline

Getter for the z coordinate of the reconstructed position.

Definition at line 306 of file CDCRecoHit3D.h.

307 {
308 return getRecoPos3D().z();
309 }

◆ getRefPos2D()

const ROOT::Math::XYVector & getRefPos2D ( ) const
inline

Getter for the reference position of the wire.

Definition at line 282 of file CDCRecoHit3D.h.

283 {
284 return getRLWireHit().getRefPos2D();
285 }

◆ 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 270 of file CDCRecoHit3D.h.

271 {
272 return getRLWireHit().getRLInfo();
273 }

◆ getRLWireHit()

const CDCRLWireHit & getRLWireHit ( ) const
inline

Getter for the oriented wire hit.

Definition at line 253 of file CDCRecoHit3D.h.

254 {
255 return m_rlWireHit;
256 }

◆ getSignedRecoDriftLength()

double getSignedRecoDriftLength ( ) const
inline

Returns the drift length next to the reconstructed position.

Dummy implemented as the reference drift length.

Definition at line 349 of file CDCRecoHit3D.h.

350 {
351 return getRLWireHit().getSignedRefDriftLength();
352 }

◆ getStereoKind()

CDC::EStereoKind getStereoKind ( ) const
inline

Getter for the stereo type of the underlying wire.

Definition at line 211 of file CDCRecoHit3D.h.

212 {
213 return getRLWireHit().getStereoKind();
214 }

◆ getWire()

const CDC::CDCWire & getWire ( ) const
inline

Getter for the wire.

Definition at line 229 of file CDCRecoHit3D.h.

230 {
231 return getRLWireHit().getWire();
232 }

◆ getWireHit()

const CDCWireHit & getWireHit ( ) const
inline

Getter for the wire hit.

Definition at line 241 of file CDCRecoHit3D.h.

242 {
243 return getRLWireHit().getWireHit();
244 }

◆ hasWireHit()

bool hasWireHit ( const CDCWireHit & wireHit) const
inline

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

Definition at line 247 of file CDCRecoHit3D.h.

248 {
249 return getRLWireHit().hasWireHit(wireHit);
250 }

◆ isAxial()

bool isAxial ( ) const
inline

Indicator if the underlying wire is axial.

Definition at line 217 of file CDCRecoHit3D.h.

218 {
219 return getRLWireHit().isAxial();
220 }

◆ 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 213 of file CDCRecoHit3D.cc.

214{
215 return getWire().isInCellZBounds(getRecoPos3D(), factor);
216}
bool isInCellZBounds(const ROOT::Math::XYZVector &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:287

◆ isOnWire()

bool isOnWire ( const CDC::CDCWire & wire) const
inline

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

Definition at line 235 of file CDCRecoHit3D.h.

236 {
237 return getRLWireHit().isOnWire(wire);
238 }

◆ operator const Belle2::CDCHit *()

operator const Belle2::CDCHit * ( ) const
inline

Make the wire hit automatically castable to its underlying cdcHit.

Definition at line 162 of file CDCRecoHit3D.h.

163 {
164 return static_cast<const CDCHit*>(getRLWireHit());
165 }

◆ 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 179 of file CDCRecoHit3D.h.

180 {
181 return (getRLWireHit() < other.getRLWireHit() or
182 (getRLWireHit() == other.getRLWireHit() and
183 getRecoPos3D() < other.getRecoPos3D()));
184 }

◆ operator==()

bool operator== ( const CDCRecoHit3D & other) const
inline

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

Definition at line 168 of file CDCRecoHit3D.h.

169 {
170 return getRLWireHit() == other.getRLWireHit() and
171 getRLInfo() == other.getRLInfo() and
172 getRecoPos3D() == other.getRecoPos3D();
173 }

◆ 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 83 of file CDCRecoHit3D.cc.

85{
86 // This this is quite legacy behaviour - do something smarter.
87 CDCTrajectory2D trajectory2D = trajectory3D.getTrajectory2D();
88 CDCTrajectorySZ trajectorySZ = trajectory3D.getTrajectorySZ();
89
90 return reconstruct(recoHit, trajectory2D, trajectorySZ);
91}
static CDCRecoHit3D reconstruct(const CDCRecoHit2D &recoHit2D, const CDCTrajectory2D &trajectory2D)
Reconstructs the three dimensional hit from the two dimensional and the two dimensional trajectory.
CDCTrajectory2D getTrajectory2D() const
Getter for the two dimensional trajectory.
CDCTrajectorySZ getTrajectorySZ() const
Getter for the sz trajectory.

◆ 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 57 of file CDCRecoHit3D.cc.

59{
60 Vector3D recoPos3D = recoHit2D.reconstruct3D(trajectory2D);
61 double arcLength2D = trajectory2D.calcArcLength2D(recoPos3D.xy());
62 return CDCRecoHit3D(recoHit2D.getRLWireHit(), recoPos3D, arcLength2D);
63}
const CDCRLWireHit & getRLWireHit() const
Getter for the oriented wire hit associated with the reconstructed hit.
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 93 of file CDCRecoHit3D.cc.

96{
97 EStereoKind stereoKind = recoHit2D.getStereoKind();
98
99 double arcLength2D = 0;
100 if (stereoKind == EStereoKind::c_StereoU or stereoKind == EStereoKind::c_StereoV) {
101 //the closest approach of a wire line to a helix
102 //( in this case represented by the two trajectories )
103 //can not be solved as a closed expression
104 //in the common case the z fit has been derived from the reconstructed points generated
105 //with the reconstruct method above in the other reconstruct method.
106 //sticking to that method but using the average z from the sz fit
107 Vector3D recoPos3D = recoHit2D.reconstruct3D(trajectory2D);
108 arcLength2D = trajectory2D.calcArcLength2D(recoPos3D.xy());
109
110 } else { /* if (stereoKind == EStereoKind::c_Axial)*/
111 Vector2D recoPos2D = trajectory2D.getClosest(recoHit2D.getRecoPos2D());
112 arcLength2D = trajectory2D.calcArcLength2D(recoPos2D);
113
114 }
115
116 const double z = trajectorySZ.mapSToZ(arcLength2D);
117
118 // Reevaluating the z position eventually accounts for wire sag.
119 const CDCWire& wire = recoHit2D.getWire();
120 const Vector2D recoWirePos2D = wire.getWirePos2DAtZ(z);
121 const Vector2D correctedRecoPos2D = trajectory2D.getClosest(recoWirePos2D);
122 const double correctedPerpS = trajectory2D.calcArcLength2D(correctedRecoPos2D);
123 const double correctedZ = trajectorySZ.mapSToZ(correctedPerpS);
124 const Vector3D correctedRecoPos3D(correctedRecoPos2D, correctedZ);
125
126 CDCRecoHit3D result(recoHit2D.getRLWireHit(), correctedRecoPos3D, correctedPerpS);
127 result.snapToDriftCircle();
128 return result;
129}
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.
CDC::EStereoKind getStereoKind() const
Getter for the stereo type of the underlying wire.
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.
EStereoKind
Type for the stereo property of the wire.
Definition EStereoKind.h:20

◆ 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 75 of file CDCRecoHit3D.cc.

77{
78 Vector3D recoPos3D = rlWireHit.reconstruct3D(trajectory2D);
79 double arcLength2D = trajectory2D.calcArcLength2D(recoPos3D.xy());
80 return CDCRecoHit3D(rlWireHit, recoPos3D, arcLength2D);
81}
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 65 of file CDCRecoHit3D.cc.

68{
69 Vector3D recoPos3D = wireHit->reconstruct3D(trajectory2D, rlInfo);
70 double arcLength2D = trajectory2D.calcArcLength2D(recoPos3D.xy());
71 CDCRLWireHit rlWireHit(wireHit, rlInfo);
72 return CDCRecoHit3D(rlWireHit, recoPos3D, arcLength2D);
73}

◆ 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 131 of file CDCRecoHit3D.cc.

133{
134 B2ASSERT("This function can only be used with axial hits.", axialWireHit->isAxial());
135 ERightLeft rlInfo = trajectory2D.isRightOrLeft(axialWireHit->getRefPos2D());
136 CDCRLWireHit rlWireHit(axialWireHit, rlInfo);
137 return CDCRecoHit3D::reconstruct(rlWireHit, trajectory2D);
138}
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 163 of file CDCRecoHit3D.cc.

164{
165 m_rlWireHit.reverse();
166}

◆ reversed()

CDCRecoHit3D reversed ( ) const

Returns the recohit with the opposite right left information.

Definition at line 168 of file CDCRecoHit3D.cc.

169{
171}
const CDCRLWireHit & getRLWireHit() const
Getter for the oriented wire hit.
double getArcLength2D() const
Getter for the travel distance in the xy projection.
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 379 of file CDCRecoHit3D.h.

380 {
381 m_arcLength2D = arcLength2D;
382 }

◆ setRecoDriftLength()

void setRecoDriftLength ( double driftLength,
bool snapRecoPos )

Setter to update the drift length of the hit.

Definition at line 188 of file CDCRecoHit3D.cc.

189{
190 double oldDriftLength = m_rlWireHit.getRefDriftLength();
191 m_rlWireHit.setRefDriftLength(driftLength);
192 if (snapRecoPos) {
193 bool switchSide = sign(oldDriftLength) != sign(driftLength);
194 snapToDriftCircle(switchSide);
195 }
196}
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 294 of file CDCRecoHit3D.h.

295 {
296 m_recoPos3D = recoPos3D;
297 }

◆ setRLInfo()

void setRLInfo ( ERightLeft rlInfo)
inline

Setter the right left passage information.

Definition at line 276 of file CDCRecoHit3D.h.

277 {
278 m_rlWireHit.setRLInfo(rlInfo);
279 }

◆ setRLWireHit()

void setRLWireHit ( const CDCRLWireHit & rlWireHit)
inline

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

Definition at line 259 of file CDCRecoHit3D.h.

260 {
261 m_rlWireHit = rlWireHit;
262 }

◆ shiftArcLength2D()

void shiftArcLength2D ( double arcLength2DOffSet)
inline

Adjust the travel distance by the given value.

Definition at line 367 of file CDCRecoHit3D.h.

368 {
369 m_arcLength2D += arcLength2DOffSet;
370 }

◆ snapToDriftCircle()

void snapToDriftCircle ( bool switchSide = false)

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

Definition at line 173 of file CDCRecoHit3D.cc.

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

◆ stereoProjectToRef()

CDCRecoHit2D stereoProjectToRef ( ) const

Constructs a two dimensional reconstructed hit by carrying out the stereo !

projection to the wire reference position.

Definition at line 203 of file CDCRecoHit3D.cc.

204{
205 return getRecoHit2D();
206}
CDCRecoHit2D getRecoHit2D() const
Constructs a two dimensional reconstructed hit by carrying out the stereo !

Friends And Related Symbol Documentation

◆ operator< [1/4]

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

Defines wires and the three dimensional reconstructed hits as coaligned.

Definition at line 193 of file CDCRecoHit3D.h.

194 {
195 return wire < recoHit3D.getRLWireHit();
196 }

◆ operator< [2/4]

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

Defines wires and the three dimensional reconstructed hits as coaligned.

Definition at line 187 of file CDCRecoHit3D.h.

188 {
189 return recoHit3D.getRLWireHit() < wire;
190 }

◆ operator< [3/4]

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

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

Definition at line 199 of file CDCRecoHit3D.h.

200 {
201 return recoHit3D.getRLWireHit() < wireHit;
202 }

◆ 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 205 of file CDCRecoHit3D.h.

206 {
207 return wireHit < recoHit3D.getRLWireHit();
208 }

Member Data Documentation

◆ m_arcLength2D

double m_arcLength2D = 0
private

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

Definition at line 398 of file CDCRecoHit3D.h.

◆ m_recoPos3D

Vector3D m_recoPos3D
private

Memory for the reconstructed hit position.

Definition at line 395 of file CDCRecoHit3D.h.

◆ m_rlWireHit

CDCRLWireHit m_rlWireHit
private

Memory for the oriented wire hit reference.

Definition at line 392 of file CDCRecoHit3D.h.


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