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/Vector3D.h>
17#include <Math/Vector2D.h>
18
19#include <iosfwd>
20
21
22
23namespace Belle2 {
28 class CDCSimHit;
29 class CDCHit;
30 class WireID;
31
32 namespace CDC {
33 class CDCWire;
34 }
35 namespace TrackingUtilities {
36 class CDCTrajectory2D;
37 class CDCWireHit;
38
47
48 public:
50 CDCRLWireHit() = default;
51
57 explicit CDCRLWireHit(const CDCWireHit* wireHit,
58 ERightLeft rlInfo = ERightLeft::c_Unknown);
59
67 CDCRLWireHit(const CDCWireHit* wireHit,
68 ERightLeft rlInfo,
69 double driftLength,
70 double driftLengthVariance);
71
76 static CDCRLWireHit average(const CDCRLWireHit& rlWireHit1, const CDCRLWireHit& rlWireHit2);
77
82 static CDCRLWireHit average(const CDCRLWireHit& rlWireHit1,
83 const CDCRLWireHit& rlWireHit2,
84 const CDCRLWireHit& rlWireHit3);
85
92 static CDCRLWireHit fromSimHit(const CDCWireHit* wirehit, const CDCSimHit& simhit);
93
102
104 void reverse()
105 {
107 }
108
111 {
112 return reversed();
113 }
114
116 bool operator==(const CDCRLWireHit& rhs) const
117 {
118 return &getWireHit() == &rhs.getWireHit() and getRLInfo() == rhs.getRLInfo();
119 }
120
125 bool operator<(const CDCRLWireHit& rhs) const
126 {
127 return &getWireHit() < &rhs.getWireHit() or
128 (&getWireHit() == &rhs.getWireHit() and (getRLInfo() < rhs.getRLInfo()));
129 }
130
132 friend bool operator<(const CDCRLWireHit& rlWireHit, const CDC::CDCWire& wire)
133 {
134 return &rlWireHit.getWire() < &wire;
135 }
136
138 friend bool operator<(const CDC::CDCWire& wire, const CDCRLWireHit& rlWireHit)
139 {
140 return &wire < &rlWireHit.getWire();
141 }
142
147 friend bool operator<(const CDCRLWireHit& rlWireHit, const CDCWireHit& wireHit)
148 {
149 return &rlWireHit.getWireHit() < &wireHit;
150 }
151
156 friend bool operator<(const CDCWireHit& wireHit, const CDCRLWireHit& rlWireHit)
157 {
158 return &wireHit < rlWireHit.m_wireHit;
159 }
160
162 operator const Belle2::CDCHit* () const
163 {
164 return getHit();
165 }
166
168 const CDCHit* getHit() const;
169
171 const CDC::CDCWire& getWire() const;
172
174 bool isOnWire(const CDC::CDCWire& wire) const
175 {
176 return &getWire() == &wire;
177 }
178
180 const WireID& getWireID() const;
181
184
187
189 bool isAxial() const;
190
192 const ROOT::Math::XYVector& getRefPos2D() const;
193
195 double getRefCylindricalR() const;
196
198 const CDCWireHit& getWireHit() const
199 {
200 return *m_wireHit;
201 }
202
204 bool hasWireHit(const CDCWireHit& wirehit) const
205 {
206 return &getWireHit() == &wirehit;
207 }
208
210 double getRefDriftLength() const
211 {
212 return m_refDriftLength;
213 }
214
216 void setRefDriftLength(double driftLength)
217 {
218 m_refDriftLength = driftLength;
219 }
220
223 {
224 return static_cast<double>(getRLInfo()) * getRefDriftLength();
225 }
226
229 {
231 }
232
234 void setRefDriftLengthVariance(double driftLengthVariance)
235 {
236 m_refDriftLengthVariance = driftLengthVariance;
237 }
238
240 ERightLeft getRLInfo() const
241 {
242 return m_rlInfo;
243 }
244
246 void setRLInfo(const ERightLeft rlInfo)
247 {
248 m_rlInfo = rlInfo;
249 }
250
260 ROOT::Math::XYVector reconstruct2D(const CDCTrajectory2D& trajectory2D) const;
261
275 ROOT::Math::XYZVector reconstruct3D(const CDCTrajectory2D& trajectory2D, double z = 0) const;
276
277 private:
279 const CDCWireHit* m_wireHit = nullptr;
280
282 double m_refDriftLength = 0.0;
283
286
288 ERightLeft m_rlInfo = ERightLeft::c_Unknown;
289 };
290
292 std::ostream& operator<<(std::ostream& output, const CDCRLWireHit& rlWireHit);
293 }
295}
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.
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.
ROOT::Math::XYZVector reconstruct3D(const CDCTrajectory2D &trajectory2D, double z=0) const
Attempts to reconstruct a three dimensional position (especially of stereo hits).
double m_refDriftLengthVariance
Memory for the reestimated drift length variance.
ROOT::Math::XYVector reconstruct2D(const CDCTrajectory2D &trajectory2D) const
Reconstructs a position of primary ionisation on the drift circle.
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.
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:56
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.