CMS 3D CMS Logo

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

Constructor & Destructor Documentation

◆ VariableEventSelector() [1/2]

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

Definition at line 67 of file VariableEventSelector.h.

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

◆ VariableEventSelector() [2/2]

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

Definition at line 68 of file VariableEventSelector.h.

References EventSelector::description_, doMax_, doMin_, max_, min_, muonDTDigis_cfi::pset, contentValuesCheck::ss, AlCaHLTBitMon_QueryRunRegistry::string, and var_.

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

Member Function Documentation

◆ select()

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

decision of the selector module

Implements EventSelector.

Definition at line 92 of file VariableEventSelector.h.

References doMax_, doMin_, MillePedeFileConverter_cfg::e, max_, min_, findQualityFiles::v, ALCARECOEcalPhiSym_cff::var, and var_.

92  {
93  const CachingVariable* var = edm::Service<VariableHelperService>()->get().variable(var_);
94  if (!var->compute(e))
95  return false;
96 
97  double v = (*var)(e);
98 
99  if (doMin_ && v < min_)
100  return false;
101  else if (doMax_ && v > max_)
102  return false;
103  else
104  return true;
105  }

Member Data Documentation

◆ doMax_

bool VariableEventSelector::doMax_
private

Definition at line 111 of file VariableEventSelector.h.

Referenced by select(), and VariableEventSelector().

◆ doMin_

bool VariableEventSelector::doMin_
private

Definition at line 109 of file VariableEventSelector.h.

Referenced by select(), and VariableEventSelector().

◆ max_

double VariableEventSelector::max_
private

Definition at line 112 of file VariableEventSelector.h.

Referenced by select(), and VariableEventSelector().

◆ min_

double VariableEventSelector::min_
private

Definition at line 110 of file VariableEventSelector.h.

Referenced by select(), and VariableEventSelector().

◆ var_

std::string VariableEventSelector::var_
private

Definition at line 108 of file VariableEventSelector.h.

Referenced by select(), and VariableEventSelector().