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 CDCSegment2D;
32 class CDCSegment3D;
33 class CDCSegmentPair;
34 class CDCSegmentTriple;
35
37 class CDCTrack : public std::vector<CDCRecoHit3D> {
38 public:
39
41 CDCTrack() = default;
42
44 explicit CDCTrack(const std::vector<CDCRecoHit3D>& recoHits3D);
45
47 explicit CDCTrack(const CDCSegment2D& segment);
48
50 static CDCTrack condense(const Path<const CDCTrack>& trackPath);
51
53 static CDCTrack condense(const Path<const CDCSegmentTriple>& segmentTriplePath);
54
56 static CDCTrack condense(const Path<const CDCSegmentPair>& segmentPairPath);
57
59 bool operator<(const CDCTrack& track __attribute__((unused))) const
60 {
61 return false;
62 }
63
66 std::vector<CDCSegment3D> splitIntoSegments() const;
67
70 {
71 return front().getISuperLayer();
72 }
73
76 {
77 return back().getISuperLayer();
78 }
79
81 const ROOT::Math::XYZVector& getStartRecoPos3D() const
82 {
83 return front().getRecoPos3D();
84 }
85
87 const ROOT::Math::XYZVector& getEndRecoPos3D() const
88 {
89 return back().getRecoPos3D();
90 }
91
94 void setStartTrajectory3D(const CDCTrajectory3D& startTrajectory3D)
95 {
96 m_startTrajectory3D = startTrajectory3D;
97 }
98
101 void setEndTrajectory3D(const CDCTrajectory3D& endTrajectory3D)
102 {
103 m_endTrajectory3D = endTrajectory3D;
104 }
105
109 {
110 return m_startTrajectory3D;
111 }
112
116 {
117 return m_endTrajectory3D;
118 }
119
122 {
123 return m_automatonCell;
124 }
125
128 {
129 return &m_automatonCell;
130 }
131
133 void unsetAndForwardMaskedFlag() const;
134
138 void setAndForwardMaskedFlag() const;
139
144 void receiveMaskedFlag() const;
145
148 void forwardTakenFlag(bool takenFlag = true) const;
149
150
152 void sortByArcLength2D();
153
157 void shiftToPositiveArcLengths2D(bool doForAllTracks = false);
158
160 void reverse();
161
163 CDCTrack reversed() const;
164
166 MayBePtr<const CDCRecoHit3D> find(const CDCWireHit& wireHit) const;
167
169 void setHasMatchingSegment(bool hasMatchingSegment = true)
170 {
171 m_hasMatchingSegment = hasMatchingSegment;
172 }
173
179 {
181 }
182
185 {
186 return m_qualityIndicator;
187 }
188
190 void setQualityIndicator(const float qualityIndicator)
191 {
192 m_qualityIndicator = qualityIndicator;
193 }
194
195 private:
198
201
204
208
211 };
212 }
214}
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:37
std::vector< CDCSegment3D > splitIntoSegments() const
Splits the track into segments.
Definition CDCTrack.cc:323
void setStartTrajectory3D(const CDCTrajectory3D &startTrajectory3D)
Setter for the two dimensional trajectory.
Definition CDCTrack.h:94
const CDCTrajectory3D & getEndTrajectory3D() const
Getter for the three dimensional trajectory.
Definition CDCTrack.h:115
CDCTrack reversed() const
Return a reversed copy of the track.
Definition CDCTrack.cc:362
CDC::ISuperLayer getStartISuperLayer() const
Getter for the superlayer id the track starts from.
Definition CDCTrack.h:69
void reverse()
Reverse the track inplace.
Definition CDCTrack.cc:338
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:169
const ROOT::Math::XYZVector & getEndRecoPos3D() const
Getter for the position of the last reconstructed hit.
Definition CDCTrack.h:87
const CDCTrajectory3D & getStartTrajectory3D() const
Getter for the two dimensional trajectory.
Definition CDCTrack.h:108
AutomatonCell * operator->() const
Indirection to the automaton cell for easier access to the flags.
Definition CDCTrack.h:127
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
AutomatonCell & getAutomatonCell() const
Mutable getter for the automaton cell.
Definition CDCTrack.h:121
void sortByArcLength2D()
Sort the recoHits according to their perpS information.
Definition CDCTrack.cc:414
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
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
CDCTrajectory3D m_startTrajectory3D
Memory for the three dimensional trajectory at the start of the track.
Definition CDCTrack.h:200
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:378
void setEndTrajectory3D(const CDCTrajectory3D &endTrajectory3D)
Setter for the three dimensional trajectory.
Definition CDCTrack.h:101
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
float getQualityIndicator() const
Get the multivariate quality indicator in [0, 1] attached the CDCTrack.
Definition CDCTrack.h:184
void setQualityIndicator(const float qualityIndicator)
Set the multivariate quality indicator in [0, 1] attached the CDCTrack.
Definition CDCTrack.h:190
float m_qualityIndicator
Multivariate classifier output in [0, 1] correlated with probability that track is good match.
Definition CDCTrack.h:207
CDC::ISuperLayer getEndISuperLayer() const
Getter for the superlayer id the track ends in.
Definition CDCTrack.h:75
static CDCTrack condense(const Path< const CDCTrack > &trackPath)
concatenates several tracks from a path
Definition CDCTrack.cc:166
bool getHasMatchingSegment() const
Get a flag which indicates that the track has a matching segment (probably set in the SegmentTrackCom...
Definition CDCTrack.h:178
AutomatonCell m_automatonCell
Memory for the automaton cell.
Definition CDCTrack.h:197
CDCTrajectory3D m_endTrajectory3D
Memory for the three dimensional trajectory at the end of the track.
Definition CDCTrack.h:203
bool operator<(const CDCTrack &track) const
Comparison of track - no particular order has been defined so far, all tracks are equivalent.
Definition CDCTrack.h:59
const ROOT::Math::XYZVector & getStartRecoPos3D() const
Getter for the position of the first reconstructed hit.
Definition CDCTrack.h:81
void receiveMaskedFlag() const
Check all contained wire hits if one has the masked flag.
Definition CDCTrack.cc:396
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:56
signed short ISuperLayer
The type of the layer and superlayer ids.
Definition ISuperLayer.h:24
Abstract base class for different kinds of events.