Belle II Software  release-05-01-25
AxialTrackUtil.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2014 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Viktor Trusov, Nils Braun *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #include <tracking/trackFindingCDC/processing/AxialTrackUtil.h>
11 
12 #include <tracking/trackFindingCDC/fitting/CDCRiemannFitter.h>
13 #include <tracking/trackFindingCDC/fitting/CDCKarimakiFitter.h>
14 #include <tracking/trackFindingCDC/fitting/CDCObservations2D.h>
15 
16 #include <tracking/trackFindingCDC/eventdata/tracks/CDCTrack.h>
17 #include <tracking/trackFindingCDC/eventdata/hits/CDCWireHit.h>
18 #include <tracking/trackFindingCDC/eventdata/trajectories/CDCTrajectorySZ.h>
19 #include <tracking/trackFindingCDC/eventdata/trajectories/CDCTrajectory2D.h>
20 
21 #include <tracking/trackFindingCDC/utilities/Algorithms.h>
22 
23 using namespace Belle2;
24 using namespace TrackFindingCDC;
25 
26 void AxialTrackUtil::addCandidateFromHits(const std::vector<const CDCWireHit*>& foundAxialWireHits,
27  const std::vector<const CDCWireHit*>& allAxialWireHits,
28  std::vector<CDCTrack>& axialTracks,
29  bool withPostprocessing)
30 {
31  if (foundAxialWireHits.empty()) return;
32 
33  // New track
34  CDCTrack track;
35 
36  // Fit trajectory
38  CDCTrajectory2D trajectory2D = fitter.fit(foundAxialWireHits);
39  track.setStartTrajectory3D(CDCTrajectory3D(trajectory2D, CDCTrajectorySZ::basicAssumption()));
40 
41  // Reconstruct and add hits
42  for (const CDCWireHit* wireHit : foundAxialWireHits) {
43  AutomatonCell& automatonCell = wireHit->getAutomatonCell();
44  if (automatonCell.hasTakenFlag()) continue;
45  CDCRecoHit3D recoHit3D = CDCRecoHit3D::reconstructNearest(wireHit, trajectory2D);
46  track.push_back(std::move(recoHit3D));
47 
48  automatonCell.setTakenFlag(true);
49  }
50  track.sortByArcLength2D();
51 
52  // Change everything again in the postprocessing, if desired
53  bool success = withPostprocessing ? postprocessTrack(track, allAxialWireHits) : true;
54  if (success) {
56  for (const CDCRecoHit3D& recoHit3D : track) {
57  recoHit3D.getWireHit().getAutomatonCell().setTakenFlag(true);
58  }
59  axialTracks.emplace_back(std::move(track));
60  } else {
62  for (const CDCRecoHit3D& recoHit3D : track) {
63  recoHit3D.getWireHit().getAutomatonCell().setMaskedFlag(true);
64  recoHit3D.getWireHit().getAutomatonCell().setTakenFlag(false);
65  }
66  }
67 }
68 
69 bool AxialTrackUtil::postprocessTrack(CDCTrack& track, const std::vector<const CDCWireHit*>& allAxialWireHits)
70 {
72 
75  if (not checkTrackQuality(track)) {
76  return false;
77  }
78 
79  AxialTrackUtil::assignNewHitsToTrack(track, allAxialWireHits);
81 
84  if (not checkTrackQuality(track)) {
85  return false;
86  }
87  return true;
88 }
89 
91 {
92  return not(track.size() < 5);
93 }
94 
96 {
97  // Set the start point of the trajectory to the first hit
98  if (track.size() < 5) return;
99 
100  CDCObservations2D observations2D(EFitPos::c_RecoPos);
101  for (const CDCRecoHit3D& item : track) {
102  observations2D.append(item);
103  }
104 
106  CDCTrajectory2D trackTrajectory2D = fitter.fit(observations2D);
107  Vector2D center = trackTrajectory2D.getGlobalCenter();
108 
109  // Arm used as a proxy for the charge of the track
110  // Correct if the track originates close to the origin
111  ESign expectedCharge = AxialTrackUtil::getMajorArmSign(track, center);
112 
113  if (trackTrajectory2D.getChargeSign() != expectedCharge) trackTrajectory2D.reverse();
114 
115  trackTrajectory2D.setLocalOrigin(trackTrajectory2D.getGlobalPerigee());
116  for (CDCRecoHit3D& recoHit : track) {
117  AxialTrackUtil::updateRecoHit3D(trackTrajectory2D, recoHit);
118  }
119 
120  track.sortByArcLength2D();
121 
122  CDCTrajectory3D trajectory3D(trackTrajectory2D, CDCTrajectorySZ::basicAssumption());
123  track.setStartTrajectory3D(trajectory3D);
124 
125  Vector3D backPosition = track.back().getRecoPos3D();
126  trajectory3D.setLocalOrigin(backPosition);
127  track.setEndTrajectory3D(trajectory3D);
128 }
129 
131 {
132  hit = CDCRecoHit3D::reconstructNearest(&hit.getWireHit(), trajectory2D);
133 
134  // Recalculate the perpS of the hits
135  double arcLength2D = hit.getArcLength2D();
136  if (arcLength2D < -trajectory2D.getArcLength2DPeriod() / 4.0) {
137  arcLength2D += trajectory2D.getArcLength2DPeriod();
138  }
139  hit.setArcLength2D(arcLength2D);
140 }
141 
142 void AxialTrackUtil::deleteHitsFarAwayFromTrajectory(CDCTrack& track, double maximumDistance)
143 {
144  const CDCTrajectory2D& trajectory2D = track.getStartTrajectory3D().getTrajectory2D();
145  auto farFromTrajectory = [&trajectory2D, &maximumDistance](CDCRecoHit3D & recoHit3D) {
146  Vector2D refPos2D = recoHit3D.getRefPos2D();
147  double distance = trajectory2D.getDist2D(refPos2D) - recoHit3D.getSignedRecoDriftLength();
148  if (std::fabs(distance) > maximumDistance) {
149  recoHit3D.getWireHit().getAutomatonCell().setTakenFlag(false);
150  // This must be here as the deleted hits must not participate in the hough search again.
151  recoHit3D.getWireHit().getAutomatonCell().setMaskedFlag(true);
152  return true;
153  }
154  return false;
155  };
156  erase_remove_if(track, farFromTrajectory);
157 }
158 
159 void AxialTrackUtil::deleteTracksWithLowFitProbability(std::vector<CDCTrack>& axialTracks,
160  double minimal_probability_for_good_fit)
161 {
163  const auto lowPValue = [&](const CDCTrack & track) {
164  CDCTrajectory2D fittedTrajectory = trackFitter.fit(track);
165  // Keep good fits - p-value is not really a probability,
166  // but what can you do if the original author did not mind...
167  if (not(fittedTrajectory.getPValue() >= minimal_probability_for_good_fit)) {
168  // Release hits
169  track.forwardTakenFlag(false);
170  return true;
171  }
172  return false;
173  };
174  erase_remove_if(axialTracks, lowPValue);
175 }
176 
178  const std::vector<const CDCWireHit*>& allAxialWireHits,
179  double minimalDistance)
180 {
181  if (track.size() < 10) return;
182 
183  const CDCTrajectory2D& trackTrajectory2D = track.getStartTrajectory3D().getTrajectory2D();
184 
185  for (const CDCWireHit* wireHit : allAxialWireHits) {
186  if (wireHit->getAutomatonCell().hasTakenFlag()) continue;
187 
188  CDCRecoHit3D recoHit3D = CDCRecoHit3D::reconstructNearest(wireHit, trackTrajectory2D);
189  const Vector2D& recoPos2D = recoHit3D.getRecoPos2D();
190 
191  if (fabs(trackTrajectory2D.getDist2D(recoPos2D)) < minimalDistance) {
192  track.push_back(std::move(recoHit3D));
193  recoHit3D.getWireHit().getAutomatonCell().setTakenFlag();
194  }
195  }
196 }
197 
198 void AxialTrackUtil::deleteShortTracks(std::vector<CDCTrack>& axialTracks, double minimal_size)
199 {
200  const auto isShort = [&](const CDCTrack & track) {
201  if (track.size() < minimal_size) {
202  // Release hits
203  track.forwardTakenFlag(false);
204  return true;
205  }
206  return false;
207  };
208  erase_remove_if(axialTracks, isShort);
209 }
210 
211 std::vector<CDCRecoHit3D> AxialTrackUtil::splitBack2BackTrack(CDCTrack& track)
212 {
213  std::vector<CDCRecoHit3D> removedHits;
214 
215  if (track.size() < 5) return removedHits;
216  if (not isBack2BackTrack(track)) return removedHits;
217 
218  Vector2D center = track.getStartTrajectory3D().getGlobalCenter();
219  ESign majorArmSign = getMajorArmSign(track, center);
220 
221  auto isOnMajorArm = [&center, &majorArmSign](const CDCRecoHit3D & hit) {
222  return getArmSign(hit, center) == majorArmSign;
223  };
224 
225  auto itFirstMinorArmHit = std::stable_partition(track.begin(),
226  track.end(),
227  isOnMajorArm);
228 
229  for (const CDCRecoHit3D& recoHit3D : asRange(itFirstMinorArmHit, track.end())) {
230  recoHit3D.getWireHit().getAutomatonCell().setTakenFlag(false);
231  removedHits.push_back(recoHit3D);
232  }
233  track.erase(itFirstMinorArmHit, track.end());
234 
235  return removedHits;
236 }
237 
239 {
240  Vector2D center = track.getStartTrajectory3D().getGlobalCenter();
241  int armSignVote = getArmSignVote(track, center);
242  if (std::abs(armSignVote) < int(track.size()) and std::fabs(center.cylindricalR()) > 60.) {
243  return true;
244  }
245  return false;
246 }
247 
249 {
250  int armSignVote = getArmSignVote(track, center);
251  if (armSignVote > 0) {
252  return ESign::c_Plus;
253  } else {
254  return ESign::c_Minus;
255  }
256 }
257 
258 int AxialTrackUtil::getArmSignVote(const CDCTrack& track, const Vector2D& center)
259 {
260  int votePos = 0;
261  int voteNeg = 0;
262 
263  if (center.hasNAN()) {
264  B2WARNING("Trajectory is not setted or wrong!");
265  return 0;
266  }
267 
268  for (const CDCRecoHit3D& hit : track) {
269  ESign armSign = getArmSign(hit, center);
270 
271  if (armSign == ESign::c_Plus) {
272  ++votePos;
273  } else if (armSign == ESign::c_Minus) {
274  ++voteNeg;
275  } else {
276  B2ERROR("Strange behaviour of getArmSignVote");
277  }
278  }
279  int armSignVote = votePos - voteNeg;
280  return armSignVote;
281 }
282 
284 {
285  return sign(center.isRightOrLeftOf(hit.getRecoPos2D()));
286 }
287 
289 {
290  double apogeeArcLength = fabs(track.getStartTrajectory3D().getGlobalCircle().perimeter()) / 2.;
291 
292  std::array<int, ISuperLayerUtil::c_N> nForwardArmHitsBySLayer = {0};
293  std::array<int, ISuperLayerUtil::c_N> nBackwardArmHitsBySLayer = {0};
294 
295  // Count the number of hits in the outgoing and ingoing arm per superlayer.
296  for (const CDCRecoHit3D& hit : track) {
297  if ((hit.getArcLength2D() <= apogeeArcLength) and (hit.getArcLength2D() > 0)) {
298  nForwardArmHitsBySLayer[hit.getISuperLayer()]++;
299  } else {
300  nBackwardArmHitsBySLayer[hit.getISuperLayer()]++;
301  }
302  }
303 
304  std::vector<ISuperLayer> forwardSLayerHoles = getSLayerHoles(nForwardArmHitsBySLayer);
305  std::vector<ISuperLayer> backwardSLayerHoles = getSLayerHoles(nBackwardArmHitsBySLayer);
306 
307  // No missing layers
308  if (forwardSLayerHoles.empty() and backwardSLayerHoles.empty()) return;
309 
310  // We only check for holes in the forward arm for now
311  // We do not use emptyEndingSLayers here, as it would leave to a severy efficiency drop.
312  assert(std::is_sorted(forwardSLayerHoles.begin(), forwardSLayerHoles.end()));
313  if (forwardSLayerHoles.empty()) return;
314 
315  const ISuperLayer breakSLayer = forwardSLayerHoles.front();
316 
317  auto isInBackwardArm = [apogeeArcLength](const CDCRecoHit3D & recoHit3D) {
318  if ((recoHit3D.getArcLength2D() >= apogeeArcLength) or (recoHit3D.getArcLength2D() < 0)) {
319  recoHit3D.getWireHit().getAutomatonCell().unsetTakenFlag();
320  return true;
321  }
322  return false;
323  };
324 
325  erase_remove_if(track, isInBackwardArm);
326 
327  auto isAfterSLayerBreak = [breakSLayer](const CDCRecoHit3D & recoHit3D) {
328  recoHit3D.getWireHit().getAutomatonCell().unsetTakenFlag();
329  if (recoHit3D.getISuperLayer() >= breakSLayer) {
330  recoHit3D.getWireHit().getAutomatonCell().unsetTakenFlag();
331  return true;
332  }
333  return false;
334  };
335 
336  erase_remove_if(track, isAfterSLayerBreak);
337 }
338 
339 std::vector<ISuperLayer> AxialTrackUtil::getSLayerHoles(const std::array<int, ISuperLayerUtil::c_N>& nHitsBySLayer)
340 {
341  std::vector<ISuperLayer> sLayerHoles;
342 
343  // Find the start end end point.
344  ISuperLayer firstSlayer = getFirstOccupiedISuperLayer(nHitsBySLayer);
345  ISuperLayer lastSlayer = getLastOccupiedISuperLayer(nHitsBySLayer);
346 
347  if (ISuperLayerUtil::isInvalid(firstSlayer) or ISuperLayerUtil::isInvalid(lastSlayer)) {
348  return sLayerHoles;
349  }
350 
351  for (ISuperLayer iSLayer = firstSlayer; iSLayer <= lastSlayer; iSLayer += 2) {
352  if (nHitsBySLayer[iSLayer] == 0) {
353  sLayerHoles.push_back(iSLayer);
354  }
355  }
356  return sLayerHoles;
357 }
358 
359 ISuperLayer AxialTrackUtil::getFirstOccupiedISuperLayer(const std::array<int, ISuperLayerUtil::c_N>& nHitsBySLayer)
360 {
361  for (ISuperLayer iSLayer = 0; iSLayer < ISuperLayerUtil::c_N; ++iSLayer) {
362  if (nHitsBySLayer[iSLayer] > 0) return iSLayer;
363  }
365 }
366 
367 ISuperLayer AxialTrackUtil::getLastOccupiedISuperLayer(const std::array<int, ISuperLayerUtil::c_N>& nHitsBySLayer)
368 {
369  for (ISuperLayer iSLayer = ISuperLayerUtil::c_N - 1; iSLayer >= 0; --iSLayer) {
370  if (nHitsBySLayer[iSLayer] > 0) return iSLayer;
371  }
373 }
Belle2::TrackFindingCDC::CDCWireHit::getAutomatonCell
AutomatonCell & getAutomatonCell() const
Mutable getter for the automaton cell.
Definition: CDCWireHit.h:294
Belle2::TrackFindingCDC::CDCTrajectory2D::getGlobalPerigee
Vector2D getGlobalPerigee() const
Getter for the closest approach on the trajectory to the global origin.
Definition: CDCTrajectory2D.h:351
Belle2::TrackFindingCDC::CDCTrajectory2D::getPValue
double getPValue() const
Getter for p-value.
Definition: CDCTrajectory2D.h:472
Belle2::TrackFindingCDC::ISuperLayerUtil::c_N
static const ISuperLayer c_N
Constant representing the total number of cdc superlayers.
Definition: ISuperLayer.h:66
Belle2::TrackFindingCDC::AxialTrackUtil::getArmSignVote
static int getArmSignVote(const CDCTrack &track, const Vector2D &center)
Calculate the sum of right and left votes for the hits relative to the center.
Definition: AxialTrackUtil.cc:258
Belle2::TrackFindingCDC::CDCRecoHit3D
Class representing a three dimensional reconstructed hit.
Definition: CDCRecoHit3D.h:62
Belle2::TrackFindingCDC::CDCRiemannFitter
Class implementing the Riemann fit for two dimensional trajectory circle.
Definition: CDCRiemannFitter.h:34
Belle2::TrackFindingCDC::CDCTrack
Class representing a sequence of three dimensional reconstructed hits.
Definition: CDCTrack.h:51
Belle2::TrackFindingCDC::Vector2D::isRightOrLeftOf
ERightLeft isRightOrLeftOf(const Vector2D &rhs) const
Indicates if the given vector is more left or more right if you looked in the direction of this vecto...
Definition: Vector2D.h:467
Belle2::TrackFindingCDC::Vector2D
A two dimensional vector which is equipped with functions for correct handeling of orientation relat...
Definition: Vector2D.h:37
Belle2::TrackFindingCDC::AxialTrackUtil::splitBack2BackTrack
static std::vector< CDCRecoHit3D > splitBack2BackTrack(CDCTrack &track)
Tries to split back-to-back tracks into two different tracks.
Definition: AxialTrackUtil.cc:211
Belle2::TrackFindingCDC::ISuperLayerUtil::c_Invalid
static const ISuperLayer c_Invalid
Constant making an invalid superlayer id.
Definition: ISuperLayer.h:75
Belle2::TrackFindingCDC::CDCTrajectory2D::reverse
void reverse()
Reverses the trajectory in place.
Definition: CDCTrajectory2D.cc:97
Belle2::TrackFindingCDC::AxialTrackUtil::deleteTracksWithLowFitProbability
static void deleteTracksWithLowFitProbability(std::vector< CDCTrack > &axialTracks, double minimal_probability_for_good_fit=0.4)
Check an (improper) p-values of the tracks. If they are below the given value, delete the track from ...
Definition: AxialTrackUtil.cc:159
Belle2::TrackFindingCDC::AxialTrackUtil::isBack2BackTrack
static bool isBack2BackTrack(CDCTrack &track)
Checks whether the track has hits on both arms as seen from the origin.
Definition: AxialTrackUtil.cc:238
Belle2::TrackFindingCDC::CDCTrajectory2D::getChargeSign
ESign getChargeSign() const
Gets the charge sign of the trajectory.
Definition: CDCTrajectory2D.cc:280
Belle2::TrackFindingCDC::CDCTrajectory3D::setLocalOrigin
double setLocalOrigin(const Vector3D &localOrigin)
Setter for the origin of the local coordinate system.
Definition: CDCTrajectory3D.cc:369
Belle2::TrackFindingCDC::AutomatonCell::setTakenFlag
void setTakenFlag(bool setTo=true)
Sets the taken flag to the given value. Default value true.
Definition: AutomatonCell.h:234
Belle2::TrackFindingCDC::AxialTrackUtil::getArmSign
static ESign getArmSign(const CDCRecoHit3D &hit, const Vector2D &center)
Calculate whether the hits is to the right or to the left relative to the line from origin to the giv...
Definition: AxialTrackUtil.cc:283
Belle2::TrackFindingCDC::CDCKarimakiFitter
Class implementing the fitter using Karimakis method.
Definition: CDCKarimakiFitter.h:33
Belle2::TrackFindingCDC::CDCTrajectory2D::setLocalOrigin
double setLocalOrigin(const Vector2D &localOrigin)
Setter for the origin of the local coordinate system.
Definition: CDCTrajectory2D.cc:357
Belle2::TrackFindingCDC::CDCTrajectorySZ::basicAssumption
static CDCTrajectorySZ basicAssumption()
Constucts a basic assumption, what the z0 start position and the sz slope are, including some broad v...
Definition: CDCTrajectorySZ.cc:29
Belle2::TrackFindingCDC::ESignUtil::ESign
ESign
Enumeration for the distinct sign values of floating point variables.
Definition: ESign.h:37
Belle2::TrackFindingCDC::CDCRecoHit3D::getWireHit
const CDCWireHit & getWireHit() const
Getter for the wire hit.
Definition: CDCRecoHit3D.h:248
Belle2::TrackFindingCDC::CDCRecoHit3D::getRecoPos2D
const Vector2D & getRecoPos2D() const
Getter for the 2d position of the hit.
Definition: CDCRecoHit3D.h:307
Belle2::TrackFindingCDC::AxialTrackUtil::removeHitsAfterSuperLayerBreak
static void removeHitsAfterSuperLayerBreak(CDCTrack &track)
Searches for a break in the super layer chain and remove all hits that come after that.
Definition: AxialTrackUtil.cc:288
Belle2::TrackFindingCDC::CDCTrajectory2D::getArcLength2DPeriod
double getArcLength2DPeriod() const
Getter for the arc length for one round trip around the trajectory.
Definition: CDCTrajectory2D.h:289
Belle2::TrackFindingCDC::AxialTrackUtil::postprocessTrack
static bool postprocessTrack(CDCTrack &track, const std::vector< const CDCWireHit * > &allAxialWireHits)
Perform all track postprocessing - return whether the track is considered good after the postprocessi...
Definition: AxialTrackUtil.cc:69
Belle2::TrackFindingCDC::AxialTrackUtil::getFirstOccupiedISuperLayer
static ISuperLayer getFirstOccupiedISuperLayer(const std::array< int, ISuperLayerUtil::c_N > &nHitsBySLayer)
Helper function to extract the first filled entry in the array of super layers ( = the start superlay...
Definition: AxialTrackUtil.cc:359
Belle2::TrackFindingCDC::CDCTrajectory2D
Particle trajectory as it is seen in xy projection represented as a circle.
Definition: CDCTrajectory2D.h:46
Belle2::TrackFindingCDC::AxialTrackUtil::assignNewHitsToTrack
static void assignNewHitsToTrack(CDCTrack &track, const std::vector< const CDCWireHit * > &allAxialWireHits, double minimalDistance=0.2)
Assign new hits to the track basing on the distance from the hit to the track.
Definition: AxialTrackUtil.cc:177
Belle2::TrackFindingCDC::CDCRecoHit3D::reconstructNearest
static CDCRecoHit3D reconstructNearest(const CDCWireHit *axialWireHit, const CDCTrajectory2D &trajectory2D)
Reconstruct a three dimensional hit from a wire hit (as in reconstruct(rlWireHit, trajectory2D)),...
Definition: CDCRecoHit3D.cc:132
Belle2::TrackFindingCDC::AxialTrackUtil::getSLayerHoles
static std::vector< ISuperLayer > getSLayerHoles(const std::array< int, ISuperLayerUtil::c_N > &nHitsBySLayer)
Helper function getting the empty axial! super layers that appear in the chain of super layers that i...
Definition: AxialTrackUtil.cc:339
Belle2::TrackFindingCDC::Vector2D::hasNAN
bool hasNAN() const
Checks if one of the coordinates is NAN.
Definition: Vector2D.h:163
Belle2::TrackFindingCDC::ISuperLayerUtil::isInvalid
static bool isInvalid(ISuperLayer iSuperLayer)
Indicates if the given number corresponds to a true cdc superlayer - excludes the logic ids for inner...
Definition: ISuperLayer.cc:40
Belle2::TrackFindingCDC::CDCObservations2D
Class serving as a storage of observed drift circles to present to the Riemann fitter.
Definition: CDCObservations2D.h:53
Belle2::TrackFindingCDC::AxialTrackUtil::addCandidateFromHits
static void addCandidateFromHits(const std::vector< const CDCWireHit * > &foundAxialWireHits, const std::vector< const CDCWireHit * > &allAxialWireHits, std::vector< CDCTrack > &axialTracks, bool withPostprocessing=true)
Create CDCTrack using CDCWireHit hits and store it in the list. Then call the postprocessing on it.
Definition: AxialTrackUtil.cc:26
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
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::Vector2D::cylindricalR
double cylindricalR() const
Gives the cylindrical radius of the vector. Same as norm()
Definition: Vector2D.h:571
Belle2::TrackFindingCDC::CDCFitter2D::fit
CDCTrajectory2D fit(const CDCObservations2D &observations2D) const
Fits a collection of observation drift circles.
Definition: CDCFitter2D.icc.h:48
Belle2::TrackFindingCDC::AxialTrackUtil::checkTrackQuality
static bool checkTrackQuality(const CDCTrack &track)
Check track quality – currently based on number of hits only.
Definition: AxialTrackUtil.cc:90
Belle2::TrackFindingCDC::AxialTrackUtil::deleteHitsFarAwayFromTrajectory
static void deleteHitsFarAwayFromTrajectory(CDCTrack &track, double maximumDistance=0.2)
Postprocessing: Delete axial hits that do not "match" to the given track.
Definition: AxialTrackUtil.cc:142
Belle2::TrackFindingCDC::AutomatonCell::hasTakenFlag
bool hasTakenFlag() const
Gets the current state of the taken marker flag.
Definition: AutomatonCell.h:249
Belle2::TrackFindingCDC::CDCRiemannFitter::getFitter
static const CDCRiemannFitter & getFitter()
Static getter for a general Riemann fitter.
Definition: CDCRiemannFitter.cc:22
Belle2::TrackFindingCDC::CDCTrajectory2D::getGlobalCenter
Vector2D getGlobalCenter() const
Getter for the center of the trajectory in global coordinates.
Definition: CDCTrajectory2D.h:357
Belle2::TrackFindingCDC::CDCKarimakiFitter::getNoDriftVarianceFitter
static const CDCKarimakiFitter & getNoDriftVarianceFitter()
Static getter for a general fitter that does not use the drift length variances.
Definition: CDCKarimakiFitter.cc:35
Belle2::TrackFindingCDC::CDCTrajectory2D::getDist2D
double getDist2D(const Vector2D &point) const
Calculates the distance from the point to the trajectory as seen from the xy projection.
Definition: CDCTrajectory2D.h:419
Belle2::TrackFindingCDC::CDCWireHit
Class representing a hit wire in the central drift chamber.
Definition: CDCWireHit.h:65
Belle2::TrackFindingCDC::AxialTrackUtil::deleteShortTracks
static void deleteShortTracks(std::vector< CDCTrack > &axialTracks, double minimal_size=5)
Remove tracks that are shorter than the given number of hits.
Definition: AxialTrackUtil.cc:198
Belle2::TrackFindingCDC::AxialTrackUtil::updateRecoHit3D
static void updateRecoHit3D(const CDCTrajectory2D &trajectory2D, CDCRecoHit3D &hit)
update given CDCRecoHit3D with given trajectory
Definition: AxialTrackUtil.cc:130
Belle2::TrackFindingCDC::AxialTrackUtil::getMajorArmSign
static ESign getMajorArmSign(const CDCTrack &track, const Vector2D &center)
Calculate whether the majority of hits is to the right or to the left relative to the line from origi...
Definition: AxialTrackUtil.cc:248
Belle2::TrackFindingCDC::AxialTrackUtil::normalizeTrack
static void normalizeTrack(CDCTrack &track)
Refit and resort the track. Unmask all hits.
Definition: AxialTrackUtil.cc:95
Belle2::TrackFindingCDC::CDCTrajectory3D
Particle full three dimensional trajectory.
Definition: CDCTrajectory3D.h:47
Belle2::TrackFindingCDC::AxialTrackUtil::getLastOccupiedISuperLayer
static ISuperLayer getLastOccupiedISuperLayer(const std::array< int, ISuperLayerUtil::c_N > &nHitsBySLayer)
Helper function to extract the last filled entry in the array of super layers ( = the final superlaye...
Definition: AxialTrackUtil.cc:367
Belle2::TrackFindingCDC::CDCObservations2D::append
std::size_t append(const CDCWireHit &wireHit, ERightLeft rlInfo=ERightLeft::c_Unknown)
Appends the hit circle at wire reference position without a right left passage hypotheses.