6 #include <vdt/vdtMath.h> 43 const float smear)
const;
50 virtual float val(
const float et)
const=0;
58 lowEt_(conf.getParameter<double>(
"lowEt")),highEt_(conf.getParameter<double>(
"highEt")),
59 lowEtUncert_(conf.getParameter<double>(
"lowEtUncert")),
60 highEtUncert_(conf.getParameter<double>(
"highEtUncert")),
62 dUncert_(highEtUncert_ - lowEtUncert_)
64 if(highEt_<=lowEt_)
throw cms::Exception(
"ConfigError") <<
" highEt "<<highEt_<<
" is not higher than lowEt "<<lowEt_;
68 float val(
const float et)
const override{
69 if(et<=lowEt_)
return lowEtUncert_;
70 else if(et>=highEt_)
return highEtUncert_;
72 return (et-lowEt_)*dUncert_/dEt_+lowEtUncert_;
94 if(funcName ==
"UncertFuncV1"){
95 uncertFunc_ = std::make_unique<UncertFuncV1>(funcPSet);
97 throw cms::Exception(
"ConfigError") <<
"Error constructing EGEtScaleSysModifier, function name "<<funcName<<
" not valid";
139 const auto oldP4 = ele.
p4();
146 const float energyEtUncertUp =
calCombinedMom(ele,corr+etUncert,smear).first;
147 const float energyEtUncertDn =
calCombinedMom(ele,corr-etUncert,smear).first;
174 const float energyEtUncertUp = ecalEnergyPreCorr*(corr+etUncert);
175 const float energyEtUncertDn = ecalEnergyPreCorr*(corr-etUncert);
184 const float smear)
const 188 const auto oldP4 = ele.
p4();
199 return combinedMomentum;
204 const float smear)
const 216 "EGEtScaleSysModifier");
EGEtScaleSysModifier(const edm::ParameterSet &conf)
T getParameter(std::string const &) const
Analysis-level Photon class.
virtual float val(const float et) const =0
float trackMomentumError() const
const LorentzVector & p4(P4Kind kind) const
std::unique_ptr< UncertFuncBase > uncertFunc_
void modifyObject(pat::Electron &ele) const final
static const std::string & name(size_t index)
void correctMomentum(const LorentzVector &p4, float trackMomentumError, float p4Error)
EpCombinationTool epCombTool_
float p4Error(P4Kind kind) const
virtual ~UncertFuncBase()
void addUserFloat(const std::string &label, float data, const bool overwrite=false)
Set user-defined float.
float userFloat(const std::string &key) const
std::pair< float, float > calCombinedMom(reco::GsfElectron &ele, const float scale, const float smear) const
void setCorrectedEcalEnergyError(float newEnergyError)
void setConsumes(edm::ConsumesCollector &) final
double et() const final
transverse energy
double energy() const final
energy
UncertFuncV1(const edm::ParameterSet &conf)
float ecalEnergyError() const
void setEvent(const edm::Event &) final
Analysis-level electron class.
void setEventContent(const edm::EventSetup &) final
void setEcalEnergy(reco::GsfElectron &ele, const float scale, const float smear) const
et
define resolution functions of each parameter
void setCorrectedEcalEnergy(float newEnergy)
#define DEFINE_EDM_PLUGIN(factory, type, name)
float val(const float et) const override
~EGEtScaleSysModifier() override