Belle II Software  release-05-02-19
CDCSegmentPair.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/trajectories/CDCTrajectory3D.h>
13 
14 #include <tracking/trackFindingCDC/topology/ISuperLayer.h>
15 #include <tracking/trackFindingCDC/topology/EStereoKind.h>
16 
17 #include <tracking/trackFindingCDC/ca/AutomatonCell.h>
18 
19 #include <tracking/trackFindingCDC/numerics/EForwardBackward.h>
20 
21 #include <cassert>
22 #include <cstddef>
23 
24 namespace Belle2 {
29  namespace TrackFindingCDC {
30  class CDCSegment2D;
31  class CDCTrajectory2D;
32  class CDCTrajectorySZ;
33 
36  class CDCSegmentPair {
37  public:
40 
42  CDCSegmentPair(const CDCSegment2D* fromSegment, const CDCSegment2D* toSegment);
43 
45  CDCSegmentPair(const CDCSegment2D* fromSegment,
46  const CDCSegment2D* toSegment,
47  const CDCTrajectory3D& trajectory3D);
48 
50  bool operator==(CDCSegmentPair const& rhs) const
51  {
52  return getFromSegment() == rhs.getFromSegment() and getToSegment() == rhs.getToSegment();
53  }
54 
56  bool operator<(CDCSegmentPair const& rhs) const
57  {
58  return (getFromSegment() < rhs.getFromSegment() or
59  (getFromSegment() == rhs.getFromSegment() and getToSegment() < rhs.getToSegment()));
60  }
61 
64  friend bool operator<(const CDCSegmentPair& segmentPair, const CDCSegment2D* segment)
65  {
66  return segmentPair.getFromSegment() < segment;
67  }
68 
71  friend bool operator<(const CDCSegment2D* segment, const CDCSegmentPair& segmentPair)
72  {
73  return segment < segmentPair.getFromSegment();
74  }
75 
77  bool checkSegmentsNonNullptr() const
78  {
79  return getFromSegment() != nullptr and getToSegment() != nullptr;
80  }
81 
83  bool checkSegmentsStereoKinds() const
84  {
85  return (getFromStereoKind() == EStereoKind::c_Axial) xor
86  (getToStereoKind() == EStereoKind::c_Axial);
87  }
88 
91  bool checkSegments() const
92  {
94  }
95 
97  EStereoKind getFromStereoKind() const;
98 
100  EStereoKind getToStereoKind() const;
101 
103  ISuperLayer getFromISuperLayer() const;
104 
106  ISuperLayer getToISuperLayer() const;
107 
109  std::size_t size() const;
110 
112  const CDCSegment2D* getFromSegment() const
113  {
114  return m_fromSegment;
115  }
116 
118  void setFromSegment(const CDCSegment2D* fromSegment)
119  {
120  setSegments(fromSegment, getToSegment());
121  }
122 
124  const CDCSegment2D* getToSegment() const
125  {
126  return m_toSegment;
127  }
128 
130  void setToSegment(const CDCSegment2D* toSegment)
131  {
133  }
134 
136  const CDCSegment2D* getStereoSegment() const
137  {
138  return getFromStereoKind() != EStereoKind::c_Axial ? getFromSegment() : getToSegment();
139  }
140 
142  const CDCSegment2D* getAxialSegment() const
143  {
144  return getFromStereoKind() == EStereoKind::c_Axial ? getFromSegment() : getToSegment();
145  }
146 
148  void setSegments(const CDCSegment2D* fromSegment, const CDCSegment2D* toSegment)
149  {
150  m_fromSegment = fromSegment;
151  m_toSegment = toSegment;
152  assert(checkSegmentsNonNullptr());
153  assert(checkSegmentsStereoKinds());
154  }
155 
158  double computeDeltaPhiAtSuperLayerBound() const;
159 
161  double computeFromIsBeforeTo() const
162  {
164  }
165 
167  double computeToIsAfterFrom() const
168  {
170  }
171 
173  double computeIsCoaligned() const
174  {
176  }
177 
180  double computeFromIsBeforeToFitless() const;
181 
184  double computeToIsAfterFromFitless() const;
185 
188  double computeIsCoalignedFitless() const;
189 
192 
196  EForwardBackward isCoaligned(const CDCTrajectory2D& trajectory2D) const;
197 
199  void setTrajectory3D(const CDCTrajectory3D& trajectory3D) const
200  {
201  m_trajectory3D = trajectory3D;
202  }
203 
206  {
208  }
209 
212 
215 
217  void clearTrajectory3D() const
218  {
220  }
221 
224  void unsetAndForwardMaskedFlag() const;
225 
228  void setAndForwardMaskedFlag() const;
229 
232  void receiveMaskedFlag() const;
233 
236  {
237  return m_automatonCell;
238  }
239 
240  private:
243 
245  const CDCSegment2D* m_toSegment;
246 
249 
252  };
253  }
255 }
Belle2::TrackFindingCDC::CDCSegmentPair::getStereoSegment
const CDCSegment2D * getStereoSegment() const
Getter for the stereo segment.
Definition: CDCSegmentPair.h:144
Belle2::TrackFindingCDC::CDCSegmentPair::computeIsCoaligned
double computeIsCoaligned() const
Indicator if the from segment and the to segment have roughly the same travel direction.
Definition: CDCSegmentPair.h:181
Belle2::TrackFindingCDC::CDCSegmentPair::m_trajectory3D
CDCTrajectory3D m_trajectory3D
Memory for the common three dimensional trajectory.
Definition: CDCSegmentPair.h:256
Belle2::TrackFindingCDC::CDCSegmentPair
Class representing a pair of one reconstructed axial segement and one stereo segment in adjacent supe...
Definition: CDCSegmentPair.h:44
Belle2::TrackFindingCDC::CDCSegmentPair::checkSegmentsNonNullptr
bool checkSegmentsNonNullptr() const
Checks if both stored segments are not nullptr. Returns true if check is succeded.
Definition: CDCSegmentPair.h:85
Belle2::TrackFindingCDC::CDCSegmentPair::CDCSegmentPair
CDCSegmentPair()
Default constructor - for ROOT compatability.
Definition: CDCSegmentPair.cc:35
Belle2::TrackFindingCDC::CDCSegmentPair::size
std::size_t size() const
Getter for the total number of hits in this segment pair.
Definition: CDCSegmentPair.cc:85
Belle2::TrackFindingCDC::CDCSegmentPair::setFromSegment
void setFromSegment(const CDCSegment2D *fromSegment)
Setter for the from segment.
Definition: CDCSegmentPair.h:126
Belle2::TrackFindingCDC::CDCSegmentPair::computeFromIsBeforeToFitless
double computeFromIsBeforeToFitless() const
Indicator if the from segment lies before the to segment, build without using the trajectories,...
Definition: CDCSegmentPair.cc:157
Belle2::TrackFindingCDC::CDCSegmentPair::computeFromIsBeforeTo
double computeFromIsBeforeTo() const
Indicator if the from segment lies before the to segment.
Definition: CDCSegmentPair.h:169
Belle2::TrackFindingCDC::CDCSegmentPair::computeIsCoalignedFitless
double computeIsCoalignedFitless() const
Indicator if the from segment and the to segment have roughly the same travel direction without using...
Definition: CDCSegmentPair.cc:227
Belle2::TrackFindingCDC::CDCTrajectorySZ
Linear trajectory in sz space.
Definition: CDCTrajectorySZ.h:41
Belle2::TrackFindingCDC::NForwardBackward::EForwardBackward
EForwardBackward
Enumeration to represent the distinct possibilities of the right left passage information.
Definition: EForwardBackward.h:35
Belle2::TrackFindingCDC::CDCSegmentPair::getAutomatonCell
AutomatonCell & getAutomatonCell() const
Mutable getter for the automaton cell.
Definition: CDCSegmentPair.h:243
Belle2::TrackFindingCDC::CDCSegmentPair::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: CDCSegmentPair.cc:265
Belle2::TrackFindingCDC::CDCTrajectory2D
Particle trajectory as it is seen in xy projection represented as a circle.
Definition: CDCTrajectory2D.h:46
Belle2::TrackFindingCDC::CDCSegmentPair::getToStereoKind
EStereoKind getToStereoKind() const
Getter for the stereo type of the second segment.
Definition: CDCSegmentPair.cc:67
Belle2::TrackFindingCDC::CDCSegmentPair::getToSegment
const CDCSegment2D * getToSegment() const
Getter for the to segment.
Definition: CDCSegmentPair.h:132
Belle2::TrackFindingCDC::CDCSegmentPair::getFromISuperLayer
ISuperLayer getFromISuperLayer() const
Getter for the superlayer id of the from segment.
Definition: CDCSegmentPair.cc:73
Belle2::TrackFindingCDC::CDCSegmentPair::getTrajectorySZ
CDCTrajectorySZ getTrajectorySZ() const
Getter for the sz projection of the common three dimensional trajectory.
Definition: CDCSegmentPair.cc:95
Belle2::TrackFindingCDC::CDCSegmentPair::computeToIsAfterFromFitless
double computeToIsAfterFromFitless() const
Indicator if the from segment lies before the to segment, build without using the trajectories,...
Definition: CDCSegmentPair.cc:192
Belle2::TrackFindingCDC::CDCTrajectory3D::clear
void clear()
Clears all information from this trajectoy.
Definition: CDCTrajectory3D.h:132
Belle2::TrackFindingCDC::CDCSegmentPair::clearTrajectory3D
void clearTrajectory3D() const
Invalides the currently stored trajectory information.
Definition: CDCSegmentPair.h:225
Belle2::TrackFindingCDC::CDCSegmentPair::computeDeltaPhiAtSuperLayerBound
double computeDeltaPhiAtSuperLayerBound() const
Determines the angle between the last reconstructed position of the from segment and the first recons...
Definition: CDCSegmentPair.cc:128
Belle2::TrackFindingCDC::CDCSegmentPair::operator<
bool operator<(CDCSegmentPair const &rhs) const
Total ordering sheme comparing the segment pointers.
Definition: CDCSegmentPair.h:64
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackFindingCDC::CDCSegmentPair::unsetAndForwardMaskedFlag
void unsetAndForwardMaskedFlag() const
Unsets the masked flag of the segment triple's automaton cell and of the three contained segments.
Definition: CDCSegmentPair.cc:100
Belle2::TrackFindingCDC::CDCSegmentPair::setAndForwardMaskedFlag
void setAndForwardMaskedFlag() const
Sets the masked flag of the segment triple's automaton cell and of the three contained segments.
Definition: CDCSegmentPair.cc:108
Belle2::TrackFindingCDC::AutomatonCell
Cell used by the cellular automata.
Definition: AutomatonCell.h:39
Belle2::TrackFindingCDC::CDCSegmentPair::m_automatonCell
AutomatonCell m_automatonCell
Automaton cell assoziated with the pair of segments.
Definition: CDCSegmentPair.h:259
Belle2::TrackFindingCDC::CDCSegmentPair::getFromStereoKind
EStereoKind getFromStereoKind() const
Getter for the stereo type of the first segment.
Definition: CDCSegmentPair.cc:61
Belle2::TrackFindingCDC::CDCSegmentPair::computeToIsAfterFrom
double computeToIsAfterFrom() const
Indicator if the from segment lies before the to segment.
Definition: CDCSegmentPair.h:175
Belle2::TrackFindingCDC::CDCSegmentPair::operator==
bool operator==(CDCSegmentPair const &rhs) const
Equality comparision based on the pointers to the stored segments.
Definition: CDCSegmentPair.h:58
Belle2::TrackFindingCDC::CDCSegmentPair::receiveMaskedFlag
void receiveMaskedFlag() const
If one of the contained segments is marked as masked this segment triple is set be masked as well.
Definition: CDCSegmentPair.cc:116
Belle2::TrackFindingCDC::CDCSegmentPair::checkSegmentsStereoKinds
bool checkSegmentsStereoKinds() const
Checks if the two segments are of different axial type.
Definition: CDCSegmentPair.h:91
Belle2::TrackFindingCDC::CDCSegmentPair::checkSegments
bool checkSegments() const
Checks the references to the contained three segment for nullptrs and exactly one of them is axial an...
Definition: CDCSegmentPair.h:99
Belle2::TrackFindingCDC::CDCSegmentPair::m_fromSegment
const CDCSegment2D * m_fromSegment
Reference to the from segment.
Definition: CDCSegmentPair.h:250
Belle2::TrackFindingCDC::CDCSegment2D
A reconstructed sequence of two dimensional hits in one super layer.
Definition: CDCSegment2D.h:40
Belle2::TrackFindingCDC::CDCSegmentPair::getTrajectory3D
CDCTrajectory3D & getTrajectory3D() const
Getter for the three dimensional trajectory.
Definition: CDCSegmentPair.h:213
Belle2::TrackFindingCDC::CDCSegmentPair::getToISuperLayer
ISuperLayer getToISuperLayer() const
Getter for the superlayer id of the to segment.
Definition: CDCSegmentPair.cc:79
Belle2::TrackFindingCDC::CDCSegmentPair::getFromSegment
const CDCSegment2D * getFromSegment() const
Getter for the from segment.
Definition: CDCSegmentPair.h:120
Belle2::TrackFindingCDC::CDCSegmentPair::setToSegment
void setToSegment(const CDCSegment2D *toSegment)
Setter for the to segment.
Definition: CDCSegmentPair.h:138
Belle2::TrackFindingCDC::CDCSegmentPair::setTrajectory3D
void setTrajectory3D(const CDCTrajectory3D &trajectory3D) const
Setter for the three dimensional trajectory.
Definition: CDCSegmentPair.h:207
Belle2::TrackFindingCDC::CDCTrajectory3D
Particle full three dimensional trajectory.
Definition: CDCTrajectory3D.h:47
Belle2::TrackFindingCDC::CDCSegmentPair::setSegments
void setSegments(const CDCSegment2D *fromSegment, const CDCSegment2D *toSegment)
Setter for both segments simultaniously.
Definition: CDCSegmentPair.h:156
Belle2::TrackFindingCDC::CDCSegmentPair::getTrajectory2D
CDCTrajectory2D getTrajectory2D() const
Getter for the two dimensional projection of the common three dimensional trajectory.
Definition: CDCSegmentPair.cc:90
Belle2::TrackFindingCDC::CDCSegmentPair::m_toSegment
const CDCSegment2D * m_toSegment
Reference to the to segment.
Definition: CDCSegmentPair.h:253
Belle2::TrackFindingCDC::CDCSegmentPair::getAxialSegment
const CDCSegment2D * getAxialSegment() const
Getter for the axial segment.
Definition: CDCSegmentPair.h:150