CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

StopAfterNEvents Class Reference

Inheritance diagram for StopAfterNEvents:
edm::EDFilter edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

 StopAfterNEvents (const edm::ParameterSet &)
 ~StopAfterNEvents ()

Private Member Functions

bool filter (edm::Event &, edm::EventSetup const &)

Private Attributes

int n_
const int nMax_
const bool verbose_

Detailed Description

Definition at line 4 of file StopAfterNEvents.cc.


Constructor & Destructor Documentation

StopAfterNEvents::StopAfterNEvents ( const edm::ParameterSet pset)

Definition at line 20 of file StopAfterNEvents.cc.

                                                              :
  nMax_( pset.getParameter<int>( "maxEvents" ) ), n_( 0 ),
  verbose_( pset.getUntrackedParameter<bool>( "verbose", false ) ) {
}
StopAfterNEvents::~StopAfterNEvents ( )

Definition at line 25 of file StopAfterNEvents.cc.

                                    {
}

Member Function Documentation

bool StopAfterNEvents::filter ( edm::Event ,
edm::EventSetup const &   
) [private, virtual]

Implements edm::EDFilter.

Definition at line 28 of file StopAfterNEvents.cc.

References gather_cfg::cout, n_, nMax_, runTheMatrix::ret, and verbose_.

                                                          {
  if ( n_ < 0 ) return true;
  n_ ++ ;
  bool ret = n_ <= nMax_;
  if ( verbose_ )
    cout << ">>> filtering event" << n_ << "/" << nMax_ 
              << "(" <<  ( ret ? "true" : "false" ) << ")" << endl;
  return ret;
}

Member Data Documentation

int StopAfterNEvents::n_ [private]

Definition at line 11 of file StopAfterNEvents.cc.

Referenced by filter().

const int StopAfterNEvents::nMax_ [private]

Definition at line 10 of file StopAfterNEvents.cc.

Referenced by filter().

const bool StopAfterNEvents::verbose_ [private]

Definition at line 12 of file StopAfterNEvents.cc.

Referenced by filter().