1 #ifndef RecoEgamma_EgammaTools_EnergyScaleCorrection_h 2 #define RecoEgamma_EgammaTools_EnergyScaleCorrection_h 42 ScaleCorrection(
float iScale,
float iScaleErrStat,
float iScaleErrSyst,
float iScaleErrGain)
46 float scaleErr(
const std::bitset<kErrNrBits>& uncBitMask)
const;
52 std::ostream&
print(std::ostream& os)
const;
60 SmearCorrection() : rho_(0.), rhoErr_(0.), phi_(0.), phiErr_(0.), eMean_(0.), eMeanErr_(0.) {}
61 SmearCorrection(
float iRho,
float iRhoErr,
float iPhi,
float iPhiErr,
float iEMean,
float iEMeanErr)
62 : rho_(iRho), rhoErr_(iRhoErr), phi_(iPhi), phiErr_(iPhiErr), eMean_(iEMean), eMeanErr_(iEMeanErr) {}
65 std::ostream&
print(std::ostream& os)
const;
67 float sigma(
const float et,
const float nrSigmaRho = 0.,
const float nrSigmaPhi = 0.)
const {
68 const float rhoVal = rho_ + rhoErr_ * nrSigmaRho;
69 const float phiVal = phi_ + phiErr_ * nrSigmaPhi;
70 const float constTerm = rhoVal *
std::sin(phiVal);
72 return std::sqrt(constTerm * constTerm + alpha * alpha / et);
85 const unsigned int runnr,
const float et,
const float eta,
const float r9,
const unsigned int gainSeed)
104 unsigned int gainSeed);
108 const unsigned int runnr,
const float et,
const float eta,
const float r9,
const unsigned int gainSeed)
const;
111 std::ostream&
print(std::ostream& os)
const;
135 unsigned int gainSeed = 12,
136 std::bitset<kErrNrBits> uncBitMask =
kErrNone)
const;
142 unsigned int gainSeed,
143 std::bitset<kErrNrBits> uncBitMask =
kErrNone)
const;
146 int runnr,
double et,
double eta,
double r9,
unsigned int gainSeed,
ParamSmear par,
float nSigma = 0.)
const;
148 int runnr,
double et,
double eta,
double r9,
unsigned int gainSeed,
float nSigmaRho,
float nSigmaPhi)
const;
161 double errSystDeltaP,
162 double errDeltaPGain);
174 double energyScaleErrStat,
175 double energyScaleErrSyst,
176 double energyScaleErrGain);
197 std::map<CorrectionCategory, ScaleCorrection>
scales_;
200 template <
typename T1,
typename T2>
203 bool operator()(
const std::pair<T1, T2>& lhs,
const T1& rhs)
const {
return lhs.first < rhs; }
204 bool operator()(
const std::pair<T1, T2>& lhs,
const std::pair<T1, T2>& rhs)
const {
return lhs.first < rhs.first; }
205 bool operator()(
const T1& lhs,
const std::pair<T1, T2>& rhs)
const {
return lhs < rhs.first; }
206 bool operator()(
const T1& lhs,
const T1& rhs)
const {
return lhs < rhs; }
bool operator()(const std::pair< T1, T2 > &lhs, const T1 &rhs) const
void readSmearingsFromFile(const std::string &filename)
float etMax_
max Et value for the bin
static constexpr float kDefaultSmearVal_
ScaleCorrection(float iScale, float iScaleErrStat, float iScaleErrSyst, float iScaleErrGain)
void addScale(const std::string &category, int runMin, int runMax, double deltaP, double errDeltaP, double errSystDeltaP, double errDeltaPGain)
Sin< T >::type sin(const T &t)
float etMin_
min Et value for the bin
std::ostream & print(std::ostream &os) const
float scaleErrGain() const
void readScalesFromFile(const std::string &filename)
bool operator()(const T1 &lhs, const std::pair< T1, T2 > &rhs) const
bool operator()(const std::pair< T1, T2 > &lhs, const std::pair< T1, T2 > &rhs) const
const ScaleCorrection * getScaleCorr(unsigned int runnr, double et, double eta, double r9, unsigned int gainSeed) const
void setSmearingType(FileFormat value)
float smearingSigma(int runnr, double et, double eta, double r9, unsigned int gainSeed, ParamSmear par, float nSigma=0.) const
static constexpr float kDefaultScaleVal_
Cos< T >::type cos(const T &t)
float etaMax_
max eta value for the bin
Abs< T >::type abs(const T &t)
const SmearCorrection * getSmearCorr(unsigned int runnr, double et, double eta, double r9, unsigned int gainSeed) const
unsigned int gain_
12, 6, 1, 61 (double gain switch)
std::map< CorrectionCategory, SmearCorrection > smearings_
friend std::ostream & operator<<(std::ostream &os, const CorrectionCategory &a)
CorrectionCategory(const unsigned int runnr, const float et, const float eta, const float r9, const unsigned int gainSeed)
float scaleErr(const std::bitset< kErrNrBits > &uncBitMask) const
float sigma(const float et, const float nrSigmaRho=0., const float nrSigmaPhi=0.) const
friend std::ostream & operator<<(std::ostream &os, const SmearCorrection &a)
friend std::ostream & operator<<(std::ostream &os, const ScaleCorrection &a)
void addSmearing(const std::string &category, int runMin, int runMax, double rho, double errRho, double phi, double errPhi, double eMean, double errEMean)
float r9Max_
max R9 value for the bin
et
define resolution functions of each parameter
bool operator<(DTCELinkId const &lhs, DTCELinkId const &rhs)
float etaMin_
min eta value for the bin
bool operator()(const T1 &lhs, const T1 &rhs) const
std::ostream & print(std::ostream &os) const
std::map< CorrectionCategory, ScaleCorrection > scales_
float scaleErrSyst() const
SmearCorrection(float iRho, float iRhoErr, float iPhi, float iPhiErr, float iEMean, float iEMeanErr)
float scaleErrStat() const
std::ostream & print(std::ostream &os) const
float r9Min_
min R9 vaule for the bin
float scaleCorrUncert(unsigned int runnr, double et, double eta, double r9, unsigned int gainSeed, std::bitset< kErrNrBits > uncBitMask=kErrNone) const
float scaleCorr(unsigned int runnr, double et, double eta, double r9, unsigned int gainSeed=12, std::bitset< kErrNrBits > uncBitMask=kErrNone) const