Main algorithm applying the adjustment of the orientation.
55{
58
59 outputTracks = inputTracks;
60
62 outputTracks.reserve(2 * inputTracks.size());
63 for (const CDCTrack& track : inputTracks) {
64 outputTracks.push_back(track.reversed());
65 outputTracks.push_back(track);
66 }
67
69
70
71 outputTracks.reserve(1.5 * inputTracks.size());
72 for (const CDCTrack& track : inputTracks) {
73 const CDCTrajectory3D& startTrajectory3D = track.getStartTrajectory3D();
74 const CDCTrajectory2D startTrajectory2D = startTrajectory3D.
getTrajectory2D();
75
76 const CDCTrajectory3D& endTrajectory3D = track.getEndTrajectory3D();
77 const CDCTrajectory2D endTrajectory2D = endTrajectory3D.
getTrajectory2D();
79 bool isStartLeaver = (not endTrajectory2D.
isCurler(1.1)) and startTrajectory2D.
isOriginer();
80 bool isEndLeaver = (not startTrajectory2D.
isCurler(1.1)) and endTrajectory2D.
isOriginer();
81
82 bool isLeaver = isFitted and (isStartLeaver or isEndLeaver);
83 if (isLeaver) {
84
85 const CDCRecoHit3D& firstHit = track.front();
86 const CDCRecoHit3D& lastHit = track.back();
88 outputTracks.push_back(track.reversed());
89 } else {
90 outputTracks.push_back(track);
91 }
92 } else {
93
94 outputTracks.push_back(track);
95 outputTracks.push_back(track.reversed());
96 }
97 }
98
100 outputTracks.reserve(inputTracks.size());
101 for (const CDCTrack& track : inputTracks) {
102 const CDCRecoHit3D& firstHit = track.front();
103 const CDCRecoHit3D& lastHit = track.back();
105 outputTracks.push_back(track.reversed());
106 } else {
107 outputTracks.push_back(track);
108 }
109 }
110
112 outputTracks.reserve(inputTracks.size());
113 for (const CDCTrack& track : inputTracks) {
114 const CDCRecoHit3D& firstHit = track.front();
115 const CDCRecoHit3D& lastHit = track.back();
117 outputTracks.push_back(track.reversed());
118 } else {
119 outputTracks.push_back(track);
120 }
121 }
122
123 } else {
124 B2WARNING("Unexpected 'TrackOrientation' parameter of track finder module : '" <<
126 "'. No tracks are put out.");
127 }
128}
EPreferredDirection m_trackOrientation
Encoded desired track orientation.
std::string m_param_trackOrientationString
Parameter: String that states the desired track orientation.
const Vector2D & getRecoPos2D() const
Getter for the 2d position of the hit.
bool isOriginer(double factor=1) const
Checks if the trajectory intersects with the inner radius of the CDC time the given tolerance factor.
bool isCurler(double factor=1) const
Checks if the trajectory leaves the outer radius of the CDC times the given tolerance factor.
bool isFitted() const
Checks if the circle is already set to a valid value.
CDCTrajectory2D getTrajectory2D() const
Getter for the two dimensional trajectory.
double cylindricalR() const
Gives the cylindrical radius of the vector. Same as norm()
double y() const
Getter for the y coordinate.