1 |
sixie |
1.1 |
#include "RooAbsPdf.h"
|
2 |
|
|
#include "RooAddPdf.h"
|
3 |
|
|
#include "RooRealVar.h"
|
4 |
|
|
#include "RooExponential.h"
|
5 |
|
|
#include "RooCMSShape.h"
|
6 |
|
|
|
7 |
|
|
class CBackgroundModel
|
8 |
|
|
{
|
9 |
|
|
public:
|
10 |
|
|
CBackgroundModel():model(0){}
|
11 |
|
|
virtual ~CBackgroundModel() { delete model; }
|
12 |
|
|
RooAbsPdf *model;
|
13 |
|
|
};
|
14 |
|
|
|
15 |
|
|
class CExponential : public CBackgroundModel
|
16 |
|
|
{
|
17 |
|
|
public:
|
18 |
|
|
CExponential(RooRealVar &m, const Bool_t pass);
|
19 |
|
|
~CExponential();
|
20 |
|
|
RooRealVar *t;
|
21 |
|
|
};
|
22 |
|
|
|
23 |
|
|
class CErfExpo : public CBackgroundModel
|
24 |
|
|
{
|
25 |
|
|
public:
|
26 |
|
|
CErfExpo(RooRealVar &m, const Bool_t pass);
|
27 |
|
|
~CErfExpo();
|
28 |
|
|
RooRealVar *alfa, *beta, *gamma, *peak;
|
29 |
|
|
};
|
30 |
|
|
|
31 |
|
|
class CDoubleExp : public CBackgroundModel
|
32 |
|
|
{
|
33 |
|
|
public:
|
34 |
|
|
CDoubleExp(RooRealVar &m, const Bool_t pass);
|
35 |
|
|
~CDoubleExp();
|
36 |
|
|
RooExponential *exp1, *exp2;
|
37 |
|
|
RooRealVar *t1, *t2, *frac;
|
38 |
|
|
};
|
39 |
|
|
|
40 |
|
|
//--------------------------------------------------------------------------------------------------
|
41 |
|
|
CExponential::CExponential(RooRealVar &m, const Bool_t pass)
|
42 |
|
|
{
|
43 |
|
|
char name[10];
|
44 |
|
|
if(pass) sprintf(name,"%s","Pass");
|
45 |
|
|
else sprintf(name,"%s","Fail");
|
46 |
|
|
|
47 |
|
|
char vname[50];
|
48 |
|
|
|
49 |
|
|
sprintf(vname,"t%s",name);
|
50 |
|
|
if(pass)
|
51 |
|
|
t = new RooRealVar(vname,vname,-0.1,-1.,0.);
|
52 |
|
|
else
|
53 |
|
|
t = new RooRealVar(vname,vname,-0.1,-1.,0.);
|
54 |
|
|
|
55 |
|
|
sprintf(vname,"background%s",name);
|
56 |
|
|
model = new RooExponential(vname,vname,m,*t);
|
57 |
|
|
}
|
58 |
|
|
|
59 |
|
|
CExponential::~CExponential()
|
60 |
|
|
{
|
61 |
|
|
delete t;
|
62 |
|
|
}
|
63 |
|
|
|
64 |
|
|
//--------------------------------------------------------------------------------------------------
|
65 |
|
|
CErfExpo::CErfExpo(RooRealVar &m, const Bool_t pass)
|
66 |
|
|
{
|
67 |
|
|
char name[10];
|
68 |
|
|
if(pass) sprintf(name,"%s","Pass");
|
69 |
|
|
else sprintf(name,"%s","Fail");
|
70 |
|
|
|
71 |
|
|
char vname[50];
|
72 |
|
|
|
73 |
|
|
if(pass) {
|
74 |
|
|
sprintf(vname,"alfa%s",name); alfa = new RooRealVar(vname,vname,50,5,200);
|
75 |
|
|
sprintf(vname,"beta%s",name); beta = new RooRealVar(vname,vname,0.01,0,10);
|
76 |
|
|
sprintf(vname,"gamma%s",name); gamma = new RooRealVar(vname,vname,0.1,0,1);
|
77 |
|
|
} else {
|
78 |
|
|
sprintf(vname,"alfa%s",name); alfa = new RooRealVar(vname,vname,50,5,200);
|
79 |
|
|
sprintf(vname,"beta%s",name); beta = new RooRealVar(vname,vname,0.01,0,10);
|
80 |
|
|
sprintf(vname,"gamma%s",name); gamma = new RooRealVar(vname,vname,0.1,0,1);
|
81 |
|
|
}
|
82 |
|
|
|
83 |
|
|
sprintf(vname,"peak%s",name);
|
84 |
|
|
peak = new RooRealVar(vname,vname,91.1876,85,97);
|
85 |
|
|
peak->setVal(91.1876);
|
86 |
|
|
peak->setConstant(kTRUE);
|
87 |
|
|
|
88 |
|
|
sprintf(vname,"background%s",name);
|
89 |
|
|
model = new RooCMSShape(vname,vname,m,*alfa,*beta,*gamma,*peak);
|
90 |
|
|
}
|
91 |
|
|
|
92 |
|
|
CErfExpo::~CErfExpo()
|
93 |
|
|
{
|
94 |
|
|
delete alfa;
|
95 |
|
|
delete beta;
|
96 |
|
|
delete gamma;
|
97 |
|
|
delete peak;
|
98 |
|
|
}
|
99 |
|
|
|
100 |
|
|
//--------------------------------------------------------------------------------------------------
|
101 |
|
|
CDoubleExp::CDoubleExp(RooRealVar &m, const Bool_t pass)
|
102 |
|
|
{
|
103 |
|
|
char name[10];
|
104 |
|
|
if(pass) sprintf(name,"%s","Pass");
|
105 |
|
|
else sprintf(name,"%s","Fail");
|
106 |
|
|
|
107 |
|
|
char vname[50];
|
108 |
|
|
|
109 |
|
|
if(pass) {
|
110 |
|
|
sprintf(vname,"t1%s",name); t1 = new RooRealVar(vname,vname,-0.20,-1.,0.);
|
111 |
|
|
sprintf(vname,"t2%s",name); t2 = new RooRealVar(vname,vname,-0.05,-1.,0.);
|
112 |
|
|
sprintf(vname,"frac%s",name); frac = new RooRealVar(vname,vname, 0.50, 0.,1.);
|
113 |
|
|
} else {
|
114 |
|
|
sprintf(vname,"t1%s",name); t1 = new RooRealVar(vname,vname,-0.20,-1.,0.);
|
115 |
|
|
sprintf(vname,"t2%s",name); t2 = new RooRealVar(vname,vname,-0.05,-1.,0.);
|
116 |
|
|
sprintf(vname,"frac%s",name); frac = new RooRealVar(vname,vname, 0.50, 0.,1.);
|
117 |
|
|
}
|
118 |
|
|
|
119 |
|
|
sprintf(vname,"exp1%s",name);
|
120 |
|
|
exp1 = new RooExponential(vname,vname,m,*t1);
|
121 |
|
|
sprintf(vname,"exp2%s",name);
|
122 |
|
|
exp2 = new RooExponential(vname,vname,m,*t2);
|
123 |
|
|
sprintf(vname,"background%s",name);
|
124 |
|
|
model = new RooAddPdf(vname,vname,RooArgList(*exp1,*exp2),RooArgList(*frac));
|
125 |
|
|
}
|
126 |
|
|
|
127 |
|
|
CDoubleExp::~CDoubleExp()
|
128 |
|
|
{
|
129 |
|
|
delete exp1;
|
130 |
|
|
delete exp2;
|
131 |
|
|
delete t1;
|
132 |
|
|
delete t2;
|
133 |
|
|
delete frac;
|
134 |
|
|
}
|