1 #ifndef PhysicsTools_FWLite_EventSelectors_h 2 #define PhysicsTools_FWLite_EventSelectors_h 10 #if !defined(__CINT__) && !defined(__MAKECINT__) 26 EventSelector(TString::Format(
"run%d_lumi%d_%d", run, firstLumi, lastLumi),
27 TString::Format(
"Run %d, Lumi range [%d, %d]", run, firstLumi, lastLumi))
28 {
add(run, firstLumi, lastLumi); }
34 void add(
int run,
int firstLumi=0,
int lastLumi = 9999999) {
36 firstLumis.push_back(firstLumi);
37 lastLumis.push_back(lastLumi);
45 if (
runs.empty())
return true;
46 for (
int i = 0,
n =
runs.size();
i <
n; ++
i) {
48 if ((firstLumis[
i] <= luminosityBlock) && (luminosityBlock <= lastLumis[
i]))
return true;
55 std::vector<int>
runs, firstLumis, lastLumis;
58 template<
typename Collection>
63 label_(label), instance_(instance),
65 scanner(new
helper::ScannerBase(
helper::Parser::elementType(
edm::TypeWithDict(
HandleT::TempWrapT::typeInfo()))))
68 scanner->setIgnoreExceptions(
true);
74 handle.
getByLabel(ev, label_.c_str(), instance_.c_str(), process_.c_str());
76 for (
size_t j = 0,
n = vals.size(); j <
n; ++j) {
77 if (scanner->test(&vals[j])) nfound++;
79 return (nfound >= min_ && (max_ == -1 || nfound <= max_));
81 void setCut(
const char *
cut) { scanner->setCut(cut); }
95 #endif // PhysicsTools_FWLite_EventSelectors_h
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
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 add(std::map< std::string, TH1 * > &h, TH1 *hist)
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)