Belle II Software development
CDCRLWireHit.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8#pragma once
9
10#include <cdc/topology/EStereoKind.h>
11#include <cdc/topology/ISuperLayer.h>
12
13#include <tracking/trackingUtilities/numerics/ERightLeft.h>
14#include <tracking/trackingUtilities/numerics/ESign.h>
15
16#include <Math/Vector2D.h>
17
18#include <iosfwd>
19
20
21
22namespace Belle2 {
27 class CDCSimHit;
28 class CDCHit;
29 class WireID;
30
31 namespace CDC {
32 class CDCWire;
33 }
34 namespace TrackingUtilities {
35 class CDCTrajectory2D;
36 class CDCWireHit;
37 class Vector3D;
38 class Vector2D;
39
48
49 public:
51 CDCRLWireHit() = default;
52
58 explicit CDCRLWireHit(const CDCWireHit* wireHit,
59 ERightLeft rlInfo = ERightLeft::c_Unknown);
60
68 CDCRLWireHit(const CDCWireHit* wireHit,
69 ERightLeft rlInfo,
70 double driftLength,
71 double driftLengthVariance);
72
77 static CDCRLWireHit average(const CDCRLWireHit& rlWireHit1, const CDCRLWireHit& rlWireHit2);
78
83 static CDCRLWireHit average(const CDCRLWireHit& rlWireHit1,
84 const CDCRLWireHit& rlWireHit2,
85 const CDCRLWireHit& rlWireHit3);
86
93 static CDCRLWireHit fromSimHit(const CDCWireHit* wirehit, const CDCSimHit& simhit);
94
103
105 void reverse()
106 {
108 }
109
112 {
113 return reversed();
114 }
115
117 bool operator==(const CDCRLWireHit& rhs) const
118 {
119 return &getWireHit() == &rhs.getWireHit() and getRLInfo() == rhs.getRLInfo();
120 }
121
126 bool operator<(const CDCRLWireHit& rhs) const
127 {
128 return &getWireHit() < &rhs.getWireHit() or
129 (&getWireHit() == &rhs.getWireHit() and (getRLInfo() < rhs.getRLInfo()));
130 }
131
133 friend bool operator<(const CDCRLWireHit& rlWireHit, const CDC::CDCWire& wire)
134 {
135 return &rlWireHit.getWire() < &wire;
136 }
137
139 friend bool operator<(const CDC::CDCWire& wire, const CDCRLWireHit& rlWireHit)
140 {
141 return &wire < &rlWireHit.getWire();
142 }
143
148 friend bool operator<(const CDCRLWireHit& rlWireHit, const CDCWireHit& wireHit)
149 {
150 return &rlWireHit.getWireHit() < &wireHit;
151 }
152
157 friend bool operator<(const CDCWireHit& wireHit, const CDCRLWireHit& rlWireHit)
158 {
159 return &wireHit < rlWireHit.m_wireHit;
160 }
161
163 operator const Belle2::CDCHit* () const
164 {
165 return getHit();
166 }
167
169 const CDCHit* getHit() const;
170
172 const CDC::CDCWire& getWire() const;
173
175 bool isOnWire(const CDC::CDCWire& wire) const
176 {
177 return &getWire() == &wire;
178 }
179
181 const WireID& getWireID() const;
182
185
188
190 bool isAxial() const;
191
193 const ROOT::Math::XYVector& getRefPos2D() const;
194
196 double getRefCylindricalR() const;
197
199 const CDCWireHit& getWireHit() const
200 {
201 return *m_wireHit;
202 }
203
205 bool hasWireHit(const CDCWireHit& wirehit) const
206 {
207 return &getWireHit() == &wirehit;
208 }
209
211 double getRefDriftLength() const
212 {
213 return m_refDriftLength;
214 }
215
217 void setRefDriftLength(double driftLength)
218 {
219 m_refDriftLength = driftLength;
220 }
221
224 {
225 return static_cast<double>(getRLInfo()) * getRefDriftLength();
226 }
227
230 {
232 }
233
235 void setRefDriftLengthVariance(double driftLengthVariance)
236 {
237 m_refDriftLengthVariance = driftLengthVariance;
238 }
239
241 ERightLeft getRLInfo() const
242 {
243 return m_rlInfo;
244 }
245
247 void setRLInfo(const ERightLeft rlInfo)
248 {
249 m_rlInfo = rlInfo;
250 }
251
261 Vector2D reconstruct2D(const CDCTrajectory2D& trajectory2D) const;
262
276 Vector3D reconstruct3D(const CDCTrajectory2D& trajectory2D, double z = 0) const;
277
278 private:
280 const CDCWireHit* m_wireHit = nullptr;
281
283 double m_refDriftLength = 0.0;
284
287
289 ERightLeft m_rlInfo = ERightLeft::c_Unknown;
290 };
291
293 std::ostream& operator<<(std::ostream& output, const CDCRLWireHit& rlWireHit);
294 }
296}
Class containing the result of the unpacker in raw data and the result of the digitizer in simulation...
Definition CDCHit.h:40
Example Detector.
Definition CDCSimHit.h:21
Class representing a sense wire in the central drift chamber.
Definition CDCWire.h:50
Class representing an oriented hit wire including a hypotheses whether the causing track passes left ...
double getRefCylindricalR() const
The distance from the beam line at reference position of the underlying wire.
const CDCHit * getHit() const
Getter for the CDCHit pointer into the StoreArray.
CDCRLWireHit getAlias() const
Returns the aliased version of this oriented wire hit - here same as reverse.
friend 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.
const CDCWireHit & getWireHit() const
Getter for the wire hit associated with the oriented hit.
bool operator<(const CDCRLWireHit &rhs) const
Total ordering relation based on wire hit and left right passage information in this order of importa...
CDC::ISuperLayer getISuperLayer() const
Getter for the superlayer id.
double getRefDriftLengthVariance() const
Getter for the variance of the drift length at the reference position of the wire.
void reverse()
Switches the right left passage to its opposite in place.
double getRefDriftLength() const
Getter for the drift length at the reference position of the wire.
const ROOT::Math::XYVector & getRefPos2D() const
The two dimensional reference position of the underlying wire.
const WireID & getWireID() const
Getter for the WireID of the wire the hit is located on.
bool isAxial() const
Indicator if the underlying wire is axial.
CDCRLWireHit reversed() const
Returns the oriented wire hit with the opposite right left information.
CDCRLWireHit()=default
Default constructor for ROOT.
ERightLeft m_rlInfo
Memory for the right left passage information of the oriented wire hit.
friend 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.
void setRefDriftLength(double driftLength)
Setter for the drift length at the reference position of the wire.
const CDC::CDCWire & getWire() const
Getter for the wire the oriented hit associated to.
static CDCRLWireHit fromSimHit(const CDCWireHit *wirehit, const CDCSimHit &simhit)
Constructs an oriented wire hit from a CDCSimHit and the associated wirehit.
static CDCRLWireHit average(const CDCRLWireHit &rlWireHit1, const CDCRLWireHit &rlWireHit2)
Constructs the average of two wire hits with right left passage information.
bool hasWireHit(const CDCWireHit &wirehit) const
Checks if the oriented hit is associated with the give wire hit.
double getSignedRefDriftLength() const
Getter for the drift length at the reference position of the wire.
void setRLInfo(const ERightLeft rlInfo)
Setter for the right left passage information.
void setRefDriftLengthVariance(double driftLengthVariance)
Setter for the variance of the drift length at the reference position of the wire.
Vector2D reconstruct2D(const CDCTrajectory2D &trajectory2D) const
Reconstructs a position of primary ionisation on the drift circle.
bool isOnWire(const CDC::CDCWire &wire) const
Checks if the oriented hit is associated with the give wire.
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.
CDC::EStereoKind getStereoKind() const
Getter for the stereo type of the underlying wire.
ERightLeft getRLInfo() const
Getter for the right left passage information.
friend 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.
friend 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 &rhs) const
Equality comparison based on wire hit, left right passage information.
Vector3D reconstruct3D(const CDCTrajectory2D &trajectory2D, double z=0) const
Attempts to reconstruct a three dimensional position (especially of stereo hits).
Particle trajectory as it is seen in xy projection represented as a circle.
Class representing a hit wire in the central drift chamber.
Definition CDCWireHit.h:58
A two dimensional vector which is equipped with functions for correct handling of orientation relate...
Definition Vector2D.h:36
A three dimensional vector.
Definition Vector3D.h:34
Class to identify a wire inside the CDC.
Definition WireID.h:34
EStereoKind
Type for the stereo property of the wire.
Definition EStereoKind.h:20
signed short ISuperLayer
The type of the layer and superlayer ids.
Definition ISuperLayer.h:24
ERightLeft reversed(ERightLeft eRightLeft)
Return the reversed right left indicator. Leaves ERightLeft::c_Invalid the same.
Definition ERightLeft.h:41
Abstract base class for different kinds of events.