CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
SCRegressionCalculator< VarCalc > Class Template Reference

#include <SCRegressionCalculator.h>

Public Member Functions

float getCorrection (const reco::SuperCluster &) const
 
std::pair< float, float > getCorrectionWithErrors (const reco::SuperCluster &) const
 
 SCRegressionCalculator (const edm::ParameterSet &)
 
void update (const edm::EventSetup &)
 
std::unique_ptr< VarCalc > & varCalc ()
 

Private Attributes

edm::ESHandle< GBRForesteb_corr
 
std::string eb_corr_name
 
edm::ESHandle< GBRForesteb_err
 
std::string eb_err_name
 
edm::ESHandle< GBRForestee_corr
 
std::string ee_corr_name
 
edm::ESHandle< GBRForestee_err
 
std::string ee_err_name
 
const GBRWrapperRcdgbr_record
 
std::unique_ptr< VarCalc > var_calc
 

Detailed Description

template<class VarCalc>
class SCRegressionCalculator< VarCalc >

Definition at line 21 of file SCRegressionCalculator.h.

Constructor & Destructor Documentation

template<class VarCalc >
SCRegressionCalculator< VarCalc >::SCRegressionCalculator ( const edm::ParameterSet conf)

Definition at line 39 of file SCRegressionCalculator.h.

References SCRegressionCalculator< VarCalc >::eb_corr_name, SCRegressionCalculator< VarCalc >::eb_err_name, SCRegressionCalculator< VarCalc >::ee_corr_name, SCRegressionCalculator< VarCalc >::ee_err_name, edm::ParameterSet::existsAs(), edm::ParameterSet::getParameter(), AlCaHLTBitMon_QueryRunRegistry::string, and SCRegressionCalculator< VarCalc >::var_calc.

39  : gbr_record(nullptr) {
40  var_calc.reset(new VarCalc());
41  eb_corr_name = conf.getParameter<std::string>("regressionKeyEB");
42  ee_corr_name = conf.getParameter<std::string>("regressionKeyEE");
43  if (conf.existsAs<std::string>("uncertaintyKeyEB"))
44  eb_err_name = conf.getParameter<std::string>("uncertaintyKeyEB");
45  if (conf.existsAs<std::string>("uncertaintyKeyEE"))
46  ee_err_name = conf.getParameter<std::string>("uncertaintyKeyEE");
47 }
T getParameter(std::string const &) const
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:160
const GBRWrapperRcd * gbr_record
std::unique_ptr< VarCalc > var_calc

Member Function Documentation

template<class VarCalc >
float SCRegressionCalculator< VarCalc >::getCorrection ( const reco::SuperCluster sc) const

Definition at line 67 of file SCRegressionCalculator.h.

References SCRegressionCalculator< VarCalc >::eb_corr, EcalBarrel, EcalEndcap, SCRegressionCalculator< VarCalc >::ee_corr, GBRForest::GetResponse(), PixelMapPlotter::inputs, reco::SuperCluster::seed(), and SCRegressionCalculator< VarCalc >::var_calc.

Referenced by SCRegressionCalculator< VarCalc >::varCalc().

67  {
68  std::vector<float> inputs;
69  var_calc->set(sc, inputs);
70  switch (sc.seed()->seed().subdetId()) {
72  return eb_corr->GetResponse(inputs.data());
73  break;
75  return ee_corr->GetResponse(inputs.data());
76  break;
77  }
78  return -1.0f;
79 }
double GetResponse(const float *vector) const
Definition: GBRForest.h:49
edm::ESHandle< GBRForest > eb_corr
edm::ESHandle< GBRForest > ee_corr
const CaloClusterPtr & seed() const
seed BasicCluster
Definition: SuperCluster.h:77
std::unique_ptr< VarCalc > var_calc
template<class VarCalc >
std::pair< float, float > SCRegressionCalculator< VarCalc >::getCorrectionWithErrors ( const reco::SuperCluster sc) const

Definition at line 82 of file SCRegressionCalculator.h.

References SCRegressionCalculator< VarCalc >::eb_corr, SCRegressionCalculator< VarCalc >::eb_err, EcalBarrel, EcalEndcap, SCRegressionCalculator< VarCalc >::ee_corr, SCRegressionCalculator< VarCalc >::ee_err, f, GBRForest::GetResponse(), PixelMapPlotter::inputs, reco::SuperCluster::seed(), and SCRegressionCalculator< VarCalc >::var_calc.

Referenced by SCRegressionCalculator< VarCalc >::varCalc().

82  {
83  std::vector<float> inputs;
84  var_calc->set(sc, inputs);
85  switch (sc.seed()->seed().subdetId()) {
87  return std::make_pair(eb_corr->GetResponse(inputs.data()), eb_err->GetResponse(inputs.data()));
88  break;
90  return std::make_pair(ee_corr->GetResponse(inputs.data()), ee_err->GetResponse(inputs.data()));
91  break;
92  }
93  return std::make_pair(-1.0f, -1.0f);
94 }
double GetResponse(const float *vector) const
Definition: GBRForest.h:49
edm::ESHandle< GBRForest > eb_corr
edm::ESHandle< GBRForest > ee_corr
double f[11][100]
edm::ESHandle< GBRForest > ee_err
const CaloClusterPtr & seed() const
seed BasicCluster
Definition: SuperCluster.h:77
std::unique_ptr< VarCalc > var_calc
edm::ESHandle< GBRForest > eb_err
template<class VarCalc >
void SCRegressionCalculator< VarCalc >::update ( const edm::EventSetup es)

Definition at line 50 of file SCRegressionCalculator.h.

References edm::eventsetup::EventSetupRecord::cacheIdentifier(), SCRegressionCalculator< VarCalc >::eb_corr, SCRegressionCalculator< VarCalc >::eb_corr_name, SCRegressionCalculator< VarCalc >::eb_err, SCRegressionCalculator< VarCalc >::eb_err_name, SCRegressionCalculator< VarCalc >::ee_corr, SCRegressionCalculator< VarCalc >::ee_corr_name, SCRegressionCalculator< VarCalc >::ee_err, SCRegressionCalculator< VarCalc >::ee_err_name, SCRegressionCalculator< VarCalc >::gbr_record, edm::EventSetup::get(), edm::eventsetup::EventSetupRecordImplementation< T >::get(), and SCRegressionCalculator< VarCalc >::var_calc.

Referenced by progressbar.ProgressBar::__next__(), MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), progressbar.ProgressBar::finish(), Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), MatrixUtil.Steps::overwrite(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), Vispa.Gui.VispaWidget.VispaWidget::setText(), Vispa.Gui.VispaWidget.VispaWidget::setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

50  {
51  var_calc->update(es);
52  const GBRWrapperRcd& gbrfrom_es = es.get<GBRWrapperRcd>();
53  if (!gbr_record || gbrfrom_es.cacheIdentifier() != gbr_record->cacheIdentifier()) {
54  gbr_record = &gbrfrom_es;
57  if (eb_err_name.size()) {
58  gbr_record->get(eb_err_name.c_str(), eb_err);
59  }
60  if (ee_err_name.size()) {
61  gbr_record->get(ee_err_name.c_str(), ee_err);
62  }
63  }
64 }
unsigned long long cacheIdentifier() const
edm::ESHandle< GBRForest > eb_corr
const GBRWrapperRcd * gbr_record
PRODUCT const & get(ESGetToken< PRODUCT, T > const &iToken) const
edm::ESHandle< GBRForest > ee_corr
edm::ESHandle< GBRForest > ee_err
T get() const
Definition: EventSetup.h:73
std::unique_ptr< VarCalc > var_calc
edm::ESHandle< GBRForest > eb_err
template<class VarCalc >
std::unique_ptr<VarCalc>& SCRegressionCalculator< VarCalc >::varCalc ( )
inline

Member Data Documentation

template<class VarCalc >
edm::ESHandle<GBRForest> SCRegressionCalculator< VarCalc >::eb_corr
private
template<class VarCalc >
std::string SCRegressionCalculator< VarCalc >::eb_corr_name
private
template<class VarCalc >
edm::ESHandle<GBRForest> SCRegressionCalculator< VarCalc >::eb_err
private
template<class VarCalc >
std::string SCRegressionCalculator< VarCalc >::eb_err_name
private
template<class VarCalc >
edm::ESHandle<GBRForest> SCRegressionCalculator< VarCalc >::ee_corr
private
template<class VarCalc >
std::string SCRegressionCalculator< VarCalc >::ee_corr_name
private
template<class VarCalc >
edm::ESHandle<GBRForest> SCRegressionCalculator< VarCalc >::ee_err
private
template<class VarCalc >
std::string SCRegressionCalculator< VarCalc >::ee_err_name
private
template<class VarCalc >
const GBRWrapperRcd* SCRegressionCalculator< VarCalc >::gbr_record
private

Definition at line 33 of file SCRegressionCalculator.h.

Referenced by SCRegressionCalculator< VarCalc >::update().

template<class VarCalc >
std::unique_ptr<VarCalc> SCRegressionCalculator< VarCalc >::var_calc
private