test
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 
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;
36  useSkipClusters_(m, iC);
37  }
39  protected:
40  virtual void useSkipClusters_(const edm::InputTag & m, edm::ConsumesCollector& iC) = 0;
41  };
42 
43 
44  template <typename DSTV, typename A, typename B>
45  inline void range2SeedingHits(DSTV const & dstv,
47  std::pair<A,B> const & sel) {
48  typename DSTV::Range range = dstv.equal_range(sel.first,sel.second);
49  size_t ts = v.size();
50  for(typename DSTV::const_iterator id=range.first; id!=range.second; id++)
51  ts += std::distance((*id).begin(), (*id).end());
52  v.reserve(ts);
53  for(typename DSTV::const_iterator id=range.first; id!=range.second; id++){
54  for ( auto const & h : (*id) ) v.emplace_back(h);
55  }
56 
57  }
58 }
59 #endif
void range2SeedingHits(DSTV const &dstv, HitExtractor::Hits &v, std::pair< A, B > const &sel)
Definition: HitExtractor.h:45
std::vector< HitPointer > Hits
Definition: HitExtractor.h:25
BaseTrackerRecHit const & TkHitRef
Definition: HitExtractor.h:23
virtual HitExtractor * clone() const =0
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
PixelRecoRange< float > Range
virtual Hits hits(const TkTransientTrackingRecHitBuilder &ttrhBuilder, const edm::Event &, const edm::EventSetup &) const =0
volatile std::atomic< bool > shutdown_flag false
void useSkipClusters(const edm::InputTag &m, edm::ConsumesCollector &iC)
Definition: HitExtractor.h:34
virtual void useSkipClusters_(const edm::InputTag &m, edm::ConsumesCollector &iC)=0