Belle II Software development
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/trackingUtilities/eventdata/hits/CDCRecoHit3D.h>
11
12#include <tracking/trackingUtilities/eventdata/trajectories/CDCTrajectory3D.h>
13
14#include <cdc/topology/ISuperLayer.h>
15
16#include <tracking/trackingUtilities/ca/AutomatonCell.h>
17
18#include <tracking/trackingUtilities/ca/Path.h>
19
20#include <tracking/trackingUtilities/utilities/MayBePtr.h>
21
22#include <vector>
23
24namespace Belle2 {
29 namespace TrackingUtilities {
30 class CDCWireHit;
31 class Vector2D;
32 class Vector3D;
33 class CDCSegment2D;
34 class CDCSegment3D;
35 class CDCSegmentPair;
36 class CDCSegmentTriple;
37
39 class CDCTrack : public std::vector<CDCRecoHit3D> {
40 public:
41
43 CDCTrack() = default;
44
46 explicit CDCTrack(const std::vector<CDCRecoHit3D>& recoHits3D);
47
49 explicit CDCTrack(const CDCSegment2D& segment);
50
52 static CDCTrack condense(const Path<const CDCTrack>& trackPath);
53
55 static CDCTrack condense(const Path<const CDCSegmentTriple>& segmentTriplePath);
56
58 static CDCTrack condense(const Path<const CDCSegmentPair>& segmentPairPath);
59
61 bool operator<(const CDCTrack& track __attribute__((unused))) const
62 {
63 return false;
64 }
65
68 std::vector<CDCSegment3D> splitIntoSegments() const;
69
72 {
73 return front().getISuperLayer();
74 }
75
78 {
79 return back().getISuperLayer();
80 }
81
84 {
85 return front().getRecoPos3D();
86 }
87
90 {
91 return back().getRecoPos3D();
92 }
93
96 void setStartTrajectory3D(const CDCTrajectory3D& startTrajectory3D)
97 {
98 m_startTrajectory3D = startTrajectory3D;
99 }
100
103 void setEndTrajectory3D(const CDCTrajectory3D& endTrajectory3D)
104 {
105 m_endTrajectory3D = endTrajectory3D;
106 }
107
111 {
112 return m_startTrajectory3D;
113 }
114
118 {
119 return m_endTrajectory3D;
120 }
121
124 {
125 return m_automatonCell;
126 }
127
130 {
131 return &m_automatonCell;
132 }
133
135 void unsetAndForwardMaskedFlag() const;
136
140 void setAndForwardMaskedFlag() const;
141
146 void receiveMaskedFlag() const;
147
150 void forwardTakenFlag(bool takenFlag = true) const;
151
152
154 void sortByArcLength2D();
155
159 void shiftToPositiveArcLengths2D(bool doForAllTracks = false);
160
162 void reverse();
163
165 CDCTrack reversed() const;
166
168 MayBePtr<const CDCRecoHit3D> find(const CDCWireHit& wireHit) const;
169
171 void setHasMatchingSegment(bool hasMatchingSegment = true)
172 {
173 m_hasMatchingSegment = hasMatchingSegment;
174 }
175
181 {
183 }
184
187 {
188 return m_qualityIndicator;
189 }
190
192 void setQualityIndicator(const float qualityIndicator)
193 {
194 m_qualityIndicator = qualityIndicator;
195 }
196
197 private:
200
203
206
210
213 };
214 }
216}
Cell used by the cellular automata.
A reconstructed sequence of two dimensional hits in one super layer.
A segment consisting of three dimensional reconstructed hits.
Class representing a pair of one reconstructed axial segment and one stereo segment in adjacent super...
Class representing a triple of reconstructed segments in adjacent superlayer.
Class representing a sequence of three dimensional reconstructed hits.
Definition CDCTrack.h:39
std::vector< CDCSegment3D > splitIntoSegments() const
Splits the track into segments.
Definition CDCTrack.cc:321
void setStartTrajectory3D(const CDCTrajectory3D &startTrajectory3D)
Setter for the two dimensional trajectory.
Definition CDCTrack.h:96
const CDCTrajectory3D & getEndTrajectory3D() const
Getter for the three dimensional trajectory.
Definition CDCTrack.h:117
CDCTrack reversed() const
Return a reversed copy of the track.
Definition CDCTrack.cc:360
CDC::ISuperLayer getStartISuperLayer() const
Getter for the superlayer id the track starts from.
Definition CDCTrack.h:71
const Vector3D & getStartRecoPos3D() const
Getter for the position of the first reconstructed hit.
Definition CDCTrack.h:83
void reverse()
Reverse the track inplace.
Definition CDCTrack.cc:336
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:171
const CDCTrajectory3D & getStartTrajectory3D() const
Getter for the two dimensional trajectory.
Definition CDCTrack.h:110
AutomatonCell * operator->() const
Indirection to the automaton cell for easier access to the flags.
Definition CDCTrack.h:129
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
const Vector3D & getEndRecoPos3D() const
Getter for the position of the last reconstructed hit.
Definition CDCTrack.h:89
AutomatonCell & getAutomatonCell() const
Mutable getter for the automaton cell.
Definition CDCTrack.h:123
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
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:202
bool m_hasMatchingSegment
Flag which indicates that the track had a matching segment (can be used for filter decisions)
Definition CDCTrack.h:212
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:103
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:186
void setQualityIndicator(const float qualityIndicator)
Set the multivariate quality indicator in [0, 1] attached the CDCTrack.
Definition CDCTrack.h:192
float m_qualityIndicator
Multivariate classifier output in [0, 1] correlated with probability that track is good match.
Definition CDCTrack.h:209
CDC::ISuperLayer getEndISuperLayer() const
Getter for the superlayer id the track ends in.
Definition CDCTrack.h:77
static CDCTrack condense(const Path< const CDCTrack > &trackPath)
concatenates 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:180
AutomatonCell m_automatonCell
Memory for the automaton cell.
Definition CDCTrack.h:199
CDCTrajectory3D m_endTrajectory3D
Memory for the three dimensional trajectory at the end of the track.
Definition CDCTrack.h:205
bool operator<(const CDCTrack &track) const
Comparison of track - no particular order has been defined so far, all tracks are equivalent.
Definition CDCTrack.h:61
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.
Particle full three dimensional trajectory.
Class representing a hit wire in the central drift chamber.
Definition CDCWireHit.h:58
A two dimensional vector which is equipped with functions for correct handling of orientation relate...
Definition Vector2D.h:36
A three dimensional vector.
Definition Vector3D.h:34
signed short ISuperLayer
The type of the layer and superlayer ids.
Definition ISuperLayer.h:24
Abstract base class for different kinds of events.