CMS 3D CMS Logo

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