CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
StopAfterNEvents.cc
Go to the documentation of this file.
3 
5 public:
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(const edm::ParameterSet &)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
bool filter(edm::Event &, edm::EventSetup const &) override
tuple cout
Definition: gather_cfg.py:121
volatile std::atomic< bool > shutdown_flag false