Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:27:58

0001 #ifndef CachingSeedCleanerBySharedInput_H
0002 #define CachingSeedCleanerBySharedInput_H
0003 #include "RecoTracker/CkfPattern/interface/RedundantSeedCleaner.h"
0004 #include <map>
0005 #include <unordered_map>
0006 
0007 /** Merge of SeedCleanerBySharedInput and CachingSeedCleanerByHitPosition */
0008 class CachingSeedCleanerBySharedInput final : public RedundantSeedCleaner {
0009 public:
0010   // in this implementation it populate the cache
0011   void add(const Trajectory *traj) override;
0012 
0013   /** \brief Provides the cleaner a pointer to the vector where trajectories are stored, in case it does not want to keep a local collection of trajectories */
0014   void init(const std::vector<Trajectory> *vect) override;
0015 
0016   void done() override;
0017 
0018   /** \brief Returns true if the seed is not overlapping with another trajectory */
0019   bool good(const TrajectorySeed *seed) override;
0020 
0021   CachingSeedCleanerBySharedInput(unsigned int numHitsForSeedCleaner = 4, bool onlyPixelHits = false)
0022       : theNumHitsForSeedCleaner(numHitsForSeedCleaner), theOnlyPixelHits(onlyPixelHits) {}
0023 
0024 private:
0025   std::vector<Trajectory::RecHitContainer> theVault;
0026   std::unordered_multimap<unsigned int, unsigned int> theCache;
0027 
0028   int theNumHitsForSeedCleaner;
0029   bool theOnlyPixelHits;
0030 
0031   //uint64_t comps_, tracks_, calls_;
0032 };
0033 
0034 #endif