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 
runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:373
StopAfterNEvents::StopAfterNEvents
StopAfterNEvents(const edm::ParameterSet &)
Definition: StopAfterNEvents.cc:21
electrons_cff.bool
bool
Definition: electrons_cff.py:393
funct::false
false
Definition: Factorize.h:29
edm
HLT enums.
Definition: AlignableModifier.h:19
gather_cfg.cout
cout
Definition: gather_cfg.py:144
EDFilter.h
StopAfterNEvents::n_
int n_
Definition: StopAfterNEvents.cc:12
StopAfterNEvents::nMax_
const int nMax_
Definition: StopAfterNEvents.cc:11
StopAfterNEvents
Definition: StopAfterNEvents.cc:4
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
StopAfterNEvents::verbose_
const bool verbose_
Definition: StopAfterNEvents.cc:13
edm::ParameterSet
Definition: ParameterSet.h:47
createfilelist.int
int
Definition: createfilelist.py:10
edm::EDFilter
Definition: EDFilter.h:38
edm::EventSetup
Definition: EventSetup.h:57
std
Definition: JetResolutionObject.h:76
StopAfterNEvents::filter
bool filter(edm::Event &, edm::EventSetup const &) override
Definition: StopAfterNEvents.cc:26
ParameterSet.h
edm::Event
Definition: Event.h:73
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
StopAfterNEvents::~StopAfterNEvents
~StopAfterNEvents() override
Definition: StopAfterNEvents.cc:24