Belle II Software  release-05-02-19
CDCRLWireHit.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2015 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Oliver Frost *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #pragma once
11 
12 #include <tracking/trackFindingCDC/topology/EStereoKind.h>
13 #include <tracking/trackFindingCDC/topology/ISuperLayer.h>
14 
15 #include <tracking/trackFindingCDC/numerics/ERightLeft.h>
16 #include <tracking/trackFindingCDC/numerics/ESign.h>
17 
18 #include <iosfwd>
19 
20 namespace Belle2 {
25  class CDCSimHit;
26  class CDCHit;
27  class WireID;
28 
29  namespace TrackFindingCDC {
30  class CDCTrajectory2D;
31  class CDCWireHit;
32  class CDCWire;
33  class Vector3D;
34  class Vector2D;
35 
43  class CDCRLWireHit {
44 
45  public:
47  CDCRLWireHit() = default;
48 
54  explicit CDCRLWireHit(const CDCWireHit* wireHit, ERightLeft rlInfo = ERightLeft::c_Unknown);
55 
63  CDCRLWireHit(const CDCWireHit* wireHit,
64  ERightLeft rlInfo,
65  double driftLength,
66  double driftLengthVariance);
67 
72  static CDCRLWireHit average(const CDCRLWireHit& rlWireHit1, const CDCRLWireHit& rlWireHit2);
73 
78  static CDCRLWireHit average(const CDCRLWireHit& rlWireHit1,
79  const CDCRLWireHit& rlWireHit2,
80  const CDCRLWireHit& rlWireHit3);
81 
88  static CDCRLWireHit fromSimHit(const CDCWireHit* wirehit, const CDCSimHit& simhit);
89 
91  CDCRLWireHit reversed() const
92  {
93  return CDCRLWireHit(m_wireHit,
97  }
98 
100  void reverse()
101  {
103  }
104 
106  CDCRLWireHit getAlias() const
107  {
108  return reversed();
109  }
110 
112  bool operator==(const CDCRLWireHit& rhs) const
113  {
114  return &getWireHit() == &rhs.getWireHit() and getRLInfo() == rhs.getRLInfo();
115  }
116 
121  bool operator<(const CDCRLWireHit& rhs) const
122  {
123  return &getWireHit() < &rhs.getWireHit() or
124  (&getWireHit() == &rhs.getWireHit() and (getRLInfo() < rhs.getRLInfo()));
125  }
126 
128  friend bool operator<(const CDCRLWireHit& rlWireHit, const CDCWire& wire)
129  {
130  return &rlWireHit.getWire() < &wire;
131  }
132 
134  friend bool operator<(const CDCWire& wire, const CDCRLWireHit& rlWireHit)
135  {
136  return &wire < &rlWireHit.getWire();
137  }
138 
143  friend bool operator<(const CDCRLWireHit& rlWireHit, const CDCWireHit& wireHit)
144  {
145  return &rlWireHit.getWireHit() < &wireHit;
146  }
147 
152  friend bool operator<(const CDCWireHit& wireHit, const CDCRLWireHit& rlWireHit)
153  {
154  return &wireHit < rlWireHit.m_wireHit;
155  }
156 
158  operator const Belle2::CDCHit* () const
159  {
160  return getHit();
161  }
162 
164  const CDCHit* getHit() const;
165 
167  const CDCWire& getWire() const;
168 
170  bool isOnWire(const CDCWire& wire) const
171  {
172  return &getWire() == &wire;
173  }
174 
176  const WireID& getWireID() const;
177 
179  ISuperLayer getISuperLayer() const;
180 
182  EStereoKind getStereoKind() const;
183 
185  bool isAxial() const;
186 
188  const Vector2D& getRefPos2D() const;
189 
191  double getRefCylindricalR() const;
192 
194  const CDCWireHit& getWireHit() const
195  {
196  return *m_wireHit;
197  }
198 
200  bool hasWireHit(const CDCWireHit& wirehit) const
201  {
202  return &getWireHit() == &wirehit;
203  }
204 
206  double getRefDriftLength() const
207  {
209  }
210 
212  void setRefDriftLength(double driftLength)
213  {
214  m_refDriftLength = driftLength;
215  }
216 
218  double getSignedRefDriftLength() const
219  {
220  return static_cast<ESign>(getRLInfo()) * getRefDriftLength();
221  }
222 
224  double getRefDriftLengthVariance() const
225  {
227  }
228 
230  void setRefDriftLengthVariance(double driftLengthVariance)
231  {
232  m_refDriftLengthVariance = driftLengthVariance;
233  }
234 
236  ERightLeft getRLInfo() const
237  {
238  return m_rlInfo;
239  }
240 
242  void setRLInfo(const ERightLeft rlInfo)
243  {
244  m_rlInfo = rlInfo;
245  }
246 
256  Vector2D reconstruct2D(const CDCTrajectory2D& trajectory2D) const;
257 
271  Vector3D reconstruct3D(const CDCTrajectory2D& trajectory2D, double z = 0) const;
272 
273  private:
275  const CDCWireHit* m_wireHit = nullptr;
276 
278  ERightLeft m_rlInfo = ERightLeft::c_Unknown;
279 
281  double m_refDriftLength = 0.0;
282 
284  double m_refDriftLengthVariance = 0.0;
285  };
286 
288  std::ostream& operator<<(std::ostream& output, const CDCRLWireHit& rlWireHit);
289  }
291 }
Belle2::TrackFindingCDC::CDCRLWireHit::average
static CDCRLWireHit average(const CDCRLWireHit &rlWireHit1, const CDCRLWireHit &rlWireHit2)
Constructs the average of two wire hits with right left passage informations.
Definition: CDCRLWireHit.cc:63
Belle2::TrackFindingCDC::CDCRLWireHit::m_refDriftLength
double m_refDriftLength
Memory for the reestimated drift length.
Definition: CDCRLWireHit.h:289
Belle2::TrackFindingCDC::CDCRLWireHit::setRLInfo
void setRLInfo(const ERightLeft rlInfo)
Setter for the right left passage information.
Definition: CDCRLWireHit.h:250
Belle2::WireID
Class to identify a wire inside the CDC.
Definition: WireID.h:44
Belle2::Vector3D
HepGeom::Vector3D< double > Vector3D
3D Vector
Definition: Cell.h:35
Belle2::operator<<
std::ostream & operator<<(std::ostream &output, const IntervalOfValidity &iov)
Definition: IntervalOfValidity.cc:196
Belle2::TrackFindingCDC::Vector2D
A two dimensional vector which is equipped with functions for correct handeling of orientation relat...
Definition: Vector2D.h:37
Belle2::TrackFindingCDC::CDCRLWireHit::operator<
bool operator<(const CDCRLWireHit &rhs) const
Total ordering relation based on wire hit and left right passage information in this order of importa...
Definition: CDCRLWireHit.h:129
Belle2::TrackFindingCDC::CDCRLWireHit::getWireHit
const CDCWireHit & getWireHit() const
Getter for the wire hit associated with the oriented hit.
Definition: CDCRLWireHit.h:202
Belle2::CDCHit
Class containing the result of the unpacker in raw data and the result of the digitizer in simulation...
Definition: CDCHit.h:51
Belle2::TrackFindingCDC::CDCRLWireHit::getISuperLayer
ISuperLayer getISuperLayer() const
Getter for the superlayer id.
Definition: CDCRLWireHit.cc:143
Belle2::TrackFindingCDC::CDCRLWireHit::operator==
bool operator==(const CDCRLWireHit &rhs) const
Equality comparison based on wire hit, left right passage information.
Definition: CDCRLWireHit.h:120
Belle2::TrackFindingCDC::CDCRLWireHit::getWire
const CDCWire & getWire() const
Getter for the wire the oriented hit associated to.
Definition: CDCRLWireHit.cc:133
Belle2::TrackFindingCDC::CDCRLWireHit::getRefDriftLength
double getRefDriftLength() const
Getter for the drift length at the reference position of the wire.
Definition: CDCRLWireHit.h:214
Belle2::TrackFindingCDC::CDCRLWireHit::m_wireHit
const CDCWireHit * m_wireHit
Memory for the reference to the assiziated wire hit.
Definition: CDCRLWireHit.h:283
Belle2::TrackFindingCDC::ESignUtil::ESign
ESign
Enumeration for the distinct sign values of floating point variables.
Definition: ESign.h:37
Belle2::TrackFindingCDC::CDCRLWireHit::getSignedRefDriftLength
double getSignedRefDriftLength() const
Getter for the drift length at the reference position of the wire.
Definition: CDCRLWireHit.h:226
Belle2::TrackFindingCDC::CDCRLWireHit::getWireID
const WireID & getWireID() const
Getter for the WireID of the wire the hit is located on.
Definition: CDCRLWireHit.cc:138
Belle2::TrackFindingCDC::CDCTrajectory2D
Particle trajectory as it is seen in xy projection represented as a circle.
Definition: CDCTrajectory2D.h:46
Belle2::TrackFindingCDC::CDCRLWireHit::reversed
CDCRLWireHit reversed() const
Returns the oriented wire hit with the opposite right left information.
Definition: CDCRLWireHit.h:99
Belle2::TrackFindingCDC::CDCRLWireHit::hasWireHit
bool hasWireHit(const CDCWireHit &wirehit) const
Checks if the oriented hit is associated with the give wire hit.
Definition: CDCRLWireHit.h:208
Belle2::TrackFindingCDC::CDCRLWireHit::getRefDriftLengthVariance
double getRefDriftLengthVariance() const
Getter for the variance of the drift length at the reference position of the wire.
Definition: CDCRLWireHit.h:232
Belle2::TrackFindingCDC::CDCRLWireHit::getAlias
CDCRLWireHit getAlias() const
Returns the aliased version of this oriented wire hit - here same as reverse.
Definition: CDCRLWireHit.h:114
Belle2::TrackFindingCDC::CDCRLWireHit::getRefCylindricalR
double getRefCylindricalR() const
The distance from the beam line at reference position of the underlying wire.
Definition: CDCRLWireHit.cc:163
Belle2::TrackFindingCDC::CDCRLWireHit::isOnWire
bool isOnWire(const CDCWire &wire) const
Checks if the oriented hit is associated with the give wire.
Definition: CDCRLWireHit.h:178
Belle2::TrackFindingCDC::CDCRLWireHit::getRLInfo
ERightLeft getRLInfo() const
Getter for the right left passage information.
Definition: CDCRLWireHit.h:244
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackFindingCDC::CDCRLWireHit
Class representing an oriented hit wire including a hypotheses whether the causing track passes left ...
Definition: CDCRLWireHit.h:51
Belle2::TrackFindingCDC::CDCRLWireHit::CDCRLWireHit
CDCRLWireHit()=default
Default constructor for ROOT.
Belle2::TrackFindingCDC::CDCRLWireHit::m_rlInfo
ERightLeft m_rlInfo
Memory for the right left passage information of the oriented wire hit.
Definition: CDCRLWireHit.h:286
Belle2::TrackFindingCDC::NRightLeft::reversed
ERightLeft reversed(ERightLeft eRightLeft)
Return the reversed right left indicator. Leaves ERightLeft::c_Invalid the same.
Definition: ERightLeft.h:51
Belle2::TrackFindingCDC::Vector3D
A three dimensional vector.
Definition: Vector3D.h:34
Belle2::TrackFindingCDC::CDCRLWireHit::reverse
void reverse()
Swiches the right left passage to its opposite inplace.
Definition: CDCRLWireHit.h:108
Belle2::TrackFindingCDC::CDCRLWireHit::reconstruct2D
Vector2D reconstruct2D(const CDCTrajectory2D &trajectory2D) const
Reconstructs a position of primary ionisation on the drift circle.
Definition: CDCRLWireHit.cc:168
Belle2::TrackFindingCDC::CDCRLWireHit::isAxial
bool isAxial() const
Indicator if the underlying wire is axial.
Definition: CDCRLWireHit.cc:153
Belle2::TrackFindingCDC::NRightLeft::ERightLeft
ERightLeft
Enumeration to represent the distinct possibilities of the right left passage.
Definition: ERightLeft.h:35
Belle2::TrackFindingCDC::CDCRLWireHit::setRefDriftLength
void setRefDriftLength(double driftLength)
Setter for the drift length at the reference position of the wire.
Definition: CDCRLWireHit.h:220
Belle2::TrackFindingCDC::CDCRLWireHit::getStereoKind
EStereoKind getStereoKind() const
Getter for the stereo type of the underlying wire.
Definition: CDCRLWireHit.cc:148
Belle2::TrackFindingCDC::CDCRLWireHit::setRefDriftLengthVariance
void setRefDriftLengthVariance(double driftLengthVariance)
Setter for the variance of the drift length at the reference position of the wire.
Definition: CDCRLWireHit.h:238
Belle2::TrackFindingCDC::CDCRLWireHit::getRefPos2D
const Vector2D & getRefPos2D() const
The two dimensional reference position of the underlying wire.
Definition: CDCRLWireHit.cc:158
Belle2::TrackFindingCDC::CDCWire
Class representing a sense wire in the central drift chamber.
Definition: CDCWire.h:60
Belle2::TrackFindingCDC::CDCWireHit
Class representing a hit wire in the central drift chamber.
Definition: CDCWireHit.h:65
Belle2::TrackFindingCDC::CDCRLWireHit::getHit
const CDCHit * getHit() const
Getter for the CDCHit pointer into the StoreArray.
Definition: CDCRLWireHit.cc:128
Belle2::TrackFindingCDC::CDCRLWireHit::reconstruct3D
Vector3D reconstruct3D(const CDCTrajectory2D &trajectory2D, double z=0) const
Attempts to reconstruct a three dimensional position (especially of stereo hits).
Definition: CDCRLWireHit.cc:183
Belle2::TrackFindingCDC::CDCRLWireHit::m_refDriftLengthVariance
double m_refDriftLengthVariance
Memory for the reestimated drift length variance.
Definition: CDCRLWireHit.h:292
Belle2::TrackFindingCDC::CDCRLWireHit::fromSimHit
static CDCRLWireHit fromSimHit(const CDCWireHit *wirehit, const CDCSimHit &simhit)
Constructs an oriented wire hit from a CDCSimHit and the associated wirehit.
Definition: CDCRLWireHit.cc:114