Belle II Software  release-05-02-19
CDCTrack.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2012 - 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/hits/CDCRecoHit3D.h>
13 
14 #include <tracking/trackFindingCDC/eventdata/trajectories/CDCTrajectory3D.h>
15 
16 #include <tracking/trackFindingCDC/topology/ISuperLayer.h>
17 
18 #include <tracking/trackFindingCDC/ca/AutomatonCell.h>
19 
20 #include <tracking/trackFindingCDC/ca/Path.h>
21 
22 #include <tracking/trackFindingCDC/utilities/MayBePtr.h>
23 
24 #include <vector>
25 
26 namespace Belle2 {
32  namespace TrackFindingCDC {
33  class CDCSegment2D;
34  class CDCSegment3D;
35  class CDCSegmentPair;
36  class CDCSegmentTriple;
37 
38  class CDCWireHit;
39  class Vector2D;
40  class Vector3D;
41 
43  class CDCTrack : public std::vector<CDCRecoHit3D> {
44  public:
45 
47  CDCTrack() = default;
48 
50  explicit CDCTrack(const std::vector<CDCRecoHit3D>& recoHits3D);
51 
53  explicit CDCTrack(const CDCSegment2D& segment);
54 
56  static CDCTrack condense(const Path<const CDCTrack>& trackPath);
57 
59  static CDCTrack condense(const Path<const CDCSegmentTriple>& segmentTriplePath);
60 
62  static CDCTrack condense(const Path<const CDCSegmentPair>& segmentPairPath);
63 
65  bool operator<(const CDCTrack& track __attribute__((unused))) const
66  {
67  return false;
68  }
69 
72  std::vector<CDCSegment3D> splitIntoSegments() const;
73 
75  ISuperLayer getStartISuperLayer() const
76  {
77  return front().getISuperLayer();
78  }
79 
81  ISuperLayer getEndISuperLayer() const
82  {
83  return back().getISuperLayer();
84  }
85 
87  const Vector3D& getStartRecoPos3D() const
88  {
89  return front().getRecoPos3D();
90  }
91 
93  const Vector3D& getEndRecoPos3D() const
94  {
95  return back().getRecoPos3D();
96  }
97 
100  void setStartTrajectory3D(const CDCTrajectory3D& startTrajectory3D)
101  {
102  m_startTrajectory3D = startTrajectory3D;
103  }
104 
107  void setEndTrajectory3D(const CDCTrajectory3D& endTrajectory3D)
108  {
109  m_endTrajectory3D = endTrajectory3D;
110  }
111 
115  {
116  return m_startTrajectory3D;
117  }
118 
121  const CDCTrajectory3D& getEndTrajectory3D() const
122  {
123  return m_endTrajectory3D;
124  }
125 
128  {
130  }
131 
133  AutomatonCell* operator->() const
134  {
136  }
137 
139  void unsetAndForwardMaskedFlag() const;
140 
144  void setAndForwardMaskedFlag() const;
145 
150  void receiveMaskedFlag() const;
151 
154  void forwardTakenFlag(bool takenFlag = true) const;
155 
156 
158  void sortByArcLength2D();
159 
163  void shiftToPositiveArcLengths2D(bool doForAllTracks = false);
164 
166  void reverse();
167 
169  CDCTrack reversed() const;
170 
172  MayBePtr<const CDCRecoHit3D> find(const CDCWireHit& wireHit) const;
173 
175  void setHasMatchingSegment(bool hasMatchingSegment = true)
176  {
177  m_hasMatchingSegment = hasMatchingSegment;
178  }
179 
184  bool getHasMatchingSegment() const
185  {
186  return m_hasMatchingSegment;
187  }
188 
190  float getQualityIndicator() const
191  {
193  }
194 
196  void setQualityIndicator(const float qualityIndicator)
197  {
198  m_qualityIndicator = qualityIndicator;
199  }
200 
201  private:
204 
207 
210 
212  bool m_hasMatchingSegment = false;
213 
216  float m_qualityIndicator = NAN;
217  };
218  }
220 }
Belle2::TrackFindingCDC::CDCTrack::shiftToPositiveArcLengths2D
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:425
Belle2::TrackFindingCDC::CDCTrack::receiveMaskedFlag
void receiveMaskedFlag() const
Check all contained wire hits if one has the masked flag.
Definition: CDCTrack.cc:396
Belle2::Vector3D
HepGeom::Vector3D< double > Vector3D
3D Vector
Definition: Cell.h:35
Belle2::TrackFindingCDC::CDCTrack::setEndTrajectory3D
void setEndTrajectory3D(const CDCTrajectory3D &endTrajectory3D)
Setter for the three dimensional trajectory.
Definition: CDCTrack.h:115
Belle2::TrackFindingCDC::CDCTrack
Class representing a sequence of three dimensional reconstructed hits.
Definition: CDCTrack.h:51
Belle2::TrackFindingCDC::CDCTrack::getStartTrajectory3D
const CDCTrajectory3D & getStartTrajectory3D() const
Getter for the two dimensional trajectory.
Definition: CDCTrack.h:122
Belle2::TrackFindingCDC::CDCTrack::getEndRecoPos3D
const Vector3D & getEndRecoPos3D() const
Getter for the position of the last reconstructed hit.
Definition: CDCTrack.h:101
Belle2::TrackFindingCDC::CDCTrack::forwardTakenFlag
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:407
Belle2::TrackFindingCDC::CDCTrack::m_endTrajectory3D
CDCTrajectory3D m_endTrajectory3D
Memory for the three dimensional trajectory at the end of the track.
Definition: CDCTrack.h:217
Belle2::TrackFindingCDC::CDCTrack::getStartISuperLayer
ISuperLayer getStartISuperLayer() const
Getter for the superlayer id the track starts from.
Definition: CDCTrack.h:83
Belle2::TrackFindingCDC::CDCTrack::setAndForwardMaskedFlag
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:387
Belle2::TrackFindingCDC::CDCTrack::splitIntoSegments
std::vector< CDCSegment3D > splitIntoSegments() const
Splits the track into segments.
Definition: CDCTrack.cc:323
Belle2::TrackFindingCDC::CDCTrack::reversed
CDCTrack reversed() const
Return a reversed copy of the track.
Definition: CDCTrack.cc:362
Belle2::TrackFindingCDC::CDCTrack::m_hasMatchingSegment
bool m_hasMatchingSegment
Flag which indicates that the track had a matching segment (can be used for filter decisions)
Definition: CDCTrack.h:220
Belle2::TrackFindingCDC::CDCTrack::getEndISuperLayer
ISuperLayer getEndISuperLayer() const
Getter for the superlayer id the track ends in.
Definition: CDCTrack.h:89
Belle2::TrackFindingCDC::CDCTrack::CDCTrack
CDCTrack()=default
Default constructor for ROOT compatibility.
Belle2::TrackFindingCDC::CDCTrack::unsetAndForwardMaskedFlag
void unsetAndForwardMaskedFlag() const
Unset the masked flag of the automaton cell of this segment and of all contained wire hits.
Definition: CDCTrack.cc:378
Belle2::TrackFindingCDC::CDCTrack::getEndTrajectory3D
const CDCTrajectory3D & getEndTrajectory3D() const
Getter for the three dimensional trajectory.
Definition: CDCTrack.h:129
Belle2::TrackFindingCDC::CDCTrack::setHasMatchingSegment
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:183
Belle2::TrackFindingCDC::CDCTrack::condense
static CDCTrack condense(const Path< const CDCTrack > &trackPath)
Concats several tracks from a path.
Belle2::TrackFindingCDC::CDCTrack::reverse
void reverse()
Reverse the track inplace.
Definition: CDCTrack.cc:338
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackFindingCDC::CDCTrack::sortByArcLength2D
void sortByArcLength2D()
Sort the recoHits according to their perpS information.
Definition: CDCTrack.cc:414
Belle2::TrackFindingCDC::AutomatonCell
Cell used by the cellular automata.
Definition: AutomatonCell.h:39
Belle2::TrackFindingCDC::Vector3D
A three dimensional vector.
Definition: Vector3D.h:34
Belle2::TrackFindingCDC::CDCTrack::getStartRecoPos3D
const Vector3D & getStartRecoPos3D() const
Getter for the position of the first reconstructed hit.
Definition: CDCTrack.h:95
Belle2::TrackFindingCDC::CDCTrack::m_qualityIndicator
float m_qualityIndicator
Multivariate classifier output in [0, 1] correlated with probability that track is good match.
Definition: CDCTrack.h:224
Belle2::TrackFindingCDC::CDCTrack::m_automatonCell
AutomatonCell m_automatonCell
Memory for the automaton cell.
Definition: CDCTrack.h:211
Belle2::TrackFindingCDC::CDCTrack::m_startTrajectory3D
CDCTrajectory3D m_startTrajectory3D
Memory for the three dimensional trajectory at the start of the track.
Definition: CDCTrack.h:214
Belle2::TrackFindingCDC::CDCTrack::setQualityIndicator
void setQualityIndicator(const float qualityIndicator)
Set the multivariate quality indicator in [0, 1] attached the CDCTrack.
Definition: CDCTrack.h:204
Belle2::TrackFindingCDC::CDCSegment2D
A reconstructed sequence of two dimensional hits in one super layer.
Definition: CDCSegment2D.h:40
Belle2::TrackFindingCDC::CDCTrack::operator->
AutomatonCell * operator->() const
Indirection to the automaton cell for easier access to the flags.
Definition: CDCTrack.h:141
Belle2::TrackFindingCDC::CDCTrack::getQualityIndicator
float getQualityIndicator() const
Get the multivariate quality indicator in [0, 1] attached the CDCTrack.
Definition: CDCTrack.h:198
Belle2::TrackFindingCDC::CDCWireHit
Class representing a hit wire in the central drift chamber.
Definition: CDCWireHit.h:65
Belle2::TrackFindingCDC::CDCTrack::find
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:369
Belle2::TrackFindingCDC::CDCTrack::getAutomatonCell
AutomatonCell & getAutomatonCell() const
Mutable getter for the automaton cell.
Definition: CDCTrack.h:135
Belle2::TrackFindingCDC::CDCTrajectory3D
Particle full three dimensional trajectory.
Definition: CDCTrajectory3D.h:47
Belle2::TrackFindingCDC::CDCTrack::setStartTrajectory3D
void setStartTrajectory3D(const CDCTrajectory3D &startTrajectory3D)
Setter for the two dimensional trajectory.
Definition: CDCTrack.h:108
Belle2::TrackFindingCDC::CDCTrack::operator<
bool operator<(const CDCTrack &track __attribute__((unused))) const
Comparision of track - no particular order has been defined so far, all tracks are equivalent.
Definition: CDCTrack.h:73
Belle2::TrackFindingCDC::CDCTrack::getHasMatchingSegment
bool getHasMatchingSegment() const
Get a flag which indicates that the track has a matching segment (probably set in the SegmentTrackCom...
Definition: CDCTrack.h:192