Belle II Software  release-05-02-19
AxialTrackUtil Struct Reference

Utility structure gathering heuristic functions used during the axial track finding. More...

#include <AxialTrackUtil.h>

Static Public Member Functions

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. More...
 
static bool postprocessTrack (CDCTrack &track, const std::vector< const CDCWireHit * > &allAxialWireHits)
 Perform all track postprocessing - return whether the track is considered good after the postprocessing.
 
static void normalizeTrack (CDCTrack &track)
 Refit and resort the track. Unmask all hits.
 
static void updateRecoHit3D (const CDCTrajectory2D &trajectory2D, CDCRecoHit3D &hit)
 update given CDCRecoHit3D with given trajectory
 
static void deleteHitsFarAwayFromTrajectory (CDCTrack &track, double maximumDistance=0.2)
 Postprocessing: Delete axial hits that do not "match" to the given track. More...
 
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.
 
static std::vector< CDCRecoHit3DsplitBack2BackTrack (CDCTrack &track)
 Tries to split back-to-back tracks into two different tracks.
 
static bool isBack2BackTrack (CDCTrack &track)
 Checks whether the track has hits on both arms as seen from the origin.
 
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 origin to given center. More...
 
static int getArmSignVote (const CDCTrack &track, const Vector2D &center)
 Calculate the sum of right and left votes for the hits relative to the center. More...
 
static void removeHitsAfterSuperLayerBreak (CDCTrack &track)
 Searches for a break in the super layer chain and remove all hits that come after that.
 
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 given center. More...
 
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 the list.
 
static void deleteShortTracks (std::vector< CDCTrack > &axialTracks, double minimal_size=5)
 Remove tracks that are shorter than the given number of hits.
 

Static Private Member Functions

static bool checkTrackQuality (const CDCTrack &track)
 Check track quality – currently based on number of hits only.
 
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 is supposed to be occupied.
 
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 superlayer of the track).
 
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 superlayer of the track).
 

Detailed Description

Utility structure gathering heuristic functions used during the axial track finding.

Definition at line 42 of file AxialTrackUtil.h.

Member Function Documentation

◆ addCandidateFromHits()

void addCandidateFromHits ( const std::vector< const CDCWireHit * > &  foundAxialWireHits,
const std::vector< const CDCWireHit * > &  allAxialWireHits,
std::vector< CDCTrack > &  axialTracks,
bool  withPostprocessing = true 
)
static

Create CDCTrack using CDCWireHit hits and store it in the list. Then call the postprocessing on it.

Mark hits as taken and add the new track to the track list

Masked bad hits

Definition at line 26 of file AxialTrackUtil.cc.

30 {
31  if (foundAxialWireHits.empty()) return;
32 
33  // New track
34  CDCTrack track;
35 
36  // Fit trajectory
37  const CDCRiemannFitter& fitter = CDCRiemannFitter::getFitter();
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 }

◆ deleteHitsFarAwayFromTrajectory()

void deleteHitsFarAwayFromTrajectory ( CDCTrack track,
double  maximumDistance = 0.2 
)
static

Postprocessing: Delete axial hits that do not "match" to the given track.

This is done by checking the distance between the hits and the trajectory, which should not exceed the maximum_distance parameter.

As this function used the masked flag, all hits should have their masked flag set to false before calling this function.

Definition at line 142 of file AxialTrackUtil.cc.

◆ getArmSign()

ESign getArmSign ( const CDCRecoHit3D hit,
const Vector2D center 
)
static

Calculate whether the hits is to the right or to the left relative to the line from origin to the given center.

Return values
ESign::c_Righthit is on the right
ESign::c_Lefthit is on the left
ESign::c_Zerorare boarderline case
ESign::c_Invalidgiven hit has a nan value

Definition at line 283 of file AxialTrackUtil.cc.

◆ getArmSignVote()

int getArmSignVote ( const CDCTrack track,
const Vector2D center 
)
static

Calculate the sum of right and left votes for the hits relative to the center.

Positive indicates a majority of right by that amout. Negative indicates a left majority.

Definition at line 258 of file AxialTrackUtil.cc.

◆ getMajorArmSign()

ESign getMajorArmSign ( const CDCTrack track,
const Vector2D center 
)
static

Calculate whether the majority of hits is to the right or to the left relative to the line from origin to given center.

Return values
ESign::c_Rightmost hits are on the right
ESign::c_Leftmost hits are on the left
ESign::c_Zerono majority
ESign::c_Invalidgiven center has a nan value

Definition at line 248 of file AxialTrackUtil.cc.


The documentation for this struct was generated from the following files:
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::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::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::CDCRiemannFitter::getFitter
static const CDCRiemannFitter & getFitter()
Static getter for a general Riemann fitter.
Definition: CDCRiemannFitter.cc:22
Belle2::TrackFindingCDC::CDCWireHit
Class representing a hit wire in the central drift chamber.
Definition: CDCWireHit.h:65