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 Attributes
RunLumiSelector Class Reference

#include <RunLumiSelector.h>

Inheritance diagram for RunLumiSelector:
EventSelector

Public Member Functions

bool operator() (edm::EventBase const &ev, pat::strbitset &ret)
 
 RunLumiSelector ()
 
 RunLumiSelector (edm::ParameterSet const &params)
 
- Public Member Functions inherited from EventSelector
const std::vector< std::string > & description ()
 
const std::vector< std::string > & description ()
 
 EventSelector ()
 
 EventSelector ()
 
 EventSelector (const edm::ParameterSet &iConfig)
 
 EventSelector (const edm::ParameterSet &iConfig)
 
const std::string & name () const
 name of the module (from configuration) More...
 
const std::string & name () const
 name of the module (from configuration) More...
 
virtual bool select (const edm::Event &) const =0
 decision of the selector module More...
 
virtual bool select (const edm::Event &) const =0
 decision of the selector module More...
 
virtual ~EventSelector ()
 
virtual ~EventSelector ()
 

Private Attributes

std::vector
< edm::LuminosityBlockRange
lumis_
 

Additional Inherited Members

- Protected Attributes inherited from EventSelector
std::vector< std::string > description_
 
std::string name_
 

Detailed Description

Definition at line 14 of file RunLumiSelector.h.

Constructor & Destructor Documentation

RunLumiSelector::RunLumiSelector ( )
inline

Definition at line 16 of file RunLumiSelector.h.

16 {}
RunLumiSelector::RunLumiSelector ( edm::ParameterSet const &  params)
inline

Definition at line 18 of file RunLumiSelector.h.

References edm::ParameterSet::exists(), edm::ParameterSet::getUntrackedParameter(), lumis_, and runtimedef::set().

18  {
19 
20  push_back("RunLumi");
21 
22  if ( params.exists("lumisToProcess") ) {
23  lumis_ = params.getUntrackedParameter<std::vector<edm::LuminosityBlockRange> > ("lumisToProcess");
24  set("RunLumi" );
25  }
26  else {
27  lumis_.clear();
28  set("RunLumi", false);
29  }
30 
31  retInternal_ = getBitTemplate();
32  }
std::vector< edm::LuminosityBlockRange > lumis_
void set(const std::string &name, int value)
set the flag, with a run-time name

Member Function Documentation

bool RunLumiSelector::operator() ( edm::EventBase const &  ev,
pat::strbitset ret 
)
inline

Definition at line 34 of file RunLumiSelector.h.

References edm::EventBase::id(), edm::EventID::luminosityBlock(), lumis_, run_regression::ret, and edm::EventID::run().

34  {
35 
36  if ( !ignoreCut("RunLumi") ) {
37  bool goodLumi = false;
38  for ( std::vector<edm::LuminosityBlockRange>::const_iterator lumisBegin = lumis_.begin(),
39  lumisEnd = lumis_.end(), ilumi = lumisBegin;
40  ilumi != lumisEnd; ++ilumi ) {
41  if ( ev.id().run() >= ilumi->startRun() && ev.id().run() <= ilumi->endRun() &&
42  ev.id().luminosityBlock() >= ilumi->startLumi() && ev.id().luminosityBlock() <= ilumi->endLumi() ) {
43  goodLumi = true;
44  break;
45  }
46  }
47  if ( goodLumi ) passCut(ret, "RunLumi" );
48  } else {
49  passCut(ret, "RunLumi");
50  }
51 
52  setIgnored(ret);
53  return (bool)ret;
54  }
std::vector< edm::LuminosityBlockRange > lumis_

Member Data Documentation

std::vector<edm::LuminosityBlockRange> RunLumiSelector::lumis_
private

Definition at line 60 of file RunLumiSelector.h.

Referenced by operator()(), and RunLumiSelector().