4 #include "TDirectory.h" 10 const bool oldAddDir = TH1::AddDirectoryStatus();
11 TH1::AddDirectory(
true);
15 string name(h->GetName());
16 h0 = (TH1*)gDirectory->Get((
name+
"_0").c_str());
17 h1 = (TH1*)gDirectory->Get((
name+
"_1").c_str());
18 h2 = (TH1*)gDirectory->Get((
name+
"_2").c_str());
19 h3 = (TH1*)gDirectory->Get((
name+
"_chi2").c_str());
20 TH1::AddDirectory(oldAddDir);
38 if (!(h1&&me))
throw cms::Exception(
"FitSlicesYTool") <<
"Pointer =0 : h1=" << h1 <<
" me=" << me;
39 if (h1->GetNbinsX()==me->getNbinsX()){
40 for (
int bin=0;
bin!=h1->GetNbinsX();
bin++){
45 throw cms::Exception(
"FitSlicesYTool") <<
"Different number of bins!";
49 if (!(h2&&me))
throw cms::Exception(
"FitSlicesYTool") <<
"Pointer =0 : h1=" << h1 <<
" me=" << me;
50 if (h2->GetNbinsX()==me->getNbinsX()){
51 for (
int bin=0;
bin!=h2->GetNbinsX();
bin++){
56 throw cms::Exception(
"FitSlicesYTool") <<
"Different number of bins!";
60 if (!(h1&&me))
throw cms::Exception(
"FitSlicesYTool") <<
"Pointer =0 : h1=" << h1 <<
" me=" << me;
61 if (h1->GetNbinsX()==me->getNbinsX()){
62 for (
int bin=0;
bin!=h1->GetNbinsX();
bin++){
65 me->setBinError(
bin+1,h1->GetBinError(
bin+1));
68 throw cms::Exception(
"FitSlicesYTool") <<
"Different number of bins!";
72 if (!(h2&&me))
throw cms::Exception(
"FitSlicesYTool") <<
"Pointer =0 : h1=" << h1 <<
" me=" << me;
73 if (h2->GetNbinsX()==me->getNbinsX()){
74 for (
int bin=0;
bin!=h2->GetNbinsX();
bin++){
77 me->setBinError(
bin+1,h2->GetBinError(
bin+1));
80 throw cms::Exception(
"FitSlicesYTool") <<
"Different number of bins!";
void setBinContent(int binx, double content)
set content of bin (1-D)
bin
set the eta bin as selection string.