Belle II Software  release-08-01-10
CDCAxialSegmentPair.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/segments/CDCAxialSegment2D.h>
11 
12 #include <tracking/trackFindingCDC/eventdata/trajectories/CDCTrajectory2D.h>
13 
14 #include <tracking/trackFindingCDC/topology/ISuperLayer.h>
15 
16 #include <tracking/trackFindingCDC/ca/AutomatonCell.h>
17 
18 #include <tracking/trackFindingCDC/numerics/EForwardBackward.h>
19 
20 #include <tuple>
21 
22 namespace Belle2 {
27  namespace TrackFindingCDC {
28  class CDCSegment2D;
29 
32 
33  public:
36 
38  CDCAxialSegmentPair(const CDCAxialSegment2D* startSegment,
39  const CDCAxialSegment2D* endSegment);
40 
42  CDCAxialSegmentPair(const CDCAxialSegment2D* startSegment,
43  const CDCAxialSegment2D* endSegment,
44  const CDCTrajectory2D& trajectory2D);
45 
47  bool operator==(CDCAxialSegmentPair const& rhs) const
48  {
49  return
50  std::tie(m_startSegment, m_endSegment) ==
51  std::tie(rhs.m_startSegment, rhs.m_endSegment);
52  }
53 
55  bool operator<(CDCAxialSegmentPair const& rhs) const
56  {
57  return
58  std::tie(m_startSegment, m_endSegment) <
59  std::tie(rhs.m_startSegment, rhs.m_endSegment);
60  }
61 
63  friend bool
64  operator<(CDCAxialSegmentPair const& segmentPair, const CDCAxialSegment2D* axialSegment)
65  {
66  return segmentPair.getStartSegment() < axialSegment;
67  }
68 
70  friend bool
71  operator<(const CDCAxialSegment2D* axialSegment, CDCAxialSegmentPair const& segmentPair)
72  {
73  return axialSegment < segmentPair.getStartSegment();
74  }
75 
77  bool checkSegments() const
78  {
79  return not(m_startSegment == nullptr or m_endSegment == nullptr);
80  }
81 
83  ISuperLayer getStartISuperLayer() const;
84 
86  ISuperLayer getEndISuperLayer() const;
87 
90  {
91  return m_startSegment;
92  }
93 
95  void setStartSegment(const CDCAxialSegment2D* startSegment)
96  {
97  m_startSegment = startSegment;
98  }
99 
102  {
103  return m_endSegment;
104  }
105 
107  void setEndSegment(const CDCAxialSegment2D* endSegment)
108  {
109  m_endSegment = endSegment;
110  }
111 
113  void setSegments(const CDCSegment2D* startSegment, const CDCSegment2D* endSegment)
114  {
115  m_startSegment = startSegment;
116  m_endSegment = endSegment;
117  checkSegments();
118  }
119 
122  {
123  return m_trajectory2D;
124  }
125 
127  void setTrajectory2D(const CDCTrajectory2D& trajectory2D) const
128  { m_trajectory2D = trajectory2D; }
129 
131  void clearTrajectory2D() const
132  { getTrajectory2D().clear(); }
133 
134 
136  void unsetAndForwardMaskedFlag() const;
137 
139  void setAndForwardMaskedFlag() const;
140 
142  void receiveMaskedFlag() const;
143 
145 
149  EForwardBackward isCoaligned(const CDCTrajectory2D& trajectory2D) const;
150 
153  {
154  return m_automatonCell;
155  }
156 
157  private:
160 
163 
166 
169  };
170  }
172 }
Cell used by the cellular automata.
Definition: AutomatonCell.h:29
Class representing a pair of reconstructed axial segements in adjacent superlayer.
const CDCAxialSegment2D * getStartSegment() const
Getter for the start segment.
bool operator==(CDCAxialSegmentPair const &rhs) const
Equality comparision based on the pointers to the stored segments.
void setTrajectory2D(const CDCTrajectory2D &trajectory2D) const
Setter for the trajectory of the two dimensional trajectory.
ISuperLayer getStartISuperLayer() const
Getter for the superlayer id of the start segment.
void setStartSegment(const CDCAxialSegment2D *startSegment)
Setter for the start segment.
void clearTrajectory2D() const
Invalides the currently stored trajectory information.
CDCTrajectory2D m_trajectory2D
Reference to the common trajectory.
const CDCAxialSegment2D * m_startSegment
Reference to the start segment.
bool checkSegments() const
Checks the references to the contained three segment for nullptrs.
bool operator<(CDCAxialSegmentPair const &rhs) const
Total ordering sheme comparing the segment pointers.
void setAndForwardMaskedFlag() const
Sets the masked flag of the segment pair's automaton cell. Also forward the masked flag to the contai...
void unsetAndForwardMaskedFlag() const
Unsets the masked flag of the segment pair's automaton cell, of the contained segments and of the con...
const CDCAxialSegment2D * getEndSegment() const
Getter for the end segment.
AutomatonCell & getAutomatonCell() const
Mutable getter for the automaton cell.
CDCAxialSegmentPair()
Default constructor setting the contained segmetns to nullptr.
CDCTrajectory2D & getTrajectory2D() const
Getter for the trajectory of the two dimensional trajectory.
const CDCAxialSegment2D * m_endSegment
Reference to the end segment.
ISuperLayer getEndISuperLayer() const
Getter for the superlayer id of the end segment.
void setEndSegment(const CDCAxialSegment2D *endSegment)
Setter for the end segment.
AutomatonCell m_automatonCell
Automaton cell assoziated with the pair of segments.
EForwardBackward isCoaligned(const CDCTrajectory2D &trajectory2D) const
Checks if the last entity in the vector lies greater or lower travel distance than the last entity.
void receiveMaskedFlag() const
If one of the contained segments is marked as masked this segment pair is set be masked as well.
void setSegments(const CDCSegment2D *startSegment, const CDCSegment2D *endSegment)
Setter for both segments simultaniously.
A reconstructed sequence of two dimensional hits in one super layer.
Definition: CDCSegment2D.h:39
Particle trajectory as it is seen in xy projection represented as a circle.
void clear()
Clears all information from this trajectoy.
EForwardBackward
Enumeration to represent the distinct possibilities of the right left passage information.
Abstract base class for different kinds of events.