Belle II Software  release-05-02-19
CDCAxialSegmentPair.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 *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #pragma once
11 
12 #include <tracking/trackFindingCDC/eventdata/segments/CDCAxialSegment2D.h>
13 
14 #include <tracking/trackFindingCDC/eventdata/trajectories/CDCTrajectory2D.h>
15 
16 #include <tracking/trackFindingCDC/topology/ISuperLayer.h>
17 
18 #include <tracking/trackFindingCDC/ca/AutomatonCell.h>
19 
20 #include <tracking/trackFindingCDC/numerics/EForwardBackward.h>
21 
22 #include <tuple>
23 
24 namespace Belle2 {
29  namespace TrackFindingCDC {
30  class CDCSegment2D;
31 
33  class CDCAxialSegmentPair {
34 
35  public:
38 
40  CDCAxialSegmentPair(const CDCAxialSegment2D* startSegment,
41  const CDCAxialSegment2D* endSegment);
42 
44  CDCAxialSegmentPair(const CDCAxialSegment2D* startSegment,
45  const CDCAxialSegment2D* endSegment,
46  const CDCTrajectory2D& trajectory2D);
47 
49  bool operator==(CDCAxialSegmentPair const& rhs) const
50  {
51  return
52  std::tie(m_startSegment, m_endSegment) ==
53  std::tie(rhs.m_startSegment, rhs.m_endSegment);
54  }
55 
57  bool operator<(CDCAxialSegmentPair const& rhs) const
58  {
59  return
60  std::tie(m_startSegment, m_endSegment) <
61  std::tie(rhs.m_startSegment, rhs.m_endSegment);
62  }
63 
65  friend bool
66  operator<(CDCAxialSegmentPair const& segmentPair, const CDCAxialSegment2D* axialSegment)
67  {
68  return segmentPair.getStartSegment() < axialSegment;
69  }
70 
72  friend bool
73  operator<(const CDCAxialSegment2D* axialSegment, CDCAxialSegmentPair const& segmentPair)
74  {
75  return axialSegment < segmentPair.getStartSegment();
76  }
77 
79  bool checkSegments() const
80  {
81  return not(m_startSegment == nullptr or m_endSegment == nullptr);
82  }
83 
85  ISuperLayer getStartISuperLayer() const;
86 
88  ISuperLayer getEndISuperLayer() const;
89 
91  const CDCAxialSegment2D* getStartSegment() const
92  {
93  return m_startSegment;
94  }
95 
97  void setStartSegment(const CDCAxialSegment2D* startSegment)
98  {
99  m_startSegment = startSegment;
100  }
101 
103  const CDCAxialSegment2D* getEndSegment() const
104  {
105  return m_endSegment;
106  }
107 
109  void setEndSegment(const CDCAxialSegment2D* endSegment)
110  {
111  m_endSegment = endSegment;
112  }
113 
115  void setSegments(const CDCSegment2D* startSegment, const CDCSegment2D* endSegment)
116  {
117  m_startSegment = startSegment;
118  m_endSegment = endSegment;
119  checkSegments();
120  }
121 
124  {
125  return m_trajectory2D;
126  }
127 
129  void setTrajectory2D(const CDCTrajectory2D& trajectory2D) const
130  { m_trajectory2D = trajectory2D; }
131 
133  void clearTrajectory2D() const
134  { getTrajectory2D().clear(); }
135 
136 
138  void unsetAndForwardMaskedFlag() const;
139 
142 
144  void receiveMaskedFlag() const;
145 
147 
151  EForwardBackward isCoaligned(const CDCTrajectory2D& trajectory2D) const;
152 
155  {
156  return m_automatonCell;
157  }
158 
159  private:
162 
165 
168 
171  };
172  }
174 }
Belle2::TrackFindingCDC::CDCAxialSegmentPair::m_automatonCell
AutomatonCell m_automatonCell
Automaton cell assoziated with the pair of segments.
Definition: CDCAxialSegmentPair.h:178
Belle2::TrackFindingCDC::CDCAxialSegmentPair::getStartISuperLayer
ISuperLayer getStartISuperLayer() const
Getter for the superlayer id of the start segment.
Definition: CDCAxialSegmentPair.cc:54
Belle2::TrackFindingCDC::CDCAxialSegmentPair::m_endSegment
const CDCAxialSegment2D * m_endSegment
Reference to the end segment.
Definition: CDCAxialSegmentPair.h:172
Belle2::TrackFindingCDC::CDCAxialSegmentPair::getStartSegment
const CDCAxialSegment2D * getStartSegment() const
Getter for the start segment.
Definition: CDCAxialSegmentPair.h:99
Belle2::TrackFindingCDC::CDCAxialSegmentPair::m_startSegment
const CDCAxialSegment2D * m_startSegment
Reference to the start segment.
Definition: CDCAxialSegmentPair.h:169
Belle2::TrackFindingCDC::CDCAxialSegmentPair::unsetAndForwardMaskedFlag
void unsetAndForwardMaskedFlag() const
Unsets the masked flag of the segment pair's automaton cell, of the contained segments and of the con...
Definition: CDCAxialSegmentPair.cc:64
Belle2::TrackFindingCDC::NForwardBackward::EForwardBackward
EForwardBackward
Enumeration to represent the distinct possibilities of the right left passage information.
Definition: EForwardBackward.h:35
Belle2::TrackFindingCDC::CDCTrajectory2D
Particle trajectory as it is seen in xy projection represented as a circle.
Definition: CDCTrajectory2D.h:46
Belle2::TrackFindingCDC::CDCAxialSegmentPair::clearTrajectory2D
void clearTrajectory2D() const
Invalides the currently stored trajectory information.
Definition: CDCAxialSegmentPair.h:141
Belle2::TrackFindingCDC::CDCAxialSegmentPair::getEndSegment
const CDCAxialSegment2D * getEndSegment() const
Getter for the end segment.
Definition: CDCAxialSegmentPair.h:111
Belle2::TrackFindingCDC::CDCAxialSegmentPair::CDCAxialSegmentPair
CDCAxialSegmentPair()
Default constructor setting the contained segmetns to nullptr.
Definition: CDCAxialSegmentPair.cc:28
Belle2::TrackFindingCDC::CDCAxialSegmentPair::setSegments
void setSegments(const CDCSegment2D *startSegment, const CDCSegment2D *endSegment)
Setter for both segments simultaniously.
Definition: CDCAxialSegmentPair.h:123
Belle2::TrackFindingCDC::CDCAxialSegmentPair::operator<
bool operator<(CDCAxialSegmentPair const &rhs) const
Total ordering sheme comparing the segment pointers.
Definition: CDCAxialSegmentPair.h:65
Belle2::TrackFindingCDC::CDCAxialSegmentPair::isCoaligned
EForwardBackward isCoaligned(const CDCTrajectory2D &trajectory2D) const
Checks if the last entity in the vector lies greater or lower travel distance than the last entity.
Definition: CDCAxialSegmentPair.cc:92
Belle2::TrackFindingCDC::CDCAxialSegmentPair
Class representing a pair of reconstructed axial segements in adjacent superlayer.
Definition: CDCAxialSegmentPair.h:41
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackFindingCDC::AutomatonCell
Cell used by the cellular automata.
Definition: AutomatonCell.h:39
Belle2::TrackFindingCDC::CDCAxialSegmentPair::checkSegments
bool checkSegments() const
Checks the references to the contained three segment for nullptrs.
Definition: CDCAxialSegmentPair.h:87
Belle2::TrackFindingCDC::CDCAxialSegmentPair::m_trajectory2D
CDCTrajectory2D m_trajectory2D
Reference to the common trajectory.
Definition: CDCAxialSegmentPair.h:175
Belle2::TrackFindingCDC::CDCAxialSegmentPair::getTrajectory2D
CDCTrajectory2D & getTrajectory2D() const
Getter for the trajectory of the two dimensional trajectory.
Definition: CDCAxialSegmentPair.h:131
Belle2::TrackFindingCDC::CDCAxialSegmentPair::getAutomatonCell
AutomatonCell & getAutomatonCell() const
Mutable getter for the automaton cell.
Definition: CDCAxialSegmentPair.h:162
Belle2::TrackFindingCDC::CDCAxialSegmentPair::setStartSegment
void setStartSegment(const CDCAxialSegment2D *startSegment)
Setter for the start segment.
Definition: CDCAxialSegmentPair.h:105
Belle2::TrackFindingCDC::CDCSegment2D
A reconstructed sequence of two dimensional hits in one super layer.
Definition: CDCSegment2D.h:40
Belle2::TrackFindingCDC::CDCAxialSegmentPair::receiveMaskedFlag
void receiveMaskedFlag() const
If one of the contained segments is marked as masked this segment pair is set be masked as well.
Definition: CDCAxialSegmentPair.cc:80
Belle2::TrackFindingCDC::CDCAxialSegmentPair::setAndForwardMaskedFlag
void setAndForwardMaskedFlag() const
Sets the masked flag of the segment pair's automaton cell. Also forward the masked flag to the contai...
Definition: CDCAxialSegmentPair.cc:72
Belle2::TrackFindingCDC::CDCAxialSegmentPair::getEndISuperLayer
ISuperLayer getEndISuperLayer() const
Getter for the superlayer id of the end segment.
Definition: CDCAxialSegmentPair.cc:59
Belle2::TrackFindingCDC::CDCAxialSegmentPair::setTrajectory2D
void setTrajectory2D(const CDCTrajectory2D &trajectory2D) const
Setter for the trajectory of the two dimensional trajectory.
Definition: CDCAxialSegmentPair.h:137
Belle2::TrackFindingCDC::CDCTrajectory2D::clear
void clear()
Clears all information from this trajectoy.
Definition: CDCTrajectory2D.cc:90
Belle2::TrackFindingCDC::CDCAxialSegmentPair::setEndSegment
void setEndSegment(const CDCAxialSegment2D *endSegment)
Setter for the end segment.
Definition: CDCAxialSegmentPair.h:117
Belle2::TrackFindingCDC::CDCAxialSegmentPair::operator==
bool operator==(CDCAxialSegmentPair const &rhs) const
Equality comparision based on the pointers to the stored segments.
Definition: CDCAxialSegmentPair.h:57