Belle II Software development
AxialTrackUtil.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 <cdc/topology/ISuperLayer.h>
11#include <tracking/trackingUtilities/numerics/ESign.h>
12
13#include <Math/Vector2D.h>
14
15#include <array>
16#include <vector>
17
18namespace Belle2 {
23
24 namespace TrackingUtilities {
25 class CDCTrack;
26 class CDCTrajectory2D;
27 class CDCWireHit;
28 class CDCRecoHit3D;
29 }
30 namespace TrackFindingCDC {
31
36
37 public:
39 static void addCandidateFromHits(const std::vector<const TrackingUtilities::CDCWireHit*>& foundAxialWireHits,
40 const std::vector<const TrackingUtilities::CDCWireHit*>& allAxialWireHits,
41 std::vector<TrackingUtilities::CDCTrack>& axialTracks,
42 bool withPostprocessing = true);
43
46 const std::vector<const TrackingUtilities::CDCWireHit*>& allAxialWireHits);
47
48 private:
50 static bool checkTrackQuality(const TrackingUtilities::CDCTrack& track);
51
52 public:
55
58
67 static void deleteHitsFarAwayFromTrajectory(TrackingUtilities::CDCTrack& track, double maximumDistance = 0.2);
68
71 const std::vector<const TrackingUtilities::CDCWireHit*>& allAxialWireHits,
72 double minimalDistance = 0.2);
73
75 static std::vector<TrackingUtilities::CDCRecoHit3D> splitBack2BackTrack(TrackingUtilities::CDCTrack& track);
76
79
89 static TrackingUtilities::ESign getMajorArmSign(const TrackingUtilities::CDCTrack& track,
90 const ROOT::Math::XYVector& center);
91
96 static int getArmSignVote(const TrackingUtilities::CDCTrack& track, const ROOT::Math::XYVector& center);
97
98
101
111 static TrackingUtilities::ESign getArmSign(const TrackingUtilities::CDCRecoHit3D& hit, const ROOT::Math::XYVector& center);
112
113 public:
115 static void deleteTracksWithLowFitProbability(std::vector<TrackingUtilities::CDCTrack>& axialTracks,
116 double minimal_probability_for_good_fit = 0.4);
117
119 static void deleteShortTracks(std::vector<TrackingUtilities::CDCTrack>& axialTracks, double minimal_size = 5);
120
121 private:
123 static std::vector<CDC::ISuperLayer> getSLayerHoles(const std::array<int, CDC::ISuperLayerUtil::c_N>&
124 nHitsBySLayer); // return 0;
125
127 static CDC::ISuperLayer getFirstOccupiedISuperLayer(const std::array<int, CDC::ISuperLayerUtil::c_N>&
128 nHitsBySLayer);
129
131 static CDC::ISuperLayer getLastOccupiedISuperLayer(const std::array<int, CDC::ISuperLayerUtil::c_N>&
132 nHitsBySLayer);
133 };
134 }
136}
Class representing a three dimensional reconstructed hit.
Class representing a sequence of three dimensional reconstructed hits.
Definition CDCTrack.h:37
Particle trajectory as it is seen in xy projection represented as a circle.
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.
Utility structure gathering heuristic functions used during the axial track finding.
static void normalizeTrack(TrackingUtilities::CDCTrack &track)
Refit and resort the track. Unmask all hits.
static void deleteShortTracks(std::vector< TrackingUtilities::CDCTrack > &axialTracks, double minimal_size=5)
Remove tracks that are shorter than the given number of hits.
static void updateRecoHit3D(const TrackingUtilities::CDCTrajectory2D &trajectory2D, TrackingUtilities::CDCRecoHit3D &hit)
update given CDCRecoHit3D with given trajectory
static void addCandidateFromHits(const std::vector< const TrackingUtilities::CDCWireHit * > &foundAxialWireHits, const std::vector< const TrackingUtilities::CDCWireHit * > &allAxialWireHits, std::vector< TrackingUtilities::CDCTrack > &axialTracks, bool withPostprocessing=true)
Create CDCTrack using CDCWireHit hits and store it in the list. Then call the postprocessing on it.
static void deleteTracksWithLowFitProbability(std::vector< TrackingUtilities::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 ...
static void removeHitsAfterSuperLayerBreak(TrackingUtilities::CDCTrack &track)
Searches for a break in the super layer chain and remove all hits that come after that.
static std::vector< CDC::ISuperLayer > getSLayerHoles(const std::array< int, CDC::ISuperLayerUtil::c_N > &nHitsBySLayer)
Helper function getting the empty axial!
static std::vector< TrackingUtilities::CDCRecoHit3D > splitBack2BackTrack(TrackingUtilities::CDCTrack &track)
Tries to split back-to-back tracks into two different tracks.
static TrackingUtilities::ESign getMajorArmSign(const TrackingUtilities::CDCTrack &track, const ROOT::Math::XYVector &center)
Calculate whether the majority of hits is to the right or to the left relative to the line from origi...
static int getArmSignVote(const TrackingUtilities::CDCTrack &track, const ROOT::Math::XYVector &center)
Calculate the sum of right and left votes for the hits relative to the center.
static void assignNewHitsToTrack(TrackingUtilities::CDCTrack &track, const std::vector< const TrackingUtilities::CDCWireHit * > &allAxialWireHits, double minimalDistance=0.2)
Assign new hits to the track basing on the distance from the hit to the track.
static bool postprocessTrack(TrackingUtilities::CDCTrack &track, const std::vector< const TrackingUtilities::CDCWireHit * > &allAxialWireHits)
Perform all track postprocessing - return whether the track is considered good after the postprocessi...
static TrackingUtilities::ESign getArmSign(const TrackingUtilities::CDCRecoHit3D &hit, const ROOT::Math::XYVector &center)
Calculate whether the hits is to the right or to the left relative to the line from origin to the giv...
static void deleteHitsFarAwayFromTrajectory(TrackingUtilities::CDCTrack &track, double maximumDistance=0.2)
Postprocessing: Delete axial hits that do not "match" to the given track.
static bool isBack2BackTrack(TrackingUtilities::CDCTrack &track)
Checks whether the track has hits on both arms as seen from the origin.
static CDC::ISuperLayer getLastOccupiedISuperLayer(const std::array< int, CDC::ISuperLayerUtil::c_N > &nHitsBySLayer)
Helper function to extract the last filled entry in the array of super layers ( = the final superlaye...
static bool checkTrackQuality(const TrackingUtilities::CDCTrack &track)
Check track quality – currently based on number of hits only.
static CDC::ISuperLayer getFirstOccupiedISuperLayer(const std::array< int, CDC::ISuperLayerUtil::c_N > &nHitsBySLayer)
Helper function to extract the first filled entry in the array of super layers ( = the start superlay...