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
fwlite::RunLumiSelector Class Reference

#include <EventSelectors.h>

Inheritance diagram for fwlite::RunLumiSelector:
fwlite::EventSelector

Public Member Functions

virtual bool accept (const fwlite::EventBase &ev) const
 
bool accept (int run, int luminosityBlock) const
 
void add (int run, int firstLumi=0, int lastLumi=9999999)
 
void clear ()
 
 RunLumiSelector (const char *name="", const char *title="")
 
 RunLumiSelector (int run, int firstLumi=0, int lastLumi=9999999)
 
virtual ~RunLumiSelector ()
 
- Public Member Functions inherited from fwlite::EventSelector
 EventSelector (const char *name="", const char *title="")
 
virtual ~EventSelector ()
 

Private Attributes

std::vector< int > firstLumis
 
std::vector< int > lastLumis
 
std::vector< int > runs
 

Detailed Description

Definition at line 20 of file EventSelectors.h.

Constructor & Destructor Documentation

fwlite::RunLumiSelector::RunLumiSelector ( const char *  name = "",
const char *  title = "" 
)
inline

Definition at line 22 of file EventSelectors.h.

EventSelector(const char *name="", const char *title="")
fwlite::RunLumiSelector::RunLumiSelector ( int  run,
int  firstLumi = 0,
int  lastLumi = 9999999 
)
inline

Definition at line 23 of file EventSelectors.h.

References add().

23  :
24  EventSelector(TString::Format("run%d_lumi%d_%d", run, firstLumi, lastLumi),
25  TString::Format("Run %d, Lumi range [%d, %d]", run, firstLumi, lastLumi))
26  { add(run, firstLumi, lastLumi); }
void add(int run, int firstLumi=0, int lastLumi=9999999)
EventSelector(const char *name="", const char *title="")
virtual fwlite::RunLumiSelector::~RunLumiSelector ( )
inlinevirtual

Definition at line 28 of file EventSelectors.h.

28 {}

Member Function Documentation

virtual bool fwlite::RunLumiSelector::accept ( const fwlite::EventBase ev) const
inlinevirtual

Implements fwlite::EventSelector.

Definition at line 29 of file EventSelectors.h.

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

Referenced by Vispa.Gui.BoxContentDialog.BoxContentDialog::apply(), Vispa.Plugins.ConfigEditor.ToolDialog.ToolDialog::apply(), and esMonitoring.FDJsonServer::handle_accept().

29  {
30  return accept(ev.id().run(), ev.luminosityBlock());
31  }
RunNumber_t run() const
Definition: EventID.h:39
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:63
virtual bool accept(const fwlite::EventBase &ev) const
edm::EventID id() const
Definition: EventBase.h:60
bool fwlite::RunLumiSelector::accept ( int  run,
int  luminosityBlock 
) const
inline

Definition at line 42 of file EventSelectors.h.

References firstLumis, i, lastLumis, gen::n, and runs.

Referenced by Vispa.Gui.BoxContentDialog.BoxContentDialog::apply(), Vispa.Plugins.ConfigEditor.ToolDialog.ToolDialog::apply(), and esMonitoring.FDJsonServer::handle_accept().

42  {
43  if (runs.empty()) return true;
44  for (int i = 0, n = runs.size(); i < n; ++i) {
45  if (runs[i] == run) {
46  if ((firstLumis[i] <= luminosityBlock) && (luminosityBlock <= lastLumis[i])) return true;
47  }
48  }
49  return false;
50  }
int i
Definition: DBlmapReader.cc:9
std::vector< int > firstLumis
std::vector< int > runs
std::vector< int > lastLumis
void fwlite::RunLumiSelector::add ( int  run,
int  firstLumi = 0,
int  lastLumi = 9999999 
)
inline

Definition at line 32 of file EventSelectors.h.

References firstLumis, lastLumis, and runs.

Referenced by counter.Counter::register(), and RunLumiSelector().

32  {
33  runs.push_back(run);
34  firstLumis.push_back(firstLumi);
35  lastLumis.push_back(lastLumi);
36  }
std::vector< int > firstLumis
std::vector< int > runs
std::vector< int > lastLumis
void fwlite::RunLumiSelector::clear ( void  )
inline

Definition at line 37 of file EventSelectors.h.

References firstLumis, lastLumis, and runs.

37  {
38  runs.clear();
39  firstLumis.clear();
40  lastLumis.clear();
41  }
std::vector< int > firstLumis
std::vector< int > runs
std::vector< int > lastLumis

Member Data Documentation

std::vector<int> fwlite::RunLumiSelector::firstLumis
private

Definition at line 53 of file EventSelectors.h.

Referenced by accept(), add(), and clear().

std::vector<int> fwlite::RunLumiSelector::lastLumis
private

Definition at line 53 of file EventSelectors.h.

Referenced by accept(), add(), and clear().

std::vector<int> fwlite::RunLumiSelector::runs
private