CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | 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

Public Member Functions

 NMaxPerLumi (const edm::ParameterSet &)
 
 ~NMaxPerLumi ()
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
virtual ~EDFilter ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

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_
 

Additional Inherited Members

- Public Types inherited from edm::EDFilter
typedef EDFilter ModuleType
 
typedef WorkerT< EDFilterWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDFilter
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDFilter
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

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_.

64 {
65  //now do what ever initialization is needed
66 
67  nMaxPerLumi_ = iConfig.getParameter<unsigned int>("nMaxPerLumi");
68 }
T getParameter(std::string const &) const
unsigned int nMaxPerLumi_
Definition: NMaxPerLumi.cc:49
NMaxPerLumi::~NMaxPerLumi ( )

Definition at line 71 of file NMaxPerLumi.cc.

72 {
73 
74  // do anything here that needs to be done at desctruction time
75  // (e.g. close files, deallocate resources etc.)
76 
77 }

Member Function Documentation

void NMaxPerLumi::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDFilter.

Definition at line 101 of file NMaxPerLumi.cc.

102 {
103 }
void NMaxPerLumi::endJob ( void  )
privatevirtual

Reimplemented from edm::EDFilter.

Definition at line 107 of file NMaxPerLumi.cc.

107  {
108 }
bool NMaxPerLumi::filter ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDFilter.

Definition at line 86 of file NMaxPerLumi.cc.

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

Referenced by Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::filter(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::find(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::setDataAccessor(), and Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::switchCenterView().

87 {
88 
89  const edm::EventID & id = iEvent.id();
90 
91  if (counters[id.run()][id.luminosityBlock()]>=nMaxPerLumi_)
92  return false;
93  else{
94  counters[id.run()][id.luminosityBlock()]++;
95  return true;
96  }
97 }
std::map< unsigned int, std::map< unsigned int, unsigned int > > counters
Definition: NMaxPerLumi.cc:48
unsigned int nMaxPerLumi_
Definition: NMaxPerLumi.cc:49
edm::EventID id() const
Definition: EventBase.h:56

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().