Belle II Software development
CDCRLWireHitTriple.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 <tracking/trackingUtilities/eventdata/hits/CDCRLWireHitPair.h>
11#include <tracking/trackingUtilities/eventdata/hits/CDCRLWireHit.h>
12
13#include <tracking/trackingUtilities/numerics/ERightLeft.h>
14#include <cdc/topology/EStereoKind.h>
15#include <cdc/topology/ISuperLayer.h>
16
17#include <iosfwd>
18#include <cassert>
19
20namespace Belle2 {
25 namespace CDC {
26 class CDCWire;
27 }
28 namespace TrackingUtilities {
29 class CDCWireHit;
30
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
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
100 }
101
102
104 bool operator< (const CDCRLWireHitTriple& other) const
105 {
106 return getICluster() < other.getICluster() or
107 (getICluster() == other.getICluster() and
109 (getStartRLWireHit() == other.getStartRLWireHit() and
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
148
154
156 bool isAxial() const
157 {
159 }
160
163 {
164 return getStartRLWireHit().getWire();
165 }
166
169 {
170 return getMiddleRLWireHit().getWire();
171 }
172
175 {
176 return getEndRLWireHit().getWire();
177 }
178
180 bool hasWire(const CDC::CDCWire& wire) const
181 {
182 return getStartRLWireHit().isOnWire(wire) or getRearRLWireHitPair().hasWire(wire);
183 }
184
186 ERightLeft getStartRLInfo() const
187 {
188 return getStartRLWireHit().getRLInfo();
189 }
190
192 ERightLeft getMiddleRLInfo() const
193 {
194 return getMiddleRLWireHit().getRLInfo();
195 }
196
198 ERightLeft getEndRLInfo() const
199 {
200 return getEndRLWireHit().getRLInfo();
201 }
202
205 {
206 return getStartRLWireHit().getWireHit();
207 }
208
211 {
213 }
214
217 {
218 return getEndRLWireHit().getWireHit();
219 }
220
222 bool hasWireHit(const CDCWireHit& wirehit) const
223 {
224 return getStartRLWireHit().hasWireHit(wirehit) or
226 }
227
233
239
245
248 {
249 return m_startRLWireHit;
250 }
251
254 {
256 }
257
260 {
262 }
263
269
272 {
273 return m_rearRLWireHitPair;
274 }
275
277 void setStartRLWireHit(const CDCRLWireHit& startRLWireHit)
278 {
279 m_startRLWireHit = startRLWireHit;
280 }
281
283 void setMiddleRLWireHit(const CDCRLWireHit& middleRLWireHit)
284 {
285 m_rearRLWireHitPair.setFromRLWireHit(middleRLWireHit);
286 }
287
289 void setEndRLWireHit(const CDCRLWireHit& endRLWireHit)
290 {
291 m_rearRLWireHitPair.setToRLWireHit(endRLWireHit);
292 }
293
295 void setStartRLInfo(const ERightLeft startRLInfo)
296 {
297 m_startRLWireHit.setRLInfo(startRLInfo);
298 }
299
301 void setMiddleRLInfo(const ERightLeft middleRLInfo)
302 {
303 getRearRLWireHitPair().setFromRLInfo(middleRLInfo);
304 }
305
307 void setEndRLInfo(const ERightLeft endRLInfo)
308 {
310 }
311
313 int getICluster() const
314 {
315 return m_rearRLWireHitPair.getICluster();
316 }
317
319 void setICluster(int iCluster)
320 {
321 m_rearRLWireHitPair.setICluster(iCluster);
322 }
323
324 protected:
327
330 };
331
332 std::ostream& operator<<(std::ostream& output, const CDCRLWireHitTriple& rlWireHitTriple);
333 }
335}
Class representing a sense wire in the central drift chamber.
Definition CDCWire.h:50
CDCRLWireHit & getToRLWireHit()
Getter for the second oriented wire hit.
bool hasWire(const CDC::CDCWire &wire) const
Indicator if any of the two oriented wire hits is based on the given wire.
void setFromRLInfo(ERightLeft fromRLInfo)
Setter for the right left passage information of the first oriented wire hit.
bool hasWireHit(const CDCWireHit &wirehit) const
Indicator if any of the two oriented wire hits is based on the given wire hit.
void setToRLInfo(ERightLeft toRLInfo)
Setter for the right left passage information of the second oriented wire hit.
int getICluster() const
Getter for the cluster id.
CDCRLWireHit & getFromRLWireHit()
Getter for the first oriented wire hit.
short getMiddleToEndCellDistance() const
Getter for the middle to end cell distance.
char m_middleToEndCellDistance
The cell distances from middle to end.
bool isValid() const
Check if the shape is considered valid.
char m_startToMiddleCellDistance
The cell distances from start to middle.
short getCellExtend() const
Getter for the sum of cell distances from start to middle and middle to end.
Shape()
Default constructor for an invalid shape.
short getOClockDelta() const
Getter for the o'clock direction difference from start to middle compared to middle to end.
short m_oClockDelta
The o'clock direction difference from start to middle compared to middle to end.
short getStartToMiddleCellDistance() const
Getter for the start to middle cell distance.
Class representing a triple of neighboring wire hits.
void setICluster(int iCluster)
Setter for the cluster id.
CDCRLWireHitPair & getRearRLWireHitPair()
Getter for the pair of second and third oriented wire hit.
ERightLeft getMiddleRLInfo() const
Getter for the right left passage information of the second oriented wire hit.
const CDCRLWireHit & getEndRLWireHit() const
Constant getter for the third oriented wire hit.
const CDCWireHit & getMiddleWireHit() const
Getter for the hit wire of the second oriented wire hit.
void setEndRLInfo(const ERightLeft endRLInfo)
Setter for the right left passage information of the third oriented wire hit.
void reverse()
Reverses the triple inplace.
CDCRLWireHitTriple()=default
Default constructor for ROOT.
const CDC::CDCWire & getStartWire() const
Getter for the wire the first oriented wire hit is based on.
bool operator==(const CDCRLWireHitTriple &other) const
Equality comparison considering all three oriented wire hits.
const CDCRLWireHit & getStartRLWireHit() const
Constant getter for the first oriented wire hit.
bool isAxial() const
Indicator if the underlying wires are axial.
void setEndRLWireHit(const CDCRLWireHit &endRLWireHit)
Setter for the third oriented wire hit.
const CDC::CDCWire & getMiddleWire() const
Getter for the wire the second oriented wire hit is based on.
CDCRLWireHit & getStartRLWireHit()
Getter for the first oriented wire hit.
void setMiddleRLInfo(const ERightLeft middleRLInfo)
Setter for the right left passage information of the second oriented wire hit.
bool hasWire(const CDC::CDCWire &wire) const
Indicator if any of the three oriented wire hits is based on the given wire.
CDC::ISuperLayer getISuperLayer() const
Getter for the common superlayer id of the pair.
const CDCRLWireHitPair & getRearRLWireHitPair() const
Constant getter for the pair of second and third oriented wire hit.
ERightLeft getStartRLInfo() const
Getter for the right left passage information of the first oriented wire hit.
const CDC::CDCWire & getEndWire() const
Getter for the wire the third oriented wire hit is based on.
bool operator<(const CDCRLWireHitTriple &other) const
Establish a total ordering based on the three oriented wire hits.
bool hasWireHit(const CDCWireHit &wirehit) const
Indicator if any of the three oriented wire hits is based on the given wire hit.
void setMiddleRLWireHit(const CDCRLWireHit &middleRLWireHit)
Setter for the second oriented wire hit.
const CDCWireHit & getEndWireHit() const
Getter for the hit wire of the third oriented wire hit.
CDCRLWireHitTriple reversed() const
Constructs the reverse triple from this one.
CDCRLWireHitPair m_rearRLWireHitPair
Memory for the second and third wire hits.
ERightLeft getEndRLInfo() const
Getter for the right left passage information of the third oriented wire hit.
CDC::EStereoKind getStereoKind() const
Getter for the common stereo type of the superlayer of the pair.
int getICluster() const
Getter for the cluster id.
const CDCWireHit & getStartWireHit() const
Getter for the hit wire of the first oriented wire hit.
const CDCRLWireHit & getMiddleRLWireHit() const
Constant getter for the second oriented wire hit.
Shape getShape() const
Getter for the shape of this triple if all three oriented wire hits are neighbors....
CDCRLWireHit & getEndRLWireHit()
Getter for the third oriented wire hit.
CDCRLWireHit & getMiddleRLWireHit()
Getter for the second oriented wire hit.
void setStartRLInfo(const ERightLeft startRLInfo)
Setter for the right left passage information of the first oriented wire hit.
void setStartRLWireHit(const CDCRLWireHit &startRLWireHit)
Setter for the first oriented wire hit.
CDCRLWireHit m_startRLWireHit
Memory for the start oriented wire hit.
CDCRLWireHitTriple getAlias() const
Returns the aliased version of this oriented wire hit triple.
Class representing an oriented hit wire including a hypotheses whether the causing track passes left ...
const CDCWireHit & getWireHit() const
Getter for the wire hit associated with the oriented hit.
CDC::ISuperLayer getISuperLayer() const
Getter for the superlayer id.
const CDC::CDCWire & getWire() const
Getter for the wire the oriented hit associated to.
bool hasWireHit(const CDCWireHit &wirehit) const
Checks if the oriented hit is associated with the give wire hit.
bool isOnWire(const CDC::CDCWire &wire) const
Checks if the oriented hit is associated with the give wire.
ERightLeft getRLInfo() const
Getter for the right left passage information.
Class representing a hit wire in the central drift chamber.
Definition CDCWireHit.h:58
EStereoKind
Type for the stereo property of the wire.
Definition EStereoKind.h:20
@ c_Axial
Constant for an axial wire.
Definition EStereoKind.h:22
signed short ISuperLayer
The type of the layer and superlayer ids.
Definition ISuperLayer.h:24
Abstract base class for different kinds of events.
static EStereoKind getStereoKind(ISuperLayer iSuperLayer)
Returns the stereo kind of the super layer.