CMS 3D CMS Logo

HitExtractor.h
Go to the documentation of this file.
1 #ifndef RecoTracker_TkSeedingLayers_HitExtractor_H
2 #define RecoTracker_TkSeedingLayers_HitExtractor_H
3 
4 #include <vector>
5 #include <iterator>
10 
13 #include <limits>
14 
15 namespace edm { class Event; class EventSetup; class ConsumesCollector;}
16 
17 namespace ctfseeding {
18 
19  class HitExtractor {
20  public:
22  using TkHitRef = BaseTrackerRecHit const &;
24  using Hits=std::vector<HitPointer>;
25 
26  virtual ~HitExtractor(){}
28 
29  virtual Hits hits(const TkTransientTrackingRecHitBuilder& ttrhBuilder, const edm::Event& , const edm::EventSetup& ) const =0;
30  virtual HitExtractor * clone() const = 0;
31 
32  //skip clusters
34  skipClusters=true; maskCluster=true;
35  useSkipClusters_(m, iC);
36  }
37  bool skipClusters=false;
38  bool filterCluster=false;
39  bool maskCluster=false;
40  float minGoodCharge=0;
41 
42  protected:
43  virtual void useSkipClusters_(const edm::InputTag & m, edm::ConsumesCollector& iC) = 0;
44  };
45 
46 
47  template <typename DSTV, typename A, typename B>
48  inline void range2SeedingHits(DSTV const & dstv,
50  std::pair<A,B> const & sel) {
51  typename DSTV::Range range = dstv.equal_range(sel.first,sel.second);
52  size_t ts = v.size();
53  for(typename DSTV::const_iterator id=range.first; id!=range.second; id++)
54  ts += std::distance((*id).begin(), (*id).end());
55  v.reserve(ts);
56  for(typename DSTV::const_iterator id=range.first; id!=range.second; id++){
57  for ( auto const & h : (*id) ) v.emplace_back(h);
58  }
59 
60  }
61 }
62 #endif
void range2SeedingHits(DSTV const &dstv, HitExtractor::Hits &v, std::pair< A, B > const &sel)
Definition: HitExtractor.h:48
std::vector< HitPointer > Hits
Definition: HitExtractor.h:24
BaseTrackerRecHit const & TkHitRef
Definition: HitExtractor.h:22
PixelRecoRange< float > Range
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
HLT enums.
void useSkipClusters(const edm::InputTag &m, edm::ConsumesCollector &iC)
Definition: HitExtractor.h:33