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

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

◆ RunLumiSelector() [1/2]

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="")

◆ RunLumiSelector() [2/2]

fwlite::RunLumiSelector::RunLumiSelector ( int  run,
int  firstLumi = 0,
int  lastLumi = 9999999 
)
inline

Definition at line 25 of file EventSelectors.h.

References add(), BeamSpotPI::lastLumi, and writedatasetfile::run.

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="")

◆ ~RunLumiSelector()

fwlite::RunLumiSelector::~RunLumiSelector ( )
inlineoverride

Definition at line 31 of file EventSelectors.h.

31 {}

Member Function Documentation

◆ accept() [1/2]

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

Implements fwlite::EventSelector.

Definition at line 32 of file EventSelectors.h.

References accept(), and makeMEIFBenchmarkPlots::ev.

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

32 { return accept(ev.id().run(), ev.luminosityBlock()); }
bool accept(const fwlite::EventBase &ev) const override

◆ accept() [2/2]

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, writedatasetfile::run, 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

◆ add()

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, writedatasetfile::run, 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

◆ clear()

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

◆ firstLumis

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

Definition at line 56 of file EventSelectors.h.

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

◆ lastLumis

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

Definition at line 56 of file EventSelectors.h.

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

◆ runs

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

Definition at line 56 of file EventSelectors.h.

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