CMS 3D CMS Logo

Public Member Functions | Private Attributes

RunLumiSelector Class Reference

#include <RunLumiSelector.h>

Inheritance diagram for RunLumiSelector:
EventSelector

List of all members.

Public Member Functions

bool operator() (edm::EventBase const &ev, pat::strbitset &ret)
 RunLumiSelector ()
 RunLumiSelector (edm::ParameterSet const &params)

Private Attributes

std::vector
< edm::LuminosityBlockRange
lumis_

Detailed Description

Definition at line 14 of file RunLumiSelector.h.


Constructor & Destructor Documentation

RunLumiSelector::RunLumiSelector ( ) [inline]

Definition at line 16 of file RunLumiSelector.h.

{}
RunLumiSelector::RunLumiSelector ( edm::ParameterSet const &  params) [inline]

Definition at line 18 of file RunLumiSelector.h.

References edm::ParameterSet::exists(), edm::ParameterSet::getUntrackedParameter(), and lumis_.

                                                    {

    push_back("RunLumi");
    
    if ( params.exists("lumisToProcess") ) {
      lumis_ = params.getUntrackedParameter<std::vector<edm::LuminosityBlockRange> > ("lumisToProcess");
      set("RunLumi" );
    }
    else {
      lumis_.clear();
      set("RunLumi", false);
    }

    retInternal_ = getBitTemplate();
  }

Member Function Documentation

bool RunLumiSelector::operator() ( edm::EventBase const &  ev,
pat::strbitset ret 
) [inline]

Definition at line 34 of file RunLumiSelector.h.

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

                                                                   {

    if ( !ignoreCut("RunLumi") ) {
      bool goodLumi = false;
      for ( std::vector<edm::LuminosityBlockRange>::const_iterator lumisBegin = lumis_.begin(),
              lumisEnd = lumis_.end(), ilumi = lumisBegin;
            ilumi != lumisEnd; ++ilumi ) {
        if ( ev.id().run() >= ilumi->startRun() && ev.id().run() <= ilumi->endRun()  &&
             ev.id().luminosityBlock() >= ilumi->startLumi() && ev.id().luminosityBlock() <= ilumi->endLumi() )  {
          goodLumi = true;
          break;
        }
      }
      if ( goodLumi ) passCut(ret, "RunLumi" );
    } else {
      passCut(ret, "RunLumi");
    }

    setIgnored(ret);
    return (bool)ret;
  }

Member Data Documentation

Definition at line 60 of file RunLumiSelector.h.

Referenced by operator()(), and RunLumiSelector().