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 {
10  class EventSetup;
11 }
12 
13 template <typename C, typename T, typename O>
15 public:
19  void newEvent(const edm::Event&, const edm::EventSetup&) const;
20  bool operator()(const T&) const;
21 
22 private:
24  mutable typename C::const_iterator begin_, end_;
26 };
27 
28 template <typename C, typename T, typename O>
30  : srcToken_(iC.consumes<C>(cfg.template getParameter<edm::InputTag>("overlap"))), overlap_(cfg) {}
31 
32 template <typename C, typename T, typename O>
35  evt.getByToken(srcToken_, h);
36  begin_ = h->begin();
37  end_ = h->end();
38 }
39 
40 template <typename C, typename T, typename O>
42  bool noOverlap = true;
43  for (typename C::const_iterator i = begin_; i != end_; ++i) {
44  if (overlap_(*i, t)) {
45  noOverlap = false;
46  break;
47  }
48  }
49  return noOverlap;
50 }
51 
53 
55 
56 #endif
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:526
edm::EDGetTokenT< C > srcToken_
#define EVENTSETUP_STD_INIT_T3(SELECTOR)
void newEvent(const edm::Event &, const edm::EventSetup &) const
def template(fileName, svg, replaceme="REPLACEME")
Definition: svgfig.py:521
bool operator()(const T &) const
HLT enums.
OverlapExclusionSelector(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
long double T