Belle II Software  release-08-01-10
CDCSegmentTriple.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/CDCStereoSegment2D.h>
11 #include <tracking/trackFindingCDC/eventdata/segments/CDCAxialSegment2D.h>
12 
13 #include <tracking/trackFindingCDC/eventdata/trajectories/CDCTrajectory3D.h>
14 
15 #include <tracking/trackFindingCDC/topology/ISuperLayer.h>
16 
17 #include <tracking/trackFindingCDC/ca/AutomatonCell.h>
18 
19 #include <tuple>
20 
21 namespace Belle2 {
26  namespace TrackFindingCDC {
27  class CDCAxialSegmentPair;
28  class CDCTrajectorySZ;
29  class CDCTrajectory2D;
30 
33  public:
34 
37 
39  CDCSegmentTriple(const CDCAxialSegment2D* startSegment,
40  const CDCAxialSegment2D* endSegment);
41 
43  explicit CDCSegmentTriple(const CDCAxialSegmentPair& segmentPair);
44 
46  CDCSegmentTriple(const CDCAxialSegment2D* startSegment,
47  const CDCStereoSegment2D* middleSegment,
48  const CDCAxialSegment2D* endSegment);
49 
51  CDCSegmentTriple(const CDCAxialSegment2D* startSegment,
52  const CDCStereoSegment2D* middleSegment,
53  const CDCAxialSegment2D* endSegment,
54  const CDCTrajectory3D& trajectory3D);
55 
57  bool operator==(CDCSegmentTriple const& rhs) const
58  {
59  return
61  std::tie(rhs.m_startSegment, rhs.m_middleSegment, rhs.m_endSegment);
62  }
63 
65  bool operator<(CDCSegmentTriple const& rhs) const
66  {
67  return
69  std::tie(rhs.m_startSegment, rhs.m_middleSegment, rhs.m_endSegment);
70  }
71 
73  friend bool operator<(CDCSegmentTriple const& segmentTriple, const CDCAxialSegment2D* axialSegment)
74  {
75  return segmentTriple.getStartSegment() < axialSegment;
76  }
77 
79  friend bool operator<(const CDCAxialSegment2D* axialSegment, CDCSegmentTriple const& segmentTriple)
80  {
81  return axialSegment < segmentTriple.getStartSegment();
82  }
83 
85  bool checkSegments() const
86  {
87  return not(getStartSegment() == nullptr) and not(m_middleSegment == nullptr) and
88  not(m_endSegment == nullptr);
89  }
90 
92  ISuperLayer getStartISuperLayer() const;
93 
95  ISuperLayer getMiddleISuperLayer() const;
96 
98  ISuperLayer getEndISuperLayer() const;
99 
102  {
103  return m_startSegment;
104  }
105 
107  void setStartSegment(const CDCAxialSegment2D* startSegment)
108  {
109  m_startSegment = startSegment;
110  }
111 
114  {
115  return m_middleSegment;
116  }
117 
119  void setMiddleSegment(const CDCStereoSegment2D* middleSegment)
120  {
121  m_middleSegment = middleSegment;
122  }
123 
126  {
127  return m_endSegment;
128  }
129 
131  void setEndSegment(const CDCAxialSegment2D* endSegment)
132  {
133  m_endSegment = endSegment;
134  }
135 
138 
141 
144  {
145  return m_trajectory3D;
146  }
147 
149  void setTrajectory3D(const CDCTrajectory3D& trajectory3D) const
150  {
151  m_trajectory3D = trajectory3D;
152  }
153 
155  void clearTrajectory3D() const
156  {
158  }
159 
161  void unsetAndForwardMaskedFlag() const;
162 
164  void setAndForwardMaskedFlag() const;
165 
167  void receiveMaskedFlag() const;
168 
171  {
172  return m_automatonCell;
173  }
174 
175  private:
178 
181 
184 
187 
190  };
191  }
193 }
Cell used by the cellular automata.
Definition: AutomatonCell.h:29
Class representing a pair of reconstructed axial segements in adjacent superlayer.
A reconstructed sequence of two dimensional hits in one super layer.
Definition: CDCSegment2D.h:39
Class representing a triple of reconstructed segements in adjacent superlayer.
const CDCAxialSegment2D * getStartSegment() const
Getter for the start axial segment.
friend bool operator<(const CDCAxialSegment2D *axialSegment, CDCSegmentTriple const &segmentTriple)
Define reconstructed segments and segment triples as coaligned on the start segment.
CDCTrajectory3D m_trajectory3D
Memory of the linear trajectory in the sz direction assoziated with the triple.
ISuperLayer getMiddleISuperLayer() const
Getter for the superlayer id of the middle segment.
ISuperLayer getStartISuperLayer() const
Getter for the superlayer id of the start segment.
bool operator<(CDCSegmentTriple const &rhs) const
Total ordering sheme based on the two axial segments first and the stereo segments second.
CDCTrajectory2D getTrajectory2D() const
Getter for the circular trajectory in the xy direction.
friend bool operator<(CDCSegmentTriple const &segmentTriple, const CDCAxialSegment2D *axialSegment)
Define reconstructed segments and segment triples as coaligned on the start segment.
void setStartSegment(const CDCAxialSegment2D *startSegment)
Setter for the start axial segment.
bool operator==(CDCSegmentTriple const &rhs) const
Equality comparision based on the pointers to the stored segments.
const CDCAxialSegment2D * m_startSegment
Reference to the axial segment in the start of the triple.
bool checkSegments() const
Checks the references to the contained three segment for nullptrs.
void setTrajectory3D(const CDCTrajectory3D &trajectory3D) const
Setter for the three dimensional helix trajectory.
CDCSegmentTriple()
Default constructor for ROOT compatability.
void setAndForwardMaskedFlag() const
Sets the masked flag of the segment triple's automaton cell. Also forward the masked to the contained...
const CDCTrajectory3D & getTrajectory3D() const
Getter for the three dimensional helix trajectory.
void unsetAndForwardMaskedFlag() const
Unsets the masked flag of the segment triple's automaton cell, of the contained segments and of the c...
const CDCAxialSegment2D * getEndSegment() const
Getter for the end axial segment.
AutomatonCell & getAutomatonCell() const
Mutable getter for the automaton cell.
const CDCStereoSegment2D * m_middleSegment
Reference to the stereo segment in the middle of the triple.
CDCTrajectorySZ getTrajectorySZ() const
Getter for the linear trajectory in the sz direction.
const CDCStereoSegment2D * getMiddleSegment() const
Getter for the middle stereo segment.
const CDCAxialSegment2D * m_endSegment
Reference to the axial segment in the start of the triple.
ISuperLayer getEndISuperLayer() const
Getter for the superlayer id of the end segment.
void setEndSegment(const CDCAxialSegment2D *endSegment)
Setter for the end axial segment.
AutomatonCell m_automatonCell
Automaton cell assoziated with the pair of segments.
void setMiddleSegment(const CDCStereoSegment2D *middleSegment)
Setter for the middle stereo segment.
void receiveMaskedFlag() const
If one of the contained segments is marked as masked this segment triple is set be masked as well.
void clearTrajectory3D() const
Clears the three dimensional helix trajectory.
Particle trajectory as it is seen in xy projection represented as a circle.
Particle full three dimensional trajectory.
void clear()
Clears all information from this trajectoy.
Linear trajectory in sz space.
Abstract base class for different kinds of events.