Belle II Software  release-08-01-10
CDCTrack.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/CDCRecoHit3D.h>
11 
12 #include <tracking/trackFindingCDC/eventdata/trajectories/CDCTrajectory3D.h>
13 
14 #include <tracking/trackFindingCDC/topology/ISuperLayer.h>
15 
16 #include <tracking/trackFindingCDC/ca/AutomatonCell.h>
17 
18 #include <tracking/trackFindingCDC/ca/Path.h>
19 
20 #include <tracking/trackFindingCDC/utilities/MayBePtr.h>
21 
22 #include <vector>
23 
24 namespace Belle2 {
30  namespace TrackFindingCDC {
31  class CDCSegment2D;
32  class CDCSegment3D;
33  class CDCSegmentPair;
34  class CDCSegmentTriple;
35 
36  class CDCWireHit;
37  class Vector2D;
38  class Vector3D;
39 
41  class CDCTrack : public std::vector<CDCRecoHit3D> {
42  public:
43 
45  CDCTrack() = default;
46 
48  explicit CDCTrack(const std::vector<CDCRecoHit3D>& recoHits3D);
49 
51  explicit CDCTrack(const CDCSegment2D& segment);
52 
54  static CDCTrack condense(const Path<const CDCTrack>& trackPath);
55 
57  static CDCTrack condense(const Path<const CDCSegmentTriple>& segmentTriplePath);
58 
60  static CDCTrack condense(const Path<const CDCSegmentPair>& segmentPairPath);
61 
63  bool operator<(const CDCTrack& track __attribute__((unused))) const
64  {
65  return false;
66  }
67 
70  std::vector<CDCSegment3D> splitIntoSegments() const;
71 
73  ISuperLayer getStartISuperLayer() const
74  {
75  return front().getISuperLayer();
76  }
77 
79  ISuperLayer getEndISuperLayer() const
80  {
81  return back().getISuperLayer();
82  }
83 
85  const Vector3D& getStartRecoPos3D() const
86  {
87  return front().getRecoPos3D();
88  }
89 
91  const Vector3D& getEndRecoPos3D() const
92  {
93  return back().getRecoPos3D();
94  }
95 
98  void setStartTrajectory3D(const CDCTrajectory3D& startTrajectory3D)
99  {
100  m_startTrajectory3D = startTrajectory3D;
101  }
102 
105  void setEndTrajectory3D(const CDCTrajectory3D& endTrajectory3D)
106  {
107  m_endTrajectory3D = endTrajectory3D;
108  }
109 
113  {
114  return m_startTrajectory3D;
115  }
116 
120  {
121  return m_endTrajectory3D;
122  }
123 
126  {
127  return m_automatonCell;
128  }
129 
132  {
133  return &m_automatonCell;
134  }
135 
137  void unsetAndForwardMaskedFlag() const;
138 
142  void setAndForwardMaskedFlag() const;
143 
148  void receiveMaskedFlag() const;
149 
152  void forwardTakenFlag(bool takenFlag = true) const;
153 
154 
156  void sortByArcLength2D();
157 
161  void shiftToPositiveArcLengths2D(bool doForAllTracks = false);
162 
164  void reverse();
165 
167  CDCTrack reversed() const;
168 
170  MayBePtr<const CDCRecoHit3D> find(const CDCWireHit& wireHit) const;
171 
173  void setHasMatchingSegment(bool hasMatchingSegment = true)
174  {
175  m_hasMatchingSegment = hasMatchingSegment;
176  }
177 
183  {
184  return m_hasMatchingSegment;
185  }
186 
188  float getQualityIndicator() const
189  {
190  return m_qualityIndicator;
191  }
192 
194  void setQualityIndicator(const float qualityIndicator)
195  {
196  m_qualityIndicator = qualityIndicator;
197  }
198 
199  private:
202 
205 
208 
210  bool m_hasMatchingSegment = false;
211 
214  float m_qualityIndicator = NAN;
215  };
216  }
218 }
Cell used by the cellular automata.
Definition: AutomatonCell.h:29
A reconstructed sequence of two dimensional hits in one super layer.
Definition: CDCSegment2D.h:39
Class representing a sequence of three dimensional reconstructed hits.
Definition: CDCTrack.h:41
std::vector< CDCSegment3D > splitIntoSegments() const
Splits the track into segments.
Definition: CDCTrack.cc:321
const Vector3D & getEndRecoPos3D() const
Getter for the position of the last reconstructed hit.
Definition: CDCTrack.h:91
void setStartTrajectory3D(const CDCTrajectory3D &startTrajectory3D)
Setter for the two dimensional trajectory.
Definition: CDCTrack.h:98
CDCTrack reversed() const
Return a reversed copy of the track.
Definition: CDCTrack.cc:360
void reverse()
Reverse the track inplace.
Definition: CDCTrack.cc:336
ISuperLayer getStartISuperLayer() const
Getter for the superlayer id the track starts from.
Definition: CDCTrack.h:73
void setHasMatchingSegment(bool hasMatchingSegment=true)
Set the flag which indicates that the track has a matching segment (probably only used in the Segment...
Definition: CDCTrack.h:173
void forwardTakenFlag(bool takenFlag=true) const
Set the taken flag of all hits belonging to this track to the given value (default true),...
Definition: CDCTrack.cc:405
void sortByArcLength2D()
Sort the recoHits according to their perpS information.
Definition: CDCTrack.cc:412
void shiftToPositiveArcLengths2D(bool doForAllTracks=false)
Set all arcLengths to have positive values by shifting them by pi*radius if they are negative.
Definition: CDCTrack.cc:423
const Vector3D & getStartRecoPos3D() const
Getter for the position of the first reconstructed hit.
Definition: CDCTrack.h:85
void setAndForwardMaskedFlag() const
Set the masked flag of the automaton cell of this segment and forward the masked flag to all containe...
Definition: CDCTrack.cc:385
CDCTrajectory3D m_startTrajectory3D
Memory for the three dimensional trajectory at the start of the track.
Definition: CDCTrack.h:204
bool m_hasMatchingSegment
Flag which indicates that the track had a matching segment (can be used for filter decisions)
Definition: CDCTrack.h:210
void unsetAndForwardMaskedFlag() const
Unset the masked flag of the automaton cell of this segment and of all contained wire hits.
Definition: CDCTrack.cc:376
void setEndTrajectory3D(const CDCTrajectory3D &endTrajectory3D)
Setter for the three dimensional trajectory.
Definition: CDCTrack.h:105
AutomatonCell & getAutomatonCell() const
Mutable getter for the automaton cell.
Definition: CDCTrack.h:125
MayBePtr< const CDCRecoHit3D > find(const CDCWireHit &wireHit) const
Finds the first CDCRecoHit3D that is based on the given wire hit - nullptr if none.
Definition: CDCTrack.cc:367
float getQualityIndicator() const
Get the multivariate quality indicator in [0, 1] attached the CDCTrack.
Definition: CDCTrack.h:188
void setQualityIndicator(const float qualityIndicator)
Set the multivariate quality indicator in [0, 1] attached the CDCTrack.
Definition: CDCTrack.h:194
float m_qualityIndicator
Multivariate classifier output in [0, 1] correlated with probability that track is good match.
Definition: CDCTrack.h:214
ISuperLayer getEndISuperLayer() const
Getter for the superlayer id the track ends in.
Definition: CDCTrack.h:79
static CDCTrack condense(const Path< const CDCTrack > &trackPath)
Concats several tracks from a path.
Definition: CDCTrack.cc:164
bool getHasMatchingSegment() const
Get a flag which indicates that the track has a matching segment (probably set in the SegmentTrackCom...
Definition: CDCTrack.h:182
AutomatonCell m_automatonCell
Memory for the automaton cell.
Definition: CDCTrack.h:201
CDCTrajectory3D m_endTrajectory3D
Memory for the three dimensional trajectory at the end of the track.
Definition: CDCTrack.h:207
bool operator<(const CDCTrack &track) const
Comparision of track - no particular order has been defined so far, all tracks are equivalent.
Definition: CDCTrack.h:63
const CDCTrajectory3D & getEndTrajectory3D() const
Getter for the three dimensional trajectory.
Definition: CDCTrack.h:119
AutomatonCell * operator->() const
Indirection to the automaton cell for easier access to the flags.
Definition: CDCTrack.h:131
void receiveMaskedFlag() const
Check all contained wire hits if one has the masked flag.
Definition: CDCTrack.cc:394
CDCTrack()=default
Default constructor for ROOT compatibility.
const CDCTrajectory3D & getStartTrajectory3D() const
Getter for the two dimensional trajectory.
Definition: CDCTrack.h:112
Particle full three dimensional trajectory.
Class representing a hit wire in the central drift chamber.
Definition: CDCWireHit.h:55
A three dimensional vector.
Definition: Vector3D.h:33
HepGeom::Vector3D< double > Vector3D
3D Vector
Definition: Cell.h:34
Abstract base class for different kinds of events.