CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
JetResolution.cc File Reference
#include "CondFormats/JetMETObjects/interface/JetResolution.h"
#include "CondFormats/JetMETObjects/interface/JetCorrectorParameters.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include <TMath.h>
#include <iostream>
#include <sstream>
#include <cassert>

Go to the source code of this file.

Functions

double fnc_dscb (double *xx, double *pp)
 
double fnc_gaussalpha (double *xx, double *pp)
 
double fnc_gaussalpha1alpha2 (double *xx, double *pp)
 

Function Documentation

double fnc_dscb ( double *  xx,
double *  pp 
)

Definition at line 223 of file JetResolution.cc.

References Abs(), RPCpg::mu, N, p1, p2, query::result, and x.

Referenced by JetResolution::initialize().

224 {
225  double x = xx[0];
226  double N = pp[0];
227  double mu = pp[1];
228  double sig = pp[2];
229  double a1 = pp[3];
230  double p1 = pp[4];
231  double a2 = pp[5];
232  double p2 = pp[6];
233 
234  double u = (x-mu)/sig;
235  double A1 = TMath::Power(p1/TMath::Abs(a1),p1)*TMath::Exp(-a1*a1/2);
236  double A2 = TMath::Power(p2/TMath::Abs(a2),p2)*TMath::Exp(-a2*a2/2);
237  double B1 = p1/TMath::Abs(a1) - TMath::Abs(a1);
238  double B2 = p2/TMath::Abs(a2) - TMath::Abs(a2);
239 
240  double result(N);
241  if (u<-a1) result *= A1*TMath::Power(B1-u,-p1);
242  else if (u<a2) result *= TMath::Exp(-u*u/2);
243  else result *= A2*TMath::Power(B2+u,-p2);
244  return result;
245 }
tuple pp
Definition: createTree.py:15
tuple result
Definition: query.py:137
T Abs(T a)
Definition: MathUtil.h:49
const int mu
Definition: Constants.h:22
double p2[4]
Definition: TauolaWrapper.h:90
#define N
Definition: blowfish.cc:9
double p1[4]
Definition: TauolaWrapper.h:89
Definition: DDAxes.h:10
double fnc_gaussalpha ( double *  xx,
double *  pp 
)

Definition at line 249 of file JetResolution.cc.

References Abs(), alpha, GOODCOLL_filter_cfg::cut, timingPdfMaker::mean, N, and edmStreamStallGrapher::t.

Referenced by JetResolution::initialize().

250 {
251  double N =par[0];
252  double mean =par[1];
253  double sigma=par[2];
254  double alpha=par[3];
255  double t =TMath::Abs((v[0]-mean)/sigma);
256  double cut = 1.0;
257  return (t<=cut) ? N*TMath::Exp(-0.5*t*t) : N*TMath::Exp(-0.5*(alpha*(t-cut)+cut*cut));
258 }
float alpha
Definition: AMPTWrapper.h:95
T Abs(T a)
Definition: MathUtil.h:49
#define N
Definition: blowfish.cc:9
double fnc_gaussalpha1alpha2 ( double *  xx,
double *  pp 
)

Definition at line 262 of file JetResolution.cc.

References Abs(), GOODCOLL_filter_cfg::cut, timingPdfMaker::mean, N, and edmStreamStallGrapher::t.

Referenced by JetResolution::initialize().

263 {
264  double N =par[0];
265  double mean =par[1];
266  double sigma =par[2];
267  double alpha1=par[3];
268  double alpha2=par[4];
269  double t =TMath::Abs((v[0]-mean)/sigma);
270  double cut = 1.0;
271  return
272  (t<=cut) ? N*TMath::Exp(-0.5*t*t) :
273  ((v[0]-mean)>=0) ? N*TMath::Exp(-0.5*(alpha1*(t-cut)+cut*cut)) :
274  N*TMath::Exp(-0.5*(alpha2*(t-cut)+cut*cut));
275 }
T Abs(T a)
Definition: MathUtil.h:49
#define N
Definition: blowfish.cc:9