Belle II Software  release-05-01-25
CDCRLWireHitTriple.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2014 - 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/CDCRLWireHitPair.h>
13 #include <tracking/trackFindingCDC/eventdata/hits/CDCRLWireHit.h>
14 
15 #include <tracking/trackFindingCDC/numerics/ERightLeft.h>
16 #include <tracking/trackFindingCDC/topology/EStereoKind.h>
17 #include <tracking/trackFindingCDC/topology/ISuperLayer.h>
18 
19 #include <iosfwd>
20 #include <cassert>
21 
22 namespace Belle2 {
27  namespace TrackFindingCDC {
28  class CDCWireHit;
29  class CDCWire;
30 
37  class CDCRLWireHitTriple {
38  public:
40  class Shape {
41 
42  public:
44  Shape();
45 
47  Shape(const short startToMiddleCellDistance,
48  const short middleToEndCellDistance,
49  const short oClockDelta);
50 
52  short getStartToMiddleCellDistance() const;
53 
55  short getMiddleToEndCellDistance() const;
56 
58  short getCellExtend() const;
59 
61  short getOClockDelta() const;
62 
64  bool isValid() const;
65 
66  private:
69 
72 
74  short m_oClockDelta;
75  };
76 
78  CDCRLWireHitTriple() = default;
79 
81  CDCRLWireHitTriple(const CDCRLWireHit& startRLWireHit,
82  const CDCRLWireHit& middleRLWireHit,
83  const CDCRLWireHit& endRLWireHit,
84  int iCluster = 0);
85 
88 
90  void reverse();
91 
94 
96  bool operator==(const CDCRLWireHitTriple& other) const
97  {
98  return getStartRLWireHit() == other.getStartRLWireHit() and
99  getRearRLWireHitPair() == other.getRearRLWireHitPair();
100  }
101 
102 
104  bool operator< (const CDCRLWireHitTriple& other) const
105  {
106  return getICluster() < other.getICluster() or
107  (getICluster() == other.getICluster() and
108  (getStartRLWireHit() < other.getStartRLWireHit() or
109  (getStartRLWireHit() == other.getStartRLWireHit() and
110  getRearRLWireHitPair() < other.getRearRLWireHitPair())));
111  }
112 
117  friend bool operator< (const CDCRLWireHitTriple& rlWireHitTriple,
118  const CDCRLWireHitPair& rlWireHitPair)
119  {
120  return rlWireHitTriple.getICluster() < rlWireHitPair.getICluster() or
121  (rlWireHitTriple.getICluster() == rlWireHitPair.getICluster() and
122  (rlWireHitTriple.getStartRLWireHit() < rlWireHitPair.getFromRLWireHit() or
123  (rlWireHitTriple.getStartRLWireHit() == rlWireHitPair.getFromRLWireHit() and
124  rlWireHitTriple.getMiddleRLWireHit() < rlWireHitPair.getToRLWireHit())));
125  }
126 
129  friend bool operator< (const CDCRLWireHitPair& rlWireHitPair,
130  const CDCRLWireHitTriple& rlWireHitTriple)
131  {
132  return rlWireHitPair.getICluster() < rlWireHitTriple.getICluster() or
133  (rlWireHitPair.getICluster() == rlWireHitTriple.getICluster() and
134  (rlWireHitPair.getFromRLWireHit() < rlWireHitTriple.getStartRLWireHit() or
135  (rlWireHitPair.getFromRLWireHit() == rlWireHitTriple.getStartRLWireHit() and
136  rlWireHitPair.getToRLWireHit() < rlWireHitTriple.getMiddleRLWireHit())));
137  }
138 
140  Shape getShape() const;
141 
143  ISuperLayer getISuperLayer() const
144  {
147  }
148 
150  EStereoKind getStereoKind() const
151  {
153  }
154 
156  bool isAxial() const
157  {
158  return getStereoKind() == EStereoKind::c_Axial;
159  }
160 
162  const CDCWire& getStartWire() const
163  {
165  }
166 
168  const CDCWire& getMiddleWire() const
169  {
171  }
172 
174  const CDCWire& getEndWire() const
175  {
177  }
178 
180  bool hasWire(const CDCWire& wire) const
181  {
183  }
184 
186  ERightLeft getStartRLInfo() const
187  {
189  }
190 
193  {
195  }
196 
198  ERightLeft getEndRLInfo() const
199  {
201  }
202 
204  const CDCWireHit& getStartWireHit() const
205  {
207  }
208 
210  const CDCWireHit& getMiddleWireHit() const
211  {
213  }
214 
216  const CDCWireHit& getEndWireHit() const
217  {
219  }
220 
222  bool hasWireHit(const CDCWireHit& wirehit) const
223  {
224  return getStartRLWireHit().hasWireHit(wirehit) or
225  getRearRLWireHitPair().hasWireHit(wirehit);
226  }
227 
230  {
231  return m_startRLWireHit;
232  }
233 
236  {
238  }
239 
242  {
244  }
245 
247  const CDCRLWireHit& getStartRLWireHit() const
248  {
250  }
251 
253  const CDCRLWireHit& getMiddleRLWireHit() const
254  {
256  }
257 
259  const CDCRLWireHit& getEndRLWireHit() const
260  {
262  }
263 
266  {
268  }
269 
272  {
274  }
275 
277  void setStartRLWireHit(const CDCRLWireHit& startRLWireHit)
278  {
279  m_startRLWireHit = startRLWireHit;
280  }
281 
283  void setMiddleRLWireHit(const CDCRLWireHit& middleRLWireHit)
284  {
286  }
287 
289  void setEndRLWireHit(const CDCRLWireHit& endRLWireHit)
290  {
292  }
293 
295  void setStartRLInfo(const ERightLeft startRLInfo)
296  {
298  }
299 
301  void setMiddleRLInfo(const ERightLeft middleRLInfo)
302  {
304  }
305 
307  void setEndRLInfo(const ERightLeft endRLInfo)
308  {
310  }
311 
313  int getICluster() const
314  {
316  }
317 
319  void setICluster(int iCluster)
320  {
322  }
323 
324  protected:
327 
330  };
331 
332  std::ostream& operator<<(std::ostream& output, const CDCRLWireHitTriple& rlWireHitTriple);
333  }
335 }
Belle2::TrackFindingCDC::CDCRLWireHitTriple::getShape
Shape getShape() const
Getter for the shape of this tiple if all three oriented wire hits are neighbors. Else ILLSHAPE.
Definition: CDCRLWireHitTriple.cc:97
Belle2::TrackFindingCDC::CDCRLWireHit::setRLInfo
void setRLInfo(const ERightLeft rlInfo)
Setter for the right left passage information.
Definition: CDCRLWireHit.h:250
Belle2::TrackFindingCDC::CDCRLWireHitTriple::Shape::m_startToMiddleCellDistance
char m_startToMiddleCellDistance
The cell distances from start to middle.
Definition: CDCRLWireHitTriple.h:76
Belle2::TrackFindingCDC::CDCRLWireHitTriple::Shape::getStartToMiddleCellDistance
short getStartToMiddleCellDistance() const
Getter for the start to middle cell distance.
Definition: CDCRLWireHitTriple.cc:39
Belle2::TrackFindingCDC::CDCRLWireHitTriple::getEndRLInfo
ERightLeft getEndRLInfo() const
Getter for the right left passage information of the third oriented wire hit.
Definition: CDCRLWireHitTriple.h:206
Belle2::operator<<
std::ostream & operator<<(std::ostream &output, const IntervalOfValidity &iov)
Definition: IntervalOfValidity.cc:196
Belle2::TrackFindingCDC::CDCRLWireHitTriple::getStartWire
const CDCWire & getStartWire() const
Getter for the wire the first oriented wire hit is based on.
Definition: CDCRLWireHitTriple.h:170
Belle2::TrackFindingCDC::CDCRLWireHitTriple::getAlias
CDCRLWireHitTriple getAlias() const
Returns the aliased version of this oriented wire hit triple.
Definition: CDCRLWireHitTriple.cc:89
Belle2::TrackFindingCDC::CDCRLWireHitPair::getICluster
int getICluster() const
Getter for the cluster id.
Definition: CDCRLWireHitPair.h:201
Belle2::TrackFindingCDC::CDCRLWireHitTriple::operator==
bool operator==(const CDCRLWireHitTriple &other) const
Equality comparision considering all three oriented wire hits.
Definition: CDCRLWireHitTriple.h:104
Belle2::TrackFindingCDC::CDCRLWireHitTriple::reverse
void reverse()
Reverses the triple inplace.
Definition: CDCRLWireHitTriple.cc:81
Belle2::TrackFindingCDC::CDCRLWireHitTriple::getStartWireHit
const CDCWireHit & getStartWireHit() const
Getter for the hit wire of the first oriented wire hit.
Definition: CDCRLWireHitTriple.h:212
Belle2::TrackFindingCDC::ISuperLayerUtil::getStereoKind
static EStereoKind getStereoKind(ISuperLayer iSuperLayer)
Returns the stereo kind of the super layer.
Definition: ISuperLayer.cc:28
Belle2::TrackFindingCDC::CDCRLWireHit::getWireHit
const CDCWireHit & getWireHit() const
Getter for the wire hit associated with the oriented hit.
Definition: CDCRLWireHit.h:202
Belle2::TrackFindingCDC::CDCRLWireHitPair::setFromRLWireHit
void setFromRLWireHit(const CDCRLWireHit &fromRLWireHit)
Setter for the first oriented wire hit.
Definition: CDCRLWireHitPair.h:183
Belle2::TrackFindingCDC::CDCRLWireHit::getISuperLayer
ISuperLayer getISuperLayer() const
Getter for the superlayer id.
Definition: CDCRLWireHit.cc:143
Belle2::TrackFindingCDC::CDCRLWireHitTriple::getMiddleRLInfo
ERightLeft getMiddleRLInfo() const
Getter for the right left passage information of the second oriented wire hit.
Definition: CDCRLWireHitTriple.h:200
Belle2::TrackFindingCDC::CDCRLWireHit::getWire
const CDCWire & getWire() const
Getter for the wire the oriented hit associated to.
Definition: CDCRLWireHit.cc:133
Belle2::TrackFindingCDC::CDCRLWireHitTriple::Shape::Shape
Shape()
Default constructor for an invalid shape.
Definition: CDCRLWireHitTriple.cc:23
Belle2::TrackFindingCDC::CDCRLWireHitTriple::setStartRLWireHit
void setStartRLWireHit(const CDCRLWireHit &startRLWireHit)
Setter for the first oriented wire hit.
Definition: CDCRLWireHitTriple.h:285
Belle2::TrackFindingCDC::CDCRLWireHitTriple::setMiddleRLWireHit
void setMiddleRLWireHit(const CDCRLWireHit &middleRLWireHit)
Setter for the second oriented wire hit.
Definition: CDCRLWireHitTriple.h:291
Belle2::TrackFindingCDC::CDCRLWireHitPair::getToRLWireHit
CDCRLWireHit & getToRLWireHit()
Getter for the second oriented wire hit.
Definition: CDCRLWireHitPair.h:165
Belle2::TrackFindingCDC::CDCRLWireHitTriple::getStartRLInfo
ERightLeft getStartRLInfo() const
Getter for the right left passage information of the first oriented wire hit.
Definition: CDCRLWireHitTriple.h:194
Belle2::TrackFindingCDC::CDCRLWireHitTriple::setMiddleRLInfo
void setMiddleRLInfo(const ERightLeft middleRLInfo)
Setter for the right left passage information of the second oriented wire hit.
Definition: CDCRLWireHitTriple.h:309
Belle2::TrackFindingCDC::CDCRLWireHitTriple::getEndWireHit
const CDCWireHit & getEndWireHit() const
Getter for the hit wire of the third oriented wire hit.
Definition: CDCRLWireHitTriple.h:224
Belle2::TrackFindingCDC::CDCRLWireHitTriple
Class representing a triple of neighboring wire hits.
Definition: CDCRLWireHitTriple.h:45
Belle2::TrackFindingCDC::CDCRLWireHitTriple::m_rearRLWireHitPair
CDCRLWireHitPair m_rearRLWireHitPair
Memory for the second and third wire hits.
Definition: CDCRLWireHitTriple.h:337
Belle2::TrackFindingCDC::CDCRLWireHitPair::setToRLInfo
void setToRLInfo(ERightLeft toRLInfo)
Setter for the right left passage information of the second oriented wire hit.
Definition: CDCRLWireHitPair.cc:61
Belle2::TrackFindingCDC::CDCRLWireHitTriple::setEndRLInfo
void setEndRLInfo(const ERightLeft endRLInfo)
Setter for the right left passage information of the third oriented wire hit.
Definition: CDCRLWireHitTriple.h:315
Belle2::TrackFindingCDC::CDCRLWireHitTriple::hasWireHit
bool hasWireHit(const CDCWireHit &wirehit) const
Indicator if any of the three oriented wire hits is based on the given wire hit.
Definition: CDCRLWireHitTriple.h:230
Belle2::TrackFindingCDC::CDCRLWireHitTriple::reversed
CDCRLWireHitTriple reversed() const
Constructs the reverse tiple from this one.
Definition: CDCRLWireHitTriple.cc:73
Belle2::TrackFindingCDC::CDCRLWireHitPair::getFromRLWireHit
CDCRLWireHit & getFromRLWireHit()
Getter for the first oriented wire hit.
Definition: CDCRLWireHitPair.h:159
Belle2::TrackFindingCDC::CDCRLWireHitPair::setToRLWireHit
void setToRLWireHit(const CDCRLWireHit &toRLWireHit)
Setter for the second oriented wire hit.
Definition: CDCRLWireHitPair.h:189
Belle2::TrackFindingCDC::CDCRLWireHitTriple::operator<
bool operator<(const CDCRLWireHitTriple &other) const
Establish a total ordering based on the three oriented wire hits.
Definition: CDCRLWireHitTriple.h:112
Belle2::TrackFindingCDC::CDCRLWireHitTriple::m_startRLWireHit
CDCRLWireHit m_startRLWireHit
Memory for the start oriented wire hit.
Definition: CDCRLWireHitTriple.h:334
Belle2::TrackFindingCDC::CDCRLWireHitPair::hasWire
bool hasWire(const CDCWire &wire) const
Indicator if any of the two oriented wire hits is based on the given wire.
Definition: CDCRLWireHitPair.h:123
Belle2::TrackFindingCDC::CDCRLWireHitTriple::getMiddleWireHit
const CDCWireHit & getMiddleWireHit() const
Getter for the hit wire of the second oriented wire hit.
Definition: CDCRLWireHitTriple.h:218
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::CDCRLWireHitTriple::getEndWire
const CDCWire & getEndWire() const
Getter for the wire the third oriented wire hit is based on.
Definition: CDCRLWireHitTriple.h:182
Belle2::TrackFindingCDC::CDCRLWireHitTriple::getRearRLWireHitPair
CDCRLWireHitPair & getRearRLWireHitPair()
Getter for the pair of second and third oriented wire hit.
Definition: CDCRLWireHitTriple.h:273
Belle2::TrackFindingCDC::CDCRLWireHitTriple::setICluster
void setICluster(int iCluster)
Setter for the cluster id.
Definition: CDCRLWireHitTriple.h:327
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::CDCRLWireHitPair::hasWireHit
bool hasWireHit(const CDCWireHit &wirehit) const
Indicator if any of the two oriented wire hits is based on the given wire hit.
Definition: CDCRLWireHitPair.h:141
Belle2::TrackFindingCDC::CDCRLWireHitPair::setICluster
void setICluster(int iCluster)
Setter for the cluster id.
Definition: CDCRLWireHitPair.h:207
Belle2::TrackFindingCDC::CDCRLWireHitTriple::Shape::getOClockDelta
short getOClockDelta() const
Getter for the o'clock direction difference from start to middle compared to middle to end.
Definition: CDCRLWireHitTriple.cc:54
Belle2::TrackFindingCDC::NRightLeft::ERightLeft
ERightLeft
Enumeration to represent the distinct possibilities of the right left passage.
Definition: ERightLeft.h:35
Belle2::TrackFindingCDC::CDCRLWireHitTriple::getMiddleWire
const CDCWire & getMiddleWire() const
Getter for the wire the second oriented wire hit is based on.
Definition: CDCRLWireHitTriple.h:176
Belle2::TrackFindingCDC::CDCRLWireHitTriple::hasWire
bool hasWire(const CDCWire &wire) const
Indicator if any of the three oriented wire hits is based on the given wire.
Definition: CDCRLWireHitTriple.h:188
Belle2::TrackFindingCDC::CDCRLWireHitTriple::getMiddleRLWireHit
CDCRLWireHit & getMiddleRLWireHit()
Getter for the second oriented wire hit.
Definition: CDCRLWireHitTriple.h:243
Belle2::TrackFindingCDC::CDCRLWireHitTriple::Shape::m_middleToEndCellDistance
char m_middleToEndCellDistance
The cell distances from middle to end.
Definition: CDCRLWireHitTriple.h:79
Belle2::TrackFindingCDC::CDCRLWireHitPair
A pair of oriented wire hits.
Definition: CDCRLWireHitPair.h:37
Belle2::TrackFindingCDC::CDCRLWireHitTriple::setStartRLInfo
void setStartRLInfo(const ERightLeft startRLInfo)
Setter for the right left passage information of the first oriented wire hit.
Definition: CDCRLWireHitTriple.h:303
Belle2::TrackFindingCDC::CDCRLWireHitTriple::Shape::m_oClockDelta
short m_oClockDelta
The o'clock direction difference from start to middle compared to middle to end.
Definition: CDCRLWireHitTriple.h:82
Belle2::TrackFindingCDC::CDCWire
Class representing a sense wire in the central drift chamber.
Definition: CDCWire.h:60
Belle2::TrackFindingCDC::CDCRLWireHitTriple::getEndRLWireHit
CDCRLWireHit & getEndRLWireHit()
Getter for the third oriented wire hit.
Definition: CDCRLWireHitTriple.h:249
Belle2::TrackFindingCDC::CDCRLWireHitTriple::isAxial
bool isAxial() const
Indicator if the underlying wires are axial.
Definition: CDCRLWireHitTriple.h:164
Belle2::TrackFindingCDC::CDCRLWireHitTriple::getStereoKind
EStereoKind getStereoKind() const
Getter for the common stereo type of the superlayer of the pair.
Definition: CDCRLWireHitTriple.h:158
Belle2::TrackFindingCDC::CDCRLWireHitTriple::CDCRLWireHitTriple
CDCRLWireHitTriple()=default
Default constructor for ROOT.
Belle2::TrackFindingCDC::CDCRLWireHitTriple::getICluster
int getICluster() const
Getter for the cluster id.
Definition: CDCRLWireHitTriple.h:321
Belle2::TrackFindingCDC::CDCWireHit
Class representing a hit wire in the central drift chamber.
Definition: CDCWireHit.h:65
Belle2::TrackFindingCDC::CDCRLWireHitTriple::Shape::isValid
bool isValid() const
Check if the shape is considered valid.
Definition: CDCRLWireHitTriple.cc:59
Belle2::TrackFindingCDC::CDCRLWireHitTriple::setEndRLWireHit
void setEndRLWireHit(const CDCRLWireHit &endRLWireHit)
Setter for the third oriented wire hit.
Definition: CDCRLWireHitTriple.h:297
Belle2::TrackFindingCDC::CDCRLWireHitTriple::Shape::getCellExtend
short getCellExtend() const
Getter for the sum of cell distances from start to middle and middle to end.
Definition: CDCRLWireHitTriple.cc:49
Belle2::TrackFindingCDC::CDCRLWireHitTriple::Shape::getMiddleToEndCellDistance
short getMiddleToEndCellDistance() const
Getter for the middle to end cell distance.
Definition: CDCRLWireHitTriple.cc:44
Belle2::TrackFindingCDC::CDCRLWireHitTriple::getStartRLWireHit
CDCRLWireHit & getStartRLWireHit()
Getter for the first oriented wire hit.
Definition: CDCRLWireHitTriple.h:237
Belle2::TrackFindingCDC::CDCRLWireHitTriple::getISuperLayer
ISuperLayer getISuperLayer() const
Getter for the common superlayer id of the pair.
Definition: CDCRLWireHitTriple.h:151
Belle2::TrackFindingCDC::CDCRLWireHitPair::setFromRLInfo
void setFromRLInfo(ERightLeft fromRLInfo)
Setter for the right left passage information of the first oriented wire hit.
Definition: CDCRLWireHitPair.cc:56