CMS 3D CMS Logo

Public Member Functions | Private Attributes

fwlite::RunLumiSelector Class Reference

#include <EventSelectors.h>

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

List of all members.

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 (int run, int firstLumi=0, int lastLumi=9999999)
 RunLumiSelector (const char *name="", const char *title="")
virtual ~RunLumiSelector ()

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.

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

Definition at line 23 of file EventSelectors.h.

References add().

                                                                              :
                EventSelector(TString::Format("run%d_lumi%d_%d", run, firstLumi, lastLumi),
                              TString::Format("Run %d, Lumi range [%d, %d]", run, firstLumi, lastLumi))
                { add(run, firstLumi, lastLumi); }
virtual fwlite::RunLumiSelector::~RunLumiSelector ( ) [inline, virtual]

Definition at line 28 of file EventSelectors.h.

{}

Member Function Documentation

virtual bool fwlite::RunLumiSelector::accept ( const fwlite::EventBase ev) const [inline, virtual]

Implements fwlite::EventSelector.

Definition at line 29 of file EventSelectors.h.

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

                                                                 {
                return accept(ev.id().run(), ev.luminosityBlock());
            }
bool fwlite::RunLumiSelector::accept ( int  run,
int  luminosityBlock 
) const [inline]

Definition at line 42 of file EventSelectors.h.

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

                                                            {
                if (runs.empty()) return true;
                for (int i = 0, n = runs.size(); i < n; ++i) {
                    if (runs[i] == run) {
                        if ((firstLumis[i] <= luminosityBlock) && (luminosityBlock <= lastLumis[i])) return true;
                    }
                }
                return false;
            }
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 RunLumiSelector().

                                                                       {
                runs.push_back(run);
                firstLumis.push_back(firstLumi);
                lastLumis.push_back(lastLumi);
            }
void fwlite::RunLumiSelector::clear ( void  ) [inline]

Definition at line 37 of file EventSelectors.h.

References firstLumis, lastLumis, and runs.

                         {
                runs.clear();
                firstLumis.clear();
                lastLumis.clear();
            }

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]

Definition at line 53 of file EventSelectors.h.

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