Belle II Software development
CDCRLWireHitPair.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/CDCRLWireHit.h>
11
12#include <tracking/trackingUtilities/numerics/ERightLeft.h>
13#include <cdc/topology/EStereoKind.h>
14#include <cdc/topology/ISuperLayer.h>
15
16namespace Belle2 {
21
22 namespace CDC {
23 class CDCWire;
24 class WireNeighborKind;
25
26 }
27
28 namespace TrackingUtilities {
29 class CDCWireHit;
32 public:
34 CDCRLWireHitPair() = default;
35
37 CDCRLWireHitPair(const CDCRLWireHit& fromRLWireHit,
38 const CDCRLWireHit& toRLWireHit,
39 int iCluster = 0);
40
43
45 void reverse();
46
49
51 bool operator==(const CDCRLWireHitPair& other) const
52 {
53 return getFromRLWireHit() == other.getFromRLWireHit() and
54 getToRLWireHit() == other.getToRLWireHit();
55 }
56
61 bool operator<(const CDCRLWireHitPair& other) const
62 {
63 return getICluster() < other.getICluster() or
64 (getICluster() == other.getICluster() and
66 (getFromRLWireHit() == other.getFromRLWireHit() and
67 getToRLWireHit() < other.getToRLWireHit())));
68 }
69
71 friend bool operator<(const CDCRLWireHitPair& rlWireHitPair, const CDCWireHit& wireHit)
72 {
73 return rlWireHitPair.getFromRLWireHit() < wireHit;
74 }
75
77 friend bool operator<(const CDCWireHit& wireHit, const CDCRLWireHitPair& rlWireHitPair)
78 {
79 return wireHit < rlWireHitPair.getFromRLWireHit();
80 }
81
84
91
97
99 bool isAxial() const
100 {
102 }
103
106 {
107 return getFromRLWireHit().getWire();
108 }
109
111 const CDC::CDCWire& getToWire() const
112 {
113 return getToRLWireHit().getWire();
114 }
115
117 bool hasWire(const CDC::CDCWire& wire) const
118 {
119 return getFromRLWireHit().isOnWire(wire) or getToRLWireHit().isOnWire(wire);
120 }
121
124 {
125 return getFromRLWireHit().getWireHit();
126 }
127
130 {
131 return getToRLWireHit().getWireHit();
132 }
133
135 bool hasWireHit(const CDCWireHit& wirehit) const
136 {
137 return getFromRLWireHit().hasWireHit(wirehit) or getToRLWireHit().hasWireHit(wirehit);
138 }
139
141 ERightLeft getFromRLInfo() const
142 {
143 return getFromRLWireHit().getRLInfo();
144 }
145
147 ERightLeft getToRLInfo() const
148 {
149 return getToRLWireHit().getRLInfo();
150 }
151
157
160 {
161 return m_toRLWireHit;
162 }
163
166 {
167 return m_fromRLWireHit;
168 }
169
172 {
173 return m_toRLWireHit;
174 }
175
177 void setFromRLWireHit(const CDCRLWireHit& fromRLWireHit)
178 {
179 m_fromRLWireHit = fromRLWireHit;
180 }
181
183 void setToRLWireHit(const CDCRLWireHit& toRLWireHit)
184 {
185 m_toRLWireHit = toRLWireHit;
186 }
187
189 void setFromRLInfo(ERightLeft fromRLInfo);
190
192 void setToRLInfo(ERightLeft toRLInfo);
193
195 int getICluster() const
196 {
197 return m_iCluster;
198 }
199
201 void setICluster(int iCluster)
202 {
203 m_iCluster = iCluster;
204 }
205
206 protected:
209
212
214 int m_iCluster = -1;
215 };
216 }
218}
Class representing a sense wire in the central drift chamber.
Definition CDCWire.h:50
Type for the neighbor relationship from one wire to another.
void setICluster(int iCluster)
Setter for the cluster id.
void setFromRLWireHit(const CDCRLWireHit &fromRLWireHit)
Setter for the first oriented wire hit.
void reverse()
Reverses the oriented wire hit pair inplace.
const CDCRLWireHit & getToRLWireHit() const
Constant getter for the second oriented wire hit.
const CDC::CDCWire & getFromWire() const
Getter for the wire the first oriented wire hit is based on.
CDCRLWireHit & getToRLWireHit()
Getter for the second oriented wire hit.
bool isAxial() const
Indicator if the underlying wires are axial.
bool hasWire(const CDC::CDCWire &wire) const
Indicator if any of the two oriented wire hits is based on the given wire.
CDC::ISuperLayer getISuperLayer() const
Getter for the common superlayer id of the pair.
CDCRLWireHitPair getAlias() const
Returns the aliased version of this oriented wire hit pair.
const CDCRLWireHit & getFromRLWireHit() const
Constant getter for the first 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.
CDCRLWireHit m_fromRLWireHit
Memory for the reference to the first oriented wire hit.
friend bool operator<(const CDCRLWireHitPair &rlWireHitPair, const CDCWireHit &wireHit)
Defines wire hits and oriented wire hit pair as coaligned on the first wire hit.
bool operator<(const CDCRLWireHitPair &other) const
Total ordering relation based on the from oriented wire hit first and the to oriented wire hit second...
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.
CDC::WireNeighborKind getNeighborKind() const
Getter for the WireNeighborKind of the two underlying wires.
const CDCWireHit & getFromWireHit() const
Getter for the hit wire of the first oriented wire hit.
ERightLeft getFromRLInfo() const
Getter for the right left passage information of the first oriented wire hit.
const CDCWireHit & getToWireHit() const
Getter for the hit wire of the second 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.
CDCRLWireHitPair reversed() const
Constructs a oriented wire hit pair that is the reverse of this one.
friend bool operator<(const CDCWireHit &wireHit, const CDCRLWireHitPair &rlWireHitPair)
Defines wire hits and oriented wire hit pair as coaligned on the first wire hit.
CDCRLWireHit & getFromRLWireHit()
Getter for the first oriented wire hit.
CDCRLWireHitPair()=default
Default constructor for ROOT.
ERightLeft getToRLInfo() const
Getter for the right left passage information of the second oriented wire hit.
CDCRLWireHit m_toRLWireHit
Memory for the reference to the second oriented wire hit.
bool operator==(const CDCRLWireHitPair &other) const
Equality comparison based the two oriented wire hits.
const CDC::CDCWire & getToWire() const
Getter for the wire the second oriented wire hit is based on.
int m_iCluster
Memory for the cluster id of this facet.
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 const ISuperLayer c_Invalid
Constant making an invalid superlayer id.
Definition ISuperLayer.h:65
static EStereoKind getStereoKind(ISuperLayer iSuperLayer)
Returns the stereo kind of the super layer.