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 8 of file VariableEventSelector.h.

Constructor & Destructor Documentation

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

Definition at line 10 of file VariableEventSelector.h.

10  :
11  VariableEventSelector(pset, iC) {}
VariableEventSelector(const edm::ParameterSet &pset, edm::ConsumesCollector &&iC)
VariableEventSelector::VariableEventSelector ( const edm::ParameterSet pset,
edm::ConsumesCollector iC 
)
inline

Definition at line 12 of file VariableEventSelector.h.

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

12  :
13  EventSelector(pset, iC)
14  {
15  var_=pset.getParameter<std::string>("var");
16  doMin_=pset.exists("min");
17  if (doMin_) min_=pset.getParameter<double>("min");
18  doMax_=pset.exists("max");
19  if (doMax_) max_=pset.getParameter<double>("max");
20 
21  std::stringstream ss;
22  ss<<"event selector based on VariableHelper variable: "<<var_;
23  description_.push_back(ss.str()); ss.str("");
24  if (doMin_){
25  ss<<"with minimum boundary: "<<min_;
26  description_.push_back(ss.str()); ss.str("");}
27  if (doMax_){
28  ss<<"with maximum boundary: "<<max_;
29  description_.push_back(ss.str()); ss.str("");}
30  }
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 31 of file VariableEventSelector.h.

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

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

Member Data Documentation

bool VariableEventSelector::doMax_
private

Definition at line 46 of file VariableEventSelector.h.

Referenced by select(), and VariableEventSelector().

bool VariableEventSelector::doMin_
private

Definition at line 44 of file VariableEventSelector.h.

Referenced by select(), and VariableEventSelector().

double VariableEventSelector::max_
private

Definition at line 47 of file VariableEventSelector.h.

Referenced by select(), and VariableEventSelector().

double VariableEventSelector::min_
private

Definition at line 45 of file VariableEventSelector.h.

Referenced by select(), and VariableEventSelector().

std::string VariableEventSelector::var_
private

Definition at line 43 of file VariableEventSelector.h.

Referenced by select(), and VariableEventSelector().