CMS 3D CMS Logo

Public Member Functions | Private Attributes

VariableEventSelector Class Reference

#include <VariableEventSelector.h>

Inheritance diagram for VariableEventSelector:
EventSelector

List of all members.

Public Member Functions

bool select (const edm::Event &e) const
 decision of the selector module
 VariableEventSelector (const edm::ParameterSet &pset)

Private Attributes

bool doMax_
bool doMin_
double max_
double min_
std::string var_

Detailed Description

Definition at line 7 of file VariableEventSelector.h.


Constructor & Destructor Documentation

VariableEventSelector::VariableEventSelector ( const edm::ParameterSet pset) [inline]

Definition at line 9 of file VariableEventSelector.h.

References EventSelector::description_, doMax_, doMin_, edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), max_, min_, and var_.

                                                     :
    EventSelector(pset)
    {
      var_=pset.getParameter<std::string>("var");
      doMin_=pset.exists("min");
      if (doMin_) min_=pset.getParameter<double>("min");
      doMax_=pset.exists("max");
      if (doMax_) max_=pset.getParameter<double>("max");

      std::stringstream ss;
      ss<<"event selector based on VariableHelper variable: "<<var_;
      description_.push_back(ss.str());       ss.str("");
      if (doMin_){
        ss<<"with minimum boundary: "<<min_;
        description_.push_back(ss.str());       ss.str("");}
      if (doMax_){
        ss<<"with maximum boundary: "<<max_;
        description_.push_back(ss.str());       ss.str("");}
    }

Member Function Documentation

bool VariableEventSelector::select ( const edm::Event ) const [inline, virtual]

decision of the selector module

Implements EventSelector.

Definition at line 28 of file VariableEventSelector.h.

References CachingVariable::compute(), doMax_, doMin_, alignCSCRings::e, max_, min_, v, and var_.

                                        {
      const CachingVariable * var=edm::Service<VariableHelperService>()->get().variable(var_);
      if (!var->compute(e)) return false;

      double v=(*var)(e);
      
      if (doMin_ && v<min_) return false;
      else if (doMax_ && v>max_) return false;
      else return true;
    }

Member Data Documentation

Definition at line 43 of file VariableEventSelector.h.

Referenced by select(), and VariableEventSelector().

Definition at line 41 of file VariableEventSelector.h.

Referenced by select(), and VariableEventSelector().

double VariableEventSelector::max_ [private]

Definition at line 44 of file VariableEventSelector.h.

Referenced by select(), and VariableEventSelector().

double VariableEventSelector::min_ [private]

Definition at line 42 of file VariableEventSelector.h.

Referenced by select(), and VariableEventSelector().

std::string VariableEventSelector::var_ [private]

Definition at line 40 of file VariableEventSelector.h.

Referenced by select(), and VariableEventSelector().