CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RunLumiSelector.h
Go to the documentation of this file.
1 #ifndef Analysis_AnalysisFilters_interface_RunLumiSelector_h
2 #define Analysis_AnalysisFilters_interface_RunLumiSelector_h
3 
4 #ifndef __GCCXML__
6 #endif
9 
12 
13 #include <vector>
14 #include <string>
15 
16 // make a selector for this selection
18 public:
20 
21 #ifndef __GCCXML__
23 #endif
24 
26  push_back("RunLumi");
27 
28  if (params.exists("lumisToProcess")) {
29  lumis_ = params.getUntrackedParameter<std::vector<edm::LuminosityBlockRange> >("lumisToProcess");
30  set("RunLumi");
31  } else {
32  lumis_.clear();
33  set("RunLumi", false);
34  }
35 
36  retInternal_ = getBitTemplate();
37  }
38 
39  bool operator()(edm::EventBase const& ev, pat::strbitset& ret) override {
40  if (!ignoreCut("RunLumi")) {
41  bool goodLumi = false;
42  for (std::vector<edm::LuminosityBlockRange>::const_iterator lumisBegin = lumis_.begin(),
43  lumisEnd = lumis_.end(),
44  ilumi = lumisBegin;
45  ilumi != lumisEnd;
46  ++ilumi) {
47  if (ev.id().run() >= ilumi->startRun() && ev.id().run() <= ilumi->endRun() &&
48  ev.id().luminosityBlock() >= ilumi->startLumi() && ev.id().luminosityBlock() <= ilumi->endLumi()) {
49  goodLumi = true;
50  break;
51  }
52  }
53  if (goodLumi)
54  passCut(ret, "RunLumi");
55  } else {
56  passCut(ret, "RunLumi");
57  }
58 
59  setIgnored(ret);
60  return (bool)ret;
61  }
62 
64 
65 private:
66  std::vector<edm::LuminosityBlockRange> lumis_;
67 };
68 
69 #endif
RunNumber_t run() const
Definition: EventID.h:38
T getUntrackedParameter(std::string const &, T const &) const
std::vector< edm::LuminosityBlockRange > lumis_
tuple ret
prodAgent to be discontinued
bool exists(std::string const &parameterName) const
checks if a parameter exists
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:39
RunLumiSelector(edm::ParameterSet const &params, edm::ConsumesCollector &&iC)
RunLumiSelector(edm::ParameterSet const &params)
A selector of events.
Definition: EventSelector.h:16
deadvectors[0] push_back({0.0175431, 0.538005, 6.80997, 13.29})
edm::EventID id() const
Definition: EventBase.h:59
bool operator()(edm::EventBase const &ev, pat::strbitset &ret) override