Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:24:12

0001 /*****************************************************************************
0002  * Project: CMS detector at the CERN
0003  *
0004  * Package: PhysicsTools/TagAndProbe/RooCMSShape
0005  *
0006  *
0007  * Authors:
0008  *   Nadia Adam, Princeton - neadam@princeton.edu
0009  *   Adam Hunt, Princeton  - ahunt@princeton.edu
0010  *   Kalanand Mishra, Fermilab - kalanand@fnal.gov
0011  *
0012  * Description:
0013  *   Defines a probability density function which has exponential decay 
0014  *   distribution at high mass beyond the pole position (say, Z peak)  
0015  *   but turns over (i.e., error function) at low mass due to threshold 
0016  *   effect. We use this to model the background shape in Z->ll invariant 
0017  *   mass.
0018  * History:
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   // ENTER EXPRESSION IN TERMS OF VARIABLE ARGUMENTS HERE
0051 
0052   //Double_t erf = TMath::Erfc((alpha - x) * beta);
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);  //exponential decay
0062   return erf * u;
0063 }