File indexing completed on 2024-04-06 12:24:12
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023 #include "PhysicsTools/TagAndProbe/interface/RooCMSShape.h"
0024
0025 ClassImp(RooCMSShape);
0026
0027 RooCMSShape::RooCMSShape(const char* name,
0028 const char* title,
0029 RooAbsReal& _x,
0030 RooAbsReal& _alpha,
0031 RooAbsReal& _beta,
0032 RooAbsReal& _gamma,
0033 RooAbsReal& _peak)
0034 : RooAbsPdf(name, title),
0035 x("x", "x", this, _x),
0036 alpha("alpha", "alpha", this, _alpha),
0037 beta("beta", "beta", this, _beta),
0038 gamma("gamma", "gamma", this, _gamma),
0039 peak("peak", "peak", this, _peak) {}
0040
0041 RooCMSShape::RooCMSShape(const RooCMSShape& other, const char* name)
0042 : RooAbsPdf(other, name),
0043 x("x", this, other.x),
0044 alpha("alpha", this, other.alpha),
0045 beta("beta", this, other.beta),
0046 gamma("gamma", this, other.gamma),
0047 peak("peak", this, other.peak) {}
0048
0049 Double_t RooCMSShape::evaluate() const {
0050
0051
0052
0053 Double_t erf = RooMath::erfc((alpha - x) * beta);
0054 Double_t u = (x - peak) * gamma;
0055
0056 if (u < -70)
0057 u = 1e20;
0058 else if (u > 70)
0059 u = 0;
0060 else
0061 u = exp(-u);
0062 return erf * u;
0063 }