CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

NMaxPerLumi Class Reference

#include <WorkSpace/NMaxPerLumi/src/NMaxPerLumi.cc>

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

List of all members.

Public Member Functions

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

Private Member Functions

virtual void beginJob ()
virtual void endJob ()
virtual bool filter (edm::Event &, const edm::EventSetup &)

Private Attributes

std::map< unsigned int,
std::map< unsigned int,
unsigned int > > 
counters
unsigned int nMaxPerLumi_

Detailed Description

Description: [one line class summary]

Implementation: [Notes on implementation]

Definition at line 37 of file NMaxPerLumi.cc.


Constructor & Destructor Documentation

NMaxPerLumi::NMaxPerLumi ( const edm::ParameterSet iConfig) [explicit]

Definition at line 63 of file NMaxPerLumi.cc.

References edm::ParameterSet::getParameter(), and nMaxPerLumi_.

{
   //now do what ever initialization is needed

  nMaxPerLumi_ = iConfig.getParameter<unsigned int>("nMaxPerLumi");
}
NMaxPerLumi::~NMaxPerLumi ( )

Definition at line 71 of file NMaxPerLumi.cc.

{
 
   // do anything here that needs to be done at desctruction time
   // (e.g. close files, deallocate resources etc.)

}

Member Function Documentation

void NMaxPerLumi::beginJob ( void  ) [private, virtual]

Reimplemented from edm::EDFilter.

Definition at line 101 of file NMaxPerLumi.cc.

{
}
void NMaxPerLumi::endJob ( void  ) [private, virtual]

Reimplemented from edm::EDFilter.

Definition at line 107 of file NMaxPerLumi.cc.

                    {
}
bool NMaxPerLumi::filter ( edm::Event iEvent,
const edm::EventSetup iSetup 
) [private, virtual]

Implements edm::EDFilter.

Definition at line 86 of file NMaxPerLumi.cc.

References counters, edm::EventBase::id(), nMaxPerLumi_, and DTTTrigCorrFirst::run.

{

  const edm::EventID & id = iEvent.id();

  if (counters[id.run()][id.luminosityBlock()]>=nMaxPerLumi_)
    return false;
  else{
    counters[id.run()][id.luminosityBlock()]++;
    return true;
  }
}

Member Data Documentation

std::map< unsigned int , std::map < unsigned int, unsigned int > > NMaxPerLumi::counters [private]

Definition at line 48 of file NMaxPerLumi.cc.

Referenced by filter().

unsigned int NMaxPerLumi::nMaxPerLumi_ [private]

Definition at line 49 of file NMaxPerLumi.cc.

Referenced by filter(), and NMaxPerLumi().