CMS 3D CMS Logo

OverlapExclusionSelector.h
Go to the documentation of this file.
1 #ifndef CommonTools_UtilAlgos_OverlapExclusionSelector_h
2 #define CommonTools_UtilAlgos_OverlapExclusionSelector_h
8 
9 namespace edm { class EventSetup; }
10 
11 template<typename C, typename T, typename O>
13 public:
15  OverlapExclusionSelector(cfg, iC) {};
17  void newEvent(const edm::Event&, const edm::EventSetup&) const;
18  bool operator()(const T&) const;
19 private:
21  mutable typename C::const_iterator begin_, end_;
23 };
24 
25 template<typename C, typename T, typename O>
27  srcToken_(iC.consumes<C>(cfg.template getParameter<edm::InputTag>("overlap"))),
28  overlap_(cfg) {
29 }
30 
31 template<typename C, typename T, typename O>
34  evt.getByToken(srcToken_, h);
35  begin_ = h->begin();
36  end_ = h->end();
37 }
38 
39 template<typename C, typename T, typename O>
41  bool noOverlap = true;
42  for(typename C::const_iterator i = begin_; i != end_; ++i) {
43  if(overlap_(*i, t)) {
44  noOverlap = false;
45  break;
46  }
47  }
48  return noOverlap;
49 }
50 
52 
54 
55 #endif
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
bool operator()(const T &) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
edm::EDGetTokenT< C > srcToken_
void newEvent(const edm::Event &, const edm::EventSetup &) const
#define EVENTSETUP_STD_INIT_T3(SELECTOR)
def template(fileName, svg, replaceme="REPLACEME")
Definition: svgfig.py:521
HLT enums.
OverlapExclusionSelector(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
long double T