CMS 3D CMS Logo

StopAfterNEvents.cc
Go to the documentation of this file.
3 
5 public:
7  ~StopAfterNEvents() override;
8 
9 private:
10  bool filter(edm::Event&, edm::EventSetup const&) override;
11  const int nMax_;
12  int n_;
13  const bool verbose_;
14 };
15 
16 #include <iostream>
17 
18 using namespace std;
19 using namespace edm;
20 
22  : nMax_(pset.getParameter<int>("maxEvents")), n_(0), verbose_(pset.getUntrackedParameter<bool>("verbose", false)) {}
23 
25 
27  if (n_ < 0)
28  return true;
29  n_++;
30  bool ret = n_ <= nMax_;
31  if (verbose_)
32  cout << ">>> filtering event" << n_ << "/" << nMax_ << "(" << (ret ? "true" : "false") << ")" << endl;
33  return ret;
34 }
35 
37 
~StopAfterNEvents() override
StopAfterNEvents(const edm::ParameterSet &)
ret
prodAgent to be discontinued
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
bool filter(edm::Event &, edm::EventSetup const &) override
HLT enums.