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

41  :
42  gbr_record(NULL) {
43  var_calc.reset(new VarCalc());
44  eb_corr_name = conf.getParameter<std::string>("regressionKeyEB");
45  ee_corr_name = conf.getParameter<std::string>("regressionKeyEE");
46  if( conf.existsAs<std::string>("uncertaintyKeyEB") )
47  eb_err_name = conf.getParameter<std::string>("uncertaintyKeyEB");
48  if( conf.existsAs<std::string>("uncertaintyKeyEE") )
49  ee_err_name = conf.getParameter<std::string>("uncertaintyKeyEE");
50 
51 }
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:186
#define NULL
Definition: scimark2.h:8
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 74 of file SCRegressionCalculator.h.

References EcalBarrel, EcalEndcap, SiPixelRawToDigiRegional_cfi::inputs, and reco::SuperCluster::seed().

74  {
75  std::vector<float> inputs;
76  var_calc->set(sc,inputs);
77  switch( sc.seed()->seed().subdetId() ) {
79  return eb_corr->GetResponse(inputs.data());
80  break;
82  return ee_corr->GetResponse(inputs.data());
83  break;
84  }
85  return -1.0f;
86 }
edm::ESHandle< GBRForest > eb_corr
edm::ESHandle< GBRForest > ee_corr
const CaloClusterPtr & seed() const
seed BasicCluster
Definition: SuperCluster.h:66
std::unique_ptr< VarCalc > var_calc
template<class VarCalc >
std::pair< float, float > SCRegressionCalculator< VarCalc >::getCorrectionWithErrors ( const reco::SuperCluster sc) const

Definition at line 90 of file SCRegressionCalculator.h.

References EcalBarrel, EcalEndcap, f, SiPixelRawToDigiRegional_cfi::inputs, and reco::SuperCluster::seed().

90  {
91  std::vector<float> inputs;
92  var_calc->set(sc,inputs);
93  switch( sc.seed()->seed().subdetId() ) {
95  return std::make_pair( eb_corr->GetResponse(inputs.data()),
96  eb_err->GetResponse(inputs.data()) );
97  break;
99  return std::make_pair( ee_corr->GetResponse(inputs.data()),
100  ee_err->GetResponse(inputs.data()) );
101  break;
102  }
103  return std::make_pair(-1.0f,-1.0f);
104 }
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:66
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 55 of file SCRegressionCalculator.h.

References edm::eventsetup::EventSetupRecord::cacheIdentifier(), edm::EventSetup::get(), and edm::eventsetup::EventSetupRecord::get().

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

55  {
56  var_calc->update(es);
57  const GBRWrapperRcd& gbrfrom_es = es.get<GBRWrapperRcd>();
58  if( !gbr_record ||
59  gbrfrom_es.cacheIdentifier() != gbr_record->cacheIdentifier() ) {
60  gbr_record = &gbrfrom_es;
63  if( eb_err_name.size() ) {
64  gbr_record->get(eb_err_name.c_str(),eb_err);
65  }
66  if( ee_err_name.size() ) {
67  gbr_record->get(ee_err_name.c_str(),ee_err);
68  }
69  }
70 }
unsigned long long cacheIdentifier() const
edm::ESHandle< GBRForest > eb_corr
const GBRWrapperRcd * gbr_record
void get(HolderT &iHolder) const
edm::ESHandle< GBRForest > ee_corr
edm::ESHandle< GBRForest > ee_err
const T & get() const
Definition: EventSetup.h:55
std::unique_ptr< VarCalc > var_calc
edm::ESHandle< GBRForest > eb_err
template<class VarCalc >
std::unique_ptr<VarCalc>& SCRegressionCalculator< VarCalc >::varCalc ( )
inline

Definition at line 26 of file SCRegressionCalculator.h.

References SCRegressionCalculator< VarCalc >::var_calc.

26 { return var_calc; }
std::unique_ptr< VarCalc > var_calc

Member Data Documentation

template<class VarCalc >
edm::ESHandle<GBRForest> SCRegressionCalculator< VarCalc >::eb_corr
private

Definition at line 35 of file SCRegressionCalculator.h.

template<class VarCalc >
std::string SCRegressionCalculator< VarCalc >::eb_corr_name
private
template<class VarCalc >
edm::ESHandle<GBRForest> SCRegressionCalculator< VarCalc >::eb_err
private

Definition at line 35 of file SCRegressionCalculator.h.

template<class VarCalc >
std::string SCRegressionCalculator< VarCalc >::eb_err_name
private
template<class VarCalc >
edm::ESHandle<GBRForest> SCRegressionCalculator< VarCalc >::ee_corr
private

Definition at line 35 of file SCRegressionCalculator.h.

template<class VarCalc >
std::string SCRegressionCalculator< VarCalc >::ee_corr_name
private
template<class VarCalc >
edm::ESHandle<GBRForest> SCRegressionCalculator< VarCalc >::ee_err
private

Definition at line 35 of file SCRegressionCalculator.h.

template<class VarCalc >
std::string SCRegressionCalculator< VarCalc >::ee_err_name
private
template<class VarCalc >
const GBRWrapperRcd* SCRegressionCalculator< VarCalc >::gbr_record
private

Definition at line 34 of file SCRegressionCalculator.h.

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