CMS 3D CMS Logo

MkFitter.h
Go to the documentation of this file.
1 #ifndef RecoTracker_MkFitCore_src_MkFitter_h
2 #define RecoTracker_MkFitCore_src_MkFitter_h
3 
4 #include "MkBase.h"
7 
8 namespace mkfit {
9 
10  class CandCloner;
11 
12  static constexpr int MPlexHitIdxMax = 16;
13  using MPlexHitIdx = Matriplex::Matriplex<int, MPlexHitIdxMax, 1, NN>;
14  using MPlexQHoT = Matriplex::Matriplex<HitOnTrack, 1, 1, NN>;
15 
16  class MkFitter : public MkBase {
17  public:
18  MkFitter() : m_Nhits(0) {}
19 
20  // Copy-in timing tests.
21  MPlexLS& refErr0() { return m_Err[0]; }
22  MPlexLV& refPar0() { return m_Par[0]; }
23 
24  //----------------------------------------------------------------------------
25 
26  void checkAlignment();
27 
28  void printPt(int idx);
29 
30  void setNhits(int newnhits) { m_Nhits = std::min(newnhits, Config::nMaxTrkHits - 1); }
31 
32  int countValidHits(int itrack, int end_hit) const;
33  int countInvalidHits(int itrack, int end_hit) const;
34  int countValidHits(int itrack) const { return countValidHits(itrack, m_Nhits); }
35  int countInvalidHits(int itrack) const { return countInvalidHits(itrack, m_Nhits); }
36 
37  void inputTracksAndHits(const std::vector<Track>& tracks, const std::vector<HitVec>& layerHits, int beg, int end);
38  void inputTracksAndHits(const std::vector<Track>& tracks,
39  const std::vector<LayerOfHits>& layerHits,
40  int beg,
41  int end);
42  void slurpInTracksAndHits(const std::vector<Track>& tracks, const std::vector<HitVec>& layerHits, int beg, int end);
43  void inputTracksAndHitIdx(const std::vector<Track>& tracks, int beg, int end, bool inputProp);
44  void inputTracksAndHitIdx(const std::vector<std::vector<Track> >& tracks,
45  const std::vector<std::pair<int, int> >& idxs,
46  int beg,
47  int end,
48  bool inputProp);
49  void inputSeedsTracksAndHits(const std::vector<Track>& seeds,
50  const std::vector<Track>& tracks,
51  const std::vector<HitVec>& layerHits,
52  int beg,
53  int end);
54 
55  void inputTracksForFit(const std::vector<Track>& tracks, int beg, int end);
56  void fitTracksWithInterSlurp(const std::vector<HitVec>& layersohits, const PropagationFlags& pflags, int N_proc);
57 
58  void outputTracks(std::vector<Track>& tracks, int beg, int end, int iCP) const;
59 
60  void outputFittedTracks(std::vector<Track>& tracks, int beg, int end) const {
61  return outputTracks(tracks, beg, end, iC);
62  }
63 
64  void outputPropagatedTracks(std::vector<Track>& tracks, int beg, int end) const {
65  return outputTracks(tracks, beg, end, iP);
66  }
67 
68  void outputFittedTracksAndHitIdx(std::vector<Track>& tracks, int beg, int end, bool outputProp) const;
69 
70  //----------------------------------------------------------------------------
71 
72  private:
74 
77 
78  MPlexQI m_Label; //this is the seed index in global seed vector (for MC truth match)
79  MPlexQI m_SeedIdx; //this is the seed index in local thread (for bookkeeping at thread level)
80  MPlexQI m_CandIdx; //this is the candidate index for the given seed (for bookkeeping of clone engine)
81 
83 
84  // Hold hit indices to explore at current layer.
87 
88  int m_Nhits;
89  };
90 
91 } // end namespace mkfit
92 
93 #endif
static constexpr int MPlexHitIdxMax
Definition: MkFitter.h:12
Matriplex::Matriplex< HitOnTrack, 1, 1, NN > MPlexQHoT
Definition: MkFitter.h:14
static constexpr int iC
Definition: MkBase.h:18
void checkAlignment()
Definition: MkFitter.cc:13
MPlexHitIdx m_XHitArr
Definition: MkFitter.h:86
static constexpr int iP
Definition: MkBase.h:19
void outputTracks(std::vector< Track > &tracks, int beg, int end, int iCP) const
Definition: MkFitter.cc:345
MPlexHV m_msPar[Config::nMaxTrkHits]
Definition: MkFitter.h:76
Matriplex::Matriplex< float, HH, 1, NN > MPlexHV
Definition: Matrix.h:53
Matriplex::Matriplex< int, MPlexHitIdxMax, 1, NN > MPlexHitIdx
Definition: MkFitter.h:13
MPlexLV m_Par[2]
Definition: MkBase.h:102
int countInvalidHits(int itrack, int end_hit) const
Definition: MkFitter.cc:38
void inputSeedsTracksAndHits(const std::vector< Track > &seeds, const std::vector< Track > &tracks, const std::vector< HitVec > &layerHits, int beg, int end)
Definition: MkFitter.cc:222
void fitTracksWithInterSlurp(const std::vector< HitVec > &layersohits, const PropagationFlags &pflags, int N_proc)
Definition: MkFitter.cc:302
void inputTracksAndHitIdx(const std::vector< Track > &tracks, int beg, int end, bool inputProp)
Definition: MkFitter.cc:165
Matriplex::Matriplex< float, LL, 1, NN > MPlexLV
Definition: Matrix.h:49
MPlexLS & refErr0()
Definition: MkFitter.h:21
void inputTracksForFit(const std::vector< Track > &tracks, int beg, int end)
Definition: MkFitter.cc:269
MPlexLS m_Err[2]
Definition: MkBase.h:101
int countValidHits(int itrack) const
Definition: MkFitter.h:34
void slurpInTracksAndHits(const std::vector< Track > &tracks, const std::vector< HitVec > &layerHits, int beg, int end)
Definition: MkFitter.cc:123
int countInvalidHits(int itrack) const
Definition: MkFitter.h:35
void outputFittedTracksAndHitIdx(std::vector< Track > &tracks, int beg, int end, bool outputProp) const
Definition: MkFitter.cc:362
MPlexQI m_SeedIdx
Definition: MkFitter.h:79
MPlexLV & refPar0()
Definition: MkFitter.h:22
void outputFittedTracks(std::vector< Track > &tracks, int beg, int end) const
Definition: MkFitter.h:60
void outputPropagatedTracks(std::vector< Track > &tracks, int beg, int end) const
Definition: MkFitter.h:64
Matriplex::Matriplex< int, 1, 1, NN > MPlexQI
Definition: Matrix.h:66
int countValidHits(int itrack, int end_hit) const
Definition: MkFitter.cc:29
MPlexQI m_XHitSize
Definition: MkFitter.h:85
MPlexQI m_Label
Definition: MkFitter.h:78
Matriplex::Matriplex< float, 1, 1, NN > MPlexQF
Definition: Matrix.h:65
void setNhits(int newnhits)
Definition: MkFitter.h:30
Matriplex::MatriplexSym< float, HH, NN > MPlexHS
Definition: Matrix.h:54
MPlexQHoT m_HoTArr[Config::nMaxTrkHits]
Definition: MkFitter.h:82
Matriplex::MatriplexSym< float, LL, NN > MPlexLS
Definition: Matrix.h:50
MPlexQF m_Chi2
Definition: MkFitter.h:73
MPlexQI m_CandIdx
Definition: MkFitter.h:80
void printPt(int idx)
Definition: MkFitter.cc:23
MPlexHS m_msErr[Config::nMaxTrkHits]
Definition: MkFitter.h:75
constexpr int nMaxTrkHits
Definition: Config.h:42
void inputTracksAndHits(const std::vector< Track > &tracks, const std::vector< HitVec > &layerHits, int beg, int end)
Definition: MkFitter.cc:50