CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
VariableEventSelector Class Reference

#include <VariableEventSelector.h>

Inheritance diagram for VariableEventSelector:
EventSelector

Public Member Functions

bool select (const edm::Event &e) const
 decision of the selector module More...
 
 VariableEventSelector (const edm::ParameterSet &pset, edm::ConsumesCollector &&iC)
 
 VariableEventSelector (const edm::ParameterSet &pset, edm::ConsumesCollector &iC)
 
- Public Member Functions inherited from EventSelector
const std::vector< std::string > & description ()
 
 EventSelector ()
 
 EventSelector (const edm::ParameterSet &iConfig, edm::ConsumesCollector &&iC)
 
 EventSelector (const edm::ParameterSet &iConfig, edm::ConsumesCollector &iC)
 
const std::string & name () const
 name of the module (from configuration) More...
 
virtual ~EventSelector ()
 

Private Attributes

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

Additional Inherited Members

- Protected Attributes inherited from EventSelector
std::vector< std::string > description_
 
std::string name_
 

Detailed Description

Definition at line 68 of file VariableEventSelector.h.

Constructor & Destructor Documentation

VariableEventSelector::VariableEventSelector ( const edm::ParameterSet pset,
edm::ConsumesCollector &&  iC 
)
inline

Definition at line 70 of file VariableEventSelector.h.

70  :
71  VariableEventSelector(pset, iC) {}
VariableEventSelector(const edm::ParameterSet &pset, edm::ConsumesCollector &&iC)
VariableEventSelector::VariableEventSelector ( const edm::ParameterSet pset,
edm::ConsumesCollector iC 
)
inline

Definition at line 72 of file VariableEventSelector.h.

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

72  :
73  EventSelector(pset, iC)
74  {
75  var_=pset.getParameter<std::string>("var");
76  doMin_=pset.exists("min");
77  if (doMin_) min_=pset.getParameter<double>("min");
78  doMax_=pset.exists("max");
79  if (doMax_) max_=pset.getParameter<double>("max");
80 
81  std::stringstream ss;
82  ss<<"event selector based on VariableHelper variable: "<<var_;
83  description_.push_back(ss.str()); ss.str("");
84  if (doMin_){
85  ss<<"with minimum boundary: "<<min_;
86  description_.push_back(ss.str()); ss.str("");}
87  if (doMax_){
88  ss<<"with maximum boundary: "<<max_;
89  description_.push_back(ss.str()); ss.str("");}
90  }
T getParameter(std::string const &) const
bool exists(std::string const &parameterName) const
checks if a parameter exists
std::vector< std::string > description_
Definition: EventSelector.h:34

Member Function Documentation

bool VariableEventSelector::select ( const edm::Event ) const
inlinevirtual

decision of the selector module

Implements EventSelector.

Definition at line 91 of file VariableEventSelector.h.

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

91  {
93  if (!var->compute(e)) return false;
94 
95  double v=(*var)(e);
96 
97  if (doMin_ && v<min_) return false;
98  else if (doMax_ && v>max_) return false;
99  else return true;
100  }
bool compute(const edm::Event &iEvent) const

Member Data Documentation

bool VariableEventSelector::doMax_
private

Definition at line 106 of file VariableEventSelector.h.

Referenced by select(), and VariableEventSelector().

bool VariableEventSelector::doMin_
private

Definition at line 104 of file VariableEventSelector.h.

Referenced by select(), and VariableEventSelector().

double VariableEventSelector::max_
private

Definition at line 107 of file VariableEventSelector.h.

Referenced by select(), and VariableEventSelector().

double VariableEventSelector::min_
private

Definition at line 105 of file VariableEventSelector.h.

Referenced by select(), and VariableEventSelector().

std::string VariableEventSelector::var_
private

Definition at line 103 of file VariableEventSelector.h.

Referenced by select(), and VariableEventSelector().