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 <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 185 of file JetResolution.cc.

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

Referenced by JetResolution::initialize().

186 {
187  double x = xx[0];
188  double N = pp[0];
189  double mu = pp[1];
190  double sig = pp[2];
191  double a1 = pp[3];
192  double p1 = pp[4];
193  double a2 = pp[5];
194  double p2 = pp[6];
195 
196  double u = (x-mu)/sig;
197  double A1 = TMath::Power(p1/TMath::Abs(a1),p1)*TMath::Exp(-a1*a1/2);
198  double A2 = TMath::Power(p2/TMath::Abs(a2),p2)*TMath::Exp(-a2*a2/2);
199  double B1 = p1/TMath::Abs(a1) - TMath::Abs(a1);
200  double B2 = p2/TMath::Abs(a2) - TMath::Abs(a2);
201 
202  double result(N);
203  if (u<-a1) result *= A1*TMath::Power(B1-u,-p1);
204  else if (u<a2) result *= TMath::Exp(-u*u/2);
205  else result *= A2*TMath::Power(B2+u,-p2);
206  return result;
207 }
tuple pp
Definition: createTree.py:15
tuple result
Definition: query.py:137
const int mu
Definition: Constants.h:23
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 211 of file JetResolution.cc.

References alpha, GOODCOLL_filter_cfg::cut, timingPdfMaker::mean, N, and lumiQTWidget::t.

Referenced by JetResolution::initialize().

212 {
213  double N =par[0];
214  double mean =par[1];
215  double sigma=par[2];
216  double alpha=par[3];
217  double t =TMath::Abs((v[0]-mean)/sigma);
218  double cut = 1.0;
219  return (t<=cut) ? N*TMath::Exp(-0.5*t*t) : N*TMath::Exp(-0.5*(alpha*(t-cut)+cut*cut));
220 }
float alpha
Definition: AMPTWrapper.h:95
#define N
Definition: blowfish.cc:9
mathSSE::Vec4< T > v
double fnc_gaussalpha1alpha2 ( double *  xx,
double *  pp 
)

Definition at line 224 of file JetResolution.cc.

References GOODCOLL_filter_cfg::cut, timingPdfMaker::mean, N, and lumiQTWidget::t.

Referenced by JetResolution::initialize().

225 {
226  double N =par[0];
227  double mean =par[1];
228  double sigma =par[2];
229  double alpha1=par[3];
230  double alpha2=par[4];
231  double t =TMath::Abs((v[0]-mean)/sigma);
232  double cut = 1.0;
233  return
234  (t<=cut) ? N*TMath::Exp(-0.5*t*t) :
235  ((v[0]-mean)>=0) ? N*TMath::Exp(-0.5*(alpha1*(t-cut)+cut*cut)) :
236  N*TMath::Exp(-0.5*(alpha2*(t-cut)+cut*cut));
237 }
#define N
Definition: blowfish.cc:9
mathSSE::Vec4< T > v