CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch2/src/PhysicsTools/TagAndProbe/src/RooCMSShape.cc

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * Project: CMS detector at the CERN
00003  *
00004  * Package: PhysicsTools/TagAndProbe/RooCMSShape
00005  *
00006  *
00007  * Authors:
00008  *   Nadia Adam, Princeton - neadam@princeton.edu
00009  *   Adam Hunt, Princeton  - ahunt@princeton.edu
00010  *   Kalanand Mishra, Fermilab - kalanand@fnal.gov
00011  *
00012  * Description:
00013  *   Defines a probability density function which has exponential decay 
00014  *   distribution at high mass beyond the pole position (say, Z peak)  
00015  *   but turns over (i.e., error function) at low mass due to threshold 
00016  *   effect. We use this to model the background shape in Z->ll invariant 
00017  *   mass.
00018  * History:
00019  *   
00020  *
00021  * Copyright (C) 2008 FNAL 
00022  *****************************************************************************/
00023 
00024 #include "PhysicsTools/TagAndProbe/interface/RooCMSShape.h"
00025 
00026 ClassImp(RooCMSShape) 
00027 
00028  RooCMSShape::RooCMSShape(const char *name, const char *title, 
00029                         RooAbsReal& _x,
00030                         RooAbsReal& _alpha,
00031                         RooAbsReal& _beta,
00032                         RooAbsReal& _gamma,
00033                         RooAbsReal& _peak) :
00034    RooAbsPdf(name,title), 
00035    x("x","x",this,_x),
00036    alpha("alpha","alpha",this,_alpha),
00037    beta("beta","beta",this,_beta),
00038    gamma("gamma","gamma",this,_gamma),
00039    peak("peak","peak",this,_peak)
00040  { } 
00041 
00042 
00043  RooCMSShape::RooCMSShape(const RooCMSShape& other, const char* name):
00044    RooAbsPdf(other,name), 
00045    x("x",this,other.x),
00046    alpha("alpha",this,other.alpha),
00047    beta("beta",this,other.beta),
00048    gamma("gamma",this,other.gamma),
00049    peak("peak",this,other.peak)
00050  { } 
00051 
00052 
00053 
00054  Double_t RooCMSShape::evaluate() const 
00055  { 
00056   // ENTER EXPRESSION IN TERMS OF VARIABLE ARGUMENTS HERE 
00057 
00058   //Double_t erf = TMath::Erfc((alpha - x) * beta);
00059   Double_t erf = RooMath::erfc((alpha - x) * beta);
00060   Double_t u = (x - peak)*gamma;
00061 
00062   if(u < -70) u = 1e20;
00063   else if( u>70 ) u = 0;
00064   else u = exp(-u);   //exponential decay
00065   return erf*u;
00066  }