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)
 
- Public Member Functions inherited from EventSelector
const std::vector< std::string > & description ()
 
const std::vector< std::string > & description ()
 
 EventSelector ()
 
 EventSelector ()
 
 EventSelector (const edm::ParameterSet &iConfig)
 
 EventSelector (const edm::ParameterSet &iConfig)
 
const std::string & name () const
 name of the module (from configuration) More...
 
const std::string & name () const
 name of the module (from configuration) More...
 
virtual ~EventSelector ()
 
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 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_.

9  :
10  EventSelector(pset)
11  {
12  var_=pset.getParameter<std::string>("var");
13  doMin_=pset.exists("min");
14  if (doMin_) min_=pset.getParameter<double>("min");
15  doMax_=pset.exists("max");
16  if (doMax_) max_=pset.getParameter<double>("max");
17 
18  std::stringstream ss;
19  ss<<"event selector based on VariableHelper variable: "<<var_;
20  description_.push_back(ss.str()); ss.str("");
21  if (doMin_){
22  ss<<"with minimum boundary: "<<min_;
23  description_.push_back(ss.str()); ss.str("");}
24  if (doMax_){
25  ss<<"with maximum boundary: "<<max_;
26  description_.push_back(ss.str()); ss.str("");}
27  }
T getParameter(std::string const &) const
std::vector< std::string > description_
Definition: EventSelector.h:31
bool exists(std::string const &parameterName) const
checks if a parameter exists

Member Function Documentation

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

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_.

28  {
29  const CachingVariable * var=edm::Service<VariableHelperService>()->get().variable(var_);
30  if (!var->compute(e)) return false;
31 
32  double v=(*var)(e);
33 
34  if (doMin_ && v<min_) return false;
35  else if (doMax_ && v>max_) return false;
36  else return true;
37  }
bool compute(const edm::Event &iEvent) const
mathSSE::Vec4< T > v

Member Data Documentation

bool VariableEventSelector::doMax_
private

Definition at line 43 of file VariableEventSelector.h.

Referenced by select(), and VariableEventSelector().

bool VariableEventSelector::doMin_
private

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