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/trackFindingCDC/eventdata/hits/CDCRLWireHitPair.h>
11#include <tracking/trackFindingCDC/eventdata/hits/CDCRLWireHit.h>
12
13#include <tracking/trackFindingCDC/numerics/ERightLeft.h>
14#include <tracking/trackFindingCDC/topology/EStereoKind.h>
15#include <tracking/trackFindingCDC/topology/ISuperLayer.h>
16
17#include <iosfwd>
18#include <cassert>
19
20namespace Belle2 {
25 namespace TrackFindingCDC {
26 class CDCWireHit;
27 class CDCWire;
28
36 public:
38 class Shape {
39
40 public:
42 Shape();
43
45 Shape(const short startToMiddleCellDistance,
46 const short middleToEndCellDistance,
47 const short oClockDelta);
48
50 short getStartToMiddleCellDistance() const;
51
53 short getMiddleToEndCellDistance() const;
54
56 short getCellExtend() const;
57
59 short getOClockDelta() const;
60
62 bool isValid() const;
63
64 private:
67
70
73 };
74
76 CDCRLWireHitTriple() = default;
77
79 CDCRLWireHitTriple(const CDCRLWireHit& startRLWireHit,
80 const CDCRLWireHit& middleRLWireHit,
81 const CDCRLWireHit& endRLWireHit,
82 int iCluster = 0);
83
86
88 void reverse();
89
92
94 bool operator==(const CDCRLWireHitTriple& other) const
95 {
96 return getStartRLWireHit() == other.getStartRLWireHit() and
98 }
99
100
102 bool operator< (const CDCRLWireHitTriple& other) const
103 {
104 return getICluster() < other.getICluster() or
105 (getICluster() == other.getICluster() and
107 (getStartRLWireHit() == other.getStartRLWireHit() and
109 }
110
115 friend bool operator< (const CDCRLWireHitTriple& rlWireHitTriple,
116 const CDCRLWireHitPair& rlWireHitPair)
117 {
118 return rlWireHitTriple.getICluster() < rlWireHitPair.getICluster() or
119 (rlWireHitTriple.getICluster() == rlWireHitPair.getICluster() and
120 (rlWireHitTriple.getStartRLWireHit() < rlWireHitPair.getFromRLWireHit() or
121 (rlWireHitTriple.getStartRLWireHit() == rlWireHitPair.getFromRLWireHit() and
122 rlWireHitTriple.getMiddleRLWireHit() < rlWireHitPair.getToRLWireHit())));
123 }
124
127 friend bool operator< (const CDCRLWireHitPair& rlWireHitPair,
128 const CDCRLWireHitTriple& rlWireHitTriple)
129 {
130 return rlWireHitPair.getICluster() < rlWireHitTriple.getICluster() or
131 (rlWireHitPair.getICluster() == rlWireHitTriple.getICluster() and
132 (rlWireHitPair.getFromRLWireHit() < rlWireHitTriple.getStartRLWireHit() or
133 (rlWireHitPair.getFromRLWireHit() == rlWireHitTriple.getStartRLWireHit() and
134 rlWireHitPair.getToRLWireHit() < rlWireHitTriple.getMiddleRLWireHit())));
135 }
136
138 Shape getShape() const;
139
141 ISuperLayer getISuperLayer() const
142 {
145 }
146
148 EStereoKind getStereoKind() const
149 {
151 }
152
154 bool isAxial() const
155 {
156 return getStereoKind() == EStereoKind::c_Axial;
157 }
158
160 const CDCWire& getStartWire() const
161 {
162 return getStartRLWireHit().getWire();
163 }
164
166 const CDCWire& getMiddleWire() const
167 {
168 return getMiddleRLWireHit().getWire();
169 }
170
172 const CDCWire& getEndWire() const
173 {
174 return getEndRLWireHit().getWire();
175 }
176
178 bool hasWire(const CDCWire& wire) const
179 {
180 return getStartRLWireHit().isOnWire(wire) or getRearRLWireHitPair().hasWire(wire);
181 }
182
185 {
186 return getStartRLWireHit().getRLInfo();
187 }
188
191 {
192 return getMiddleRLWireHit().getRLInfo();
193 }
194
197 {
198 return getEndRLWireHit().getRLInfo();
199 }
200
203 {
204 return getStartRLWireHit().getWireHit();
205 }
206
209 {
211 }
212
215 {
216 return getEndRLWireHit().getWireHit();
217 }
218
220 bool hasWireHit(const CDCWireHit& wirehit) const
221 {
222 return getStartRLWireHit().hasWireHit(wirehit) or
224 }
225
228 {
229 return m_startRLWireHit;
230 }
231
234 {
236 }
237
240 {
242 }
243
246 {
247 return m_startRLWireHit;
248 }
249
252 {
254 }
255
258 {
260 }
261
264 {
265 return m_rearRLWireHitPair;
266 }
267
270 {
271 return m_rearRLWireHitPair;
272 }
273
275 void setStartRLWireHit(const CDCRLWireHit& startRLWireHit)
276 {
277 m_startRLWireHit = startRLWireHit;
278 }
279
281 void setMiddleRLWireHit(const CDCRLWireHit& middleRLWireHit)
282 {
283 m_rearRLWireHitPair.setFromRLWireHit(middleRLWireHit);
284 }
285
287 void setEndRLWireHit(const CDCRLWireHit& endRLWireHit)
288 {
290 }
291
293 void setStartRLInfo(const ERightLeft startRLInfo)
294 {
295 m_startRLWireHit.setRLInfo(startRLInfo);
296 }
297
299 void setMiddleRLInfo(const ERightLeft middleRLInfo)
300 {
301 getRearRLWireHitPair().setFromRLInfo(middleRLInfo);
302 }
303
305 void setEndRLInfo(const ERightLeft endRLInfo)
306 {
308 }
309
311 int getICluster() const
312 {
314 }
315
317 void setICluster(int iCluster)
318 {
320 }
321
322 protected:
325
328 };
329
330 std::ostream& operator<<(std::ostream& output, const CDCRLWireHitTriple& rlWireHitTriple);
331 }
333}
void setICluster(int iCluster)
Setter for the cluster id.
void setFromRLWireHit(const CDCRLWireHit &fromRLWireHit)
Setter for the first oriented wire hit.
CDCRLWireHit & getToRLWireHit()
Getter for the second oriented wire hit.
void setToRLWireHit(const CDCRLWireHit &toRLWireHit)
Setter for the second oriented wire hit.
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.
bool hasWire(const CDCWire &wire) const
Indicator if any of the two oriented wire hits is based on the given wire.
Type for the different shapes of a triple of neighboring wire hits.
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.
ISuperLayer getISuperLayer() const
Getter for the common superlayer id of the pair.
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 CDCWire & getStartWire() const
Getter for the wire the first oriented wire hit is based on.
bool operator==(const CDCRLWireHitTriple &other) const
Equality comparision 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.
const CDCWire & getMiddleWire() const
Getter for the wire the second oriented wire hit is based on.
void setEndRLWireHit(const CDCRLWireHit &endRLWireHit)
Setter for the third oriented wire hit.
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.
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.
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 tiple 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.
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.
const CDCWire & getEndWire() const
Getter for the wire the third oriented wire hit is based on.
EStereoKind getStereoKind() const
Getter for the common stereo type of the superlayer of the pair.
Shape getShape() const
Getter for the shape of this tiple if all three oriented wire hits are neighbors. Else ILLSHAPE.
CDCRLWireHit & getEndRLWireHit()
Getter for the third oriented wire hit.
bool hasWire(const CDCWire &wire) const
Indicator if any of the three oriented wire hits is based on the given wire.
CDCRLWireHit & getMiddleRLWireHit()
Getter for the second oriented wire hit.
friend bool operator<(const CDCRLWireHitTriple &rlWireHitTriple, const CDCRLWireHitPair &rlWireHitPair)
Define oriented wire hit pairs to be coaligned with oriented wire hit triples on the first two orient...
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 ...
Definition: CDCRLWireHit.h:41
const CDCWireHit & getWireHit() const
Getter for the wire hit associated with the oriented hit.
Definition: CDCRLWireHit.h:192
ISuperLayer getISuperLayer() const
Getter for the superlayer id.
const 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.
Definition: CDCRLWireHit.h:198
void setRLInfo(const ERightLeft rlInfo)
Setter for the right left passage information.
Definition: CDCRLWireHit.h:240
bool isOnWire(const CDCWire &wire) const
Checks if the oriented hit is associated with the give wire.
Definition: CDCRLWireHit.h:168
ERightLeft getRLInfo() const
Getter for the right left passage information.
Definition: CDCRLWireHit.h:234
Class representing a hit wire in the central drift chamber.
Definition: CDCWireHit.h:55
Class representing a sense wire in the central drift chamber.
Definition: CDCWire.h:58
ERightLeft
Enumeration to represent the distinct possibilities of the right left passage.
Definition: ERightLeft.h:25
Abstract base class for different kinds of events.
static EStereoKind getStereoKind(ISuperLayer iSuperLayer)
Returns the stereo kind of the super layer.
Definition: ISuperLayer.cc:26