Belle II Software  release-05-01-25
CDCRLWireHitPair.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 <oliver.frost@desy.de> *
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/numerics/ERightLeft.h>
15 #include <tracking/trackFindingCDC/topology/EStereoKind.h>
16 #include <tracking/trackFindingCDC/topology/ISuperLayer.h>
17 
18 namespace Belle2 {
23  namespace TrackFindingCDC {
24  class CDCWireHit;
25  class CDCWire;
26  class WireNeighborKind;
27 
29  class CDCRLWireHitPair {
30  public:
32  CDCRLWireHitPair() = default;
33 
35  CDCRLWireHitPair(const CDCRLWireHit& fromRLWireHit,
36  const CDCRLWireHit& toRLWireHit,
37  int iCluster = 0);
38 
40  CDCRLWireHitPair reversed() const;
41 
43  void reverse();
44 
46  CDCRLWireHitPair getAlias() const;
47 
49  bool operator==(const CDCRLWireHitPair& other) const
50  {
51  return getFromRLWireHit() == other.getFromRLWireHit() and
52  getToRLWireHit() == other.getToRLWireHit();
53  }
54 
59  bool operator<(const CDCRLWireHitPair& other) const
60  {
61  return getICluster() < other.getICluster() or
62  (getICluster() == other.getICluster() and
63  (getFromRLWireHit() < other.getFromRLWireHit() or
64  (getFromRLWireHit() == other.getFromRLWireHit() and
65  getToRLWireHit() < other.getToRLWireHit())));
66  }
67 
69  friend bool operator<(const CDCRLWireHitPair& rlWireHitPair, const CDCWireHit& wireHit)
70  {
71  return rlWireHitPair.getFromRLWireHit() < wireHit;
72  }
73 
75  friend bool operator<(const CDCWireHit& wireHit, const CDCRLWireHitPair& rlWireHitPair)
76  {
77  return wireHit < rlWireHitPair.getFromRLWireHit();
78  }
79 
82 
84  ISuperLayer getISuperLayer() const
85  {
86  ISuperLayer result = getFromRLWireHit().getISuperLayer();
87  return result == getToRLWireHit().getISuperLayer() ? result : ISuperLayerUtil::c_Invalid;
88  }
89 
91  EStereoKind getStereoKind() const
92  {
94  }
95 
97  bool isAxial() const
98  {
99  return getStereoKind() == EStereoKind::c_Axial;
100  }
101 
103  const CDCWire& getFromWire() const
104  {
106  }
107 
109  const CDCWire& getToWire() const
110  {
112  }
113 
115  bool hasWire(const CDCWire& wire) const
116  {
118  }
119 
121  const CDCWireHit& getFromWireHit() const
122  {
124  }
125 
127  const CDCWireHit& getToWireHit() const
128  {
130  }
131 
133  bool hasWireHit(const CDCWireHit& wirehit) const
134  {
135  return getFromRLWireHit().hasWireHit(wirehit) or getToRLWireHit().hasWireHit(wirehit);
136  }
137 
139  ERightLeft getFromRLInfo() const
140  {
142  }
143 
145  ERightLeft getToRLInfo() const
146  {
148  }
149 
152  {
154  }
155 
158  {
160  }
161 
163  const CDCRLWireHit& getFromRLWireHit() const
164  {
166  }
167 
169  const CDCRLWireHit& getToRLWireHit() const
170  {
172  }
173 
175  void setFromRLWireHit(const CDCRLWireHit& fromRLWireHit)
176  {
177  m_fromRLWireHit = fromRLWireHit;
178  }
179 
181  void setToRLWireHit(const CDCRLWireHit& toRLWireHit)
182  {
183  m_toRLWireHit = toRLWireHit;
184  }
185 
187  void setFromRLInfo(ERightLeft fromRLInfo);
188 
190  void setToRLInfo(ERightLeft toRLInfo);
191 
193  int getICluster() const
194  {
195  return m_iCluster;
196  }
197 
199  void setICluster(int iCluster)
200  {
201  m_iCluster = iCluster;
202  }
203 
204  protected:
207 
210 
212  int m_iCluster = -1;
213  };
214  }
216 }
Belle2::TrackFindingCDC::CDCRLWireHitPair::isAxial
bool isAxial() const
Indicator if the underlying wires are axial.
Definition: CDCRLWireHitPair.h:105
Belle2::TrackFindingCDC::CDCRLWireHitPair::getICluster
int getICluster() const
Getter for the cluster id.
Definition: CDCRLWireHitPair.h:201
Belle2::TrackFindingCDC::CDCRLWireHitPair::getFromRLInfo
ERightLeft getFromRLInfo() const
Getter for the right left passage information of the first oriented wire hit.
Definition: CDCRLWireHitPair.h:147
Belle2::TrackFindingCDC::CDCRLWireHitPair::getToRLInfo
ERightLeft getToRLInfo() const
Getter for the right left passage information of the second oriented wire hit.
Definition: CDCRLWireHitPair.h:153
Belle2::TrackFindingCDC::ISuperLayerUtil::getStereoKind
static EStereoKind getStereoKind(ISuperLayer iSuperLayer)
Returns the stereo kind of the super layer.
Definition: ISuperLayer.cc:28
Belle2::TrackFindingCDC::ISuperLayerUtil::c_Invalid
static const ISuperLayer c_Invalid
Constant making an invalid superlayer id.
Definition: ISuperLayer.h:75
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::CDCRLWireHitPair::m_iCluster
int m_iCluster
Memory for the cluster id of this facet.
Definition: CDCRLWireHitPair.h:220
Belle2::TrackFindingCDC::CDCRLWireHit::getWire
const CDCWire & getWire() const
Getter for the wire the oriented hit associated to.
Definition: CDCRLWireHit.cc:133
Belle2::TrackFindingCDC::CDCRLWireHitPair::getToRLWireHit
CDCRLWireHit & getToRLWireHit()
Getter for the second oriented wire hit.
Definition: CDCRLWireHitPair.h:165
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::CDCRLWireHitPair::operator==
bool operator==(const CDCRLWireHitPair &other) const
Equality comparision based the two oriented wire hits.
Definition: CDCRLWireHitPair.h:57
Belle2::TrackFindingCDC::CDCRLWireHitPair::CDCRLWireHitPair
CDCRLWireHitPair()=default
Default constructor for ROOT.
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::CDCRLWireHitPair::getFromWireHit
const CDCWireHit & getFromWireHit() const
Getter for the hit wire of the first oriented wire hit.
Definition: CDCRLWireHitPair.h:129
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::CDCRLWireHitPair::getToWireHit
const CDCWireHit & getToWireHit() const
Getter for the hit wire of the second oriented wire hit.
Definition: CDCRLWireHitPair.h:135
Belle2::TrackFindingCDC::CDCRLWireHitPair::reversed
CDCRLWireHitPair reversed() const
Constructs a oriented wire hit pair that is the reverse of this one.
Definition: CDCRLWireHitPair.cc:39
Belle2::TrackFindingCDC::CDCRLWireHitPair::m_fromRLWireHit
CDCRLWireHit m_fromRLWireHit
Memory for the reference to the first oriented wire hit.
Definition: CDCRLWireHitPair.h:214
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::CDCRLWireHitPair::m_toRLWireHit
CDCRLWireHit m_toRLWireHit
Memory for the reference to the second oriented wire hit.
Definition: CDCRLWireHitPair.h:217
Belle2::TrackFindingCDC::CDCRLWireHitPair::reverse
void reverse()
Reverses the oriented wire hit pair inplace.
Definition: CDCRLWireHitPair.cc:44
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::TrackFindingCDC::CDCRLWireHitPair::getStereoKind
EStereoKind getStereoKind() const
Getter for the common stereo type of the superlayer of the pair.
Definition: CDCRLWireHitPair.h:99
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackFindingCDC::CDCRLWireHitPair::getAlias
CDCRLWireHitPair getAlias() const
Returns the aliased version of this oriented wire hit pair.
Definition: CDCRLWireHitPair.cc:51
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::NRightLeft::ERightLeft
ERightLeft
Enumeration to represent the distinct possibilities of the right left passage.
Definition: ERightLeft.h:35
Belle2::TrackFindingCDC::CDCRLWireHitPair::operator<
bool operator<(const CDCRLWireHitPair &other) const
Total ordering relation based on the from oriented wire hit first and the to oriented wire hit second...
Definition: CDCRLWireHitPair.h:67
Belle2::TrackFindingCDC::CDCRLWireHitPair
A pair of oriented wire hits.
Definition: CDCRLWireHitPair.h:37
Belle2::TrackFindingCDC::CDCWire
Class representing a sense wire in the central drift chamber.
Definition: CDCWire.h:60
Belle2::TrackFindingCDC::CDCRLWireHitPair::getFromWire
const CDCWire & getFromWire() const
Getter for the wire the first oriented wire hit is based on.
Definition: CDCRLWireHitPair.h:111
Belle2::TrackFindingCDC::CDCRLWireHitPair::getISuperLayer
ISuperLayer getISuperLayer() const
Getter for the common superlayer id of the pair.
Definition: CDCRLWireHitPair.h:92
Belle2::TrackFindingCDC::WireNeighborKind
Type for the neighbor relationship from one wire to another.
Definition: WireNeighborKind.h:35
Belle2::TrackFindingCDC::CDCWireHit
Class representing a hit wire in the central drift chamber.
Definition: CDCWireHit.h:65
Belle2::TrackFindingCDC::CDCRLWireHitPair::getToWire
const CDCWire & getToWire() const
Getter for the wire the second oriented wire hit is based on.
Definition: CDCRLWireHitPair.h:117
Belle2::TrackFindingCDC::CDCRLWireHitPair::getNeighborKind
WireNeighborKind getNeighborKind() const
Getter for the WireNeighborKind of the two underlying wires.
Definition: CDCRLWireHitPair.cc:34
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