Belle II Software development
CDCRecoHit2D Class Reference

Class representing a two dimensional reconstructed hit in the central drift chamber. More...

#include <CDCRecoHit2D.h>

Public Member Functions

 CDCRecoHit2D ()=default
 Default constructor for ROOT.
 
 CDCRecoHit2D (const CDCRLWireHit &rlWireHit, const Vector2D &recoDisp2D)
 Constructs a reconstructed hit based on the given oriented wire hit with the given displacement from the wire reference position.
 
 CDCRecoHit2D (const CDCRLWireHit &rlWireHit)
 Constructs a reconstructed hit based on the oriented wire hit with no displacement.
 
void reverse ()
 Turns the orientation in place.
 
CDCRecoHit2D reversed () const
 Returns the recohit with the opposite right left information.
 
CDCRecoHit2D getAlias () const
 Getter for the alias version of the reco hit.
 
 operator const Belle2::CDCHit * () const
 Make the wire hit automatically castable to its underlying cdcHit.
 
bool operator== (const CDCRecoHit2D &other) const
 Equality comparison based on the oriented wire hit and displacement.
 
bool operator< (const CDCRecoHit2D &other) const
 Total ordering relation based on wire hit, left right passage information and displacement 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 the reconstructed hit associated to.
 
const Vector2DgetRefPos2D () const
 Getter for the reference position of 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 associated with the reconstructed hit.
 
bool hasWireHit (const CDCWireHit &wireHit) const
 Checks if the reconstructed hit is associated with the give wire hit.
 
ERightLeft getRLInfo () const
 Getter for the right left passage information.
 
void setRLInfo (ERightLeft &rlInfo)
 Setter the right left passage information.
 
double getRefDriftLength () const
 Getter for the drift length at the wire reference position.
 
void setRefDriftLength (double driftLength, bool snapRecoPos)
 Setter for the drift length at the wire reference position.
 
double getSignedRefDriftLength () const
 Getter for the drift length at the wire reference position signed with the right left passage hypotheses.
 
double getRefDriftLengthVariance () const
 Getter for the uncertainty in the drift length at the wire reference position.
 
Vector2D getRecoPos2D () const
 Getter for the position in the reference plane.
 
void setRecoPos2D (const Vector2D &recoPos2D)
 Setter for the position in the reference plane.
 
const Vector2DgetRecoDisp2D () const
 Getter for the displacement from the wire reference position.
 
Vector2D getFlightDirection2D () const
 Getter for the direction of flight.
 
double getAlpha () const
 Getter for the direction of flight relative to the position.
 
void snapToDriftCircle (bool switchSide=false)
 Scales the displacement vector in place to lie on the drift circle.
 
Vector3D reconstruct3D (const CDCTrajectory2D &trajectory2D, const double z=0) const
 Reconstruct the three dimensional position (especially of stereo hits) by determining the z coordinate such that the reconstructed position lies on the given two dimensional trajectory as the reference reconstructed position is moved parallel to the stereo wire.
 
const CDCRLWireHitgetRLWireHit () const
 Getter for the oriented wire hit associated with the reconstructed hit.
 
void setRLWireHit (const CDCRLWireHit &rlWireHit)
 Setter for the oriented wire hit associated with the reconstructed hit.
 

Static Public Member Functions

static CDCRecoHit2D average (const CDCRecoHit2D &recoHit1, const CDCRecoHit2D &recoHit2)
 Constructs the average of two reconstructed hit positions and snaps it to the drift circle.
 
static CDCRecoHit2D average (const CDCRecoHit2D &recoHit1, const CDCRecoHit2D &recoHit2, const CDCRecoHit2D &recoHit3)
 Constructs the average of three reconstructed hit positions and snaps it to the drift circle.
 
static CDCRecoHit2D fromRecoPos2D (const CDCRLWireHit &rlWireHit, const Vector2D &recoPos2D, bool snap=true)
 Constructs a two dimensional reconstructed hit from an absolute position.
 
static CDCRecoHit2D fromSimHit (const CDCWireHit *wireHit, const CDCSimHit &simHit)
 Constructs a two dimensional reconstructed hit from a sim hit and the associated wirehit.
 

Private Attributes

CDCRLWireHit m_rlWireHit
 Memory for the reference to the associated wire hit.
 
Vector2D m_recoDisp2D
 Memory for the displacement of the associated wire reference position.
 

Friends

bool operator< (const CDCRecoHit2D &recoHit2D, const CDCWire &wire)
 Defines wires and the two dimensional reconstructed hits as coaligned.
 
bool operator< (const CDCWire &wire, const CDCRecoHit2D &recoHit2D)
 Defines wires and the two dimensional reconstructed hits as coaligned.
 
bool operator< (const CDCRecoHit2D &recoHit2D, const CDCWireHit &wireHit)
 Defines wire hits and the two dimensional reconstructed hits as coaligned.
 
bool operator< (const CDCWireHit &wireHit, const CDCRecoHit2D &recoHit2D)
 Defines wire hits and the two dimensional reconstructed hits as coaligned.
 

Detailed Description

Class representing a two dimensional reconstructed hit in the central drift chamber.

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 a displacement from the wire reference position associated with the hit. The displacement generally is as long as the drift length but must not.
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.

Definition at line 47 of file CDCRecoHit2D.h.

Constructor & Destructor Documentation

◆ CDCRecoHit2D() [1/2]

CDCRecoHit2D ( const CDCRLWireHit rlWireHit,
const Vector2D recoDisp2D 
)

Constructs a reconstructed hit based on the given oriented wire hit with the given displacement from the wire reference position.

Definition at line 29 of file CDCRecoHit2D.cc.

30 :
31 m_rlWireHit(rlWireHit),
32 m_recoDisp2D(recoDisp2D)
33{}
Vector2D m_recoDisp2D
Memory for the displacement of the associated wire reference position.
Definition: CDCRecoHit2D.h:297
CDCRLWireHit m_rlWireHit
Memory for the reference to the associated wire hit.
Definition: CDCRecoHit2D.h:294

◆ CDCRecoHit2D() [2/2]

CDCRecoHit2D ( const CDCRLWireHit rlWireHit)
explicit

Constructs a reconstructed hit based on the oriented wire hit with no displacement.

Definition at line 24 of file CDCRecoHit2D.cc.

24 :
25 m_rlWireHit(rlWireHit),
27{}
static Vector2D getLowest()
Getter for the lowest possible vector.
Definition: Vector2D.h:137

Member Function Documentation

◆ average() [1/2]

CDCRecoHit2D average ( const CDCRecoHit2D recoHit1,
const CDCRecoHit2D recoHit2 
)
static

Constructs the average of two reconstructed hit positions and snaps it to the drift circle.

Averages the hit positions first. But the result will not lie on the circle, so we scale the displacement to snap onto the drift circle again. The function averages only reconstructed hits associated with the same right left oriented wire hit.
If not all reconstructed hits are on the same wire hit, the first hit is used.

Definition at line 47 of file CDCRecoHit2D.cc.

49{
50 CDCRLWireHit rlWireHit =
52 recoHit2.getRLWireHit());
53
54 Vector2D displacement =
56 recoHit2.getRecoDisp2D());
57
58 CDCRecoHit2D result(rlWireHit, displacement);
59 result.snapToDriftCircle();
60
61 return result;
62}
Class representing an oriented hit wire including a hypotheses whether the causing track passes left ...
Definition: CDCRLWireHit.h:41
static CDCRLWireHit average(const CDCRLWireHit &rlWireHit1, const CDCRLWireHit &rlWireHit2)
Constructs the average of two wire hits with right left passage information.
Definition: CDCRLWireHit.cc:59
Class representing a two dimensional reconstructed hit in the central drift chamber.
Definition: CDCRecoHit2D.h:47
const CDCRLWireHit & getRLWireHit() const
Getter for the oriented wire hit associated with the reconstructed hit.
Definition: CDCRecoHit2D.h:281
const Vector2D & getRecoDisp2D() const
Getter for the displacement from the wire reference position.
Definition: CDCRecoHit2D.h:250
A two dimensional vector which is equipped with functions for correct handling of orientation relate...
Definition: Vector2D.h:32
static Vector2D average(const Vector2D &one, const Vector2D &two)
Constructs the average of two vectors.
Definition: Vector2D.h:84

◆ average() [2/2]

CDCRecoHit2D average ( const CDCRecoHit2D recoHit1,
const CDCRecoHit2D recoHit2,
const CDCRecoHit2D recoHit3 
)
static

Constructs the average of three reconstructed hit positions and snaps it to the drift circle.

Averages the hit positions first. But the result will not lie on the circle, so we scale the displacement to snap onto the drift circle again. The function averages only reconstructed hits associated with the same wire hit.
If not all reconstructed hits are on the same wire, the first hit is used.

Definition at line 64 of file CDCRecoHit2D.cc.

67{
68 CDCRLWireHit rlWireHit =
70 recoHit2.getRLWireHit(),
71 recoHit3.getRLWireHit());
72
73 Vector2D displacement =
75 recoHit2.getRecoDisp2D(),
76 recoHit3.getRecoDisp2D());
77
78 CDCRecoHit2D result(rlWireHit, displacement);
79 result.snapToDriftCircle();
80
81 return result;
82}

◆ fromRecoPos2D()

CDCRecoHit2D fromRecoPos2D ( const CDCRLWireHit rlWireHit,
const Vector2D recoPos2D,
bool  snap = true 
)
static

Constructs a two dimensional reconstructed hit from an absolute position.

Parameters
rlWireHitthe oriented wire hit the reconstructed hit is associated to
recoPos2Dthe absolute position of the wire
snapoptional indicator if the displacement shall be shrank to the drift circle (default true)

Definition at line 84 of file CDCRecoHit2D.cc.

87{
88 CDCRecoHit2D result(rlWireHit, recoPos2D - rlWireHit.getRefPos2D());
89 if (snap) result.snapToDriftCircle();
90 return result;
91}
const Vector2D & getRefPos2D() const
The two dimensional reference position of the underlying wire.

◆ fromSimHit()

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

Constructs a two 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 displacement from the wire, projects it to the reference plane and scales it onto the drift circle defined by the wire.

Definition at line 35 of file CDCRecoHit2D.cc.

37{
38 // find out if the wire is right or left of the track ( view in flight direction )
39 Vector3D trackPosToWire{simHit.getPosWire() - simHit.getPosTrack()};
40 CDCRecoHit2D recoHit2D(CDCRLWireHit::fromSimHit(wireHit, simHit),
41 Vector2D(-trackPosToWire.x(), -trackPosToWire.y()));
42
43 recoHit2D.snapToDriftCircle();
44 return recoHit2D;
45}
B2Vector3D getPosWire() const
The method to get position on wire.
Definition: CDCSimHit.h:199
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

◆ getAlias()

CDCRecoHit2D getAlias ( ) const

Getter for the alias version of the reco hit.

Definition at line 105 of file CDCRecoHit2D.cc.

106{
108}
CDCRecoHit2D()=default
Default constructor for ROOT.
CDCRecoHit2D getAlias() const
Getter for the alias version of the reco hit.

◆ getAlpha()

double getAlpha ( ) const
inline

Getter for the direction of flight relative to the position.

Definition at line 263 of file CDCRecoHit2D.h.

264 {
266 }
Vector2D getFlightDirection2D() const
Getter for the direction of flight.
Definition: CDCRecoHit2D.h:256
Vector2D getRecoPos2D() const
Getter for the position in the reference plane.
Definition: CDCRecoHit2D.h:238
double angleWith(const Vector2D &rhs) const
The angle between this and rhs.
Definition: Vector2D.h:197

◆ getFlightDirection2D()

Vector2D getFlightDirection2D ( ) const
inline

Getter for the direction of flight.

Definition at line 256 of file CDCRecoHit2D.h.

257 {
258 ERotation rotation = static_cast<ERotation>(-getRLInfo());
259 return getRecoDisp2D().orthogonal(rotation);
260 }
ERightLeft getRLInfo() const
Getter for the right left passage information.
Definition: CDCRecoHit2D.h:205
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 169 of file CDCRecoHit2D.h.

170 {
171 return getRLWireHit().getISuperLayer();
172 }
ISuperLayer getISuperLayer() const
Getter for the superlayer id.

◆ getRecoDisp2D()

const Vector2D & getRecoDisp2D ( ) const
inline

Getter for the displacement from the wire reference position.

Definition at line 250 of file CDCRecoHit2D.h.

251 {
252 return m_recoDisp2D;
253 }

◆ getRecoPos2D()

Vector2D getRecoPos2D ( ) const
inline

Getter for the position in the reference plane.

Definition at line 238 of file CDCRecoHit2D.h.

239 {
240 return getRecoDisp2D() + getRefPos2D();
241 }
const Vector2D & getRefPos2D() const
Getter for the reference position of the wire.
Definition: CDCRecoHit2D.h:181

◆ getRefDriftLength()

double getRefDriftLength ( ) const
inline

Getter for the drift length at the wire reference position.

Definition at line 217 of file CDCRecoHit2D.h.

218 {
220 }
double getRefDriftLength() const
Getter for the drift length at the reference position of the wire.
Definition: CDCRLWireHit.h:204

◆ getRefDriftLengthVariance()

double getRefDriftLengthVariance ( ) const
inline

Getter for the uncertainty in the drift length at the wire reference position.

Definition at line 232 of file CDCRecoHit2D.h.

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

◆ getRefPos2D()

const Vector2D & getRefPos2D ( ) const
inline

Getter for the reference position of the wire.

Definition at line 181 of file CDCRecoHit2D.h.

182 {
183 return getRLWireHit().getRefPos2D();
184 }

◆ getRLInfo()

ERightLeft getRLInfo ( ) const
inline

Getter for the right left passage information.

Definition at line 205 of file CDCRecoHit2D.h.

206 {
207 return getRLWireHit().getRLInfo();
208 }
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 associated with the reconstructed hit.

Definition at line 281 of file CDCRecoHit2D.h.

282 {
283 return m_rlWireHit;
284 }

◆ getSignedRefDriftLength()

double getSignedRefDriftLength ( ) const
inline

Getter for the drift length at the wire reference position signed with the right left passage hypotheses.

Definition at line 226 of file CDCRecoHit2D.h.

227 {
229 }
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 157 of file CDCRecoHit2D.h.

158 {
159 return getRLWireHit().getStereoKind();
160 }
EStereoKind getStereoKind() const
Getter for the stereo type of the underlying wire.

◆ getWire()

const CDCWire & getWire ( ) const
inline

Getter for the wire the reconstructed hit associated to.

Definition at line 175 of file CDCRecoHit2D.h.

176 {
177 return getRLWireHit().getWire();
178 }
const CDCWire & getWire() const
Getter for the wire the oriented hit associated to.

◆ getWireHit()

const CDCWireHit & getWireHit ( ) const
inline

Getter for the wire hit associated with the reconstructed hit.

Definition at line 193 of file CDCRecoHit2D.h.

194 {
195 return getRLWireHit().getWireHit();
196 }
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 199 of file CDCRecoHit2D.h.

200 {
201 return getRLWireHit().hasWireHit(wireHit);
202 }
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 163 of file CDCRecoHit2D.h.

164 {
165 return getRLWireHit().isAxial();
166 }
bool isAxial() const
Indicator if the underlying wire is axial.

◆ isOnWire()

bool isOnWire ( const CDCWire wire) const
inline

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

Definition at line 187 of file CDCRecoHit2D.h.

188 {
189 return getRLWireHit().isOnWire(wire);
190 }
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 118 of file CDCRecoHit2D.h.

119 { return static_cast<const CDCHit*>(getRLWireHit()); }

◆ operator<()

bool operator< ( const CDCRecoHit2D other) const
inline

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

Definition at line 133 of file CDCRecoHit2D.h.

134 {
135 return getRLWireHit() < other.getRLWireHit() or (
136 getRLWireHit() == other.getRLWireHit() and
137 getRecoDisp2D() < other.getRecoDisp2D());
138 }

◆ operator==()

bool operator== ( const CDCRecoHit2D other) const
inline

Equality comparison based on the oriented wire hit and displacement.

Definition at line 123 of file CDCRecoHit2D.h.

124 {
125 return getRLWireHit() == other.getRLWireHit() and
126 getRecoDisp2D() == other.getRecoDisp2D();
127 }

◆ reconstruct3D()

Vector3D reconstruct3D ( const CDCTrajectory2D trajectory2D,
const double  z = 0 
) const

Reconstruct the three dimensional position (especially of stereo hits) by determining the z coordinate such that the reconstructed position lies on the given two dimensional trajectory as the reference reconstructed position is moved parallel to the stereo wire.

For axial hits the point of closest approach on the trajectory is returned.

Definition at line 129 of file CDCRecoHit2D.cc.

130{
131 return getRLWireHit().reconstruct3D(trajectory2D, z);
132}
Vector3D reconstruct3D(const CDCTrajectory2D &trajectory2D, double z=0) const
Attempts to reconstruct a three dimensional position (especially of stereo hits).

◆ 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 93 of file CDCRecoHit2D.cc.

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

◆ reversed()

CDCRecoHit2D reversed ( ) const

Returns the recohit with the opposite right left information.

Definition at line 98 of file CDCRecoHit2D.cc.

99{
100 CDCRecoHit2D reversedRecoHit(*this);
101 reversedRecoHit.reverse();
102 return reversedRecoHit;
103}

◆ setRecoPos2D()

void setRecoPos2D ( const Vector2D recoPos2D)
inline

Setter for the position in the reference plane.

Definition at line 244 of file CDCRecoHit2D.h.

245 {
246 m_recoDisp2D = recoPos2D - getRefPos2D();
247 }

◆ setRefDriftLength()

void setRefDriftLength ( double  driftLength,
bool  snapRecoPos 
)

Setter for the drift length at the wire reference position.

Definition at line 111 of file CDCRecoHit2D.cc.

112{
113 double oldDriftLength = m_rlWireHit.getRefDriftLength();
114 m_rlWireHit.setRefDriftLength(driftLength);
115 if (snapRecoPos) {
116 bool switchSide = sign(oldDriftLength) != sign(driftLength);
117 snapToDriftCircle(switchSide);
118 }
119}
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.

◆ setRLInfo()

void setRLInfo ( ERightLeft rlInfo)
inline

Setter the right left passage information.

Definition at line 211 of file CDCRecoHit2D.h.

212 {
213 m_rlWireHit.setRLInfo(rlInfo);
214 }
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 287 of file CDCRecoHit2D.h.

288 {
289 m_rlWireHit = rlWireHit;
290 }

◆ snapToDriftCircle()

void snapToDriftCircle ( bool  switchSide = false)

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

Definition at line 121 of file CDCRecoHit2D.cc.

122{
124 if (switchSide) {
126 }
127}
double getRefDriftLength() const
Getter for the drift length at the wire reference position.
Definition: CDCRecoHit2D.h:217
double normalizeTo(const double toLength)
Normalizes the vector to the given length.
Definition: Vector2D.h:313

Friends And Related Function Documentation

◆ operator< [1/4]

bool operator< ( const CDCRecoHit2D recoHit2D,
const CDCWire wire 
)
friend

Defines wires and the two dimensional reconstructed hits as coaligned.

Definition at line 141 of file CDCRecoHit2D.h.

142 { return recoHit2D.getRLWireHit() < wire; }

◆ operator< [2/4]

bool operator< ( const CDCRecoHit2D recoHit2D,
const CDCWireHit wireHit 
)
friend

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

Definition at line 149 of file CDCRecoHit2D.h.

150 { return recoHit2D.getRLWireHit() < wireHit; }

◆ operator< [3/4]

bool operator< ( const CDCWire wire,
const CDCRecoHit2D recoHit2D 
)
friend

Defines wires and the two dimensional reconstructed hits as coaligned.

Definition at line 145 of file CDCRecoHit2D.h.

146 { return wire < recoHit2D.getRLWireHit(); }

◆ operator< [4/4]

bool operator< ( const CDCWireHit wireHit,
const CDCRecoHit2D recoHit2D 
)
friend

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

Definition at line 153 of file CDCRecoHit2D.h.

154 { return wireHit < recoHit2D.getRLWireHit(); }

Member Data Documentation

◆ m_recoDisp2D

Vector2D m_recoDisp2D
private

Memory for the displacement of the associated wire reference position.

Definition at line 297 of file CDCRecoHit2D.h.

◆ m_rlWireHit

CDCRLWireHit m_rlWireHit
private

Memory for the reference to the associated wire hit.

Definition at line 294 of file CDCRecoHit2D.h.


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