CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
int i
Definition: DBlmapReader.cc:9
tuple cfg
Definition: looper.py:237
bool operator()(const T &) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:446
edm::EDGetTokenT< C > srcToken_
void newEvent(const edm::Event &, const edm::EventSetup &) const
#define EVENTSETUP_STD_INIT_T3(SELECTOR)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
OverlapExclusionSelector(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
long double T
def template
Definition: svgfig.py:520