1 |
|
#ifndef FITINFO_H |
2 |
|
#define FITINFO_H |
3 |
|
|
4 |
< |
#include "sampleCollection.h" |
4 |
> |
#include "samples.hpp" |
5 |
|
#include "controlRegions.h" |
6 |
+ |
#include "../plugins/customize.h" |
7 |
+ |
#include "../plugins/setTDRStyle.C" |
8 |
|
#include <iostream> |
9 |
|
#include <TCanvas.h> |
10 |
|
#include <TLine.h> |
11 |
|
#include <TRegexp.h> |
12 |
|
#include <TLegend.h> |
13 |
|
#include <THStack.h> |
12 |
– |
#include "setTDRStyle.C" |
14 |
|
#include <TROOT.h> |
14 |
– |
#include "customize.h" |
15 |
|
#include "TLatex.h" |
16 |
|
#include "TPaveText.h" |
17 |
|
#include "TGraphErrors.h" |
139 |
|
templates.push_back( new RooDataHist((s_region+"_cr_"+fixedTemplateNames.at(i)).c_str(),(s_region+"_cr_"+fixedTemplateNames.at(i)).c_str(), RooArgList(*var), cr->histo(fixedTemplateNames.at(i) ))); |
140 |
|
if(!SF) tr_vars.push_back( new RooRealVar(("tr_"+s_region+"_cr_"+fixedTemplateNames.at(i)).c_str(),("tr_"+s_region+"_cr_"+fixedTemplateNames.at(i)).c_str(), cr->count(fixedTemplateNames.at(i))/cr_signal->count(fixedTemplateNames.at(i))) ); |
141 |
|
else tr_vars.push_back( new RooRealVar(("tr_"+s_region+"_cr_"+fixedTemplateNames.at(i)).c_str(),("tr_"+s_region+"_cr_"+fixedTemplateNames.at(i)).c_str(), cr->count(fixedTemplateNames.at(i)) ) ); |
142 |
– |
//tr_vars.push_back( new RooRealVar(("tr_"+s_region+"cr_"+fixedTemplateNames.at(i)).c_str(),("tr_"+s_region+"cr_"+fixedTemplateNames.at(i)).c_str(), cr->count(fixedTemplateNames.at(i)) ) ); |
142 |
|
fit_vars.push_back( new RooFormulaVar(("fit_"+s_region+"_cr_"+fixedTemplateNames.at(i)).c_str(),("fit_"+s_region+"_cr_"+fixedTemplateNames.at(i)).c_str(),"@0*@1", RooArgList(*f_vars.at(i),*tr_vars.at(i) ) ) ); |
143 |
|
pdfs.push_back( new RooHistPdf( ("pdf_"+fixedTemplateNames.at(i)+"_"+s_region+"_cr_"+fixedTemplateNames.at(i)).c_str(),("pdf_"+fixedTemplateNames.at(i)+"_"+s_region+"_cr_"+fixedTemplateNames.at(i)).c_str(), RooArgList(*var), *templates.at(i) ) ); |
144 |
+ |
|
145 |
|
pdfList->addOwned(*pdfs.at(i)); |
146 |
|
varList->addOwned(*fit_vars.at(i)); |
147 |
|
} |
152 |
|
templates.push_back( new RooDataHist((s_region+"_cr_"+templateNames.at(i)).c_str(),(s_region+"_cr_"+templateNames.at(i)).c_str(), RooArgList(*var), cr->histo(templateNames.at(i)))); |
153 |
|
if(!SF) tr_vars.push_back( new RooRealVar(("tr_"+s_region+"_cr_"+templateNames.at(i)).c_str(),("tr_"+s_region+"_cr_"+templateNames.at(i)).c_str(), cr->count(templateNames.at(i))/cr_signal->count(templateNames.at(i))) ); |
154 |
|
else tr_vars.push_back( new RooRealVar(("tr_"+s_region+"_cr_"+templateNames.at(i)).c_str(),("tr_"+s_region+"_cr_"+templateNames.at(i)).c_str(), cr->count(templateNames.at(i)) ) ); |
155 |
– |
//tr_vars.push_back( new RooRealVar(("tr_"+s_region+"_cr_"+templateNames.at(i)).c_str(),("tr_"+s_region+"cr_"+templateNames.at(i)).c_str(), cr->count(templateNames.at(i)) ) ); |
155 |
|
fit_vars.push_back( new RooFormulaVar(("fit_"+s_region+"_cr_"+templateNames.at(i)).c_str(),("fit_"+s_region+"_cr_"+templateNames.at(i)).c_str(),"@0*@1", RooArgList(*f_vars.at(j),*tr_vars.at(j) ) ) ); |
156 |
|
pdfs.push_back( new RooHistPdf( ("pdf_"+templateNames.at(i)+"_"+s_region+"_cr_"+templateNames.at(i)).c_str(),("pdf_"+templateNames.at(i)+"_"+s_region+"_cr_"+templateNames.at(i)).c_str(), RooArgList(*var), *templates.at(j) ) ); |
157 |
+ |
|
158 |
|
pdfList->addOwned(*pdfs.at(j)); |
159 |
|
varList->addOwned(*fit_vars.at(j)); |
160 |
|
} |
161 |
|
|
162 |
|
pdfList->Print(); |
163 |
|
varList->Print(); |
164 |
< |
model = new RooAddPdf( ("model_"+s_region+s_var).c_str(),("model_"+s_region+s_var).c_str(), *pdfList, *varList, kFALSE ); |
164 |
> |
model = new RooAddPdf( ("model_"+s_region+s_var+s_suffix).c_str(),("model_"+s_region+s_var+s_suffix).c_str(), *pdfList, *varList, kFALSE ); |
165 |
|
} |
166 |
|
|
167 |
|
|