Belle II Software development
CDCRLWireHit Class Reference

Class representing an oriented hit wire including a hypotheses whether the causing track passes left or right. More...

#include <CDCRLWireHit.h>

Public Member Functions

 CDCRLWireHit ()=default
 Default constructor for ROOT.
 
 CDCRLWireHit (const CDCWireHit *wireHit, ERightLeft rlInfo=ERightLeft::c_Unknown)
 Constructs an oriented wire hit with unknown left right passage information.
 
 CDCRLWireHit (const CDCWireHit *wireHit, ERightLeft rlInfo, double driftLength, double driftLengthVariance)
 Constructs an oriented wire hit.
 
CDCRLWireHit reversed () const
 Returns the oriented wire hit with the opposite right left information.
 
void reverse ()
 Switches the right left passage to its opposite in place.
 
CDCRLWireHit getAlias () const
 Returns the aliased version of this oriented wire hit - here same as reverse.
 
bool operator== (const CDCRLWireHit &rhs) const
 Equality comparison based on wire hit, left right passage information.
 
bool operator< (const CDCRLWireHit &rhs) const
 Total ordering relation based on wire hit and left right passage information in this order of importance.
 
 operator const Belle2::CDCHit * () const
 Make the wire hit automatically castable to its underlying cdcHit.
 
const CDCHitgetHit () const
 Getter for the CDCHit pointer into the StoreArray.
 
const CDC::CDCWiregetWire () const
 Getter for the wire the oriented hit associated to.
 
bool isOnWire (const CDC::CDCWire &wire) const
 Checks if the oriented hit is associated with the give wire.
 
const WireIDgetWireID () const
 Getter for the WireID of the wire the hit is located on.
 
CDC::ISuperLayer getISuperLayer () const
 Getter for the superlayer id.
 
CDC::EStereoKind getStereoKind () const
 Getter for the stereo type of the underlying wire.
 
bool isAxial () const
 Indicator if the underlying wire is axial.
 
const ROOT::Math::XYVector & getRefPos2D () const
 The two dimensional reference position of the underlying wire.
 
double getRefCylindricalR () const
 The distance from the beam line at reference position of the underlying wire.
 
const CDCWireHitgetWireHit () const
 Getter for the wire hit associated with the oriented hit.
 
bool hasWireHit (const CDCWireHit &wirehit) const
 Checks if the oriented hit is associated with the give wire hit.
 
double getRefDriftLength () const
 Getter for the drift length at the reference position of the wire.
 
void setRefDriftLength (double driftLength)
 Setter for the drift length at the reference position of the wire.
 
double getSignedRefDriftLength () const
 Getter for the drift length at the reference position of the wire.
 
double getRefDriftLengthVariance () const
 Getter for the variance of the drift length at the reference position of the wire.
 
void setRefDriftLengthVariance (double driftLengthVariance)
 Setter for the variance of the drift length at the reference position of the wire.
 
ERightLeft getRLInfo () const
 Getter for the right left passage information.
 
void setRLInfo (const ERightLeft rlInfo)
 Setter for the right left passage information.
 
Vector2D reconstruct2D (const CDCTrajectory2D &trajectory2D) const
 Reconstructs a position of primary ionisation on the drift circle.
 
Vector3D reconstruct3D (const CDCTrajectory2D &trajectory2D, double z=0) const
 Attempts to reconstruct a three dimensional position (especially of stereo hits).
 

Static Public Member Functions

static CDCRLWireHit average (const CDCRLWireHit &rlWireHit1, const CDCRLWireHit &rlWireHit2)
 Constructs the average of two wire hits with right left passage information.
 
static CDCRLWireHit average (const CDCRLWireHit &rlWireHit1, const CDCRLWireHit &rlWireHit2, const CDCRLWireHit &rlWireHit3)
 Constructs the average of three wire hits with right left passage information.
 
static CDCRLWireHit fromSimHit (const CDCWireHit *wirehit, const CDCSimHit &simhit)
 Constructs an oriented wire hit from a CDCSimHit and the associated wirehit.
 

Private Attributes

const CDCWireHitm_wireHit = nullptr
 Memory for the reference to the assiziated wire hit.
 
double m_refDriftLength = 0.0
 Memory for the reestimated drift length.
 
double m_refDriftLengthVariance = 0.0
 Memory for the reestimated drift length variance.
 
ERightLeft m_rlInfo = ERightLeft::c_Unknown
 Memory for the right left passage information of the oriented wire hit.
 

Friends

bool operator< (const CDCRLWireHit &rlWireHit, const CDC::CDCWire &wire)
 Defines wires and oriented wire hits to be coaligned on the wire on which they are based.
 
bool operator< (const CDC::CDCWire &wire, const CDCRLWireHit &rlWireHit)
 Defines oriented wire hits and wires to be coaligned on the wire on which they are based.
 
bool operator< (const CDCRLWireHit &rlWireHit, const CDCWireHit &wireHit)
 Defines wire hits and oriented wire hits to be coaligned on the wire hit on which they are based.
 
bool operator< (const CDCWireHit &wireHit, const CDCRLWireHit &rlWireHit)
 Defines oriented wire hits and wire hits to be coaligned on the wire hit on which they are based.
 

Detailed Description

Class representing an oriented hit wire including a hypotheses whether the causing track passes left or right.

The right left information is freely setable. More than one CDCRLWireHit can point to one CDCWireHit. For more information see

See also
CDCWireHit.

Definition at line 47 of file CDCRLWireHit.h.

Constructor & Destructor Documentation

◆ CDCRLWireHit() [1/2]

CDCRLWireHit ( const CDCWireHit * wireHit,
ERightLeft rlInfo = ERightLeft::c_Unknown )
explicit

Constructs an oriented wire hit with unknown left right passage information.

Parameters
wireHitThe wire hit the oriented hit is associated with.
rlInfoThe right left passage information of the wire relative to the track

Definition at line 44 of file CDCRLWireHit.cc.

45 : CDCRLWireHit(wireHit, rlInfo, wireHit->getRefDriftLength(), wireHit->getRefDriftLengthVariance())
46{
47}
CDCRLWireHit()=default
Default constructor for ROOT.

◆ CDCRLWireHit() [2/2]

CDCRLWireHit ( const CDCWireHit * wireHit,
ERightLeft rlInfo,
double driftLength,
double driftLengthVariance )

Constructs an oriented wire hit.

Parameters
wireHitThe wire hit the oriented hit is associated with.
rlInfoThe right left passage information of the wire relative to the track
driftLengthThe re-estimated drift length
driftLengthVarianceThe re-estimated drift length variance

Definition at line 49 of file CDCRLWireHit.cc.

53 : m_wireHit(wireHit)
54 , m_refDriftLength(driftLength)
55 , m_refDriftLengthVariance(driftLengthVariance)
56 , m_rlInfo(rlInfo)
57{
58}
ERightLeft m_rlInfo
Memory for the right left passage information of the oriented wire hit.
double m_refDriftLength
Memory for the reestimated drift length.
double m_refDriftLengthVariance
Memory for the reestimated drift length variance.
const CDCWireHit * m_wireHit
Memory for the reference to the assiziated wire hit.

Member Function Documentation

◆ average() [1/2]

CDCRLWireHit average ( const CDCRLWireHit & rlWireHit1,
const CDCRLWireHit & rlWireHit2 )
static

Constructs the average of two wire hits with right left passage information.

Takes the average of the estimated drift lengths.

Definition at line 60 of file CDCRLWireHit.cc.

62{
63 B2ASSERT("Average of two CDCRLWireHits with different wire hits requested.",
64 rlWireHit1.getWireHit() == rlWireHit2.getWireHit());
65
66 B2ASSERT("Average of two CDCRLWireHits with different right left passage information requested.",
67 rlWireHit1.getRLInfo() == rlWireHit2.getRLInfo());
68
69 ERightLeft rlInfo = rlWireHit1.getRLInfo();
70 const CDCWireHit& wireHit = rlWireHit1.getWireHit();
71
72 double driftLength = (rlWireHit1.getRefDriftLength() +
73 rlWireHit2.getRefDriftLength()) / 2.0;
74
75 double driftLengthVariance = (rlWireHit1.getRefDriftLengthVariance() +
76 rlWireHit2.getRefDriftLengthVariance()) / 2.0;
77
78 CDCRLWireHit result(&wireHit, rlInfo, driftLength, driftLengthVariance);
79 return result;
80}
const CDCWireHit & getWireHit() const
Getter for the wire hit associated with the oriented hit.
double getRefDriftLengthVariance() const
Getter for the variance of the drift length at the reference position of the wire.
double getRefDriftLength() const
Getter for the drift length at the reference position of the wire.
ERightLeft getRLInfo() const
Getter for the right left passage information.
ERightLeft
Enumeration to represent the distinct possibilities of the right left passage.
Definition ERightLeft.h:25

◆ average() [2/2]

CDCRLWireHit average ( const CDCRLWireHit & rlWireHit1,
const CDCRLWireHit & rlWireHit2,
const CDCRLWireHit & rlWireHit3 )
static

Constructs the average of three wire hits with right left passage information.

Takes the average of the estimated drift lengths.

Definition at line 82 of file CDCRLWireHit.cc.

85{
86 B2ASSERT("Average of three CDCRLWireHits with different wire hits requested.",
87 rlWireHit1.getWireHit() == rlWireHit2.getWireHit() and
88 rlWireHit2.getWireHit() == rlWireHit3.getWireHit());
89
90 B2ASSERT("Average of three CDCRLWireHits with different right left passage information requested.",
91 rlWireHit1.getRLInfo() == rlWireHit2.getRLInfo() and
92 rlWireHit2.getRLInfo() == rlWireHit3.getRLInfo());
93
94
95 ERightLeft rlInfo = rlWireHit1.getRLInfo();
96 const CDCWireHit& wireHit = rlWireHit1.getWireHit();
97
98 double driftLength = (rlWireHit1.getRefDriftLength() +
99 rlWireHit2.getRefDriftLength() +
100 rlWireHit3.getRefDriftLength()) / 3.0;
101
102 double driftLengthVariance = (rlWireHit1.getRefDriftLengthVariance() +
103 rlWireHit2.getRefDriftLengthVariance() +
104 rlWireHit3.getRefDriftLengthVariance()) / 3.0;
105
106 CDCRLWireHit result(&wireHit, rlInfo, driftLength, driftLengthVariance);
107 return result;
108}

◆ fromSimHit()

CDCRLWireHit fromSimHit ( const CDCWireHit * wirehit,
const CDCSimHit & simhit )
static

Constructs an oriented wire hit from a CDCSimHit and the associated wirehit.

This translates the sim hit to an oriented wire hit mainly to be able to compare the reconstructed values from the algorithm with the Monte Carlo information. It merely evaluates, if the true trajectory passes right or left of the wire.

Definition at line 111 of file CDCRLWireHit.cc.

113{
114 // find out if the wire is right or left of the track ( view in flight direction )
115 Vector3D trackPosToWire{simhit.getPosWire() - simhit.getPosTrack()};
116 Vector3D directionOfFlight{simhit.getMomentum()};
117
118 ERightLeft rlInfo = trackPosToWire.xy().isRightOrLeftOf(directionOfFlight.xy());
119
120 CDCRLWireHit rlWireHit(wirehit, rlInfo, simhit.getDriftLength(), CDCWireHit::c_simpleDriftLengthVariance);
121
122 return rlWireHit;
123}
B2Vector3D getPosWire() const
The method to get position on wire.
Definition CDCSimHit.h:198
B2Vector3D getPosTrack() const
The method to get position on the track.
Definition CDCSimHit.h:216
double getDriftLength() const
The method to get drift length.
Definition CDCSimHit.h:180
B2Vector3D getMomentum() const
The method to get momentum.
Definition CDCSimHit.h:192
static constexpr const double c_simpleDriftLengthVariance
A default value for the drift length variance if no variance from the drift length translation is ava...
Definition CDCWireHit.h:67
HepGeom::Vector3D< double > Vector3D
3D Vector
Definition Cell.h:34

◆ getAlias()

CDCRLWireHit getAlias ( ) const
inline

Returns the aliased version of this oriented wire hit - here same as reverse.

Definition at line 111 of file CDCRLWireHit.h.

112 {
113 return reversed();
114 }
EForwardBackward reversed(EForwardBackward eForwardBackward)
Return the reversed forward backward indicator. Leaves EForwardBackward::c_Invalid the same.

◆ getHit()

const CDCHit * getHit ( ) const

Getter for the CDCHit pointer into the StoreArray.

Definition at line 125 of file CDCRLWireHit.cc.

126{
127 return getWireHit().getHit();
128}
const CDCHit * getHit() const
Getter for the CDCHit pointer into the StoreArray.
Definition CDCWireHit.h:162

◆ getISuperLayer()

ISuperLayer getISuperLayer ( ) const

Getter for the superlayer id.

Definition at line 140 of file CDCRLWireHit.cc.

141{
142 return getWire().getISuperLayer();
143}
ISuperLayer getISuperLayer() const
Gives the superlayer id ranging from 0 - 8.
Definition CDCWire.h:155
const CDC::CDCWire & getWire() const
Getter for the wire the oriented hit associated to.

◆ getRefCylindricalR()

double getRefCylindricalR ( ) const

The distance from the beam line at reference position of the underlying wire.

Definition at line 160 of file CDCRLWireHit.cc.

161{
162 return getWire().getRefCylindricalR();
163}
double getRefCylindricalR() const
Getter for the cylindrical radius at the wire reference position.
Definition CDCWire.h:252

◆ getRefDriftLength()

double getRefDriftLength ( ) const
inline

Getter for the drift length at the reference position of the wire.

Definition at line 211 of file CDCRLWireHit.h.

212 {
213 return m_refDriftLength;
214 }

◆ getRefDriftLengthVariance()

double getRefDriftLengthVariance ( ) const
inline

Getter for the variance of the drift length at the reference position of the wire.

Definition at line 229 of file CDCRLWireHit.h.

230 {
231 return m_refDriftLengthVariance;
232 }

◆ getRefPos2D()

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

The two dimensional reference position of the underlying wire.

Definition at line 155 of file CDCRLWireHit.cc.

156{
157 return getWire().getRefPos2D();
158}
const ROOT::Math::XYVector & getRefPos2D() const
Getter for the wire reference position for 2D tracking Gives the wire's reference position projected ...
Definition CDCWire.h:221

◆ getRLInfo()

ERightLeft getRLInfo ( ) const
inline

Getter for the right left passage information.

Definition at line 241 of file CDCRLWireHit.h.

242 {
243 return m_rlInfo;
244 }

◆ getSignedRefDriftLength()

double getSignedRefDriftLength ( ) const
inline

Getter for the drift length at the reference position of the wire.

Definition at line 223 of file CDCRLWireHit.h.

224 {
225 return static_cast<double>(getRLInfo()) * getRefDriftLength();
226 }

◆ getStereoKind()

EStereoKind getStereoKind ( ) const

Getter for the stereo type of the underlying wire.

Definition at line 145 of file CDCRLWireHit.cc.

146{
147 return getWire().getStereoKind();
148}
EStereoKind getStereoKind() const
Getter for the stereo type of the wire.
Definition CDCWire.h:176

◆ getWire()

const CDCWire & getWire ( ) const

Getter for the wire the oriented hit associated to.

Definition at line 130 of file CDCRLWireHit.cc.

131{
132 return getWireHit().getWire();
133}
const CDC::CDCWire & getWire() const
Getter for the CDCWire the hit is located on.
Definition CDCWireHit.h:171

◆ getWireHit()

const CDCWireHit & getWireHit ( ) const
inline

Getter for the wire hit associated with the oriented hit.

Definition at line 199 of file CDCRLWireHit.h.

200 {
201 return *m_wireHit;
202 }

◆ getWireID()

const WireID & getWireID ( ) const

Getter for the WireID of the wire the hit is located on.

Definition at line 135 of file CDCRLWireHit.cc.

136{
137 return getWire().getWireID();
138}
const WireID & getWireID() const
Getter for the wire id.
Definition CDCWire.h:114

◆ hasWireHit()

bool hasWireHit ( const CDCWireHit & wirehit) const
inline

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

Definition at line 205 of file CDCRLWireHit.h.

206 {
207 return &getWireHit() == &wirehit;
208 }

◆ isAxial()

bool isAxial ( ) const

Indicator if the underlying wire is axial.

Definition at line 150 of file CDCRLWireHit.cc.

151{
152 return getWire().isAxial();
153}
bool isAxial() const
Indicates if the wire is axial or stereo.
Definition CDCWire.h:166

◆ isOnWire()

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

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

Definition at line 175 of file CDCRLWireHit.h.

176 {
177 return &getWire() == &wire;
178 }

◆ operator const Belle2::CDCHit *()

operator const Belle2::CDCHit * ( ) const
inline

Make the wire hit automatically castable to its underlying cdcHit.

Definition at line 163 of file CDCRLWireHit.h.

164 {
165 return getHit();
166 }

◆ operator<()

bool operator< ( const CDCRLWireHit & rhs) const
inline

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

Definition at line 126 of file CDCRLWireHit.h.

127 {
128 return &getWireHit() < &rhs.getWireHit() or
129 (&getWireHit() == &rhs.getWireHit() and (getRLInfo() < rhs.getRLInfo()));
130 }

◆ operator==()

bool operator== ( const CDCRLWireHit & rhs) const
inline

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

Definition at line 117 of file CDCRLWireHit.h.

118 {
119 return &getWireHit() == &rhs.getWireHit() and getRLInfo() == rhs.getRLInfo();
120 }

◆ reconstruct2D()

Vector2D reconstruct2D ( const CDCTrajectory2D & trajectory2D) const

Reconstructs a position of primary ionisation on the drift circle.

The result is the position of closest approach on the drift circle to the trajectory.

All positions and the trajectory are interpreted to lie at z=0. Also the right left passage hypotheses does not play a role in the reconstruction in any way.

Definition at line 165 of file CDCRLWireHit.cc.

166{
167 const Vector2D& refPos2D = getRefPos2D();
168 Vector2D recoPos2D = trajectory2D.getClosest(refPos2D);
169
170 const Vector2D& wirePos2D = getWire().getRefPos2D();
171 const double driftLength = getRefDriftLength();
172
173 Vector2D disp2D = recoPos2D - wirePos2D;
174
175 // Fix the displacement to lie on the drift circle.
176 disp2D.normalizeTo(driftLength);
177 return wirePos2D + disp2D;
178}
const ROOT::Math::XYVector & getRefPos2D() const
The two dimensional reference position of the underlying wire.
Vector2D getClosest(const Vector2D &point) const
Calculates the closest approach on the trajectory to the given point.
double normalizeTo(const double toLength)
Normalizes the vector to the given length.
Definition Vector2D.h:331

◆ reconstruct3D()

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

Attempts to reconstruct a three dimensional position (especially of stereo hits).

This method makes a distinct difference between axial and stereo hits:

  • Stereo hits are moved out of the reference plane such that the oriented drift circle meets the trajectory in one point. Therefore the left right passage hypothesis has to be taken into account
  • For axial hits the reconstructed position is ambiguous in the z coordinate. Also the drift circle cannot moved such that it would meet the trajectory. Hence we default to the result of reconstruct2D, which yield the closest approach of the drift circle to the trajectory in the reference plane.

Definition at line 180 of file CDCRLWireHit.cc.

181{
182 const EStereoKind stereoType = getStereoKind();
183 const ERightLeft rlInfo = getRLInfo();
184
185 if (stereoType == EStereoKind::c_StereoV or stereoType == EStereoKind::c_StereoU) {
186 const WireLine& wireLine = getWire().getWireLine();
187 const double signedDriftLength = isValid(rlInfo) ? static_cast<double>(rlInfo) * getRefDriftLength() : 0.0;
188 return trajectory2D.reconstruct3D(wireLine, signedDriftLength, z);
189
190 } else { /*if (stereoType == EStereoKind::c_Axial)*/
191 const Vector2D recoPos2D = reconstruct2D(trajectory2D);
192 // for axial wire we can not determine the z coordinate by looking at the xy projection only
193 // we set it the basic assumption.
194 return Vector3D(recoPos2D, z);
195 }
196}
const WireLine & getWireLine() const
Getter for the wire line representation of the wire.
Definition CDCWire.h:180
Vector2D reconstruct2D(const CDCTrajectory2D &trajectory2D) const
Reconstructs a position of primary ionisation on the drift circle.
CDC::EStereoKind getStereoKind() const
Getter for the stereo type of the underlying wire.
Vector3D reconstruct3D(const CDC::WireLine &wireLine, double distance=0.0, double z=0) const
Gives the one three dimensional positions within the CDC closest to the given z where the given drift...
EStereoKind
Type for the stereo property of the wire.
Definition EStereoKind.h:20
bool isValid(EForwardBackward eForwardBackward)
Check whether the given enum instance is one of the valid values.

◆ reverse()

void reverse ( )
inline

Switches the right left passage to its opposite in place.

Definition at line 105 of file CDCRLWireHit.h.

106 {
107 m_rlInfo = NRightLeft::reversed(m_rlInfo);
108 }

◆ reversed()

CDCRLWireHit reversed ( ) const
inline

Returns the oriented wire hit with the opposite right left information.

Definition at line 96 of file CDCRLWireHit.h.

97 {
98 return CDCRLWireHit(m_wireHit,
99 NRightLeft::reversed(m_rlInfo),
100 m_refDriftLength,
101 m_refDriftLengthVariance);
102 }

◆ setRefDriftLength()

void setRefDriftLength ( double driftLength)
inline

Setter for the drift length at the reference position of the wire.

Definition at line 217 of file CDCRLWireHit.h.

218 {
219 m_refDriftLength = driftLength;
220 }

◆ setRefDriftLengthVariance()

void setRefDriftLengthVariance ( double driftLengthVariance)
inline

Setter for the variance of the drift length at the reference position of the wire.

Definition at line 235 of file CDCRLWireHit.h.

236 {
237 m_refDriftLengthVariance = driftLengthVariance;
238 }

◆ setRLInfo()

void setRLInfo ( const ERightLeft rlInfo)
inline

Setter for the right left passage information.

Definition at line 247 of file CDCRLWireHit.h.

248 {
249 m_rlInfo = rlInfo;
250 }

Friends And Related Symbol Documentation

◆ operator< [1/4]

bool operator< ( const CDC::CDCWire & wire,
const CDCRLWireHit & rlWireHit )
friend

Defines oriented wire hits and wires to be coaligned on the wire on which they are based.

Definition at line 139 of file CDCRLWireHit.h.

140 {
141 return &wire < &rlWireHit.getWire();
142 }

◆ operator< [2/4]

bool operator< ( const CDCRLWireHit & rlWireHit,
const CDC::CDCWire & wire )
friend

Defines wires and oriented wire hits to be coaligned on the wire on which they are based.

Definition at line 133 of file CDCRLWireHit.h.

134 {
135 return &rlWireHit.getWire() < &wire;
136 }

◆ operator< [3/4]

bool operator< ( const CDCRLWireHit & rlWireHit,
const CDCWireHit & wireHit )
friend

Defines wire hits and oriented wire hits to be coaligned on the wire hit on which they are based.

Definition at line 148 of file CDCRLWireHit.h.

149 {
150 return &rlWireHit.getWireHit() < &wireHit;
151 }

◆ operator< [4/4]

bool operator< ( const CDCWireHit & wireHit,
const CDCRLWireHit & rlWireHit )
friend

Defines oriented wire hits and wire hits to be coaligned on the wire hit on which they are based.

Definition at line 157 of file CDCRLWireHit.h.

158 {
159 return &wireHit < rlWireHit.m_wireHit;
160 }

Member Data Documentation

◆ m_refDriftLength

double m_refDriftLength = 0.0
private

Memory for the reestimated drift length.

Definition at line 283 of file CDCRLWireHit.h.

◆ m_refDriftLengthVariance

double m_refDriftLengthVariance = 0.0
private

Memory for the reestimated drift length variance.

Definition at line 286 of file CDCRLWireHit.h.

◆ m_rlInfo

ERightLeft m_rlInfo = ERightLeft::c_Unknown
private

Memory for the right left passage information of the oriented wire hit.

Definition at line 289 of file CDCRLWireHit.h.

◆ m_wireHit

const CDCWireHit* m_wireHit = nullptr
private

Memory for the reference to the assiziated wire hit.

Definition at line 280 of file CDCRLWireHit.h.


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