CMS 3D CMS Logo

Public Member Functions | Static Public Member Functions | Private Attributes

edm::Prescaler Class Reference

Inheritance diagram for edm::Prescaler:
edm::EDFilter edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

void endJob ()
virtual bool filter (Event &e, EventSetup const &c)
 Prescaler (ParameterSet const &)
virtual ~Prescaler ()

Static Public Member Functions

static void fillDescriptions (ConfigurationDescriptions &descriptions)

Private Attributes

int count_
int n_
int offset_

Detailed Description

Definition at line 9 of file Prescaler.cc.


Constructor & Destructor Documentation

edm::Prescaler::Prescaler ( ParameterSet const &  ps) [explicit]

Definition at line 24 of file Prescaler.cc.

                                             :
    count_(),
    n_(ps.getParameter<int>("prescaleFactor")),
    offset_(ps.getParameter<int>("prescaleOffset")) {
  }
edm::Prescaler::~Prescaler ( ) [virtual]

Definition at line 30 of file Prescaler.cc.

                        {
  }

Member Function Documentation

void edm::Prescaler::endJob ( void  ) [virtual]

Reimplemented from edm::EDFilter.

Definition at line 38 of file Prescaler.cc.

                         {
  }
void edm::Prescaler::fillDescriptions ( ConfigurationDescriptions descriptions) [static]

Reimplemented from edm::EDFilter.

Definition at line 42 of file Prescaler.cc.

References edm::ParameterSetDescription::add(), and edm::ConfigurationDescriptions::add().

                                                                     {
    ParameterSetDescription desc;
    desc.add<int>("prescaleFactor")->setComment("Accept one event every N events");
    desc.add<int>("prescaleOffset")->setComment("The first event to accept should be the Mth one. Choose 'prescaleFactor'=1 to accept the first event from the source.");
    descriptions.add("preScaler", desc);
  }
bool edm::Prescaler::filter ( Event e,
EventSetup const &  c 
) [virtual]

Implements edm::EDFilter.

Definition at line 33 of file Prescaler.cc.

References count_, n_, and offset_.

                                                  {
    ++count_;
    return count_ % n_ == offset_ ? true : false;
  }

Member Data Documentation

int edm::Prescaler::count_ [private]

Definition at line 19 of file Prescaler.cc.

Referenced by filter().

int edm::Prescaler::n_ [private]

Definition at line 20 of file Prescaler.cc.

Referenced by filter().

int edm::Prescaler::offset_ [private]

Definition at line 21 of file Prescaler.cc.

Referenced by filter().