CMS 3D CMS Logo

MkStdSeqs.h
Go to the documentation of this file.
1 #ifndef RecoTracker_MkFitCMS_interface_MkStdSeqs_h
2 #define RecoTracker_MkFitCMS_interface_MkStdSeqs_h
3 
8 
9 namespace mkfit {
10 
11  class EventOfHits;
12  class IterationConfig;
13  class TrackerInfo;
14 
15  namespace StdSeq {
16 
17  void loadDeads(EventOfHits &eoh, const std::vector<DeadVec> &deadvectors);
18 
19  void cmssw_LoadHits_Begin(EventOfHits &eoh, const std::vector<const HitVec *> &orig_hitvectors);
21 
22  // Not used anymore. Left here if we want to experiment again with
23  // COPY_SORTED_HITS in class LayerOfHits.
25  void cmssw_ReMap_TrackHitIndices(const EventOfHits &eoh, TrackVec &out_tracks);
26 
27  int clean_cms_seedtracks_iter(TrackVec *seed_ptr, const IterationConfig &itrcfg, const BeamSpot &bspot);
28 
31 
34  const float fraction,
35  const float drth_central,
36  const float drth_obarrel,
37  const float drth_forward);
38 
39  // quality filter for n hits with seed hit "penalty" for strip-based seeds
40  // this implicitly separates triplets and doublet seeds with glued layers
41  template <class TRACK>
42  bool qfilter_n_hits(const TRACK &t, int nMinHits) {
43  int seedHits = t.getNSeedHits();
44  int seedReduction = (seedHits <= 5) ? 2 : 3;
45  return t.nFoundHits() - seedReduction >= nMinHits;
46  }
47 
48  // simple hit-count quality filter; used with pixel-based seeds
49  template <class TRACK>
50  bool qfilter_n_hits_pixseed(const TRACK &t, int nMinHits) {
51  return t.nFoundHits() >= nMinHits;
52  }
53 
54  // layer-dependent quality filter
55  template <class TRACK>
56  bool qfilter_n_layers(const TRACK &t, const BeamSpot &bspot, const TrackerInfo &trk_inf) {
57  int enhits = t.nHitsByTypeEncoded(trk_inf);
58  int npixhits = t.nPixelDecoded(enhits);
59  int enlyrs = t.nLayersByTypeEncoded(trk_inf);
60  int npixlyrs = t.nPixelDecoded(enlyrs);
61  int nmatlyrs = t.nTotMatchDecoded(enlyrs);
62  int llyr = t.getLastFoundHitLyr();
63  int lplyr = t.getLastFoundPixelHitLyr();
64  float invpt = t.invpT();
65  float invptmin = 1.43; // min 1/pT (=1/0.7) for full filter on (npixhits<=3 .or. npixlyrs<=3)
66  float d0BS = t.d0BeamSpot(bspot.x, bspot.y);
67  float d0_max = 0.1; // 1 mm
68 
69  bool endsInsidePix = (llyr == 2 || llyr == 18 || llyr == 45);
70  bool lastInsidePix = ((0 <= lplyr && lplyr < 3) || (18 <= lplyr && lplyr < 20) || (45 <= lplyr && lplyr < 47));
71  return !(((npixhits <= 3 || npixlyrs <= 3) && endsInsidePix &&
72  (invpt < invptmin || (invpt >= invptmin && std::abs(d0BS) > d0_max))) ||
73  ((npixlyrs <= 3 && nmatlyrs <= 6) && lastInsidePix && llyr != lplyr && std::abs(d0BS) > d0_max));
74  }
75 
77  template <class TRACK>
78  bool qfilter_pixelLessFwd(const TRACK &t, const BeamSpot &bspot, const TrackerInfo &tk_info) {
79  float d0BS = t.d0BeamSpot(bspot.x, bspot.y);
80  float d0_max = 0.05; // 0.5 mm
81 
82  int encoded;
83  encoded = t.nLayersByTypeEncoded(tk_info);
84  int nLyrs = t.nTotMatchDecoded(encoded);
85  encoded = t.nHitsByTypeEncoded(tk_info);
86  int nHits = t.nTotMatchDecoded(encoded);
87 
88  int seedReduction = (t.getNSeedHits() <= 5) ? 2 : 3;
89 
90  float invpt = t.invpT();
91  float invptmin = 1.11; // =1/0.9
92 
93  float thetasym = std::abs(t.theta() - Const::PIOver2);
94  float thetasymmin = 1.11; // -> |eta|=1.45
95 
96  return (((t.nFoundHits() - seedReduction >= 4 && invpt < invptmin) ||
97  (t.nFoundHits() - seedReduction >= 3 && invpt > invptmin && thetasym <= thetasymmin) ||
98  (t.nFoundHits() - seedReduction >= 4 && invpt > invptmin && thetasym > thetasymmin)) &&
99  !((nLyrs <= 4 || nHits <= 4) && std::abs(d0BS) > d0_max && invpt < invptmin));
100  }
101 
103  template <class TRACK>
104  bool qfilter_pixelLessBkwd(const TRACK &t, const BeamSpot &bspot, const TrackerInfo &tk_info) {
105  float d0BS = t.d0BeamSpot(bspot.x, bspot.y);
106  float d0_max = 0.1; // 1 mm
107 
108  int encoded;
109  encoded = t.nLayersByTypeEncoded(tk_info);
110  int nLyrs = t.nTotMatchDecoded(encoded);
111  encoded = t.nHitsByTypeEncoded(tk_info);
112  int nHits = t.nTotMatchDecoded(encoded);
113 
114  float invpt = t.invpT();
115  float invptmin = 1.11; // =1/0.9
116 
117  float thetasym = std::abs(t.theta() - Const::PIOver2);
118  float thetasymmin_l = 0.80; // -> |eta|=0.9
119  float thetasymmin_h = 1.11; // -> |eta|=1.45
120 
121  return !(
122  ((nLyrs <= 3 || nHits <= 3)) ||
123  ((nLyrs <= 4 || nHits <= 4) && (invpt < invptmin || (thetasym > thetasymmin_l && std::abs(d0BS) > d0_max))) ||
124  ((nLyrs <= 5 || nHits <= 5) && (invpt > invptmin && thetasym > thetasymmin_h && std::abs(d0BS) > d0_max)));
125  }
126 
127  template <class TRACK>
128  bool qfilter_nan_n_silly(const TRACK &t) {
129  return !(t.hasNanNSillyValues());
130  }
131 
133 
134  } // namespace StdSeq
135 
136 } // namespace mkfit
137 
138 #endif
void find_and_remove_duplicates(TrackVec &tracks, const IterationConfig &itconf)
Definition: MkStdSeqs.cc:598
bool qfilter_n_hits_pixseed(const TRACK &t, int nMinHits)
Definition: MkStdSeqs.h:50
bool qfilter_pixelLessFwd(const TRACK &t, const BeamSpot &bspot, const TrackerInfo &tk_info)
quality filter tuned for pixelLess iteration during forward search
Definition: MkStdSeqs.h:78
void cmssw_Map_TrackHitIndices(const EventOfHits &eoh, TrackVec &seeds)
Definition: MkStdSeqs.cc:55
void find_duplicates(TrackVec &tracks)
Definition: MkStdSeqs.cc:342
bool qfilter_n_hits(const TRACK &t, int nMinHits)
Definition: MkStdSeqs.h:42
bool qfilter_n_layers(const TRACK &t, const BeamSpot &bspot, const TrackerInfo &trk_inf)
Definition: MkStdSeqs.h:56
void cmssw_LoadHits_End(EventOfHits &eoh)
Definition: MkStdSeqs.cc:44
void find_duplicates_sharedhits_pixelseed(TrackVec &tracks, const float fraction, const float drth_central, const float drth_obarrel, const float drth_forward)
Definition: MkStdSeqs.cc:499
constexpr float PIOver2
Definition: Config.h:44
void cmssw_LoadHits_Begin(EventOfHits &eoh, const std::vector< const HitVec *> &orig_hitvectors)
Definition: MkStdSeqs.cc:28
void find_duplicates_sharedhits(TrackVec &tracks, const float fraction)
Definition: MkStdSeqs.cc:435
void remove_duplicates(TrackVec &tracks)
Definition: MkStdSeqs.cc:426
float x
Definition: Hit.h:283
void cmssw_ReMap_TrackHitIndices(const EventOfHits &eoh, TrackVec &out_tracks)
Definition: MkStdSeqs.cc:68
float y
Definition: Hit.h:283
bool qfilter_pixelLessBkwd(const TRACK &t, const BeamSpot &bspot, const TrackerInfo &tk_info)
quality filter tuned for pixelLess iteration during backward search
Definition: MkStdSeqs.h:104
void loadDeads(EventOfHits &eoh, const std::vector< DeadVec > &deadvectors)
Definition: MkStdSeqs.cc:18
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::vector< Track > TrackVec
auto const & tracks
cannot be loose
caConstants::TupleMultiplicity const CAHitNtupletGeneratorKernelsGPU::HitToTuple const cms::cuda::AtomicPairCounter GPUCACell const *__restrict__ uint32_t const *__restrict__ gpuPixelDoublets::CellNeighborsVector const gpuPixelDoublets::CellTracksVector const GPUCACell::OuterHitOfCell const int32_t nHits
bool qfilter_nan_n_silly(const TRACK &t)
Definition: MkStdSeqs.h:128
int clean_cms_seedtracks_iter(TrackVec *seed_ptr, const IterationConfig &itrcfg, const BeamSpot &bspot)
Definition: MkStdSeqs.cc:84