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.

◆ RunLumiSelector() [2/2]

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

Definition at line 25 of file EventSelectors.h.

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  }

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

◆ ~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.

32 { return accept(ev.id().run(), ev.luminosityBlock()); }

References accept(), and ev.

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

◆ accept() [2/2]

bool fwlite::RunLumiSelector::accept ( int  run,
int  luminosityBlock 
) const
inline

Definition at line 43 of file EventSelectors.h.

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  }

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

Referenced by esMonitoring.FDJsonServer::handle_accept().

◆ add()

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

Definition at line 33 of file EventSelectors.h.

33  {
34  runs.push_back(run);
35  firstLumis.push_back(firstLumi);
36  lastLumis.push_back(lastLumi);
37  }

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

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

◆ clear()

void fwlite::RunLumiSelector::clear ( void  )
inline

Definition at line 38 of file EventSelectors.h.

38  {
39  runs.clear();
40  firstLumis.clear();
41  lastLumis.clear();
42  }

References firstLumis, lastLumis, and runs.

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().

runGCPTkAlMap.title
string title
Definition: runGCPTkAlMap.py:94
mps_fire.i
i
Definition: mps_fire.py:428
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
BeamSpotPI::lastLumi
Definition: BeamSpotPayloadInspectorHelper.h:39
fwlite::RunLumiSelector::runs
std::vector< int > runs
Definition: EventSelectors.h:56
fwlite::RunLumiSelector::lastLumis
std::vector< int > lastLumis
Definition: EventSelectors.h:56
fwlite::RunLumiSelector::firstLumis
std::vector< int > firstLumis
Definition: EventSelectors.h:56
fwlite::RunLumiSelector::add
void add(int run, int firstLumi=0, int lastLumi=9999999)
Definition: EventSelectors.h:33
writedatasetfile.run
run
Definition: writedatasetfile.py:27
ev
bool ev
Definition: Hydjet2Hadronizer.cc:95
fwlite::RunLumiSelector::accept
bool accept(const fwlite::EventBase &ev) const override
Definition: EventSelectors.h:32
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
fwlite::EventSelector::EventSelector
EventSelector(const char *name="", const char *title="")
Definition: EventSelectors.h:17