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 {
16  class Event;
17  class EventSetup;
18  class ConsumesCollector;
19 } // namespace edm
20 
21 namespace ctfseeding {
22 
23  class HitExtractor {
24  public:
26  using TkHitRef = BaseTrackerRecHit const&;
28  using Hits = std::vector<HitPointer>;
29 
30  virtual ~HitExtractor() {}
32 
33  virtual Hits hits(const TkTransientTrackingRecHitBuilder& ttrhBuilder,
34  const edm::Event&,
35  const edm::EventSetup&) const = 0;
36  virtual HitExtractor* clone() const = 0;
37 
38  //skip clusters
40  skipClusters = true;
41  maskCluster = true;
42  useSkipClusters_(m, iC);
43  }
44  bool skipClusters = false;
45  bool filterCluster = false;
46  bool maskCluster = false;
47  float minGoodCharge = 0;
48 
49  protected:
50  virtual void useSkipClusters_(const edm::InputTag& m, edm::ConsumesCollector& iC) = 0;
51  };
52 
53  template <typename DSTV, typename A, typename B>
54  inline void range2SeedingHits(DSTV const& dstv, HitExtractor::Hits& v, std::pair<A, B> const& sel) {
55  typename DSTV::Range range = dstv.equal_range(sel.first, sel.second);
56  size_t ts = v.size();
57  for (typename DSTV::const_iterator id = range.first; id != range.second; id++)
58  ts += std::distance((*id).begin(), (*id).end());
59  v.reserve(ts);
60  for (typename DSTV::const_iterator id = range.first; id != range.second; id++) {
61  for (auto const& h : (*id))
62  v.emplace_back(h);
63  }
64  }
65 } // namespace ctfseeding
66 #endif
ctfseeding::HitExtractor::useSkipClusters_
virtual void useSkipClusters_(const edm::InputTag &m, edm::ConsumesCollector &iC)=0
FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
ctfseeding::HitExtractor::TkHitRef
BaseTrackerRecHit const & TkHitRef
Definition: HitExtractor.h:26
ContainerMask.h
ctfseeding::HitExtractor::maskCluster
bool maskCluster
Definition: HitExtractor.h:46
Range
PixelRecoRange< float > Range
Definition: PixelTripletHLTGenerator.cc:31
ctfseeding::HitExtractor::skipClusters
bool skipClusters
Definition: HitExtractor.h:44
edm
HLT enums.
Definition: AlignableModifier.h:19
mayown_ptr
Definition: mayown_ptr.h:13
findQualityFiles.v
v
Definition: findQualityFiles.py:179
ctfseeding::HitExtractor
Definition: HitExtractor.h:23
TkTransientTrackingRecHitBuilder.h
TkTransientTrackingRecHitBuilder
Definition: TkTransientTrackingRecHitBuilder.h:15
ctfseeding::HitExtractor::filterCluster
bool filterCluster
Definition: HitExtractor.h:45
ctfseeding::HitExtractor::clone
virtual HitExtractor * clone() const =0
BaseTrackerRecHit
Definition: BaseTrackerRecHit.h:15
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
Event
h
EDGetToken.h
ctfseeding::HitExtractor::hits
virtual Hits hits(const TkTransientTrackingRecHitBuilder &ttrhBuilder, const edm::Event &, const edm::EventSetup &) const =0
ctfseeding::range2SeedingHits
void range2SeedingHits(DSTV const &dstv, HitExtractor::Hits &v, std::pair< A, B > const &sel)
Definition: HitExtractor.h:54
ctfseeding::HitExtractor::HitExtractor
HitExtractor()
Definition: HitExtractor.h:31
ctfseeding::HitExtractor::~HitExtractor
virtual ~HitExtractor()
Definition: HitExtractor.h:30
edm::EventSetup
Definition: EventSetup.h:57
ctfseeding
Definition: SeedingLayerSetsBuilder.h:23
ctfseeding::HitExtractor::Hits
std::vector< HitPointer > Hits
Definition: HitExtractor.h:28
BaseTrackerRecHit.h
ctfseeding::HitExtractor::useSkipClusters
void useSkipClusters(const edm::InputTag &m, edm::ConsumesCollector &iC)
Definition: HitExtractor.h:39
mayown_ptr.h
ctfseeding::HitExtractor::minGoodCharge
float minGoodCharge
Definition: HitExtractor.h:47
ConsumesCollector.h
EventSetup
EgammaValidation_Wenu_cff.sel
sel
Definition: EgammaValidation_Wenu_cff.py:33
edm::Event
Definition: Event.h:73
HLT_FULL_cff.distance
distance
Definition: HLT_FULL_cff.py:7796
edm::InputTag
Definition: InputTag.h:15
edm::ConsumesCollector
Definition: ConsumesCollector.h:45