Belle II Software  release-08-01-10
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 32 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 24 of file AxialTrackUtil.cc.

28 {
29  if (foundAxialWireHits.empty()) return;
30 
31  // New track
32  CDCTrack track;
33 
34  // Fit trajectory
36  CDCTrajectory2D trajectory2D = fitter.fit(foundAxialWireHits);
37  track.setStartTrajectory3D(CDCTrajectory3D(trajectory2D, CDCTrajectorySZ::basicAssumption()));
38 
39  // Reconstruct and add hits
40  for (const CDCWireHit* wireHit : foundAxialWireHits) {
41  AutomatonCell& automatonCell = wireHit->getAutomatonCell();
42  if (automatonCell.hasTakenFlag()) continue;
43  CDCRecoHit3D recoHit3D = CDCRecoHit3D::reconstructNearest(wireHit, trajectory2D);
44  track.push_back(std::move(recoHit3D));
45 
46  automatonCell.setTakenFlag(true);
47  }
48  track.sortByArcLength2D();
49 
50  // Change everything again in the postprocessing, if desired
51  bool success = withPostprocessing ? postprocessTrack(track, allAxialWireHits) : true;
52  if (success) {
54  for (const CDCRecoHit3D& recoHit3D : track) {
55  recoHit3D.getWireHit().getAutomatonCell().setTakenFlag(true);
56  }
57  axialTracks.emplace_back(std::move(track));
58  } else {
60  for (const CDCRecoHit3D& recoHit3D : track) {
61  recoHit3D.getWireHit().getAutomatonCell().setMaskedFlag(true);
62  recoHit3D.getWireHit().getAutomatonCell().setTakenFlag(false);
63  }
64  }
65 }
Cell used by the cellular automata.
Definition: AutomatonCell.h:29
void setTakenFlag(bool setTo=true)
Sets the taken flag to the given value. Default value true.
void setMaskedFlag(bool setTo=true)
Sets the masked flag to the given value. Default value true.
bool hasTakenFlag() const
Gets the current state of the taken marker flag.
Class representing a three dimensional reconstructed hit.
Definition: CDCRecoHit3D.h:52
const CDCWireHit & getWireHit() const
Getter for the wire hit.
Definition: CDCRecoHit3D.h:238
static CDCRecoHit3D reconstructNearest(const CDCWireHit *axialWireHit, const CDCTrajectory2D &trajectory2D)
Reconstruct a three dimensional hit from a wire hit (as in reconstruct(rlWireHit, trajectory2D)),...
Class implementing the Riemann fit for two dimensional trajectory circle.
static const CDCRiemannFitter & getFitter()
Static getter for a general Riemann fitter.
Class representing a sequence of three dimensional reconstructed hits.
Definition: CDCTrack.h:41
Particle trajectory as it is seen in xy projection represented as a circle.
Particle full three dimensional trajectory.
static CDCTrajectorySZ basicAssumption()
Constucts a basic assumption, what the z0 start position and the sz slope are, including some broad v...
Class representing a hit wire in the central drift chamber.
Definition: CDCWireHit.h:55
AutomatonCell & getAutomatonCell() const
Mutable getter for the automaton cell.
Definition: CDCWireHit.h:286
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...

◆ 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 140 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 281 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 256 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 246 of file AxialTrackUtil.cc.


The documentation for this struct was generated from the following files: