ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitHzz4l/Efficiency/src/RooCMSShape.cc
Revision: 1.1
Committed: Tue Jun 12 21:31:44 2012 UTC (12 years, 11 months ago) by dkralph
Content type: text/plain
Branch: MAIN
CVS Tags: compiled, HEAD
Log Message:
First commit: A tag and probe selector for id, iso, or trigger efficiencies and a port of Kevin's fitting code.

File Contents

# User Rev Content
1 dkralph 1.1 /*****************************************************************************
2     * Project: CMS detector at the CERN
3     *
4     * Package: PhysicsTools/TagAndProbe/RooCMSShape
5     *
6     *
7     * Authors:
8     * Nadia Adam, Princeton - neadam@princeton.edu
9     * Adam Hunt, Princeton - ahunt@princeton.edu
10     * Kalanand Mishra, Fermilab - kalanand@fnal.gov
11     *
12     * Description:
13     * Defines a probability density function which has exponential decay
14     * distribution at high mass beyond the pole position (say, Z peak)
15     * but turns over (i.e., error function) at low mass due to threshold
16     * effect. We use this to model the background shape in Z->ll invariant
17     * mass.
18     * History:
19     *
20     *
21     * Copyright (C) 2008 FNAL
22     *****************************************************************************/
23    
24     #include "RooCMSShape.h"
25    
26     RooCMSShape::RooCMSShape(const char *name, const char *title,
27     RooAbsReal& _x,
28     RooAbsReal& _alpha,
29     RooAbsReal& _beta,
30     RooAbsReal& _gamma,
31     RooAbsReal& _peak) :
32     RooAbsPdf(name,title),
33     x("x","x",this,_x),
34     alpha("alpha","alpha",this,_alpha),
35     beta("beta","beta",this,_beta),
36     gamma("gamma","gamma",this,_gamma),
37     peak("peak","peak",this,_peak)
38     { }
39    
40    
41     RooCMSShape::RooCMSShape(const RooCMSShape& other, const char* name):
42     RooAbsPdf(other,name),
43     x("x",this,other.x),
44     alpha("alpha",this,other.alpha),
45     beta("beta",this,other.beta),
46     gamma("gamma",this,other.gamma),
47     peak("peak",this,other.peak)
48     { }
49    
50    
51    
52     Double_t RooCMSShape::evaluate() const
53     {
54     // ENTER EXPRESSION IN TERMS OF VARIABLE ARGUMENTS HERE
55    
56     //Double_t erf = TMath::Erfc((alpha - x) * beta);
57     Double_t erf = RooMath::erfc((alpha - x) * beta);
58     Double_t u = (x - peak)*gamma;
59    
60     if(u < -70) u = 1e20;
61     else if( u>70 ) u = 0;
62     else u = exp(-u); //exponential decay
63     return erf*u;
64     }