CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 namespace ctfseeding { class SeedingLayer; }
17 
18 namespace ctfseeding {
19 
20  class HitExtractor {
21  public:
23  using TkHitRef = BaseTrackerRecHit const &;
25  using Hits=std::vector<HitPointer>;
26 
27  virtual ~HitExtractor(){}
29 
30  virtual Hits hits(const TkTransientTrackingRecHitBuilder& ttrhBuilder, const edm::Event& , const edm::EventSetup& ) const =0;
31  virtual HitExtractor * clone() const = 0;
32 
33  //skip clusters
35  skipClusters=true; maskCluster=true;
36  useSkipClusters_(m, iC);
37  }
38  bool skipClusters=false;
39  bool filterCluster=false;
40  bool maskCluster=false;
41  float minGoodCharge=0;
42 
43  protected:
44  virtual void useSkipClusters_(const edm::InputTag & m, edm::ConsumesCollector& iC) = 0;
45  };
46 
47 
48  template <typename DSTV, typename A, typename B>
49  inline void range2SeedingHits(DSTV const & dstv,
51  std::pair<A,B> const & sel) {
52  typename DSTV::Range range = dstv.equal_range(sel.first,sel.second);
53  size_t ts = v.size();
54  for(typename DSTV::const_iterator id=range.first; id!=range.second; id++)
55  ts += std::distance((*id).begin(), (*id).end());
56  v.reserve(ts);
57  for(typename DSTV::const_iterator id=range.first; id!=range.second; id++){
58  for ( auto const & h : (*id) ) v.emplace_back(h);
59  }
60 
61  }
62 }
63 #endif
void range2SeedingHits(DSTV const &dstv, HitExtractor::Hits &v, std::pair< A, B > const &sel)
Definition: HitExtractor.h:49
std::vector< HitPointer > Hits
Definition: HitExtractor.h:25
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
BaseTrackerRecHit const & TkHitRef
Definition: HitExtractor.h:23
virtual HitExtractor * clone() const =0
Definition: Event.h:16
PixelRecoRange< float > Range
virtual Hits hits(const TkTransientTrackingRecHitBuilder &ttrhBuilder, const edm::Event &, const edm::EventSetup &) const =0
void useSkipClusters(const edm::InputTag &m, edm::ConsumesCollector &iC)
Definition: HitExtractor.h:34
virtual void useSkipClusters_(const edm::InputTag &m, edm::ConsumesCollector &iC)=0