Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:28:21

0001 #ifndef RecoTracker_MkFitCore_src_MkFitter_h
0002 #define RecoTracker_MkFitCore_src_MkFitter_h
0003 
0004 #include "MkBase.h"
0005 #include "RecoTracker/MkFitCore/interface/Track.h"
0006 #include "RecoTracker/MkFitCore/interface/HitStructures.h"
0007 
0008 namespace mkfit {
0009 
0010   class CandCloner;
0011 
0012   static constexpr int MPlexHitIdxMax = 16;
0013   using MPlexHitIdx = Matriplex::Matriplex<int, MPlexHitIdxMax, 1, NN>;
0014   using MPlexQHoT = Matriplex::Matriplex<HitOnTrack, 1, 1, NN>;
0015 
0016   class MkFitter : public MkBase {
0017   public:
0018     MkFitter() : m_Nhits(0) {}
0019 
0020     // Copy-in timing tests.
0021     MPlexLS& refErr0() { return m_Err[0]; }
0022     MPlexLV& refPar0() { return m_Par[0]; }
0023 
0024     //----------------------------------------------------------------------------
0025 
0026     void checkAlignment();
0027 
0028     void printPt(int idx);
0029 
0030     void setNhits(int newnhits) { m_Nhits = std::min(newnhits, Config::nMaxTrkHits - 1); }
0031 
0032     int countValidHits(int itrack, int end_hit) const;
0033     int countInvalidHits(int itrack, int end_hit) const;
0034     int countValidHits(int itrack) const { return countValidHits(itrack, m_Nhits); }
0035     int countInvalidHits(int itrack) const { return countInvalidHits(itrack, m_Nhits); }
0036 
0037     void inputTracksAndHits(const std::vector<Track>& tracks, const std::vector<HitVec>& layerHits, int beg, int end);
0038     void inputTracksAndHits(const std::vector<Track>& tracks,
0039                             const std::vector<LayerOfHits>& layerHits,
0040                             int beg,
0041                             int end);
0042     void slurpInTracksAndHits(const std::vector<Track>& tracks, const std::vector<HitVec>& layerHits, int beg, int end);
0043     void inputTracksAndHitIdx(const std::vector<Track>& tracks, int beg, int end, bool inputProp);
0044     void inputTracksAndHitIdx(const std::vector<std::vector<Track> >& tracks,
0045                               const std::vector<std::pair<int, int> >& idxs,
0046                               int beg,
0047                               int end,
0048                               bool inputProp);
0049     void inputSeedsTracksAndHits(const std::vector<Track>& seeds,
0050                                  const std::vector<Track>& tracks,
0051                                  const std::vector<HitVec>& layerHits,
0052                                  int beg,
0053                                  int end);
0054 
0055     void inputTracksForFit(const std::vector<Track>& tracks, int beg, int end);
0056     void fitTracksWithInterSlurp(const std::vector<HitVec>& layersohits, const PropagationFlags& pflags, int N_proc);
0057 
0058     void outputTracks(std::vector<Track>& tracks, int beg, int end, int iCP) const;
0059 
0060     void outputFittedTracks(std::vector<Track>& tracks, int beg, int end) const {
0061       return outputTracks(tracks, beg, end, iC);
0062     }
0063 
0064     void outputPropagatedTracks(std::vector<Track>& tracks, int beg, int end) const {
0065       return outputTracks(tracks, beg, end, iP);
0066     }
0067 
0068     void outputFittedTracksAndHitIdx(std::vector<Track>& tracks, int beg, int end, bool outputProp) const;
0069 
0070     //----------------------------------------------------------------------------
0071 
0072   private:
0073     MPlexQF m_Chi2;
0074 
0075     MPlexHS m_msErr[Config::nMaxTrkHits]{0.0f};
0076     MPlexHV m_msPar[Config::nMaxTrkHits]{0.0f};
0077 
0078     MPlexQI m_Label;    //this is the seed index in global seed vector (for MC truth match)
0079     MPlexQI m_SeedIdx;  //this is the seed index in local thread (for bookkeeping at thread level)
0080     MPlexQI m_CandIdx;  //this is the candidate index for the given seed (for bookkeeping of clone engine)
0081 
0082     MPlexQHoT m_HoTArr[Config::nMaxTrkHits];
0083 
0084     // Hold hit indices to explore at current layer.
0085     MPlexQI m_XHitSize;
0086     MPlexHitIdx m_XHitArr;
0087 
0088     int m_Nhits;
0089   };
0090 
0091 }  // end namespace mkfit
0092 
0093 #endif