CMS 3D CMS Logo

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
runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:543
Handle.h
RunLumiSelector::RunLumiSelector
RunLumiSelector()
Definition: RunLumiSelector.h:19
CalibrationSummaryClient_cfi.params
params
Definition: CalibrationSummaryClient_cfi.py:14
RunLumiSelector::RunLumiSelector
RunLumiSelector(edm::ParameterSet const &params)
Definition: RunLumiSelector.h:25
RunLumiSelector::operator()
bool operator()(edm::EventBase const &ev, pat::strbitset &ret) override
Definition: RunLumiSelector.h:39
EventBase.h
Utilities.operator
operator
Definition: Utilities.py:24
RunLumiSelector::RunLumiSelector
RunLumiSelector(edm::ParameterSet const &params, edm::ConsumesCollector &&iC)
Definition: RunLumiSelector.h:22
EventSelector.h
edm::ParameterSet
Definition: ParameterSet.h:47
pat::strbitset
Definition: strbitset.h:23
RunLumiSelector
Definition: RunLumiSelector.h:17
RunLumiSelector::lumis_
std::vector< edm::LuminosityBlockRange > lumis_
Definition: RunLumiSelector.h:66
Vertex.h
ev
bool ev
Definition: Hydjet2Hadronizer.cc:97
edm::EventBase
Definition: EventBase.h:46
EventSelector
A selector of events.
Definition: EventSelector.h:16
ConsumesCollector.h
edm::ConsumesCollector
Definition: ConsumesCollector.h:45