本文整理汇总了C++中TPaveStats::SetFillColor方法的典型用法代码示例。如果您正苦于以下问题:C++ TPaveStats::SetFillColor方法的具体用法?C++ TPaveStats::SetFillColor怎么用?C++ TPaveStats::SetFillColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TPaveStats
的用法示例。
在下文中一共展示了TPaveStats::SetFillColor方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetStPadPos
TPaveStats* SetStPadPos(TH1* hst,float x1,float x2,float y1,float y2, Int_t stl, Int_t col)
{
TPaveStats* pad = GetStPad(hst);
if (!pad) return 0;
pad->SetX1NDC( x1 );
pad->SetX2NDC( x2 );
pad->SetY1NDC( y1 );
pad->SetY2NDC( y2 );
if (stl>=0) pad->SetFillStyle(stl);
if (col>=0) pad->SetTextColor(col);
pad->SetFillColor(0);
//
gPad->Modified();
return pad;
}
示例2: drawStatBox
// Statistik-Boxen an den Rand der Canvas malen, automatische Größenanpassung
void drawStatBox(TH1D* histo, int& step, int nSteps, double FrameSize, int color = -1, int style = 0){
TPaveStats* statBox = dynamic_cast<TPaveStats*>( histo->GetListOfFunctions()->FindObject("stats") );
double statboxSpacing = FrameSize / nSteps; // gleichmaessiges Aufteilen der Statboxes ueber den Rand
double statboxHeight = 0.1 * statboxSpacing * (9.+1./nSteps);; // 1/10 Abstand, (9/10+Abstand/nSteps) Statbox
if(color == -1) color = step+1;
statBox->SetX1NDC(0.80);
statBox->SetX2NDC(0.99);
statBox->SetY2NDC(0.95-step*statboxSpacing);
statBox->SetY1NDC(0.95-step*statboxSpacing-statboxHeight);
statBox->SetFillColor(color);
statBox->SetFillStyle(style);
statBox->Draw();
step++;
}
示例3: MakeNiceStatBox
void MakeNiceStatBox(TH1* histo){
TObject *statObj;
TPaveStats *stats;
statObj = histo->GetListOfFunctions()->FindObject("stats");
stats= static_cast<TPaveStats*>(statObj);
stats->SetFillColor(10);
stats->SetLineWidth(1);
stats->SetShadowColor(0);
stats->SetTextFont(42);
stats->SetTextSize(0.05);
//stats->SetLineColor(LineColors);
//stats->SetTextColor(LineColors);
stats->SetX1NDC(0.615);
stats->SetY1NDC(0.747);
stats->SetX2NDC(0.979);
stats->SetY2NDC(0.986);
}
示例4: plotSubDetResiduals
//------------------------------------------------------------------------------
void PlotAlignmentValidation::plotSubDetResiduals(bool plotNormHisto,unsigned int subDetId)
{
setNiceStyle();
gStyle->SetOptStat(11111);
gStyle->SetOptFit(0000);
TCanvas *c = new TCanvas("c", "c", 600,600);
c->SetTopMargin(0.15);
TString histoName= "";
if (plotNormHisto) {histoName= "h_NormXprime";}
else histoName= "h_Xprime_";
switch (subDetId){
case 1 : histoName+="TPBBarrel_0";break;
case 2 : histoName+="TPEendcap_1";break;
case 3 : histoName+="TPEendcap_2";break;
case 4 : histoName+="TIBBarrel_0";break;
case 5 : histoName+="TIDEndcap_1";break;
case 6 : histoName+="TIDEndcap_2";break;
case 7 : histoName+="TOBBarrel_3";break;
case 8 : histoName+="TECEndcap_4";break;
case 9 : histoName+="TECEndcap_5";break;
}
int tmpcounter = 0;
TH1 *sumHisto = 0;
for(std::vector<TkOfflineVariables*>::iterator it = sourceList.begin();
it != sourceList.end(); ++it) {
if (tmpcounter == 0 ) {
TFile *f= (*it)->getFile();
sumHisto =(TH1*) f->FindKeyAny(histoName)->ReadObj();//FindObjectAny(histoName.Data());
sumHisto->SetLineColor(tmpcounter+1);
sumHisto->SetLineStyle(tmpcounter+1);
sumHisto->GetFunction("tmp")->SetBit(TF1::kNotDraw);
sumHisto->Draw();
//get statistic box coordinate to plot all boxes one below the other
//gStyle->SetStatY(0.91);
//gStyle->SetStatW(0.15);
//gStyle->SetStatBorderSize(1);
//gStyle->SetStatH(0.10);
tmpcounter++;
} else {
sumHisto = (TH1*) (*it)->getFile()->FindObjectAny(histoName);
sumHisto->SetLineColor(tmpcounter+1);
sumHisto->SetLineStyle(tmpcounter+1);
sumHisto->GetFunction("tmp")->SetBit(TF1::kNotDraw);
//hstack->Add(sumHisto);
c->Update();
tmpcounter++;
}
TObject *statObj = sumHisto->GetListOfFunctions()->FindObject("stats");
if (statObj && statObj->InheritsFrom(TPaveStats::Class())) {
TPaveStats *stats = static_cast<TPaveStats*>(statObj);
stats->SetLineColor(tmpcounter+1);
stats->SetTextColor(tmpcounter+1);
stats->SetFillColor(10);
stats->SetX1NDC(0.91-tmpcounter*0.1);
stats->SetX2NDC(0.15);
stats->SetY1NDC(1);
stats->SetY2NDC(0.10);
sumHisto->Draw("sames");
}
}
//hstack->Draw("nostack");
char PlotName[1000];
sprintf( PlotName, "%s/%s.eps", outputDir.c_str(), histoName.Data() );
c->Print(PlotName);
//delete c;
//c=0;
}
示例5: hw1
int hw1(){
//define landau formula
TF1* myf = new TF1("mylandau",landauf,-3,10,3);
myf->SetParameters(1.0,2,1);
//get ready to initial hist
/*
const int num = 3;
string histvName[num] = {"ld_1e2","ld_1e3","ld_1e4"};
string histvTitle[num] = {"Landau 100 entris","Landau 1000 entris","Landau 10000 entris"};
int histEntries[num] = {100,1000,10000};
//new hist and fill them
TCanvas* canvas = new TCanvas("myc","HW1",800,600);
TMultiGraph* mg = new TMultiGraph();
for(int i = 0;i<num;i++){
TH1F* tmp=new TH1F(histvName[i].c_str(),histvTitle[i].c_str(),100,-3,10);
tmp->FillRandom("mylandau",histEntries[i]);
}
gDirectory->Get(histvName[2])->Draw("e");
gDirectory->Get(histvName[1])->Draw("esame");
gDirectory->Get(histvName[0])->Draw("esame");
*/
TCanvas* canvas = new TCanvas("myc","HW1",800,600);
TH1F* h1 = new TH1F("h1","Landau 100 entries",15,-3,10);
TH1F* h2 = new TH1F("h2","Landau 1000 entries",60,-3,10);
TH1F* h3 = new TH1F("h3","Landau 10000 entries",200,-3,10);
h1->FillRandom("mylandau",100);
h2->FillRandom("mylandau",1000);
h3->FillRandom("mylandau",10000);
h3->GetXaxis()->SetTitle("x");
h3->GetXaxis()->CenterTitle(true);
h3->GetYaxis()->SetTitle("Entries");
h3->GetYaxis()->CenterTitle(true);
h3->SetStats(kFALSE);
TF1* fit3 = new TF1("fit3",landauf,-3,10,3);
fit3->SetParameters(1.0,2,1);
h3->SetMarkerColor(kRed);
h3->SetLineColor(kRed);
fit3->SetLineColor(kRed+2);
h3->Fit("fit3","q","e");
TF1* fit2 = new TF1("fit2",landauf,-3,10,3);
fit2->SetParameters(1.0,2,1);
h2->SetMarkerColor(kBlue);
h2->SetLineColor(kBlue);
fit2->SetLineColor(kBlue+2);
h2->Fit("fit2","q","esame");
TF1* fit1 = new TF1("fit1",landauf,-3,10,3);
fit1->SetParameters(1.0,2,1);
h1->SetMarkerColor(kGreen);
h1->SetLineColor(kGreen);
fit1->SetLineColor(kGreen+2);
h1->Fit("fit1","q","esame");
double h1M = h1->GetMean();
double h1R = h1->GetRMS();
double h1S = h1->GetSkewness();
double h2M = h2->GetMean();
double h2R = h2->GetRMS();
double h2S = h2->GetSkewness();
double h3M = h3->GetMean();
double h3R = h3->GetRMS();
double h3S = h3->GetSkewness();
cout<<setprecision(4);
cout<<"+----+--------+--------+--------+"<<endl;
cout<<"|hist| Mean | RMS |skewness|"<<endl;
cout<<"+----+--------+--------+--------+"<<endl;
cout<<"+ 1 |"<<setw(8)<<h1M<<"|"<<setw(8)<<h1R<<"|"<<setw(8)<<h1S<<"|"<<endl;
cout<<"+----+--------+--------+--------+"<<endl;
cout<<"+ 2 |"<<setw(8)<<h2M<<"|"<<setw(8)<<h2R<<"|"<<setw(8)<<h2S<<"|"<<endl;
cout<<"+----+--------+--------+--------+"<<endl;
cout<<"+ 3 |"<<setw(8)<<h3M<<"|"<<setw(8)<<h3R<<"|"<<setw(8)<<h3S<<"|"<<endl;
cout<<"+----+--------+--------+--------+"<<endl;
TPaveStats *ptstats = new TPaveStats(0.5747126,0.6334746,0.9353448,0.934322,"brNDC");
ptstats->SetName("stats");
ptstats->SetBorderSize(1);
ptstats->SetFillColor(0);
ptstats->SetLineWidth(2);
ptstats->SetTextAlign(12);
ptstats->SetTextFont(132);
ptstats->AddText(" hist Mean RMS skewness ");
ostringstream os;
cout<<setprecision(4);
os<<" 1 "<<setw(8)<<h1M<<" "<<setw(8)<<h1R<<" "<<setw(8)<<h1S<<" ";
ptstats->AddText(os.str().c_str());
os.str(string());
os<<" 2 "<<setw(8)<<h2M<<" "<<setw(8)<<h2R<<" "<<setw(8)<<h2S<<" ";
ptstats->AddText(os.str().c_str());
os.str(string());
os<<" 3 "<<setw(8)<<h3M<<" "<<setw(8)<<h3R<<" "<<setw(8)<<h3S<<" ";
ptstats->AddText(os.str().c_str());
ptstats->SetOptStat(0);
ptstats->SetOptFit(111);
//.........这里部分代码省略.........
示例6: c
void c()
{
//=========Macro generated from canvas: c/
//========= (Wed Jul 15 12:00:01 2015) by ROOT version6.04/00
TCanvas *c = new TCanvas("c", "",241,92,600,502);
c->SetHighLightColor(2);
c->Range(-162.5,793.0968,162.5,5327.128);
c->SetFillColor(0);
c->SetBorderMode(0);
c->SetBorderSize(2);
c->SetFrameBorderMode(0);
c->SetFrameBorderMode(0);
TH1D *hist__1__1 = new TH1D("hist__1__1","Difference in PMT-constructed position and mc-truth start position",100,-130,130);
hist__1__1->SetBinContent(0,12746);
hist__1__1->SetBinContent(1,1411);
hist__1__1->SetBinContent(2,1544);
hist__1__1->SetBinContent(3,1661);
hist__1__1->SetBinContent(4,1683);
hist__1__1->SetBinContent(5,1784);
hist__1__1->SetBinContent(6,2533);
hist__1__1->SetBinContent(7,2615);
hist__1__1->SetBinContent(8,2743);
hist__1__1->SetBinContent(9,2797);
hist__1__1->SetBinContent(10,2647);
hist__1__1->SetBinContent(11,2958);
hist__1__1->SetBinContent(12,3082);
hist__1__1->SetBinContent(13,2971);
hist__1__1->SetBinContent(14,3232);
hist__1__1->SetBinContent(15,3016);
hist__1__1->SetBinContent(16,3336);
hist__1__1->SetBinContent(17,3712);
hist__1__1->SetBinContent(18,3809);
hist__1__1->SetBinContent(19,3902);
hist__1__1->SetBinContent(20,3742);
hist__1__1->SetBinContent(21,3718);
hist__1__1->SetBinContent(22,3825);
hist__1__1->SetBinContent(23,4008);
hist__1__1->SetBinContent(24,3934);
hist__1__1->SetBinContent(25,4167);
hist__1__1->SetBinContent(26,4107);
hist__1__1->SetBinContent(27,4153);
hist__1__1->SetBinContent(28,4438);
hist__1__1->SetBinContent(29,4538);
hist__1__1->SetBinContent(30,4540);
hist__1__1->SetBinContent(31,4452);
hist__1__1->SetBinContent(32,4157);
hist__1__1->SetBinContent(33,4423);
hist__1__1->SetBinContent(34,4408);
hist__1__1->SetBinContent(35,4611);
hist__1__1->SetBinContent(36,4621);
hist__1__1->SetBinContent(37,4339);
hist__1__1->SetBinContent(38,4458);
hist__1__1->SetBinContent(39,4609);
hist__1__1->SetBinContent(40,4519);
hist__1__1->SetBinContent(41,4430);
hist__1__1->SetBinContent(42,4648);
hist__1__1->SetBinContent(43,4358);
hist__1__1->SetBinContent(44,4503);
hist__1__1->SetBinContent(45,4561);
hist__1__1->SetBinContent(46,4632);
hist__1__1->SetBinContent(47,4566);
hist__1__1->SetBinContent(48,4420);
hist__1__1->SetBinContent(49,4395);
hist__1__1->SetBinContent(50,4628);
hist__1__1->SetBinContent(51,4563);
hist__1__1->SetBinContent(52,4471);
hist__1__1->SetBinContent(53,4539);
hist__1__1->SetBinContent(54,4464);
hist__1__1->SetBinContent(55,4581);
hist__1__1->SetBinContent(56,4531);
hist__1__1->SetBinContent(57,4598);
hist__1__1->SetBinContent(58,4456);
hist__1__1->SetBinContent(59,4341);
hist__1__1->SetBinContent(60,4654);
hist__1__1->SetBinContent(61,4672);
hist__1__1->SetBinContent(62,4511);
hist__1__1->SetBinContent(63,4446);
hist__1__1->SetBinContent(64,4356);
hist__1__1->SetBinContent(65,4380);
hist__1__1->SetBinContent(66,4383);
hist__1__1->SetBinContent(67,4469);
hist__1__1->SetBinContent(68,4606);
hist__1__1->SetBinContent(69,4563);
hist__1__1->SetBinContent(70,4413);
hist__1__1->SetBinContent(71,4701);
hist__1__1->SetBinContent(72,4643);
hist__1__1->SetBinContent(73,4427);
hist__1__1->SetBinContent(74,3933);
hist__1__1->SetBinContent(75,3939);
hist__1__1->SetBinContent(76,4093);
hist__1__1->SetBinContent(77,3913);
hist__1__1->SetBinContent(78,4026);
hist__1__1->SetBinContent(79,3843);
hist__1__1->SetBinContent(80,3641);
hist__1__1->SetBinContent(81,3916);
hist__1__1->SetBinContent(82,4042);
hist__1__1->SetBinContent(83,3798);
hist__1__1->SetBinContent(84,3601);
hist__1__1->SetBinContent(85,3249);
//.........这里部分代码省略.........
示例7: plot_PbPb_fit_ratio_eff
void plot_PbPb_fit_ratio_eff()
{
//=========Macro generated from canvas: Fit/Fit on Efficiency Ratio
//========= (Mon Aug 29 17:39:14 2016) by ROOT version6.02/10
TCanvas *Fit = new TCanvas("Fit", "Fit on Efficiency Ratio",0,0,800,500);
gStyle->SetOptFit(1);
Fit->Range(1.625,-0.3125,55.375,2.8125);
Fit->SetFillColor(0);
Fit->SetBorderMode(0);
Fit->SetBorderSize(2);
Fit->SetFrameBorderMode(0);
Fit->SetFrameBorderMode(0);
Double_t xAxis1[6] = {7, 10, 15, 20, 30, 50};
TH1D *PbPb_fit1 = new TH1D("PbPb_fit1","",5, xAxis1);
PbPb_fit1->SetBinContent(1,0.8304669);
PbPb_fit1->SetBinContent(2,0.8392248);
PbPb_fit1->SetBinContent(3,0.8551938);
PbPb_fit1->SetBinContent(4,0.8559738);
PbPb_fit1->SetBinContent(5,0.8749088);
PbPb_fit1->SetBinError(1,0.06688803);
PbPb_fit1->SetBinError(2,0.03626477);
PbPb_fit1->SetBinError(3,0.03301156);
PbPb_fit1->SetBinError(4,0.02217037);
PbPb_fit1->SetBinError(5,0.01963207);
PbPb_fit1->SetMinimum(0);
PbPb_fit1->SetMaximum(2.5);
PbPb_fit1->SetEntries(2335.214);
TF1 *myfit1 = new TF1("myfit","pow(10,[0]+[1]*x+x*x*[2])+pow(10,[3]*x*x+[4]*x*x*x+[5])",2,100);
myfit1->SetFillColor(19);
myfit1->SetFillStyle(0);
myfit1->SetMarkerStyle(20);
myfit1->SetLineColor(2);
myfit1->SetLineWidth(2);
myfit1->SetChisquare(5.134234e-08);
myfit1->SetNDF(0);
myfit1->GetXaxis()->SetLabelFont(42);
myfit1->GetXaxis()->SetLabelSize(0.035);
myfit1->GetXaxis()->SetTitleSize(0.035);
myfit1->GetXaxis()->SetTitleFont(42);
myfit1->GetYaxis()->SetLabelFont(42);
myfit1->GetYaxis()->SetLabelSize(0.035);
myfit1->GetYaxis()->SetTitleSize(0.035);
myfit1->GetYaxis()->SetTitleFont(42);
myfit1->SetParameter(0,-0.1325891);
myfit1->SetParError(0,0.07303413);
myfit1->SetParLimits(0,0,0);
myfit1->SetParameter(1,-0.004821085);
myfit1->SetParError(1,0.00252747);
myfit1->SetParLimits(1,0,0);
myfit1->SetParameter(2,0.0001629026);
myfit1->SetParError(2,6.139007e-05);
myfit1->SetParLimits(2,0,0);
myfit1->SetParameter(3,0.001400688);
myfit1->SetParError(3,0.0009400359);
myfit1->SetParLimits(3,0,0);
myfit1->SetParameter(4,-4.985927e-05);
myfit1->SetParError(4,3.268586e-05);
myfit1->SetParLimits(4,0,0);
myfit1->SetParameter(5,-0.9198558);
myfit1->SetParError(5,0.3015603);
myfit1->SetParLimits(5,0,0);
PbPb_fit1->GetListOfFunctions()->Add(myfit1);
TPaveStats *ptstats = new TPaveStats(0.558,0.6,0.9,0.9,"brNDC");
ptstats->SetName("stats");
ptstats->SetBorderSize(1);
ptstats->SetFillColor(0);
ptstats->SetTextAlign(12);
ptstats->SetTextFont(42);
TText *AText = ptstats->AddText("PbPb_fit");
AText->SetTextSize(0.01971428);
AText = ptstats->AddText("Entries = 2335 ");
AText = ptstats->AddText("Mean = 20.89");
AText = ptstats->AddText("RMS = 11.16");
AText = ptstats->AddText("Underflow = 0");
AText = ptstats->AddText("Overflow = 0");
AText = ptstats->AddText("Integral = 4.256");
AText = ptstats->AddText("#chi^{2} / ndf = 5.134e-08 / 0");
AText = ptstats->AddText("p0 = -0.1326 #pm 0.0730 ");
AText = ptstats->AddText("p1 = -0.004821 #pm 0.002527 ");
AText = ptstats->AddText("p2 = 0.0001629 #pm 0.0000614 ");
AText = ptstats->AddText("p3 = 0.001401 #pm 0.000940 ");
AText = ptstats->AddText("p4 = -4.986e-05 #pm 3.269e-05 ");
AText = ptstats->AddText("p5 = -0.9199 #pm 0.3016 ");
ptstats->SetOptStat(1111111);
ptstats->SetOptFit(111);
ptstats->Draw();
PbPb_fit1->GetListOfFunctions()->Add(ptstats);
ptstats->SetParent(PbPb_fit1);
Int_t ci; // for color index setting
TColor *color; // for color definition with alpha
ci = TColor::GetColor("#000099");
PbPb_fit1->SetLineColor(ci);
PbPb_fit1->SetMarkerStyle(20);
PbPb_fit1->GetXaxis()->SetTitle("Gen p_{T}(GeV)");
PbPb_fit1->GetXaxis()->CenterTitle(true);
PbPb_fit1->GetXaxis()->SetLabelFont(42);
//.........这里部分代码省略.........
示例8: initial_z_diff
void initial_z_diff()
{
//=========Macro generated from canvas: c/
//========= (Fri Jul 24 10:47:18 2015) by ROOT version6.04/00
TCanvas *c = new TCanvas("c", "",0,45,600,500);
c->SetHighLightColor(2);
c->Range(-187.5,-3568.557,187.5,32117.01);
c->SetFillColor(0);
c->SetBorderMode(0);
c->SetBorderSize(2);
c->SetFrameBorderMode(0);
c->SetFrameBorderMode(0);
TH1D *hist__1 = new TH1D("hist__1","Difference in PMT-constructed position and mc-truth start position",100,-150,150);
hist__1->SetBinContent(0,49);
hist__1->SetBinContent(1,12);
hist__1->SetBinContent(2,7);
hist__1->SetBinContent(3,9);
hist__1->SetBinContent(4,12);
hist__1->SetBinContent(5,21);
hist__1->SetBinContent(6,30);
hist__1->SetBinContent(7,36);
hist__1->SetBinContent(8,47);
hist__1->SetBinContent(9,67);
hist__1->SetBinContent(10,70);
hist__1->SetBinContent(11,90);
hist__1->SetBinContent(12,140);
hist__1->SetBinContent(13,162);
hist__1->SetBinContent(14,208);
hist__1->SetBinContent(15,208);
hist__1->SetBinContent(16,317);
hist__1->SetBinContent(17,367);
hist__1->SetBinContent(18,460);
hist__1->SetBinContent(19,581);
hist__1->SetBinContent(20,685);
hist__1->SetBinContent(21,838);
hist__1->SetBinContent(22,963);
hist__1->SetBinContent(23,1079);
hist__1->SetBinContent(24,1231);
hist__1->SetBinContent(25,1281);
hist__1->SetBinContent(26,1264);
hist__1->SetBinContent(27,1318);
hist__1->SetBinContent(28,1318);
hist__1->SetBinContent(29,1265);
hist__1->SetBinContent(30,1282);
hist__1->SetBinContent(31,1235);
hist__1->SetBinContent(32,1315);
hist__1->SetBinContent(33,1290);
hist__1->SetBinContent(34,1399);
hist__1->SetBinContent(35,1363);
hist__1->SetBinContent(36,1528);
hist__1->SetBinContent(37,1700);
hist__1->SetBinContent(38,1822);
hist__1->SetBinContent(39,2053);
hist__1->SetBinContent(40,2441);
hist__1->SetBinContent(41,2903);
hist__1->SetBinContent(42,3359);
hist__1->SetBinContent(43,4326);
hist__1->SetBinContent(44,5618);
hist__1->SetBinContent(45,7284);
hist__1->SetBinContent(46,9575);
hist__1->SetBinContent(47,12857);
hist__1->SetBinContent(48,16804);
hist__1->SetBinContent(49,21562);
hist__1->SetBinContent(50,27189);
hist__1->SetBinContent(51,26947);
hist__1->SetBinContent(52,21828);
hist__1->SetBinContent(53,17254);
hist__1->SetBinContent(54,13388);
hist__1->SetBinContent(55,10171);
hist__1->SetBinContent(56,7452);
hist__1->SetBinContent(57,5752);
hist__1->SetBinContent(58,4452);
hist__1->SetBinContent(59,3522);
hist__1->SetBinContent(60,2826);
hist__1->SetBinContent(61,2449);
hist__1->SetBinContent(62,2170);
hist__1->SetBinContent(63,1855);
hist__1->SetBinContent(64,1635);
hist__1->SetBinContent(65,1515);
hist__1->SetBinContent(66,1393);
hist__1->SetBinContent(67,1344);
hist__1->SetBinContent(68,1279);
hist__1->SetBinContent(69,1232);
hist__1->SetBinContent(70,1248);
hist__1->SetBinContent(71,1277);
hist__1->SetBinContent(72,1226);
hist__1->SetBinContent(73,1247);
hist__1->SetBinContent(74,1229);
hist__1->SetBinContent(75,1187);
hist__1->SetBinContent(76,1265);
hist__1->SetBinContent(77,1253);
hist__1->SetBinContent(78,1269);
hist__1->SetBinContent(79,1210);
hist__1->SetBinContent(80,1055);
hist__1->SetBinContent(81,914);
hist__1->SetBinContent(82,761);
hist__1->SetBinContent(83,632);
hist__1->SetBinContent(84,515);
hist__1->SetBinContent(85,450);
//.........这里部分代码省略.........
示例9: x_dist_cuts
void x_dist_cuts()
{
//=========Macro generated from canvas: c/
//========= (Fri Jul 24 12:08:10 2015) by ROOT version6.04/00
TCanvas *c = new TCanvas("c", "",0,45,600,500);
c->SetHighLightColor(2);
c->Range(-187.5,-2144.494,187.5,19300.44);
c->SetFillColor(0);
c->SetBorderMode(0);
c->SetBorderSize(2);
c->SetFrameBorderMode(0);
c->SetFrameBorderMode(0);
TH1D *hist__1 = new TH1D("hist__1","Worry Later",100,-150,150);
hist__1->SetBinContent(0,37);
hist__1->SetBinContent(1,11);
hist__1->SetBinContent(2,6);
hist__1->SetBinContent(3,9);
hist__1->SetBinContent(4,11);
hist__1->SetBinContent(5,17);
hist__1->SetBinContent(6,29);
hist__1->SetBinContent(7,31);
hist__1->SetBinContent(8,40);
hist__1->SetBinContent(9,65);
hist__1->SetBinContent(10,62);
hist__1->SetBinContent(11,79);
hist__1->SetBinContent(12,132);
hist__1->SetBinContent(13,148);
hist__1->SetBinContent(14,184);
hist__1->SetBinContent(15,187);
hist__1->SetBinContent(16,257);
hist__1->SetBinContent(17,316);
hist__1->SetBinContent(18,354);
hist__1->SetBinContent(19,449);
hist__1->SetBinContent(20,495);
hist__1->SetBinContent(21,568);
hist__1->SetBinContent(22,607);
hist__1->SetBinContent(23,624);
hist__1->SetBinContent(24,686);
hist__1->SetBinContent(25,704);
hist__1->SetBinContent(26,739);
hist__1->SetBinContent(27,738);
hist__1->SetBinContent(28,743);
hist__1->SetBinContent(29,732);
hist__1->SetBinContent(30,730);
hist__1->SetBinContent(31,706);
hist__1->SetBinContent(32,773);
hist__1->SetBinContent(33,716);
hist__1->SetBinContent(34,788);
hist__1->SetBinContent(35,760);
hist__1->SetBinContent(36,900);
hist__1->SetBinContent(37,945);
hist__1->SetBinContent(38,1039);
hist__1->SetBinContent(39,1194);
hist__1->SetBinContent(40,1368);
hist__1->SetBinContent(41,1682);
hist__1->SetBinContent(42,1928);
hist__1->SetBinContent(43,2500);
hist__1->SetBinContent(44,3260);
hist__1->SetBinContent(45,4389);
hist__1->SetBinContent(46,5759);
hist__1->SetBinContent(47,7620);
hist__1->SetBinContent(48,9955);
hist__1->SetBinContent(49,13012);
hist__1->SetBinContent(50,16339);
hist__1->SetBinContent(51,16048);
hist__1->SetBinContent(52,13155);
hist__1->SetBinContent(53,10318);
hist__1->SetBinContent(54,7953);
hist__1->SetBinContent(55,6143);
hist__1->SetBinContent(56,4420);
hist__1->SetBinContent(57,3422);
hist__1->SetBinContent(58,2687);
hist__1->SetBinContent(59,2027);
hist__1->SetBinContent(60,1643);
hist__1->SetBinContent(61,1359);
hist__1->SetBinContent(62,1189);
hist__1->SetBinContent(63,1057);
hist__1->SetBinContent(64,929);
hist__1->SetBinContent(65,840);
hist__1->SetBinContent(66,792);
hist__1->SetBinContent(67,759);
hist__1->SetBinContent(68,719);
hist__1->SetBinContent(69,673);
hist__1->SetBinContent(70,702);
hist__1->SetBinContent(71,769);
hist__1->SetBinContent(72,693);
hist__1->SetBinContent(73,728);
hist__1->SetBinContent(74,719);
hist__1->SetBinContent(75,698);
hist__1->SetBinContent(76,729);
hist__1->SetBinContent(77,695);
hist__1->SetBinContent(78,732);
hist__1->SetBinContent(79,692);
hist__1->SetBinContent(80,620);
hist__1->SetBinContent(81,592);
hist__1->SetBinContent(82,525);
hist__1->SetBinContent(83,463);
hist__1->SetBinContent(84,407);
hist__1->SetBinContent(85,357);
//.........这里部分代码省略.........
示例10: BSA_InCoherent_t
void BSA_InCoherent_t()
{
//=========Macro generated from canvas: c17/Incoherent channe
//========= (Tue Aug 21 12:00:26 2018) by ROOT version6.09/01
TCanvas *c17 = new TCanvas("c17", "Incoherent channe",0,0,1200,400);
gStyle->SetOptFit(1);
c17->Range(0,0,1,1);
c17->SetFillColor(0);
c17->SetBorderMode(0);
c17->SetBorderSize(2);
c17->SetLeftMargin(0.025);
c17->SetRightMargin(0.02325581);
c17->SetFrameBorderMode(0);
// ------------>Primitives in pad: c17_1
TPad *c17_1 = new TPad("c17_1", "Incoherent channe_1",0,0,0.262936,0.9);
c17_1->Draw();
c17_1->cd();
c17_1->Range(-32.86883,-0.4888889,353.6809,0.4);
c17_1->SetFillColor(0);
c17_1->SetBorderMode(0);
c17_1->SetBorderSize(2);
c17_1->SetGridx();
c17_1->SetGridy();
c17_1->SetRightMargin(0);
c17_1->SetTopMargin(0);
c17_1->SetFrameBorderMode(0);
c17_1->SetFrameBorderMode(0);
TMultiGraph *multigraph = new TMultiGraph();
multigraph->SetName("");
multigraph->SetTitle("0.05<-t<0.21 [GeV^{2}/c^{2}]");
Double_t Graph_fx1154[9] = {
21.59954,
59.03178,
96.06391,
141.7703,
179.2242,
222.8541,
259.5793,
303.38,
337.8675};
Double_t Graph_fy1154[9] = {
0.1020231,
0.03114899,
0.2309077,
0.1341245,
0.01684177,
-0.1267998,
-0.2824572,
-0.2260703,
-0.0186068};
Double_t Graph_fex1154[9] = {
0,
0,
0,
0,
0,
0,
0,
0,
0};
Double_t Graph_fey1154[9] = {
0.04242532,
0.05165487,
0.05483741,
0.07646672,
0.1006626,
0.09089962,
0.05905575,
0.04462244,
0.05521722};
TGraphErrors *gre = new TGraphErrors(9,Graph_fx1154,Graph_fy1154,Graph_fex1154,Graph_fey1154);
gre->SetName("Graph");
gre->SetTitle("Graph");
gre->SetFillColor(1);
Int_t ci; // for color index setting
TColor *color; // for color definition with alpha
ci = TColor::GetColor("#00ff00");
gre->SetMarkerColor(ci);
gre->SetMarkerStyle(21);
TH1F *Graph_Graph1154 = new TH1F("Graph_Graph1154","Graph",100,0,369.4943);
Graph_Graph1154->SetMinimum(-0.4042387);
Graph_Graph1154->SetMaximum(0.3484709);
Graph_Graph1154->SetDirectory(0);
Graph_Graph1154->SetStats(0);
ci = TColor::GetColor("#000099");
Graph_Graph1154->SetLineColor(ci);
Graph_Graph1154->GetXaxis()->SetLabelFont(42);
Graph_Graph1154->GetXaxis()->SetLabelSize(0.035);
Graph_Graph1154->GetXaxis()->SetTitleSize(0.035);
Graph_Graph1154->GetXaxis()->SetTitleFont(42);
Graph_Graph1154->GetYaxis()->SetLabelFont(42);
Graph_Graph1154->GetYaxis()->SetLabelSize(0.035);
Graph_Graph1154->GetYaxis()->SetTitleSize(0.035);
Graph_Graph1154->GetYaxis()->SetTitleFont(42);
//.........这里部分代码省略.........
示例11: BSA_InCoherent_xB
void BSA_InCoherent_xB()
{
//=========Macro generated from canvas: c16/Incoherent channe
//========= (Tue Aug 21 12:00:25 2018) by ROOT version6.09/01
TCanvas *c16 = new TCanvas("c16", "Incoherent channe",0,0,1200,400);
gStyle->SetOptFit(1);
c16->Range(0,0,1,1);
c16->SetFillColor(0);
c16->SetBorderMode(0);
c16->SetBorderSize(2);
c16->SetLeftMargin(0.025);
c16->SetRightMargin(0.02325581);
c16->SetFrameBorderMode(0);
// ------------>Primitives in pad: c16_1
TPad *c16_1 = new TPad("c16_1", "Incoherent channe_1",0,0,0.262936,0.9);
c16_1->Draw();
c16_1->cd();
c16_1->Range(-29.34641,-0.4888889,350.2581,0.4);
c16_1->SetFillColor(0);
c16_1->SetBorderMode(0);
c16_1->SetBorderSize(2);
c16_1->SetGridx();
c16_1->SetGridy();
c16_1->SetRightMargin(0);
c16_1->SetTopMargin(0);
c16_1->SetFrameBorderMode(0);
c16_1->SetFrameBorderMode(0);
TMultiGraph *multigraph = new TMultiGraph();
multigraph->SetName("");
multigraph->SetTitle("0.12<x_{B}<0.21 ");
Double_t Graph_fx1134[9] = {
24.14331,
62.70082,
96.14623,
141.7289,
180.8857,
220.5862,
258.7856,
303.3336,
334.7288};
Double_t Graph_fy1134[9] = {
0.1330996,
-0.03883743,
0.1388413,
0.2120595,
0.03749243,
-0.09129921,
-0.1273289,
-0.1643618,
0.03103783};
Double_t Graph_fex1134[9] = {
0,
0,
0,
0,
0,
0,
0,
0,
0};
Double_t Graph_fey1134[9] = {
0.07077824,
0.06445297,
0.05939535,
0.06833722,
0.08559024,
0.08401363,
0.06136237,
0.05845869,
0.08718727};
TGraphErrors *gre = new TGraphErrors(9,Graph_fx1134,Graph_fy1134,Graph_fex1134,Graph_fey1134);
gre->SetName("Graph");
gre->SetTitle("Graph");
gre->SetFillColor(1);
Int_t ci; // for color index setting
TColor *color; // for color definition with alpha
ci = TColor::GetColor("#00ff00");
gre->SetMarkerColor(ci);
gre->SetMarkerStyle(21);
TH1F *Graph_Graph1134 = new TH1F("Graph_Graph1134","Graph",100,0,365.7873);
Graph_Graph1134->SetMinimum(-0.2731422);
Graph_Graph1134->SetMaximum(0.3307184);
Graph_Graph1134->SetDirectory(0);
Graph_Graph1134->SetStats(0);
ci = TColor::GetColor("#000099");
Graph_Graph1134->SetLineColor(ci);
Graph_Graph1134->GetXaxis()->SetLabelFont(42);
Graph_Graph1134->GetXaxis()->SetLabelSize(0.035);
Graph_Graph1134->GetXaxis()->SetTitleSize(0.035);
Graph_Graph1134->GetXaxis()->SetTitleFont(42);
Graph_Graph1134->GetYaxis()->SetLabelFont(42);
Graph_Graph1134->GetYaxis()->SetLabelSize(0.035);
Graph_Graph1134->GetYaxis()->SetTitleSize(0.035);
Graph_Graph1134->GetYaxis()->SetTitleFont(42);
//.........这里部分代码省略.........
示例12: TCanvas
void yz-plane-length()
{
//=========Macro generated from canvas: c/
//========= (Tue Jul 28 19:55:12 2015) by ROOT version6.04/00
TCanvas *c = new TCanvas("c", "",0,45,600,500);
c->SetHighLightColor(2);
c->Range(-187.5,-2928.319,187.5,26354.87);
c->SetFillColor(0);
c->SetBorderMode(0);
c->SetBorderSize(2);
c->SetFrameBorderMode(0);
c->SetFrameBorderMode(0);
TH1D *hist__1 = new TH1D("hist__1","Worry Later",100,-150,150);
hist__1->SetBinContent(0,14);
hist__1->SetBinContent(1,1);
hist__1->SetBinContent(3,1);
hist__1->SetBinContent(4,2);
hist__1->SetBinContent(5,4);
hist__1->SetBinContent(6,4);
hist__1->SetBinContent(7,9);
hist__1->SetBinContent(8,20);
hist__1->SetBinContent(9,20);
hist__1->SetBinContent(10,19);
hist__1->SetBinContent(11,21);
hist__1->SetBinContent(12,41);
hist__1->SetBinContent(13,42);
hist__1->SetBinContent(14,72);
hist__1->SetBinContent(15,82);
hist__1->SetBinContent(16,124);
hist__1->SetBinContent(17,144);
hist__1->SetBinContent(18,204);
hist__1->SetBinContent(19,254);
hist__1->SetBinContent(20,298);
hist__1->SetBinContent(21,353);
hist__1->SetBinContent(22,426);
hist__1->SetBinContent(23,534);
hist__1->SetBinContent(24,636);
hist__1->SetBinContent(25,718);
hist__1->SetBinContent(26,800);
hist__1->SetBinContent(27,817);
hist__1->SetBinContent(28,856);
hist__1->SetBinContent(29,901);
hist__1->SetBinContent(30,928);
hist__1->SetBinContent(31,930);
hist__1->SetBinContent(32,1032);
hist__1->SetBinContent(33,1025);
hist__1->SetBinContent(34,1121);
hist__1->SetBinContent(35,1070);
hist__1->SetBinContent(36,1200);
hist__1->SetBinContent(37,1355);
hist__1->SetBinContent(38,1453);
hist__1->SetBinContent(39,1633);
hist__1->SetBinContent(40,1926);
hist__1->SetBinContent(41,2337);
hist__1->SetBinContent(42,2676);
hist__1->SetBinContent(43,3487);
hist__1->SetBinContent(44,4580);
hist__1->SetBinContent(45,5833);
hist__1->SetBinContent(46,7742);
hist__1->SetBinContent(47,10511);
hist__1->SetBinContent(48,13797);
hist__1->SetBinContent(49,17765);
hist__1->SetBinContent(50,22311);
hist__1->SetBinContent(51,22160);
hist__1->SetBinContent(52,17962);
hist__1->SetBinContent(53,14130);
hist__1->SetBinContent(54,10947);
hist__1->SetBinContent(55,8303);
hist__1->SetBinContent(56,6081);
hist__1->SetBinContent(57,4643);
hist__1->SetBinContent(58,3602);
hist__1->SetBinContent(59,2825);
hist__1->SetBinContent(60,2235);
hist__1->SetBinContent(61,1955);
hist__1->SetBinContent(62,1716);
hist__1->SetBinContent(63,1461);
hist__1->SetBinContent(64,1266);
hist__1->SetBinContent(65,1191);
hist__1->SetBinContent(66,1098);
hist__1->SetBinContent(67,1054);
hist__1->SetBinContent(68,999);
hist__1->SetBinContent(69,957);
hist__1->SetBinContent(70,982);
hist__1->SetBinContent(71,980);
hist__1->SetBinContent(72,932);
hist__1->SetBinContent(73,910);
hist__1->SetBinContent(74,873);
hist__1->SetBinContent(75,812);
hist__1->SetBinContent(76,785);
hist__1->SetBinContent(77,748);
hist__1->SetBinContent(78,649);
hist__1->SetBinContent(79,593);
hist__1->SetBinContent(80,459);
hist__1->SetBinContent(81,400);
hist__1->SetBinContent(82,321);
hist__1->SetBinContent(83,244);
hist__1->SetBinContent(84,198);
hist__1->SetBinContent(85,180);
hist__1->SetBinContent(86,147);
//.........这里部分代码省略.........
示例13: QCDHT_cutflow_weighted
void QCDHT_cutflow_weighted()
{
//=========Macro generated from canvas: c1/c1
//========= (Wed Feb 24 17:48:49 2016) by ROOT version6.02/05
TCanvas *c1 = new TCanvas("c1", "c1",65,52,700,500);
c1->Range(-1.25,-2351156,16.25,2.11604e+07);
c1->SetFillColor(0);
c1->SetBorderMode(0);
c1->SetBorderSize(2);
c1->SetFrameBorderMode(0);
c1->SetFrameBorderMode(0);
TH1D *cutflow1 = new TH1D("cutflow1","cut flow",14,0.5,14.5);
cutflow1->SetBinContent(1,1.791357e+07);
cutflow1->SetBinContent(2,1.791357e+07);
cutflow1->SetBinContent(3,1.482016e+07);
cutflow1->SetBinContent(4,1.397007e+07);
cutflow1->SetBinContent(5,8159947);
cutflow1->SetBinContent(6,1368453);
cutflow1->SetBinContent(7,12035.83);
cutflow1->SetBinContent(8,10653.79);
cutflow1->SetBinContent(9,4100.401);
cutflow1->SetBinContent(10,4323.004);
cutflow1->SetBinContent(11,1820.803);
cutflow1->SetBinContent(12,374.2397);
cutflow1->SetBinContent(13,35.33991);
cutflow1->SetBinContent(14,214.6597);
cutflow1->SetEntries(1.137194e+08);
TPaveStats *ptstats = new TPaveStats(0.78,0.775,0.98,0.935,"brNDC");
ptstats->SetName("stats");
ptstats->SetBorderSize(1);
ptstats->SetFillColor(0);
ptstats->SetTextAlign(12);
ptstats->SetTextFont(42);
TText *AText = ptstats->AddText("cutflow");
AText->SetTextSize(0.0368);
AText = ptstats->AddText("Entries = 1.137194e+08");
AText = ptstats->AddText("Mean = 0");
AText = ptstats->AddText("RMS = 0");
ptstats->SetOptStat(1111);
ptstats->SetOptFit(0);
ptstats->Draw();
cutflow1->GetListOfFunctions()->Add(ptstats);
ptstats->SetParent(cutflow1);
Int_t ci; // for color index setting
TColor *color; // for color definition with alpha
ci = TColor::GetColor("#000099");
cutflow1->SetLineColor(ci);
cutflow1->GetXaxis()->SetBinLabel(1,"All");
cutflow1->GetXaxis()->SetBinLabel(2,"Trigger");
cutflow1->GetXaxis()->SetBinLabel(3,"p_{T}");
cutflow1->GetXaxis()->SetBinLabel(4,"|#eta|");
cutflow1->GetXaxis()->SetBinLabel(5,"|#Delta#eta|");
cutflow1->GetXaxis()->SetBinLabel(6,"M(jet_{0},jet(1))");
cutflow1->GetXaxis()->SetBinLabel(7,"M(jets)");
cutflow1->GetXaxis()->SetBinLabel(8,"#tau_{21}");
cutflow1->GetXaxis()->SetBinLabel(9,"0b");
cutflow1->GetXaxis()->SetBinLabel(10,"1b");
cutflow1->GetXaxis()->SetBinLabel(11,"2b");
cutflow1->GetXaxis()->SetBinLabel(12,"3b");
cutflow1->GetXaxis()->SetBinLabel(13,"4b");
cutflow1->GetXaxis()->SetBinLabel(14,"3b+HPHP");
cutflow1->GetXaxis()->SetLabelFont(42);
cutflow1->GetXaxis()->SetLabelSize(0.035);
cutflow1->GetXaxis()->SetTitleSize(0.035);
cutflow1->GetXaxis()->SetTitleFont(42);
cutflow1->GetYaxis()->SetLabelFont(42);
cutflow1->GetYaxis()->SetLabelSize(0.035);
cutflow1->GetYaxis()->SetTitleSize(0.035);
cutflow1->GetYaxis()->SetTitleFont(42);
cutflow1->GetZaxis()->SetLabelFont(42);
cutflow1->GetZaxis()->SetLabelSize(0.035);
cutflow1->GetZaxis()->SetTitleSize(0.035);
cutflow1->GetZaxis()->SetTitleFont(42);
cutflow1->Draw("");
TPaveText *pt = new TPaveText(0.4246264,0.94,0.5753736,0.995,"blNDC");
pt->SetName("title");
pt->SetBorderSize(0);
pt->SetFillColor(0);
pt->SetFillStyle(0);
pt->SetTextFont(42);
AText = pt->AddText("cut flow");
pt->Draw();
c1->Modified();
c1->cd();
c1->SetSelected(c1);
}
示例14: plot
// -----------------------------------------------------------------------------
// Create plots
void plot( std::string& path,
std::string& type,
std::string& sample,
std::string& dir,
std::string& histo,
double lumi,
bool scale ) {
std::string canvas_name = histo + "_" + dir + "_" + type + "_" + sample;
// Create canvas
TCanvas* canvas = new TCanvas(canvas_name.c_str(),"");
canvas->SetFillColor(0);
canvas->SetFrameBorderMode(0);
canvas->SetFrameFillColor(0);
canvas->SetTopMargin(0.10);
canvas->SetBottomMargin(0.12);
canvas->SetLeftMargin(0.12);
canvas->SetRightMargin(0.15);
// Retrieve histogram
std::string file_name = path + type + "_" + sample + ".root";
TFile* f = new TFile(file_name.c_str(),"READ");
TDirectory* d = (TDirectory*)f->Get(dir.c_str());
TH2D* his = (TH1*)d->Get(histo.c_str());
if ( !his ) return;
//his->Rebin2D(2,2);
if ( true ) { gPad->SetLogz(); }
if ( scale ) his->Scale( lumi / 100. );
his->SetMaximum(1.e4);
his->SetMinimum(1.e-5);
//his->SetMinimum( his->GetMinimum(1.e-12) );
// his->SetMaximum( 20000. );
// his->SetMinimum( 2.e-4 );
// his->SetMaximum( 20000. );
// his->SetMinimum( 20. );
double xmin = his->GetXaxis()->GetXmin();
double xmax = his->GetXaxis()->GetXmax();
double ymin = his->GetYaxis()->GetXmin();
double ymax = his->GetYaxis()->GetXmax();
// Reset title
std::string title = ";" + std::string(his->GetXaxis()->GetTitle()) + ";" + std::string(his->GetYaxis()->GetTitle());
his->SetTitle(title.c_str());
his->GetXaxis()->SetTitle("x_{2}");
his->GetXaxis()->SetTitleOffset(1.2);
his->GetYaxis()->SetTitle("x_{1}");
his->GetYaxis()->SetTitleOffset(1.4);
his->Draw("COLZ");
gPad->Update();
// Lumi
if (1) {
std::stringstream ss;
ss << "#int L dt = " << lumi << " pb^{-1}";
double xpos = 0.05 * (xmax-xmin)+xmin;
double ypos = 0.25 * (ymax-ymin)+ymin;
TLatex* text1 = new TLatex(xpos,ypos,ss.str().c_str());
text1->SetTextAlign(12);
text1->SetTextSize(0.035);
text1->Draw();
}
// Jet type
if (1) {
double xpos = 0.05 * (xmax-xmin)+xmin;
double ypos = 0.15 * (ymax-ymin)+ymin;
TText* text2 = new TText(xpos,ypos,type.c_str());
text2->SetTextAlign(12);
text2->SetTextSize(0.035);
text2->Draw();
}
// Sample
if (1) {
double xpos = 0.05 * (xmax-xmin)+xmin;
double ypos = 0.10 * (ymax-ymin)+ymin;
TText* text3 = new TText(xpos,ypos,sample.c_str());
text3->SetTextAlign(12);
text3->SetTextSize(0.035);
text3->Draw();
}
// Stats
gStyle->SetOptStat("i");
his->SetStats(1);
TPaveStats* stats = (TPaveStats*)his->GetListOfFunctions()->FindObject("stats");
std::string stats_pos = "br";
if ( stats ) {
stats->SetFillColor(0);
stats->SetLineColor(0);
stats->SetShadowColor(0);
//.........这里部分代码省略.........
示例15: DrawAllHistos
void DrawAllHistos(TString filename,Bool_t isMC,TString format){
// setTDRStyle("logredblue");
std::vector<TH1F*> h1vec;
std::vector<TH2F*> h2vec;
h1vec.clear();
h2vec.clear();
TFile *file = TFile::Open(filename);
// to get the names of the conditions
TObjArray *conditions_from_name = filename.Tokenize("_");
TString sa = conditions_from_name->At(1)->GetName();
TString sb = conditions_from_name->At(3)->GetName();
sb.ReplaceAll(".root","");
file->cd();
TDirectory *stardir = gDirectory;
TObject *thesourcedir;
TIter nextdir(stardir->GetListOfKeys());
while((thesourcedir=nextdir())){
TString dirName = thesourcedir->GetName();
stardir->cd(dirName);
TDirectory *current_sourcedir = gDirectory;
TH1::AddDirectory(kFALSE);
std::cout << "*************************" <<std::endl;
std::cout << "Reading Directory: " << dirName <<std::endl;
TObject *obj;
TIter next(current_sourcedir->GetListOfKeys());
while ((obj=next())) {
TString objName =obj->GetName();
if(objName.Contains("pfx")) continue;
if (objName.Contains("h2") && !objName.Contains("pfx")) {
//std::cout << "Reading: " << obj->GetName() <<std::endl;
TH2F* h2 = (TH2F*)file->Get(dirName+"/"+objName);
h2->SetName(objName+dirName);
h2vec.push_back(h2);
TCanvas *c = new TCanvas(h2->GetName(),h2->GetName(),800,600);
c->cd();
gPad->SetTopMargin(0.08);
gPad->SetRightMargin(0.15);
h2->SetStats(kFALSE);
h2->Draw("colz");
c->Draw();
c->cd();
TProfile *hpfx_tmp = (TProfile*) h2->ProfileX("_pfx",1,-1,"o");
hpfx_tmp->SetStats(kFALSE);
//hpfx_tmp->SetMarkerColor(kBlack);
hpfx_tmp->SetMarkerColor(kRed);
hpfx_tmp->SetMarkerSize(1.2);
hpfx_tmp->SetMarkerStyle(20);
hpfx_tmp->Draw("psame");
c->Draw();
cmsPrel(60.,sa,sb, isMC);
TString canvName = h2->GetName();
c->cd()->SetLogz();
c->SaveAs(canvName+"."+format);
} else {
TH1F* h1 = (TH1F*)file->Get(dirName+"/"+objName);
h1->SetName(objName+dirName);
h1vec.push_back(h1);
TCanvas *c = new TCanvas(h1->GetName(),h1->GetName(),600,600);
c->cd()->SetLogy();
h1->SetMarkerColor(kBlack);
h1->SetMarkerStyle(20);
h1->SetLineWidth(1.5);
h1->SetFillColor(393);
//h1->SetFillStyle(3005);
h1->Draw("hist");
h1->Draw("e1same");
c->Draw();
TObject *statObj;
TPaveStats *stats;
statObj = h1->GetListOfFunctions()->FindObject("stats");
stats= static_cast<TPaveStats*>(statObj);
stats->SetFillColor(10);
//.........这里部分代码省略.........