CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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

bool accept (const fwlite::EventBase &ev) const override
 
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)
 
 ~RunLumiSelector () override
 
- Public Member Functions inherited from fwlite::EventSelector
 EventSelector (const char *name="", const char *title="")
 
 ~EventSelector () override
 

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 add(), and BeamSpotPI::lastLumi.

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);
29  }
void add(int run, int firstLumi=0, int lastLumi=9999999)
EventSelector(const char *name="", const char *title="")
fwlite::RunLumiSelector::~RunLumiSelector ( )
inlineoverride

Definition at line 31 of file EventSelectors.h.

31 {}

Member Function Documentation

bool fwlite::RunLumiSelector::accept ( const fwlite::EventBase ev) const
inlineoverridevirtual

Implements fwlite::EventSelector.

Definition at line 32 of file EventSelectors.h.

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

Referenced by accept(), and esMonitoring.FDJsonServer::handle_accept().

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

Definition at line 43 of file EventSelectors.h.

References firstLumis, mps_fire::i, lastLumis, dqmiodumpmetadata::n, and runs.

Referenced by esMonitoring.FDJsonServer::handle_accept().

43  {
44  if (runs.empty())
45  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]))
49  return true;
50  }
51  }
52  return false;
53  }
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 33 of file EventSelectors.h.

References firstLumis, BeamSpotPI::lastLumi, lastLumis, and runs.

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

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

Definition at line 38 of file EventSelectors.h.

References firstLumis, lastLumis, and runs.

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

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

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

Definition at line 56 of file EventSelectors.h.

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

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

Definition at line 56 of file EventSelectors.h.

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