|
DAS
3.0
Das Analysis System
|
Go to the documentation of this file.
12 static const size_t nN = 8;
13 static const size_t nmu = 3;
14 static const size_t nkL = 2;
15 static const size_t nnL = 5;
16 static const size_t nkR = 2;
17 static const size_t nnR = 5;
19 inline double safelog (
double x) {
return x > 0 ? log(x) : 0; };
21 inline double id (
double x) {
return x; };
29 const char *
name = Form(
"derivative_%s", h->GetName());
30 TH1 * d =
dynamic_cast<TH1*
>(h->Clone(
name));
32 for (
int i = 2; i < d->GetNbinsX(); ++i) {
33 auto x1 = h->GetBinCenter(i-1),
34 x2 = h->GetBinCenter(i+1),
35 f1 =
f(h->GetBinContent(i-1)),
36 f2 =
f(h->GetBinContent(i+1));
38 if (abs(dx) < 1e-20)
continue;
40 d->SetBinContent(i, df/dx);
51 const char *
name = Form(
"derivative_%s", h->GetName());
52 auto d = unique_ptr<TH1>(
dynamic_cast<TH1*
>(h->Clone(
name)) );
54 for (
int i = 3; i < d->GetNbinsX()-1; ++i) {
55 auto w = d->GetBinWidth(i);
57 auto f1 =
f(h->GetBinContent(i-2)),
58 f2 =
f(h->GetBinContent(i-1)),
59 f3 =
f(h->GetBinContent(i+1)),
60 f4 =
f(h->GetBinContent(i+2));
62 if (abs(dx) < 1e-20)
continue;
63 auto df = -f4 + 8*f3 - 8*f2 + f1;
64 d->SetBinContent(i, df/dx);
77 const char *
name = Form(
"secondderivative_%s", h->GetName());
78 TH1 * d2 =
dynamic_cast<TH1*
>(h->Clone(
name));
80 for (
int i = 2; i < d2->GetNbinsX(); ++i) {
81 auto x0 = h->GetBinCenter(i-1),
82 x1 = h->GetBinCenter(i ),
83 x2 = h->GetBinCenter(i+1),
84 f0 =
f(h->GetBinContent(i-1)),
85 f1 =
f(h->GetBinContent(i )),
86 f2 =
f(h->GetBinContent(i+1));
87 auto dx2 = (x2-x1)*(x1-x0);
88 if (abs(dx2) < 1e-20)
continue;
89 auto d2f = f2-2*f1+f0;
90 d2->SetBinContent(i, d2f/dx2);
105 double mNSC (
double * x,
double *
p)
107 return sqrt(
p[0]*abs(
p[0])/(x[0]*x[0]) +
p[1]*
p[1]/pow(x[0],
p[3]) +
p[2]*
p[2]);
123 auto z = [&](
double x) {
return (x - mu)/sigma; };
129 return N*exp(0.5*pow(zk,2)-zk*zx);
132 return N*exp(-0.5*pow(zx,2));
147 if (sigma <= 0)
return 0;
149 double y = (*x-mu)/sigma;
151 static const double C = sqrt(log(4.));
152 double coeff = sinh(C*tau) / C;
154 double z2 = pow( log(1.+coeff*y)/tau, 2) + pow(tau,2);
155 return N*exp(-0.5*z2);
179 double z = (*x - mu)/sigma,
180 a = abs( k - mu)/sigma;
182 double expa2 = exp(-pow(a,2)/2.);
184 double C = n * expa2 / (a*(n-1)),
185 D = sqrt(M_PI/2.)*(1 + erf(a/sqrt(2)));
187 N /= sigma * (C + D);
190 return N*exp(-pow(z,2)/2.);
193 double A = pow(n/a, n) * expa2,
195 return N*A*pow(
B-z,-n);
205 sigma = max(1e-8,abs(
p[2])),
209 return N*exp(- pow((*x-mu)/sigma,2)/2
211 -C*pow((*x-mu) ,4)/4);
name
Definition: DYToLL_M-50_13TeV_pythia8_cff_GEN_SIM_RECOBEFMIX_DIGI_L1_DIGI2RAW_L1Reco_RECO.py:48
Definition: applyBTagSF.cc:31
double Novosibirsk(double *x, double *p)
Definition: resolution.h:140
TH1 * SecondDerivative(TH1 *h, double(*f)(double)=id)
Definition: resolution.h:75
TH1 * Derivative(TH1 *h, double(*f)(double)=id)
Definition: resolution.h:27
static const size_t nmu
order of Chebyshev polynomial for global mean of DCB
Definition: resolution.h:13
unique_ptr< TH1 > DerivativeFivePointStencil(const unique_ptr< TH1 > &h, double(*f)(double)=id)
Definition: resolution.h:49
double GausExp(double *x, double *p)
Definition: resolution.h:116
p
Definition: Ntupliser_cfg.py:362
f
Definition: Ntupliser_cfg.py:256
< SOURCE_DIR >< SOURCE_SUBDIR > B
Definition: Core-cfgcmd.txt:1
static const float w
Definition: common.h:51
double id(double x)
Definition: resolution.h:21
static const size_t nN
order of Chebyshev polynomial for global normalisation of DCB
Definition: resolution.h:12
static const size_t nkR
order of Chebyshev polynomial for global RHS tail transition of DCB
Definition: resolution.h:16
double CrystalBall(double *x, double *p)
Definition: resolution.h:171
static const size_t nnL
order of Chebyshev polynomial for global LHS tail steepness of DCB
Definition: resolution.h:15
static const size_t nnR
order of Chebyshev polynomial for global RHS tail steepness of DCB
Definition: resolution.h:17
double mNSC(double *x, double *p)
Definition: resolution.h:105
double ModifiedGaussianCore(double *x, double *p)
Advanced function to fit resolution including non-Gaussian deviations and pile-up jets.
Definition: resolution.h:201
static const size_t nkL
order of Chebyshev polynomial for global LHS tail transition of DCB
Definition: resolution.h:14
double safelog(double x)
Definition: resolution.h:19