1 #ifndef __SCREGRESSIONCALCULATOR_H__
2 #define __SCREGRESSIONCALCULATOR_H__
20 template <
class VarCalc>
38 template <
class VarCalc>
49 template <
class VarCalc>
53 if (!gbr_record || gbrfrom_es.
cacheIdentifier() != gbr_record->cacheIdentifier()) {
54 gbr_record = &gbrfrom_es;
55 gbr_record->
get(eb_corr_name.c_str(), eb_corr);
56 gbr_record->get(ee_corr_name.c_str(), ee_corr);
57 if (!eb_err_name.empty()) {
58 gbr_record->get(eb_err_name.c_str(), eb_err);
60 if (!ee_err_name.empty()) {
61 gbr_record->get(ee_err_name.c_str(), ee_err);
66 template <
class VarCalc>
69 var_calc->set(sc, inputs);
70 switch (sc.
seed()->seed().subdetId()) {
72 return eb_corr->GetResponse(inputs.data());
75 return ee_corr->GetResponse(inputs.data());
81 template <
class VarCalc>
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()));
90 return std::make_pair(ee_corr->GetResponse(inputs.data()), ee_err->GetResponse(inputs.data()));
93 return std::make_pair(-1.0
f, -1.0
f);
unsigned long long cacheIdentifier() const
edm::ESHandle< GBRForest > eb_corr
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
float getCorrection(const reco::SuperCluster &) const
SCRegressionCalculator(const edm::ParameterSet &)
const GBRWrapperRcd * gbr_record
PRODUCT const & get(ESGetToken< PRODUCT, T > const &iToken) const
std::pair< float, float > getCorrectionWithErrors(const reco::SuperCluster &) const
std::unique_ptr< VarCalc > & varCalc()
edm::ESHandle< GBRForest > ee_corr
edm::ESHandle< GBRForest > ee_err
T getParameter(std::string const &) const
void update(const edm::EventSetup &)
const CaloClusterPtr & seed() const
seed BasicCluster
std::unique_ptr< VarCalc > var_calc
edm::ESHandle< GBRForest > eb_err