8 #if !defined(__CINT__) && !defined(__MAKECINT__) 24 EventSelector(TString::Format(
"run%d_lumi%d_%d", run, firstLumi, lastLumi),
25 TString::Format(
"Run %d, Lumi range [%d, %d]", run, firstLumi, lastLumi))
26 {
add(run, firstLumi, lastLumi); }
32 void add(
int run,
int firstLumi=0,
int lastLumi = 9999999) {
34 firstLumis.push_back(firstLumi);
35 lastLumis.push_back(lastLumi);
43 if (
runs.empty())
return true;
44 for (
int i = 0,
n =
runs.size();
i <
n; ++
i) {
46 if ((firstLumis[
i] <= luminosityBlock) && (luminosityBlock <= lastLumis[
i]))
return true;
53 std::vector<int>
runs, firstLumis, lastLumis;
56 template<
typename Collection>
61 label_(label), instance_(instance),
63 scanner(new
helper::ScannerBase(
helper::Parser::elementType(
edm::TypeWithDict(
HandleT::TempWrapT::typeInfo()))))
66 scanner->setIgnoreExceptions(
true);
72 handle.
getByLabel(ev, label_.c_str(), instance_.c_str(), process_.c_str());
74 for (
size_t j = 0,
n = vals.size(); j <
n; ++j) {
75 if (scanner->test(&vals[j])) nfound++;
77 return (nfound >= min_ && (max_ == -1 || nfound <= max_));
79 void setCut(
const char *
cut) { scanner->setCut(cut); }
virtual ~RunLumiSelector()
RunLumiSelector(int run, int firstLumi=0, int lastLumi=9999999)
void add(int run, int firstLumi=0, int lastLumi=9999999)
static PFTauRenderPlugin instance
edm::LuminosityBlockNumber_t luminosityBlock() const
void add(const std::vector< const T * > &source, std::vector< const T * > &dest)
helper::ScannerBase * scanner
RunLumiSelector(const char *name="", const char *title="")
void setMax(int maxNumber)
void getByLabel(const P &iP, const char *iModuleLabel, const char *iProductInstanceLabel=0, const char *iProcessLabel=0)
bool accept(int run, int luminosityBlock) const
virtual bool accept(const fwlite::EventBase &ev) const
fwlite::Handle< Collection > HandleT
virtual bool accept(const fwlite::EventBase &ev) const =0
void setIgnoreExceptions(bool ignoreThem=true)
void setMin(int minNumber)
virtual bool accept(const fwlite::EventBase &ev) const
void setCut(const char *cut)
EventSelector(const char *name="", const char *title="")
ObjectCountSelector(const char *label, const char *instance, const char *process, const char *cut, int minNumber=1, int maxNumber=-1)