Belle II Software  release-05-02-19
CDCRecoHit3D.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2012 - 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/eventdata/hits/CDCRLWireHit.h>
13 
14 #include <tracking/trackFindingCDC/geometry/Vector3D.h>
15 #include <tracking/trackFindingCDC/geometry/Vector2D.h>
16 
17 #include <tracking/trackFindingCDC/topology/EStereoKind.h>
18 #include <tracking/trackFindingCDC/topology/ISuperLayer.h>
19 
20 #include <tracking/trackFindingCDC/numerics/ERightLeft.h>
21 #include <tracking/trackFindingCDC/numerics/ERotation.h>
22 
23 namespace Belle2 {
28  class CDCSimHit;
29  class CDCHit;
30 
31  namespace TrackFindingCDC {
32  // Forward declaration.
33  class CDCTrajectory3D;
34  class CDCTrajectory2D;
35  class CDCTrajectorySZ;
36  class CDCRecoHit2D;
37  class CDCWireHit;
38  class CDCWire;
39 
54  class CDCRecoHit3D {
55  public:
57  CDCRecoHit3D() = default;
58 
60  CDCRecoHit3D(const CDCRLWireHit& rlWireHit, const Vector3D& recoPos3D, double arcLength2D = 0);
61 
70  static CDCRecoHit3D fromSimHit(const CDCWireHit* wireHit, const CDCSimHit& simHit);
71 
84  static CDCRecoHit3D reconstruct(const CDCRecoHit2D& recoHit2D,
85  const CDCTrajectory2D& trajectory2D);
86 
92  static CDCRecoHit3D reconstruct(const CDCRLWireHit& rlWireHit,
93  const CDCTrajectory2D& trajectory2D);
94 
100  static CDCRecoHit3D reconstruct(const CDCWireHit* wireHit,
101  ERightLeft rlInfo,
102  const CDCTrajectory2D& trajectory2D);
103 
113  static CDCRecoHit3D reconstructNearest(const CDCWireHit* axialWireHit,
114  const CDCTrajectory2D& trajectory2D);
115 
117  static CDCRecoHit3D reconstruct(const CDCRecoHit2D& recoHit,
118  const CDCTrajectory3D& trajectory3D);
119 
136  static CDCRecoHit3D reconstruct(const CDCRecoHit2D& recoHit2D,
137  const CDCTrajectory2D& trajectory2D,
138  const CDCTrajectorySZ& trajectorySZ);
139 
140  public:
147  static CDCRecoHit3D average(const CDCRecoHit3D& first,
148  const CDCRecoHit3D& second);
149 
155  void reverse();
156 
158  CDCRecoHit3D reversed() const;
159 
161  operator const Belle2::CDCHit* () const
162  {
163  return static_cast<const CDCHit*>(getRLWireHit());
164  }
165 
167  bool operator==(const CDCRecoHit3D& other) const
168  {
169  return getRLWireHit() == other.getRLWireHit() and
170  getRLInfo() == other.getRLInfo() and
171  getRecoPos3D() == other.getRecoPos3D();
172  }
173 
178  bool operator<(const CDCRecoHit3D& other) const
179  {
180  return (getRLWireHit() < other.getRLWireHit() or
181  (getRLWireHit() == other.getRLWireHit() and
182  getRecoPos3D() < other.getRecoPos3D()));
183  }
184 
186  friend bool operator<(const CDCRecoHit3D& recoHit3D, const CDCWire& wire)
187  {
188  return recoHit3D.getRLWireHit() < wire;
189  }
190 
192  friend bool operator<(const CDCWire& wire, const CDCRecoHit3D& recoHit3D)
193  {
194  return wire < recoHit3D.getRLWireHit();
195  }
196 
198  friend bool operator<(const CDCRecoHit3D& recoHit3D, const CDCWireHit& wireHit)
199  {
200  return recoHit3D.getRLWireHit() < wireHit;
201  }
202 
204  friend bool operator<(const CDCWireHit& wireHit, const CDCRecoHit3D& recoHit3D)
205  {
206  return wireHit < recoHit3D.getRLWireHit();
207  }
208 
210  EStereoKind getStereoKind() const
211  {
213  }
214 
216  bool isAxial() const
217  {
218  return getRLWireHit().isAxial();
219  }
220 
222  ISuperLayer getISuperLayer() const
223  {
225  }
226 
228  const CDCWire& getWire() const
229  {
230  return getRLWireHit().getWire();
231  }
232 
234  bool isOnWire(const CDCWire& wire) const
235  {
236  return getRLWireHit().isOnWire(wire);
237  }
238 
240  const CDCWireHit& getWireHit() const
241  {
243  }
244 
246  bool hasWireHit(const CDCWireHit& wireHit) const
247  {
248  return getRLWireHit().hasWireHit(wireHit);
249  }
250 
252  const CDCRLWireHit& getRLWireHit() const
253  {
254  return m_rlWireHit;
255  }
256 
258  void setRLWireHit(const CDCRLWireHit& rlWireHit)
259  {
260  m_rlWireHit = rlWireHit;
261  }
262 
269  ERightLeft getRLInfo() const
270  {
271  return getRLWireHit().getRLInfo();
272  }
273 
275  void setRLInfo(ERightLeft rlInfo)
276  {
278  }
279 
281  const Vector2D& getRefPos2D() const
282  {
284  }
285 
287  const Vector3D& getRecoPos3D() const
288  {
289  return m_recoPos3D;
290  }
291 
293  void setRecoPos3D(const Vector3D& recoPos3D)
294  {
295  m_recoPos3D = recoPos3D;
296  }
297 
299  const Vector2D& getRecoPos2D() const
300  {
301  return getRecoPos3D().xy();
302  }
303 
305  double getRecoZ() const
306  {
307  return getRecoPos3D().z();
308  }
309 
311  Vector2D getRecoDisp2D() const;
312 
315  {
316  ERotation rotation = static_cast<ERotation>(-getRLInfo());
317  return getRecoDisp2D().orthogonal(rotation);
318  }
319 
321  double getAlpha() const
322  {
324  }
325 
330  CDCRecoHit2D getRecoHit2D() const;
331 
337 
339  Vector2D getRecoWirePos2D() const;
340 
342  void snapToDriftCircle(bool switchSide = false);
343 
348  double getSignedRecoDriftLength() const
349  {
351  }
352 
354  void setRecoDriftLength(double driftLength, bool snapRecoPos);
355 
360  double getRecoDriftLengthVariance() const
361  {
363  }
364 
366  void shiftArcLength2D(double arcLength2DOffSet)
367  {
368  m_arcLength2D += arcLength2DOffSet;
369  }
370 
372  double getArcLength2D() const
373  {
375  }
376 
378  void setArcLength2D(const double arcLength2D)
379  {
380  m_arcLength2D = arcLength2D;
381  }
382 
387  bool isInCellZBounds(const double factor = 1) const;
388 
389  private:
392 
395 
397  double m_arcLength2D = 0;
398  };
399  }
401 }
Belle2::TrackFindingCDC::CDCRecoHit3D::getRecoDisp2D
Vector2D getRecoDisp2D() const
Gets the displacement from the wire position in the xy plain at the reconstructed position.
Definition: CDCRecoHit3D.cc:154
Belle2::TrackFindingCDC::CDCRecoHit3D::getWire
const CDCWire & getWire() const
Getter for the wire.
Definition: CDCRecoHit3D.h:236
Belle2::TrackFindingCDC::CDCRLWireHit::setRLInfo
void setRLInfo(const ERightLeft rlInfo)
Setter for the right left passage information.
Definition: CDCRLWireHit.h:250
Belle2::Vector3D
HepGeom::Vector3D< double > Vector3D
3D Vector
Definition: Cell.h:35
Belle2::TrackFindingCDC::CDCRecoHit3D
Class representing a three dimensional reconstructed hit.
Definition: CDCRecoHit3D.h:62
Belle2::TrackFindingCDC::CDCRecoHit3D::m_recoPos3D
Vector3D m_recoPos3D
Memory for the reconstructed hit position.
Definition: CDCRecoHit3D.h:402
Belle2::TrackFindingCDC::Vector2D::orthogonal
Vector2D orthogonal() const
Orthogonal vector to the counterclockwise direction.
Definition: Vector2D.h:303
Belle2::TrackFindingCDC::CDCRecoHit3D::CDCRecoHit3D
CDCRecoHit3D()=default
Default constructor for ROOT.
Belle2::TrackFindingCDC::CDCRecoHit3D::getRecoWirePos2D
Vector2D getRecoWirePos2D() const
Returns the position of the wire in the xy plain the reconstructed position is located in.
Definition: CDCRecoHit3D.cc:209
Belle2::TrackFindingCDC::Vector2D
A two dimensional vector which is equipped with functions for correct handeling of orientation relat...
Definition: Vector2D.h:37
Belle2::TrackFindingCDC::CDCRecoHit3D::reversed
CDCRecoHit3D reversed() const
Returns the recohit with the opposite right left information.
Definition: CDCRecoHit3D.cc:169
Belle2::TrackFindingCDC::CDCRecoHit3D::getISuperLayer
ISuperLayer getISuperLayer() const
Getter for the superlayer id.
Definition: CDCRecoHit3D.h:230
Belle2::TrackFindingCDC::CDCRecoHit3D::setRecoPos3D
void setRecoPos3D(const Vector3D &recoPos3D)
Setter for the 3d position of the hit.
Definition: CDCRecoHit3D.h:301
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::getWire
const CDCWire & getWire() const
Getter for the wire the oriented hit associated to.
Definition: CDCRLWireHit.cc:133
Belle2::TrackFindingCDC::CDCRecoHit3D::isAxial
bool isAxial() const
Indicator if the underlying wire is axial.
Definition: CDCRecoHit3D.h:224
Belle2::TrackFindingCDC::CDCRecoHit3D::fromSimHit
static CDCRecoHit3D fromSimHit(const CDCWireHit *wireHit, const CDCSimHit &simHit)
Constructs a three dimensional reconstructed hit from a sim hit and the assoziated wirehit.
Definition: CDCRecoHit3D.cc:48
Belle2::TrackFindingCDC::CDCRecoHit3D::getRecoZ
double getRecoZ() const
Getter for the z coordinate of the reconstructed position.
Definition: CDCRecoHit3D.h:313
Belle2::TrackFindingCDC::CDCRecoHit3D::snapToDriftCircle
void snapToDriftCircle(bool switchSide=false)
Scales the displacement vector in place to lie on the dirft circle.
Definition: CDCRecoHit3D.cc:174
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::CDCRecoHit3D::reverse
void reverse()
Turns the orientation in place.
Definition: CDCRecoHit3D.cc:164
Belle2::TrackFindingCDC::CDCRecoHit3D::getWireHit
const CDCWireHit & getWireHit() const
Getter for the wire hit.
Definition: CDCRecoHit3D.h:248
Belle2::TrackFindingCDC::CDCRecoHit3D::getArcLength2D
double getArcLength2D() const
Getter for the travel distance in the xy projection.
Definition: CDCRecoHit3D.h:380
Belle2::TrackFindingCDC::CDCRecoHit3D::getRLInfo
ERightLeft getRLInfo() const
Getter for the right left passage information.
Definition: CDCRecoHit3D.h:277
Belle2::TrackFindingCDC::CDCRecoHit3D::getRecoPos2D
const Vector2D & getRecoPos2D() const
Getter for the 2d position of the hit.
Definition: CDCRecoHit3D.h:307
Belle2::TrackFindingCDC::CDCRecoHit3D::reconstructNearest
static CDCRecoHit3D reconstructNearest(const CDCWireHit *axialWireHit, const CDCTrajectory2D &trajectory2D)
Reconstruct a three dimensional hit from a wire hit (as in reconstruct(rlWireHit, trajectory2D)),...
Definition: CDCRecoHit3D.cc:132
Belle2::TrackFindingCDC::CDCRecoHit3D::getAlpha
double getAlpha() const
Getter for the direction of flight relative to the position.
Definition: CDCRecoHit3D.h:329
Belle2::TrackFindingCDC::CDCRecoHit3D::getStereoKind
EStereoKind getStereoKind() const
Getter for the stereo type of the underlying wire.
Definition: CDCRecoHit3D.h:218
Belle2::TrackFindingCDC::CDCRecoHit3D::setRLWireHit
void setRLWireHit(const CDCRLWireHit &rlWireHit)
Setter for the oriented wire hit assoziated with the reconstructed hit.
Definition: CDCRecoHit3D.h:266
Belle2::TrackFindingCDC::CDCRecoHit3D::average
static CDCRecoHit3D average(const CDCRecoHit3D &first, const CDCRecoHit3D &second)
Constructs the average of two reconstructed hit positions.
Definition: CDCRecoHit3D.cc:141
Belle2::TrackFindingCDC::CDCRecoHit3D::isOnWire
bool isOnWire(const CDCWire &wire) const
Checks if the reconstructed hit is assoziated with the give wire.
Definition: CDCRecoHit3D.h:242
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::CDCRecoHit3D::getRecoDriftLengthVariance
double getRecoDriftLengthVariance() const
Returns the drift length variance next to the reconstructed position.
Definition: CDCRecoHit3D.h:368
Belle2::TrackFindingCDC::CDCRecoHit3D::getFlightDirection2D
Vector2D getFlightDirection2D() const
Getter for the direction of flight.
Definition: CDCRecoHit3D.h:322
Belle2::TrackFindingCDC::CDCRecoHit2D
Class representing a two dimensional reconstructed hit in the central drift chamber.
Definition: CDCRecoHit2D.h:57
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::CDCRecoHit3D::getRLWireHit
const CDCRLWireHit & getRLWireHit() const
Getter for the oriented wire hit.
Definition: CDCRecoHit3D.h:260
Belle2::TrackFindingCDC::Vector3D
A three dimensional vector.
Definition: Vector3D.h:34
Belle2::TrackFindingCDC::CDCRecoHit3D::m_arcLength2D
double m_arcLength2D
Memory for the travel distance as see in the xy projection.
Definition: CDCRecoHit3D.h:405
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::CDCRecoHit3D::stereoProjectToRef
CDCRecoHit2D stereoProjectToRef() const
Constructs a two dimensional reconstructed hit by carrying out the stereo ! projection to the wire re...
Definition: CDCRecoHit3D.cc:204
Belle2::TrackFindingCDC::NRotation::ERotation
ERotation
Enumeration to represent the distinct possibilities of the right left passage information.
Definition: ERotation.h:35
Belle2::TrackFindingCDC::CDCRecoHit3D::shiftArcLength2D
void shiftArcLength2D(double arcLength2DOffSet)
Adjust the travel distance by the given value.
Definition: CDCRecoHit3D.h:374
Belle2::TrackFindingCDC::CDCRecoHit3D::isInCellZBounds
bool isInCellZBounds(const double factor=1) const
Indicator if the hit is in the cdc (scaled by the factor) or already outside its boundaries.
Definition: CDCRecoHit3D.cc:214
Belle2::TrackFindingCDC::Vector3D::xy
const Vector2D & xy() const
Getter for the xy projected vector ( reference ! )
Definition: Vector3D.h:500
Belle2::TrackFindingCDC::CDCRLWireHit::getStereoKind
EStereoKind getStereoKind() const
Getter for the stereo type of the underlying wire.
Definition: CDCRLWireHit.cc:148
Belle2::TrackFindingCDC::CDCRecoHit3D::operator<
bool operator<(const CDCRecoHit3D &other) const
Total ordering relation based on wire hit, right left passage information and position information in...
Definition: CDCRecoHit3D.h:186
Belle2::TrackFindingCDC::CDCRecoHit3D::setArcLength2D
void setArcLength2D(const double arcLength2D)
Setter for the travel distance in the xy projection.
Definition: CDCRecoHit3D.h:386
Belle2::TrackFindingCDC::CDCRecoHit3D::setRLInfo
void setRLInfo(ERightLeft rlInfo)
Setter the right left passage information.
Definition: CDCRecoHit3D.h:283
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::CDCRecoHit3D::getSignedRecoDriftLength
double getSignedRecoDriftLength() const
Returns the drift length next to the reconstructed position.
Definition: CDCRecoHit3D.h:356
Belle2::TrackFindingCDC::CDCRecoHit3D::setRecoDriftLength
void setRecoDriftLength(double driftLength, bool snapRecoPos)
Setter to update the drift length of the hit.
Definition: CDCRecoHit3D.cc:189
Belle2::TrackFindingCDC::Vector2D::angleWith
double angleWith(const Vector2D &rhs) const
The angle between this and rhs.
Definition: Vector2D.h:211
Belle2::TrackFindingCDC::Vector3D::z
double z() const
Getter for the z coordinate.
Definition: Vector3D.h:488
Belle2::TrackFindingCDC::CDCWireHit
Class representing a hit wire in the central drift chamber.
Definition: CDCWireHit.h:65
Belle2::TrackFindingCDC::CDCRecoHit3D::reconstruct
static CDCRecoHit3D reconstruct(const CDCRecoHit2D &recoHit2D, const CDCTrajectory2D &trajectory2D)
Reconstructs the three dimensional hit from the two dimensional and the two dimensional trajectory.
Definition: CDCRecoHit3D.cc:58
Belle2::TrackFindingCDC::CDCRecoHit3D::getRecoPos3D
const Vector3D & getRecoPos3D() const
Getter for the 3d position of the hit.
Definition: CDCRecoHit3D.h:295
Belle2::TrackFindingCDC::CDCRecoHit3D::hasWireHit
bool hasWireHit(const CDCWireHit &wireHit) const
Checks if the reconstructed hit is assoziated with the give wire hit.
Definition: CDCRecoHit3D.h:254
Belle2::TrackFindingCDC::CDCRecoHit3D::m_rlWireHit
CDCRLWireHit m_rlWireHit
Memory for the oriented wire hit reference.
Definition: CDCRecoHit3D.h:399
Belle2::TrackFindingCDC::CDCRecoHit3D::operator==
bool operator==(const CDCRecoHit3D &other) const
Equality comparision based on wire hit, right left passage information and reconstructed position.
Definition: CDCRecoHit3D.h:175
Belle2::TrackFindingCDC::CDCRecoHit3D::getRefPos2D
const Vector2D & getRefPos2D() const
Getter for the reference position of the wire.
Definition: CDCRecoHit3D.h:289
Belle2::TrackFindingCDC::CDCRecoHit3D::getRecoHit2D
CDCRecoHit2D getRecoHit2D() const
Constructs a two dimensional reconstructed hit by carrying out the stereo ! projection to the wire re...
Definition: CDCRecoHit3D.cc:199