Belle II Software  release-08-01-10
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/trackFindingCDC/eventdata/hits/CDCRLWireHit.h>
11 
12 #include <tracking/trackFindingCDC/numerics/ERightLeft.h>
13 #include <tracking/trackFindingCDC/topology/EStereoKind.h>
14 #include <tracking/trackFindingCDC/topology/ISuperLayer.h>
15 
16 namespace Belle2 {
21  namespace TrackFindingCDC {
22  class CDCWireHit;
23  class CDCWire;
24  class WireNeighborKind;
25 
28  public:
30  CDCRLWireHitPair() = default;
31 
33  CDCRLWireHitPair(const CDCRLWireHit& fromRLWireHit,
34  const CDCRLWireHit& toRLWireHit,
35  int iCluster = 0);
36 
38  CDCRLWireHitPair reversed() const;
39 
41  void reverse();
42 
44  CDCRLWireHitPair getAlias() const;
45 
47  bool operator==(const CDCRLWireHitPair& other) const
48  {
49  return getFromRLWireHit() == other.getFromRLWireHit() and
50  getToRLWireHit() == other.getToRLWireHit();
51  }
52 
57  bool operator<(const CDCRLWireHitPair& other) const
58  {
59  return getICluster() < other.getICluster() or
60  (getICluster() == other.getICluster() and
61  (getFromRLWireHit() < other.getFromRLWireHit() or
62  (getFromRLWireHit() == other.getFromRLWireHit() and
63  getToRLWireHit() < other.getToRLWireHit())));
64  }
65 
67  friend bool operator<(const CDCRLWireHitPair& rlWireHitPair, const CDCWireHit& wireHit)
68  {
69  return rlWireHitPair.getFromRLWireHit() < wireHit;
70  }
71 
73  friend bool operator<(const CDCWireHit& wireHit, const CDCRLWireHitPair& rlWireHitPair)
74  {
75  return wireHit < rlWireHitPair.getFromRLWireHit();
76  }
77 
80 
82  ISuperLayer getISuperLayer() const
83  {
84  ISuperLayer result = getFromRLWireHit().getISuperLayer();
85  return result == getToRLWireHit().getISuperLayer() ? result : ISuperLayerUtil::c_Invalid;
86  }
87 
89  EStereoKind getStereoKind() const
90  {
92  }
93 
95  bool isAxial() const
96  {
97  return getStereoKind() == EStereoKind::c_Axial;
98  }
99 
101  const CDCWire& getFromWire() const
102  {
103  return getFromRLWireHit().getWire();
104  }
105 
107  const CDCWire& getToWire() const
108  {
109  return getToRLWireHit().getWire();
110  }
111 
113  bool hasWire(const CDCWire& wire) const
114  {
115  return getFromRLWireHit().isOnWire(wire) or getToRLWireHit().isOnWire(wire);
116  }
117 
119  const CDCWireHit& getFromWireHit() const
120  {
121  return getFromRLWireHit().getWireHit();
122  }
123 
125  const CDCWireHit& getToWireHit() const
126  {
127  return getToRLWireHit().getWireHit();
128  }
129 
131  bool hasWireHit(const CDCWireHit& wirehit) const
132  {
133  return getFromRLWireHit().hasWireHit(wirehit) or getToRLWireHit().hasWireHit(wirehit);
134  }
135 
138  {
139  return getFromRLWireHit().getRLInfo();
140  }
141 
144  {
145  return getToRLWireHit().getRLInfo();
146  }
147 
150  {
151  return m_fromRLWireHit;
152  }
153 
156  {
157  return m_toRLWireHit;
158  }
159 
162  {
163  return m_fromRLWireHit;
164  }
165 
168  {
169  return m_toRLWireHit;
170  }
171 
173  void setFromRLWireHit(const CDCRLWireHit& fromRLWireHit)
174  {
175  m_fromRLWireHit = fromRLWireHit;
176  }
177 
179  void setToRLWireHit(const CDCRLWireHit& toRLWireHit)
180  {
181  m_toRLWireHit = toRLWireHit;
182  }
183 
185  void setFromRLInfo(ERightLeft fromRLInfo);
186 
188  void setToRLInfo(ERightLeft toRLInfo);
189 
191  int getICluster() const
192  {
193  return m_iCluster;
194  }
195 
197  void setICluster(int iCluster)
198  {
199  m_iCluster = iCluster;
200  }
201 
202  protected:
205 
208 
210  int m_iCluster = -1;
211  };
212  }
214 }
void setICluster(int iCluster)
Setter for the cluster id.
void setFromRLWireHit(const CDCRLWireHit &fromRLWireHit)
Setter for the first oriented wire hit.
const CDCWire & getFromWire() const
Getter for the wire the first oriented wire hit is based on.
ISuperLayer getISuperLayer() const
Getter for the common superlayer id of the pair.
void reverse()
Reverses the oriented wire hit pair inplace.
CDCRLWireHit & getFromRLWireHit()
Getter for the first oriented wire hit.
bool isAxial() const
Indicator if the underlying wires are axial.
CDCRLWireHitPair getAlias() const
Returns the aliased version of this oriented wire hit pair.
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.
const CDCRLWireHit & getFromRLWireHit() const
Constant getter for the first oriented wire hit.
const CDCRLWireHit & getToRLWireHit() const
Constant getter for the second 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.
const CDCWire & getToWire() const
Getter for the wire the second oriented wire hit is based on.
WireNeighborKind getNeighborKind() const
Getter for the WireNeighborKind of the two underlying wires.
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.
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.
EStereoKind getStereoKind() const
Getter for the common stereo type of the superlayer of the pair.
const CDCWireHit & getFromWireHit() const
Getter for the hit wire of 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 comparision based the two oriented wire hits.
bool hasWire(const CDCWire &wire) const
Indicator if any of the two oriented wire hits is based on the given wire.
CDCRLWireHit & getToRLWireHit()
Getter for the second oriented wire hit.
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 ...
Definition: CDCRLWireHit.h:41
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
bool isOnWire(const CDCWire &wire) const
Checks if the oriented hit is associated with the give wire.
Definition: CDCRLWireHit.h:168
const CDCWireHit & getWireHit() const
Getter for the wire hit associated with the oriented hit.
Definition: CDCRLWireHit.h:192
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
Type for the neighbor relationship from one wire to another.
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 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.
Definition: ISuperLayer.cc:26