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 ROOT::Math::XYZVector &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 ROOT::Math::XYZVector & getRecoPos3D () const
 Getter for the 3d position of the hit.
 
void setRecoPos3D (const ROOT::Math::XYZVector &recoPos3D)
 Setter for the 3d position of the hit.
 
const ROOT::Math::XYVector getRecoPos2D () const
 Getter for the 2d position of the hit.
 
double getRecoZ () const
 Getter for the z coordinate of the reconstructed position.
 
ROOT::Math::XYVector getRecoDisp2D () const
 Gets the displacement from the wire position in the xy plain at the reconstructed position.
 
ROOT::Math::XYVector 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 !
 
ROOT::Math::XYVector 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.
 
ROOT::Math::XYZVector 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 59 of file CDCRecoHit3D.h.

Constructor & Destructor Documentation

◆ CDCRecoHit3D()

CDCRecoHit3D ( const CDCRLWireHit & rlWireHit,
const ROOT::Math::XYZVector & 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.
ROOT::Math::XYZVector m_recoPos3D
Memory for the reconstructed hit position.
CDCRLWireHit m_rlWireHit
Memory for the oriented wire hit reference.

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 VectorUtil::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 ROOT::Math::XYZVector{simHit.getPosTrack()},
53 arcLength2D);
54}
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.

◆ getAlpha()

double getAlpha ( ) const
inline

Getter for the direction of flight relative to the position.

Definition at line 328 of file CDCRecoHit3D.h.

329 {
330 return ROOT::Math::VectorUtil::DeltaPhi(getRecoPos2D(), getFlightDirection2D());
331 }

◆ getArcLength2D()

double getArcLength2D ( ) const
inline

Getter for the travel distance in the xy projection.

Definition at line 379 of file CDCRecoHit3D.h.

380 {
381 return m_arcLength2D;
382 }

◆ getFlightDirection2D()

ROOT::Math::XYVector getFlightDirection2D ( ) const
inline

Getter for the direction of flight.

Definition at line 321 of file CDCRecoHit3D.h.

322 {
323 ERotation rotation = static_cast<ERotation>(-getRLInfo());
324 return VectorUtil::Orthogonal(getRecoDisp2D(), rotation);
325 }
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 227 of file CDCRecoHit3D.h.

228 {
229 return getRLWireHit().getISuperLayer();
230 }

◆ getRecoDisp2D()

ROOT::Math::XYVector 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 ROOT::Math::XYVector wirePos = wire.getWirePos2DAtZ(recoPosZ);
158 ROOT::Math::XYVector disp2D = VectorUtil::getXYVector(getRecoPos3D()) - wirePos;
159 return disp2D;
160}
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 ROOT::Math::XYZVector & getRecoPos3D() const
Getter for the 3d position of the hit.
const CDC::CDCWire & getWire() const
Getter for the wire.

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

368 {
369 return getRLWireHit().getRefDriftLengthVariance();
370 }

◆ getRecoHit2D()

CDCRecoHit2D getRecoHit2D ( ) const

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

projection to the wire reference position.

Definition at line 200 of file CDCRecoHit3D.cc.

201{
202 return CDCRecoHit2D(m_rlWireHit, getRecoDisp2D());
203}
ROOT::Math::XYVector getRecoDisp2D() const
Gets the displacement from the wire position in the xy plain at the reconstructed position.

◆ getRecoPos2D()

const ROOT::Math::XYVector getRecoPos2D ( ) const
inline

Getter for the 2d position of the hit.

This used to return a reference, but that's not possible when creating the vector on the fly after moving to ROOT::Math::Vector(2/3)D

Definition at line 306 of file CDCRecoHit3D.h.

307 {
308 return VectorUtil::getXYVector(getRecoPos3D());
309 }

◆ getRecoPos3D()

const ROOT::Math::XYZVector & getRecoPos3D ( ) const
inline

Getter for the 3d position of the hit.

Definition at line 292 of file CDCRecoHit3D.h.

293 {
294 return m_recoPos3D;
295 }

◆ getRecoWirePos2D()

ROOT::Math::XYVector getRecoWirePos2D ( ) const

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

Definition at line 210 of file CDCRecoHit3D.cc.

211{
212 return getWire().getWirePos2DAtZ(getRecoZ());
213}
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 312 of file CDCRecoHit3D.h.

313 {
314 return getRecoPos3D().z();
315 }

◆ getRefPos2D()

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

Getter for the reference position of the wire.

Definition at line 286 of file CDCRecoHit3D.h.

287 {
288 return getRLWireHit().getRefPos2D();
289 }

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

275 {
276 return getRLWireHit().getRLInfo();
277 }

◆ getRLWireHit()

const CDCRLWireHit & getRLWireHit ( ) const
inline

Getter for the oriented wire hit.

Definition at line 257 of file CDCRecoHit3D.h.

258 {
259 return m_rlWireHit;
260 }

◆ getSignedRecoDriftLength()

double getSignedRecoDriftLength ( ) const
inline

Returns the drift length next to the reconstructed position.

Dummy implemented as the reference drift length.

Definition at line 355 of file CDCRecoHit3D.h.

356 {
357 return getRLWireHit().getSignedRefDriftLength();
358 }

◆ getStereoKind()

CDC::EStereoKind getStereoKind ( ) const
inline

Getter for the stereo type of the underlying wire.

Definition at line 215 of file CDCRecoHit3D.h.

216 {
217 return getRLWireHit().getStereoKind();
218 }

◆ getWire()

const CDC::CDCWire & getWire ( ) const
inline

Getter for the wire.

Definition at line 233 of file CDCRecoHit3D.h.

234 {
235 return getRLWireHit().getWire();
236 }

◆ getWireHit()

const CDCWireHit & getWireHit ( ) const
inline

Getter for the wire hit.

Definition at line 245 of file CDCRecoHit3D.h.

246 {
247 return getRLWireHit().getWireHit();
248 }

◆ hasWireHit()

bool hasWireHit ( const CDCWireHit & wireHit) const
inline

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

Definition at line 251 of file CDCRecoHit3D.h.

252 {
253 return getRLWireHit().hasWireHit(wireHit);
254 }

◆ isAxial()

bool isAxial ( ) const
inline

Indicator if the underlying wire is axial.

Definition at line 221 of file CDCRecoHit3D.h.

222 {
223 return getRLWireHit().isAxial();
224 }

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

216{
217 return getWire().isInCellZBounds(getRecoPos3D(), factor);
218}
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 239 of file CDCRecoHit3D.h.

240 {
241 return getRLWireHit().isOnWire(wire);
242 }

◆ operator const Belle2::CDCHit *()

operator const Belle2::CDCHit * ( ) const
inline

Make the wire hit automatically castable to its underlying cdcHit.

Definition at line 166 of file CDCRecoHit3D.h.

167 {
168 return static_cast<const CDCHit*>(getRLWireHit());
169 }

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

184 {
185 return (getRLWireHit() < other.getRLWireHit() or
186 (getRLWireHit() == other.getRLWireHit() and
187 VectorUtil::smaller(getRecoPos3D(), other.getRecoPos3D())));
188 }

◆ operator==()

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

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

Definition at line 172 of file CDCRecoHit3D.h.

173 {
174 return getRLWireHit() == other.getRLWireHit() and
175 getRLInfo() == other.getRLInfo() and
176 getRecoPos3D() == other.getRecoPos3D();
177 }

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

58{
59 ROOT::Math::XYZVector recoPos3D = recoHit2D.reconstruct3D(trajectory2D);
60 double arcLength2D = trajectory2D.calcArcLength2D(VectorUtil::getXYVector(recoPos3D));
61 return CDCRecoHit3D(recoHit2D.getRLWireHit(), recoPos3D, arcLength2D);
62}
const CDCRLWireHit & getRLWireHit() const
Getter for the oriented wire hit associated with the reconstructed hit.
ROOT::Math::XYZVector 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 ROOT::Math::XYVector &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 ROOT::Math::XYZVector recoPos3D = recoHit2D.reconstruct3D(trajectory2D);
107 arcLength2D = trajectory2D.calcArcLength2D(VectorUtil::getXYVector(recoPos3D));
108
109 } else { /* if (stereoKind == EStereoKind::c_Axial)*/
110 ROOT::Math::XYVector 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 ROOT::Math::XYVector recoWirePos2D = wire.getWirePos2DAtZ(z);
120 const ROOT::Math::XYVector correctedRecoPos2D = trajectory2D.getClosest(recoWirePos2D);
121 const double correctedPerpS = trajectory2D.calcArcLength2D(correctedRecoPos2D);
122 const double correctedZ = trajectorySZ.mapSToZ(correctedPerpS);
123 const ROOT::Math::XYZVector correctedRecoPos3D(correctedRecoPos2D.X(), correctedRecoPos2D.Y(), correctedZ);
124
125 CDCRecoHit3D result(recoHit2D.getRLWireHit(), correctedRecoPos3D, correctedPerpS);
126 result.snapToDriftCircle();
127 return result;
128}
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.
CDC::EStereoKind getStereoKind() const
Getter for the stereo type of the underlying wire.
ROOT::Math::XYVector getClosest(const ROOT::Math::XYVector &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 74 of file CDCRecoHit3D.cc.

76{
77 ROOT::Math::XYZVector recoPos3D = rlWireHit.reconstruct3D(trajectory2D);
78 double arcLength2D = trajectory2D.calcArcLength2D(VectorUtil::getXYVector(recoPos3D));
79 return CDCRecoHit3D(rlWireHit, recoPos3D, arcLength2D);
80}
ROOT::Math::XYZVector 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 ROOT::Math::XYZVector recoPos3D = wireHit->reconstruct3D(trajectory2D, rlInfo);
69 double arcLength2D = trajectory2D.calcArcLength2D(VectorUtil::getXYVector(recoPos3D));
70 CDCRLWireHit rlWireHit(wireHit, rlInfo);
71 return CDCRecoHit3D(rlWireHit, recoPos3D, arcLength2D);
72}

◆ 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 ROOT::Math::XYVector &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{
164 m_rlWireHit.reverse();
165}

◆ reversed()

CDCRecoHit3D reversed ( ) const

Returns the recohit with the opposite right left information.

Definition at line 167 of file CDCRecoHit3D.cc.

168{
170}
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 385 of file CDCRecoHit3D.h.

386 {
387 m_arcLength2D = arcLength2D;
388 }

◆ setRecoDriftLength()

void setRecoDriftLength ( double driftLength,
bool snapRecoPos )

Setter to update the drift length of the hit.

Definition at line 190 of file CDCRecoHit3D.cc.

191{
192 double oldDriftLength = m_rlWireHit.getRefDriftLength();
193 m_rlWireHit.setRefDriftLength(driftLength);
194 if (snapRecoPos) {
195 bool switchSide = sign(oldDriftLength) != sign(driftLength);
196 snapToDriftCircle(switchSide);
197 }
198}
void snapToDriftCircle(bool switchSide=false)
Scales the displacement vector in place to lie on the drift circle.

◆ setRecoPos3D()

void setRecoPos3D ( const ROOT::Math::XYZVector & recoPos3D)
inline

Setter for the 3d position of the hit.

Definition at line 298 of file CDCRecoHit3D.h.

299 {
300 m_recoPos3D = recoPos3D;
301 }

◆ setRLInfo()

void setRLInfo ( ERightLeft rlInfo)
inline

Setter the right left passage information.

Definition at line 280 of file CDCRecoHit3D.h.

281 {
282 m_rlWireHit.setRLInfo(rlInfo);
283 }

◆ setRLWireHit()

void setRLWireHit ( const CDCRLWireHit & rlWireHit)
inline

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

Definition at line 263 of file CDCRecoHit3D.h.

264 {
265 m_rlWireHit = rlWireHit;
266 }

◆ shiftArcLength2D()

void shiftArcLength2D ( double arcLength2DOffSet)
inline

Adjust the travel distance by the given value.

Definition at line 373 of file CDCRecoHit3D.h.

374 {
375 m_arcLength2D += arcLength2DOffSet;
376 }

◆ 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 ROOT::Math::XYVector wirePos = wire.getWirePos2DAtZ(recoPosZ);
178 ROOT::Math::XYVector disp2D = VectorUtil::getXYVector(getRecoPos3D()) - wirePos;
179
180 if (disp2D.R() != 0.0) {
181 disp2D *= (std::fabs(getSignedRecoDriftLength()) / disp2D.R());
182 }
183 if (switchSide) {
184 disp2D = -disp2D;
185 }
186 const auto& tmp = wirePos + disp2D;
187 m_recoPos3D = ROOT::Math::XYZVector(tmp.X(), tmp.Y(), recoPosZ);
188}
double getSignedRecoDriftLength() const
Returns the drift length next to the reconstructed position.

◆ stereoProjectToRef()

CDCRecoHit2D stereoProjectToRef ( ) const

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

projection to the wire reference position.

Definition at line 205 of file CDCRecoHit3D.cc.

206{
207 return getRecoHit2D();
208}
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 197 of file CDCRecoHit3D.h.

198 {
199 return wire < recoHit3D.getRLWireHit();
200 }

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

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

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

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

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

210 {
211 return wireHit < recoHit3D.getRLWireHit();
212 }

Member Data Documentation

◆ m_arcLength2D

double m_arcLength2D = 0
private

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

Definition at line 404 of file CDCRecoHit3D.h.

◆ m_recoPos3D

ROOT::Math::XYZVector m_recoPos3D
private

Memory for the reconstructed hit position.

Definition at line 401 of file CDCRecoHit3D.h.

◆ m_rlWireHit

CDCRLWireHit m_rlWireHit
private

Memory for the oriented wire hit reference.

Definition at line 398 of file CDCRecoHit3D.h.


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