CMS 3D CMS Logo

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 22 of file EventSelectors.h.

Constructor & Destructor Documentation

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

Definition at line 24 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 25 of file EventSelectors.h.

References PVValHelper::add().

25  :
26  EventSelector(TString::Format("run%d_lumi%d_%d", run, firstLumi, lastLumi),
27  TString::Format("Run %d, Lumi range [%d, %d]", run, firstLumi, lastLumi))
28  { 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 30 of file EventSelectors.h.

30 {}

Member Function Documentation

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

Implements fwlite::EventSelector.

Definition at line 31 of file EventSelectors.h.

References fwlite::EventSelector::accept(), 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().

31  {
32  return accept(ev.id().run(), ev.luminosityBlock());
33  }
RunNumber_t run() const
Definition: EventID.h:39
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:61
virtual bool accept(const fwlite::EventBase &ev) const
edm::EventID id() const
Definition: EventBase.h:59
bool fwlite::RunLumiSelector::accept ( int  run,
int  luminosityBlock 
) const
inline

Definition at line 44 of file EventSelectors.h.

References mps_fire::i, gen::n, and writedatasetfile::runs.

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

44  {
45  if (runs.empty()) return true;
46  for (int i = 0, n = runs.size(); i < n; ++i) {
47  if (runs[i] == run) {
48  if ((firstLumis[i] <= luminosityBlock) && (luminosityBlock <= lastLumis[i])) return true;
49  }
50  }
51  return false;
52  }
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 34 of file EventSelectors.h.

References writedatasetfile::runs.

Referenced by counter.Counter::register().

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

Definition at line 39 of file EventSelectors.h.

References writedatasetfile::runs.

39  {
40  runs.clear();
41  firstLumis.clear();
42  lastLumis.clear();
43  }
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 55 of file EventSelectors.h.

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

Definition at line 55 of file EventSelectors.h.

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