本文整理汇总了C++中TLatex::SetTextSize方法的典型用法代码示例。如果您正苦于以下问题:C++ TLatex::SetTextSize方法的具体用法?C++ TLatex::SetTextSize怎么用?C++ TLatex::SetTextSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TLatex
的用法示例。
在下文中一共展示了TLatex::SetTextSize方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
//.........这里部分代码省略.........
// lumiText += " (2.76 TeV)";
}
else if (iPeriod==102)
{
lumiText += lumi_pp2013;
lumiText2 += " #sqrt{s} = 2.76 TeV";
// lumiText += " (2.76 TeV)";
}
else if (iPeriod==103)
{
lumiText += lumi_PbPb2011;
lumiText += ", ";
lumiText += lumi_pp2013;
lumiText2 += " #sqrt{s_{NN}} = 2.76 TeV";
// lumiText += " (2.76 TeV)";
}
else if (iPeriod==104)
{
lumiText += label;
lumiText2 += " #sqrt{s_{NN}} = 5.02 TeV";
}
cout << lumiText << endl;
TLatex latex;
latex.SetNDC();
latex.SetTextAngle(0);
latex.SetTextColor(kBlack);
float extraTextSize = extraOverCmsTextSize*cmsTextSize;
latex.SetTextFont(42);
latex.SetTextAlign(31);
latex.SetTextSize(lumiTextSize*t);
latex.DrawLatex(1-r,1-t+lumiTextOffset*t,lumiText2);
// latex.DrawLatex(1-r,1-t+lumiTextOffset*t,lumiText);
latex.SetTextAlign(11);
latex.DrawLatex(l,1-t+lumiTextOffset*t,lumiText);
if( outOfFrame )
{
latex.SetTextFont(cmsTextFont);
latex.SetTextAlign(11);
latex.SetTextSize(cmsTextSize*t);
latex.DrawLatex(l,1-t+lumiTextOffset*t,cmsText);
}
pad->cd();
float posX_=0;
if( iPosX%10<=1 )
{
posX_ = l + relPosX*(1-l-r);
}
else if( iPosX%10==2 )
{
posX_ = l + 0.5*(1-l-r);
}
else if( iPosX%10==3 )
{
posX_ = 1-r - relPosX*(1-l-r);
}
float posY_ = 1-t - relPosY*(1-t-b);
if (pad->GetTickx()) posX_ -= cmsTextOffset;
cout << pad->GetTickx() << endl;
if (pad->GetTicky()) posY_ -= cmsTextOffset;
示例2: canvas1DhEff_ppInc
void canvas1DhEff_ppInc()
{
//=========Macro generated from canvas: canvas1D/
//========= (Mon Dec 5 21:22:37 2016) by ROOT version6.02/10
TCanvas *canvas1D = new TCanvas("canvas1D", "",0,0,600,600);
gStyle->SetOptStat(0);
gStyle->SetOptTitle(0);
canvas1D->SetHighLightColor(2);
canvas1D->Range(-4.625,-0.07500001,61.625,0.675);
canvas1D->SetFillColor(0);
canvas1D->SetBorderMode(0);
canvas1D->SetBorderSize(2);
canvas1D->SetFrameBorderMode(0);
canvas1D->SetFrameBorderMode(0);
TH2F *hemptyEff1 = new TH2F("hemptyEff1","",50,2,55,10,0,0.6);
hemptyEff1->SetMinimum(0);
hemptyEff1->SetMaximum(0.6);
hemptyEff1->SetStats(0);
Int_t ci; // for color index setting
TColor *color; // for color definition with alpha
ci = TColor::GetColor("#000099");
hemptyEff1->SetLineColor(ci);
hemptyEff1->SetMarkerStyle(20);
hemptyEff1->GetXaxis()->SetTitle("p_{T} GeV^{-1}c)");
hemptyEff1->GetXaxis()->CenterTitle(true);
hemptyEff1->GetXaxis()->SetLabelFont(42);
hemptyEff1->GetXaxis()->SetLabelSize(0.035);
hemptyEff1->GetXaxis()->SetTitleSize(0.05);
hemptyEff1->GetXaxis()->SetTitleOffset(0.9);
hemptyEff1->GetXaxis()->SetTitleFont(42);
hemptyEff1->GetYaxis()->SetTitle("#alpha x #epsilon");
hemptyEff1->GetYaxis()->CenterTitle(true);
hemptyEff1->GetYaxis()->SetLabelFont(42);
hemptyEff1->GetYaxis()->SetLabelSize(0.035);
hemptyEff1->GetYaxis()->SetTitleSize(0.05);
hemptyEff1->GetYaxis()->SetTitleOffset(0.95);
hemptyEff1->GetYaxis()->SetTitleFont(42);
hemptyEff1->GetZaxis()->SetLabelFont(42);
hemptyEff1->GetZaxis()->SetLabelSize(0.035);
hemptyEff1->GetZaxis()->SetTitleSize(0.035);
hemptyEff1->GetZaxis()->SetTitleFont(42);
hemptyEff1->Draw("");
Double_t xAxis1[2] = {7, 50};
TH1D *hEff2 = new TH1D("hEff2","",1, xAxis1);
hEff2->SetBinContent(1,0.05799468);
hEff2->SetBinError(1,0.0003918457);
hEff2->SetEntries(21905.14);
hEff2->SetStats(0);
hEff2->SetLineColor(2);
hEff2->SetMarkerColor(2);
hEff2->SetMarkerStyle(20);
hEff2->GetXaxis()->CenterTitle(true);
hEff2->GetXaxis()->SetLabelFont(42);
hEff2->GetXaxis()->SetLabelSize(0.035);
hEff2->GetXaxis()->SetTitleSize(0.035);
hEff2->GetXaxis()->SetTitleFont(42);
hEff2->GetYaxis()->CenterTitle(true);
hEff2->GetYaxis()->SetLabelFont(42);
hEff2->GetYaxis()->SetLabelSize(0.035);
hEff2->GetYaxis()->SetTitleSize(0.035);
hEff2->GetYaxis()->SetTitleFont(42);
hEff2->GetZaxis()->SetLabelFont(42);
hEff2->GetZaxis()->SetLabelSize(0.035);
hEff2->GetZaxis()->SetTitleSize(0.035);
hEff2->GetZaxis()->SetTitleFont(42);
hEff2->Draw("same");
TLatex * tex = new TLatex(0.5,0.75,"|y| < 2.4");
tex->SetNDC();
tex->SetTextFont(42);
tex->SetLineWidth(2);
tex->Draw();
tex = new TLatex(0.08,0.95,"CMS Preliminary");
tex->SetNDC();
tex->SetTextAlign(13);
tex->SetTextSize(0.038);
tex->SetLineWidth(2);
tex->Draw();
tex = new TLatex(0.9,0.92,"25.8 pb^{-1} (5.02 TeV pp)");
tex->SetNDC();
tex->SetTextAlign(31);
tex->SetTextFont(42);
tex->SetTextSize(0.038);
tex->SetLineWidth(2);
tex->Draw();
canvas1D->Modified();
canvas1D->cd();
canvas1D->SetSelected(canvas1D);
}
示例3: fsr
//.........这里部分代码省略.........
whw*ps[2][j]->GetBinContent(k));
ps[ns-1][j]->SetBinError(k, (1-whw)*ps[1][j]->GetBinError(k) +
whw*ps[2][j]->GetBinError(k));
}
}
*/
TGraphErrors *gas[ns];
TGraphErrors *ga = new TGraphErrors(4);
TF1 *f1 = new TF1("f1","[0]+[1]*x",0,0.35);
for (int i = 0; i != ns; ++i) {
for (int k = 1; k != p8_10->GetNbinsX()+1; ++k) {
for (int j = 1; j != np; ++j) {
ga->SetPoint(j, alpha[j], ps[i][j]->GetBinContent(k));
ga->SetPointError(j, 0., ps[i][j]->GetBinError(k));
}
ga->Fit(f1, "QRN");
ps[i][0]->SetBinContent(k, f1->GetParameter(0));
ps[i][0]->SetBinError(k, f1->GetParError(0));
if (p8_10->FindBin(pt)==k) {
gas[i] = (TGraphErrors*)ga->Clone(Form("ga_%d",i));
}
}
}
TH1D *h = new TH1D("h",";p_{T,parton} (GeV);"
"#LTp_{T,gen} / p_{T,parton}#GT", 100, 0, 900);
h->SetMaximum(1.06);//1.03);
h->SetMinimum(0.91);//0.96);
TLatex *tex = new TLatex();
tex->SetNDC(); tex->SetTextSize(0.045);
extraText = "Simulation";
//extraText2 = "Preliminary";
if (ins==0) lumi_13TeV = "Pythia8";
if (ins==1) lumi_13TeV = "Pythia6";
if (ins==2) lumi_13TeV = "Herwig++";
if (ins==-1) lumi_13TeV = "Herwig++ / Pythia8 / Pythia6";
TCanvas *c1 = tdrCanvas("c1",h,2,0,kSquare);
tex->DrawLatex(0.18,0.87,title[cs]);
tex->DrawLatex(0.18,0.80,"Anti-k_{T} R=0.5");
tex->DrawLatex(0.18,0.75,"|#eta| < 1.3");
tex->DrawLatex(0.0,0.01,"#copyright Hannu Siikonen");
for (int i = 0; i != ns; ++i) {
for (int j = 0; j != np; ++j) {
if ((ins == -1 && (j==0 || j==np-1)) || i == ins)
tdrDraw(ps[i][j], "P", markers[i][j==0 ? 0 : 1], colors[j]);
}
}
//tdrDraw(h8_0,"P",kFullSquare,kBlack);
//tdrDraw(p8_10,"P",kFullCircle,kRed);
//tdrDraw(p8_15,"P",kFullCircle,kOrange+2);
//tdrDraw(p8_20,"P",kFullCircle,kGreen+1);
//tdrDraw(p8_30,"P",kFullCircle,kBlue);
TF1 *f2 = new TF1("f2","[0] + [1]*pow(x,[2])",100,840);
f2->SetParameters(1,-0.1,-0.5);
for (int i = 0; i != ns; ++i) {
for (int j = 0; j != np; ++j) {
ps[i][j]->Fit(f2,"QRN");
f2->SetLineColor(ps[i][j]->GetMarkerColor());
示例4: if
void
CMS_lumi( TPad* pad, int iPeriod, int iPosX )
{
//https://ghm.web.cern.ch/ghm/plots/
bool outOfFrame = false;
if( iPosX/10==0 )
{
outOfFrame = true;
}
int alignY_=3;
int alignX_=2;
if( iPosX/10==0 ) alignX_=1;
if( iPosX==0 ) alignY_=1;
if( iPosX/10==1 ) alignX_=1;
if( iPosX/10==2 ) alignX_=2;
if( iPosX/10==3 ) alignX_=3;
int align_ = 10*alignX_ + alignY_;
float H = pad->GetWh();
float W = pad->GetWw();
float l = pad->GetLeftMargin();
float t = pad->GetTopMargin();
float r = pad->GetRightMargin();
float b = pad->GetBottomMargin();
float e = 0.025;
pad->cd();
TString lumiText;
if( iPeriod==1 )
{
lumiText += lumi_7TeV;
lumiText += " (7 TeV)";
}
else if ( iPeriod==2 )
{
lumiText += lumi_8TeV;
lumiText += " (8 TeV)";
}
else if( iPeriod==3 )
{
lumiText = lumi_8TeV;
lumiText += " (8 TeV)";
lumiText += " + ";
lumiText += lumi_7TeV;
lumiText += " (7 TeV)";
}
else if ( iPeriod==4 )
{
lumiText += lumi_13TeV;
lumiText += " (13 TeV)";
}
else if ( iPeriod==7 )
{
if( outOfFrame ) lumiText += "#scale[0.85]{";
lumiText += lumi_13TeV;
lumiText += " (13 TeV)";
lumiText += " + ";
lumiText += lumi_8TeV;
lumiText += " (8 TeV)";
lumiText += " + ";
lumiText += lumi_7TeV;
lumiText += " (7 TeV)";
if( outOfFrame) lumiText += "}";
}
else if ( iPeriod==12 )
{
lumiText += "8 TeV";
}
//cout << lumiText << endl;
TLatex latex;
latex.SetNDC();
latex.SetTextAngle(0);
latex.SetTextColor(kBlack);
float extraTextSize = extraOverCmsTextSize*cmsTextSize;
latex.SetTextFont(42);
latex.SetTextAlign(31);
latex.SetTextSize(lumiTextSize*t);
latex.DrawLatex(1-r,1-t+lumiTextOffset*t,lumiText);
if( outOfFrame )
{
latex.SetTextFont(cmsTextFont);
latex.SetTextAlign(11);
latex.SetTextSize(cmsTextSize*t);
latex.DrawLatex(l,1-t+lumiTextOffset*t,cmsText);
}
pad->cd();
float posX_;
if( iPosX%10<=1 )
{
posX_ = l + relPosX*(1-l-r);
}
else if( iPosX%10==2 )
//.........这里部分代码省略.........
示例5: qcdBkgdEst_new
//.........这里部分代码省略.........
if ( choice == PLOT_NUMERATOR ) { name = "Pass"; }
else if ( choice == PLOT_DENOMINATOR ) {
if ( efficiency ) { name = "Total"; }
else { name = "Fail"; }
}
else if ( choice == PLOT_RATIO ) {
if ( efficiency ) { name = "Eff"; }
else { name = "Ratio"; }
}
else { name = "Unknown"; }
std::stringstream ss_canvas;
ss_canvas << "Multi";
if ( multi[imulti] >= 0 ) { ss_canvas << multi[imulti]; }
else { ss_canvas << abs(multi[imulti]) << "Incl"; }
ss_canvas << "_AlphaT" << at[iat];
gStyle->SetOptFit(111);
TCanvas* canvas = 0;
TLegend* legend = 0;
TLatex* prelim = 0;
TLatex* lumitxt = 0;
TMultiGraph* mg = 0;
canvas = new TCanvas(TString(name+"_"+ss_canvas.str()),
TString(name+"_"+ss_canvas.str()),800,600);
canvas->SetFillColor(0);
canvas->SetLineColor(0);
canvas->SetLeftMargin(0.17);
legend = new TLegend( 0.65, 0.7-(nfile*0.04), 0.85, 0.7, NULL, "brNDC" );
legend->SetTextSize(0.035);
legend->SetFillColor(0);
legend->SetLineColor(0);
legend->SetShadowColor(0);
if (!simulation) {
prelim = new TLatex( 0.20, 0.88, "#scale[0.8]{CMS preliminary 2011}" );
} else {
prelim = new TLatex( 0.20, 0.88, "#scale[0.8]{CMS simulation 2011}" );
}
prelim->SetTextSize(0.035);
prelim->SetNDC();
std::stringstream ssl;
ssl << "#scale[0.8]{#int L dt = " << std::setprecision(3) << lumi/1000. << " fb^{-1}, #sqrt{s} = 7 TeV}";
lumitxt = new TLatex( 0.68, 0.88, ssl.str().c_str() );
lumitxt->SetTextSize(0.035);
lumitxt->SetNDC();
mg = new TMultiGraph();
std::stringstream ss_axis;
if ( choice == PLOT_NUMERATOR ) {
ss_axis << "N(#alpha_{T}>" << at[iat] << ") / " << ht_step[nht-1] << " GeV";
} else if ( choice == PLOT_DENOMINATOR ) {
if ( efficiency ) { ss_axis << "Total"; }
else { ss_axis << "N(#alpha_{T}<" << at[iat] << ") / " << ht_step[nht-1] << " GeV"; }
} else if ( choice == PLOT_RATIO ) {
if ( !efficiency ) {
//ss_axis << "R_{#alpha_{T}}(" << at[iat] << ")";
if ( iat+1 < nat ) {
ss_axis << "N(" << at[iat] << "<#alpha_{T}<" << at[iat+1] << ") / N(#alpha_{T}<" << at[iat] << ")";
} else {
ss_axis << "N(#alpha_{T}>" << at[iat] << ") / N(#alpha_{T}<" << at[iat] << ")";
示例6: plotTree
//.........这里部分代码省略.........
pad1_y1 = 0.045;
pad1_y2 = 0.98;
} else {
pad1_x1 = 0.01;
pad1_x2 = 0.59;
pad1_y1 = 0.56;
pad1_y2 = 0.98;
}
TPad pad1("t1","",pad1_x1,pad1_y1,pad1_x2,pad1_y2);
TPad pad1a("t1a","",0.01,0.045,0.59,0.522);
TPad pad2("t2","",0.59,0.04,0.98,0.62);
TPad pad3("t3","",0.55,0.64,0.96,0.95);
pad1.SetNumber(1); pad2.SetNumber(2); pad3.SetNumber(3); pad1a.SetNumber(4);
if ( isFitted ) {pad1a.Draw();pad2.Draw();pad3.Draw();}
pad1.Draw();
pad2.SetGrid(true);
TLatex *titletext = new TLatex();titletext->SetNDC();
if ( isFitted ){
c->cd(4);
tree_->Draw(Form("%s:%s_In>>%s_%s_2d",name,name,name,tree_->GetName()),"");
//TH2D *h2d_corr = (TH2D*)gROOT->FindObject(Form("%s_2d",name));
//h2d_corr->SetMarkerColor(4);
//h2d_corr->SetTitle("");
//h2d_corr->GetXaxis()->SetTitle(Form("%s_In",name));
//h2d_corr->GetYaxis()->SetTitle(Form("%s",name));
titletext->SetTextAlign(11);
titletext->SetTextSize(0.05);
titletext->DrawLatex(0.05,0.02,Form("%s_In",name));
titletext->SetTextAngle(90);
titletext->DrawLatex(0.04,0.06,Form("%s",name));
titletext->SetTextAngle(0);
}
c->cd(1); bH->Draw(); bHf->Draw("same");
TLegend *legend = new TLegend(0.6,0.8,0.9,0.89);
legend->SetFillColor(0);
legend->AddEntry(bH,"All Toys","L");
legend->AddEntry(bHf,selectString.c_str(),"L");
legend->Draw();
if (doPull && plotLH) {
c->cd(2); gr->Draw("ALP");
}
if (fitPull){
c->cd(3);
double gap;
TLatex *tlatex = new TLatex(); tlatex->SetNDC();
if (fitPullf) {tlatex->SetTextSize(0.09); gap=0.12;}
else {tlatex->SetTextSize(0.11);gap=0.14;}
tlatex->SetTextColor(4);
tlatex->DrawLatex(0.11,0.80,Form("Mean : %.3f #pm %.3f",bH->GetFunction("gaus")->GetParameter(1),bH->GetFunction("gaus")->GetParError(1)));
tlatex->DrawLatex(0.11,0.80-gap,Form("Sigma : %.3f #pm %.3f",bH->GetFunction("gaus")->GetParameter(2),bH->GetFunction("gaus")->GetParError(2)));
if (fitPullf){
tlatex->SetTextColor(2);
tlatex->DrawLatex(0.11,0.60,Form("Mean : %.3f #pm %.3f",bHf->GetFunction("gaus")->GetParameter(1),bHf->GetFunction("gaus")->GetParError(1)));
示例7: TnPDrawMass_test_5eta5
//.........这里部分代码省略.........
//TString ptbins[ptBins] = {"pt_bin0_", "pt_bin1_", "pt_bin2_", "pt_bin3_", "pt_bin4_",
// "pt_bin5_", "pt_bin6_", "pt_bin7_", "pt_bin8_", "pt_bin9_"};//4
//TString ptbins1[ptBins1] = {"0 - 3.3 GeV", "3.3 - 3.8 GeV", "3.8 - 4.3 GeV", "4.3 - 5 GeV", "5 -6 GeV",
// "6 - 7 GeV", "7 - 8 GeV", "8 - 10 GeV", "10 - 13 GeV", "13 - 30 GeV"};//4
//TString ptbins[ptBins] = {"pt_bin0_", "pt_bin1_", "pt_bin2_", "pt_bin3_", "pt_bin4_",
// "pt_bin5_", "pt_bin6_", "pt_bin7_", "pt_bin8_", "pt_bin9_"};//5
//TString ptbins1[ptBins1] = {"0 - 3.3 GeV", "3.3 - 3.8 GeV", "3.8 - 4.3 GeV", "4.3 - 5 GeV", "5 -6 GeV",
// "6 - 7 GeV", "7 - 8 GeV", "8 - 10 GeV", "10 - 13 GeV", "13 - 30 GeV"};//5
//dir_pt = "tpTree/ptBin_eta1/";
//dir_pt = "tpTree/ptBin_eta3/";
//dir_pt = "tpTree/ptBin_eta3/";
//dir_pt = "tpTree/ptBin_eta5/";
//dir_pt = "tpTree/ptBin_eta5/";
//dir_suffix = "_cbGaussPlusPoly1";
//dir_suffix = "_cbGaussPlusPoly4";
TString dir_suffix[ptBins]= {"_cbGaussPlusExpo5_0","_cbGaussPlusExpo5_1","_cbGaussPlusExpo5_2","_cbGaussPlusExpo5_3","_cbGaussPlusExpo5_4","_cbGaussPlusExpo5_5", "_cbGaussPlusExpo5_6", "_cbGaussPlusExpo5_7"};
//dir_suffix = "_GaussPlusExpo";
//dir_suffix = "_twoGaussPlusExpo";
gStyle->SetPaperSize(20,26);
c1->Print(outname_in);
int cnt = 0;
TCanvas *tmp1 = new TCanvas();
tmp1->cd();
TString title;
title = "J/#psi Efficiency Heavy Ion TnP Result (" + middle_name2 + ")";
c1 = (TCanvas *)tmp1->Clone();
c1->Print(outname_mid);
c1->Print(outfile_);
TString mid_title = "Centrality : (" + middle_name2 + ")";
TString leg_title = Cat2 + " Efficiency (" + middle_name2 + ")";
// pt
for(int j = 0; j < ptBins; j++){
//TString tot_dir = dir_pt + "abseta_bin0__event_PrimaryVertex_z_bin0__" + ptbins[j] + "_tag_eta_bin0__tag_pt_bin0__Acc_JPsi_pass__Calo_pass__tag_PAMu3_standard_pass_" + dir_suffix;
TString tot_dir = dir_pt[j] + "abseta_bin0__event_PrimaryVertex_z_bin0__pt_bin0__tag_eta_bin0__tag_pt_bin0__Acc_JPsiG_pass__Calo_pass__tag_PAMu3_standard_pass_" + dir_suffix[j];//2G,PAMu3,merge
//TString tot_dir = dir_pt + "abseta_bin0__event_PrimaryVertex_z_bin0__" + ptbins[j] + "_tag_eta_bin0__tag_pt_bin0__Acc_JPsiG_pass__Calo_pass__tag_PAMu7_standard_pass_" + dir_suffix;//PAMu7
//TString tot_dir = dir_pt + "abseta_bin0__event_PrimaryVertex_z_bin0__pair_probeMultiplicity_bin0__" + ptbins[j] + "_tag_eta_bin0__tag_pt_bin0__Acc_JPsiG_pass__Calo_pass__tag_PAMu3_standard_pass_" + dir_suffix;//multi
//TString tot_dir = dir_pt + "abseta_bin0__event_PrimaryVertex_z_bin0__" + ptbins[j] + "_tag_eta_bin0__tag_pt_bin0__Acc_JPsi_pass__Calo_pass__tag_PAMu3_standard_pass_" + dir_suffix;//merge
//
f->cd(tot_dir);
cout<<" tot_dir : "<<tot_dir<<endl;
TDirectory *root_dir = gDirectory;
TIter rootnextkey( root_dir->GetListOfKeys() );
root_dir->cd();
TKey *rootkey;
TCanvas *ctmp = new TCanvas();
ctmp->cd();
TLatex l;
l.SetTextAlign(13);
l.SetTextSize(0.06);
l.DrawLatex(0.1,0.8,mid_title);
l.DrawLatex(0.1,0.6,"Bin : ");
l.SetTextSize(0.04);
//l.DrawLatex(0.1,0.5,tot_dir);
l.DrawLatex(0.1,0.5,ptbins1[j]);
ctmp->Update();
c1 = (TCanvas *)ctmp->Clone();
c1->Print(outname_mid);
c1->Print(outfile_);
while( rootkey = (TKey*)rootnextkey() )
{
TObject *rootobj = rootkey->ReadObj();
TDirectory *rdir = gDirectory;
TIter rdirnextkey(rdir->GetListOfKeys());
rdir->cd();
TKey *dir_key;
while( dir_key = (TKey*)rdirnextkey())
{
if (rootobj->IsA()->InheritsFrom("TCanvas")){
c1 = (TCanvas *)rootobj;
c1->SetLogy();
c1->Modified();
c1->Update();
c1->Print(outname_mid);
c1->Print(outfile_);
cnt++;
cout<<"Count : "<<cnt<<endl;
if(cnt > 0) break;
}
}
}
}
c1->Print(outname_out);
TString out2 = outfile_ + "]";
c1->Print(out2);
}
示例8: Loop
//.........这里部分代码省略.........
gStyle->SetLabelFont(font);
gStyle->SetLegendFont(font);
gStyle->SetOptStat(0);
gStyle->SetOptTitle(0);
gStyle->SetOptFit(1111);
gStyle->SetTitleXOffset(1.);
gStyle->SetTitleYOffset(1.3);
gPad->SetTicks(1, 1);
gPad->SetGrid(1, 1);
TH1F* hAccTimesEff2 = (TH1F*)hAccTimesEff->Clone("hAccTimesEff2");
TF1 *fitFunc = new TF1("fitFunc", "[0] + [1]/ (x + [2]) + [3]*x", 10., 5010.);
//TF1 *fitFuncEB = new TF1("fitFuncEB", "[0] + [1]/ (x + [2])", 10., 5010.);
TF1 *fitFuncEB = new TF1("fitFuncEB", "[0] + [1]/ (x + [2]) + [3]*x", 10., 5010.);
TF1 *fitFuncEE = new TF1("fitFuncEE", "[0] + [1]/ (x*x + [2])", 10., 5010.);
fitFunc->SetLineColor(kBlue);
fitFuncEB->SetLineColor(kBlue);
fitFuncEE->SetLineColor(kBlue);
hAccTimesEff->Fit("fitFunc", "", "", 480., 5010.);
hAccTimesEffEB->Fit("fitFuncEB", "", "", 480., 5010.);
hAccTimesEffEE->Fit("fitFuncEE", "", "", 480., 5010.);
cout << "Chi^2 / NDF: " << fitFunc->GetChisquare() << " / " << fitFunc->GetNDF() << ", prob: " << fitFunc->GetProb() << endl;
cout << "Chi^2 / NDF EB: " << fitFuncEB->GetChisquare() << " / " << fitFuncEB->GetNDF() << ", prob: " << fitFuncEB->GetProb() << endl;
cout << "Chi^2 / NDF EE: " << fitFuncEE->GetChisquare() << " / " << fitFuncEE->GetNDF() << ", prob: " << fitFuncEE->GetProb() << endl;
hAccTimesEff->GetYaxis()->SetTitle("acc x eff");
hAccTimesEff->GetYaxis()->SetRangeUser(0., 1.);
hAccTimesEff->Draw();
TLatex *tex = new TLatex(0.22, 0.21, "P(M|p0,p1,p2,p3) = p0 + #frac{p1}{M+p2} + p3*M");
tex->SetNDC();
tex->SetTextFont(font);
tex->SetLineWidth(2);
tex->SetTextSize(0.03);
tex->Draw();
tex->DrawLatex(0.109, 0.935, "CMS Simulation, 8 TeV");
tex->DrawLatex(0.17, 0.85, "trg + electron + muon");
TCanvas *accTimesEffPlotEB = new TCanvas("accTimesEffPlotEB", "acc x eff, barrel electron + muon", 100, 100, 600, 600);
TPad *accTimesEffPadEB = (TPad*)accTimesEffPad->Clone("accTimesEffPadEB");
accTimesEffPadEB->Draw();
accTimesEffPadEB->cd();
hAccTimesEffEB->GetYaxis()->SetTitle("acc x eff");
hAccTimesEffEB->GetYaxis()->SetRangeUser(0., 1.);
hAccTimesEffEB->Draw();
tex->DrawLatex(0.109, 0.935, "CMS Simulation, 8 TeV");
//tex->DrawLatex(0.46, 0.21, "P(M|p0,p1,p2) = p0 + #frac{p1}{M+p2}");
tex->DrawLatex(0.22, 0.21, "P(M|p0,p1,p2,p3) = p0 + #frac{p1}{M+p2} + p3*M");
tex->DrawLatex(0.17, 0.85, "trg + barrel electron + muon");
TCanvas *accTimesEffPlotEE = new TCanvas("accTimesEffPlotEE", "acc x eff, endcap electron + muon", 100, 100, 600, 600);
TPad *accTimesEffPadEE = (TPad*)accTimesEffPad->Clone("accTimesEffPadEE");
accTimesEffPadEE->Draw();
accTimesEffPadEE->cd();
hAccTimesEffEE->GetYaxis()->SetTitle("acc x eff");
hAccTimesEffEE->GetYaxis()->SetRangeUser(0., 1.);
hAccTimesEffEE->Draw();
tex->DrawLatex(0.109, 0.935, "CMS Simulation, 8 TeV");
tex->DrawLatex(0.45, 0.38, "P(M|p0,p1,p2) = p0 + #frac{p1}{M^{2}+p2}");
tex->DrawLatex(0.17, 0.85, "trg + endcap electron + muon");
TCanvas *accTimesEffObjPlot = new TCanvas("accTimesEffObjPlot", "acc x eff, objects", 100, 100, 600, 600);
TPad *accTimesEffObjPad = (TPad*)accTimesEffPad->Clone("accTimesEffObjPad");
accTimesEffObjPad->Draw();
accTimesEffObjPad->cd();
hAccTimesEffEle->GetYaxis()->SetTitle("acc x eff");
示例9: getX0
void getX0()
{
gROOT->Reset();
gROOT->LoadMacro("fitfun.C"); // fit function for localY, local Z
const Int_t N = 120;
const Int_t M = 7; // number of module angle groups
//histograms to check the par2 and par3 distributions
TH1D *hPar2 = new TH1D("Par2","",500,0., 5.);
TH1D *hPar3 = new TH1D("Par3","",500,0., 1.);
Double_t a[M] = {0., 16., 20., 22., 26., 30., 32.};
TH2D *zLocal2D[M];
TH1D *zLocal[N][M];
TFile *fin = new TFile("align.root");
for(int j=0;j<M;j++) {
char inhis[100];
sprintf(inhis,"zLocal_%d",j);
zLocal2D[j] = (TH2D *)fin->Get(inhis);
zLocal2D[j]->RebinY(5);
for(int i=0;i<N;i++) {
char hisname[100];
sprintf(hisname,"Tray_%d_A_%d",i+1,j);
zLocal[i][j] = zLocal2D[j]->ProjectionY(hisname,i+1,i+1);
zLocal[i][j]->Sumw2();
}
}
TF1 *fitfun = new TF1("fitfun",fitfun,-6.,6.,5);
double t[N];
double z0[N][M], ze[N][M];
gStyle->SetOptStat(101);
gStyle->SetOptFit(100);
gStyle->SetTextSize(0.06);
gStyle->SetTextFont(42);
TCanvas *c1 = new TCanvas("c1","c1",0,0,800,600);
c1->SetFillColor(10);
c1->SetBorderMode(0);
c1->SetBorderSize(2);
c1->Divide(4,3);
TPostScript *ps = new TPostScript("fig/xLocalFit.ps",112);
for(int j=0;j<M;j++) {
for(int i=0;i<N;i++) {
t[i] = i+1; // tray number
if(i%12==0) ps->NewPage(); // 12 trays per page
c1->cd(i%12+1);
double par[5], err[5];
fitfun->SetParameters(0., zLocal[i][j]->GetBinContent(50), 0.1, 1., 0.);
fitfun->SetLineWidth(2);
zLocal[i][j]->Draw("e");
double entries = zLocal[i][j]->Integral(1,100);
if(entries>10) {
fitfun->SetParLimits(0, -3., 3.);
fitfun->SetParLimits(2, 2.9, 3.1);
fitfun->SetParLimits(3, 0.01, 0.16);
zLocal[i][j]->Fit("fitfun","R");
fitfun->GetParameters(&par[0]);
err[0] = fitfun->GetParError(0);
} else {
par[0] = 0.;
err[0] = 0.;
}
hPar2->Fill(par[2]);
hPar3->Fill(par[3]);
char text[100];
sprintf(text, "Z0 = %5.3f #pm %5.3f", par[0], err[0]);
TLatex *tex = new TLatex(-3, par[1]/3., text);
tex->SetTextSize(0.07);
tex->SetTextFont(12);
tex->Draw("same");
z0[i][j] = par[0];
ze[i][j] = err[0];
c1->Update();
}
}
gStyle->SetOptStat(0);
gStyle->SetOptFit(0);
gStyle->SetEndErrorSize(0.01);
TF1 *fitangle = new TF1("fitangle","[0]*sin(x*3.14159/180.)+[1]",-10.,40.);
double z00[N], ze0[N]; // angle=0 modules zOffset
double z0F[N], zeF[N]; // angle=0 modules zOffset after fitangle fit
double x0[N], xe[N];
for(int i=0;i<N;i++) {
//.........这里部分代码省略.........
示例10: cutChecker
//.........这里部分代码省略.........
RooArgList(*cb3S_1,*cb3S_2),*sigmaFraction);
// bkg Chebychev
RooRealVar *nbkgd = new RooRealVar("n_{Bkgd}","nbkgd",0,nt);
RooRealVar *bkg_a1 = new RooRealVar("a1_bkg", "bkg_{a1}", 0, -5, 5);
RooRealVar *bkg_a2 = new RooRealVar("a2_Bkg", "bkg_{a2}", 0, -5, 5);
RooRealVar *bkg_a3 = new RooRealVar("a3_Bkg", "bkg_{a3}", 0, -2, 2);
RooAbsPdf *pdf_combinedbkgd = new RooChebychev("bkgPdf","bkgPdf",
*mass, RooArgList(*bkg_a1,*bkg_a2));
RooRealVar turnOn("turnOn","turnOn",2.,8.6);
RooRealVar width("width","width",0.3,8.5);// MB 2.63
RooRealVar decay("decay","decay",1,18);// MB: 3.39
RooGenericPdf *ErrPdf = new RooGenericPdf("ErrPdf","ErrPdf",
"exp([email protected]/decay)*(TMath::Erf((@0-turnOn)/width)+1)",
RooArgList(*mass,turnOn,width,decay));
// bkg_a2->setVal(0);
// bkg_a2->setConstant();
RooDataHist binnedData1 ("binnedData1","binnedData1",*mass,Import(*MReco1));
RooDataHist binnedData2 ("binnedData2","binnedData2",*mass,Import(*MReco2));
RooDataHist binnedData3 ("binnedData3","binnedData3",*mass,Import(*MReco3));
RooDataHist binnedData4 ("binnedData4","binnedData4",*mass,Import(*MReco4));
RooAbsPdf *pdf = new RooAddPdf ("pdf","total p.d.f.",
RooArgList(*sig1S,*sig2S,*sig3S,*ErrPdf),
RooArgList(*nsig1f,*nsig2f,*nsig3f,*nbkgd));
npow->setVal(2);
npow->setConstant();
//for the plots!
TCanvas c; c.cd();
TPad phead("phead","phead",0.05,0.9,1.,1.,0,0,0);
phead.Draw(); phead.cd();
TLatex *cms = new TLatex (0.1,0.1,"CMS Internal");
cms->SetTextFont(40);
cms->SetTextSize(0.4);
cms->SetTextColor(kBlack);
cms->Draw();
if(pbpb){ TLatex *pbpb = new TLatex (0.6,0.1,"PbPb #sqrt{s_{NN}} = 2.76 TeV");
pbpb->SetTextFont(42);
pbpb->SetTextSize(0.35);
pbpb->SetTextColor(kBlack);
pbpb->Draw();
}else if(!pbpb){
TLatex *pp = new TLatex (0.6,0.1,"pp #sqrt{s} = 2.76 TeV");
pp->SetTextFont(42);
pp->SetTextSize(0.35);
pp->SetTextColor(kBlack);
pp->Draw();
}
TPad pbody("pbody","pbody",0.0,0.0,1.,0.9,0,0,0);
c.cd();
pbody.SetLeftMargin(0.15);
pbody.Draw(); pbody.cd();
RooPlot* frame = mass->frame(Bins(70),Range(7,14));
// 1st round
RooAbsReal* nll1 = pdf->createNLL(binnedData1,NumCPU(4)) ;
RooMinuit(*nll1).migrad();
RooMinuit(*nll1).hesse();
binnedData1.plotOn(frame,Name("theData"),MarkerSize(0.6),MarkerStyle(20),MarkerColor(kBlue));
pdf->plotOn(frame,Name("thePdf"),LineColor(kBlue));
double signif1 = nsig1f->getVal()/nsig1f->getError();
double signif1_2s = nsig2f->getVal()/nsig2f->getError();
double signif1_3s = nsig3f->getVal()/nsig3f->getError();
MReco1->SetMarkerSize(1.0);
MReco1->SetMarkerStyle(20);
MReco1->SetMarkerColor(kBlue);
MReco1->Draw("esame");
示例11: multiple_detector_fit
//.........这里部分代码省略.........
c6->SetRightMargin(.15);
c6->cd();
M6.Draw("COLZ");
gStyle->SetPalette(56,0);
TMatrixFBase->SetContour(999);
// TMatrixFBase->GetZaxis()->SetRangeUser(-0.05,0.4);
TMatrixFBase->GetZaxis()->SetTitleFont(62);
TMatrixFBase->GetZaxis()->SetLabelFont(62);
TMatrixFBase->GetZaxis()->SetTitleSize(0.045);
// TMatrixFBase->GetZaxis()->SetTitle("Fractional Error Matrix");
TMatrixFBase->GetZaxis()->SetTitleOffset(1.5);
TMatrixFBase->GetXaxis()->SetTitle("");
TMatrixFBase->GetXaxis()->SetLabelSize(0);
TMatrixFBase->GetXaxis()->SetTitleOffset(1.5);
TMatrixFBase->GetYaxis()->SetTitle("");
TMatrixFBase->GetYaxis()->SetTitleOffset(1.5);
TMatrixFBase->GetYaxis()->SetLabelSize(0);
TMatrixFBase->SetStats(0);
TLine *split = new TLine();
split->SetLineStyle(2);
split->SetLineWidth(5);
split->SetLineColor(kBlue);
split->DrawLineNDC(.1,.51,.849,.51);
split->DrawLineNDC(.475,.101,.475,.930);
add_plot_label("| 0.2 #minus 3.0 GeV | 0.2 #minus 3.0 GeV | ", 0.48,0.08,0.03);
TLatex *ND = new TLatex(.15,.01,"LAr1-ND (100m) ");
ND->SetNDC();
ND->SetTextFont(62);
ND->SetTextSize(0.04);
ND->Draw();
TLatex *MD = new TLatex(.5,.01,"T600 (600m, on axis)");
MD->SetNDC();
MD->SetTextFont(62);
MD->SetTextSize(0.04);
MD->Draw();
TLatex *ND45 = new TLatex(.05,.15,"LAr1-ND (100m) ");
ND45->SetNDC();
ND45->SetTextAngle(90);
ND45->SetTextFont(62);
ND45->SetTextSize(0.04);
ND45->Draw();
TLatex *MD45 = new TLatex(.05,.54,"T600 (600m, on axis)");
MD45->SetNDC();
MD45->SetTextAngle(90);
MD45->SetTextFont(62);
MD45->SetTextSize(0.04);
MD45->Draw();
TLatex *Total = new TLatex(.2,.96,"#nu#lower[0.3]{#mu} Flux Fractional Error Matrix");
Total->SetNDC();
Total->SetTextFont(62);
Total->SetTextSize(0.045);
Total->Draw();
// c6->Print("total_matrix.pdf");
示例12: example_plot
TCanvas* example_plot( int iPeriod, int iPos )
{
// if( iPos==0 ) relPosX = 0.12;
int W = 800;
int H = 600;
int H_ref = 600;
int W_ref = 800;
// references for T, B, L, R
float T = 0.08*H_ref;
float B = 0.12*H_ref;
float L = 0.12*W_ref;
float R = 0.04*W_ref;
TString canvName = "FigExample_";
canvName += W;
canvName += "-";
canvName += H;
canvName += "_";
canvName += iPeriod;
if( writeExtraText ) canvName += "-prelim";
if( iPos%10==0 ) canvName += "-out";
else if( iPos%10==1 ) canvName += "-left";
else if( iPos%10==2 ) canvName += "-center";
else if( iPos%10==3 ) canvName += "-right";
TCanvas* canv = new TCanvas(canvName,canvName,50,50,W,H);
canv->SetFillColor(0);
canv->SetBorderMode(0);
canv->SetFrameFillStyle(0);
canv->SetFrameBorderMode(0);
canv->SetLeftMargin( L/W );
canv->SetRightMargin( R/W );
canv->SetTopMargin( T/H );
canv->SetBottomMargin( B/H );
canv->SetTickx(0);
canv->SetTicky(0);
int histLineColor = kOrange+7;
int histFillColor = kOrange-2;
float markerSize = 1.0;
{
TLatex latex;
int n_ = 2;
float x1_l = 0.92;
float y1_l = 0.60;
float dx_l = 0.30;
float dy_l = 0.18;
float x0_l = x1_l-dx_l;
float y0_l = y1_l-dy_l;
TPad* legend = new TPad("legend_0","legend_0",x0_l,y0_l,x1_l, y1_l );
// legend->SetFillColor( kGray );
legend->Draw();
legend->cd();
float ar_l = dy_l/dx_l;
float x_l[1];
float ex_l[1];
float y_l[1];
float ey_l[1];
// float gap_ = 0.09/ar_l;
float gap_ = 1./(n_+1);
float bwx_ = 0.12;
float bwy_ = gap_/1.5;
x_l[0] = 1.2*bwx_;
// y_l[0] = 1-(1-0.10)/ar_l;
y_l[0] = 1-gap_;
ex_l[0] = 0;
ey_l[0] = 0.04/ar_l;
TGraph* gr_l = new TGraphErrors(1, x_l, y_l, ex_l, ey_l );
gStyle->SetEndErrorSize(0);
gr_l->SetMarkerSize(0.9);
gr_l->Draw("0P");
latex.SetTextFont(42);
latex.SetTextAngle(0);
latex.SetTextColor(kBlack);
latex.SetTextSize(0.25);
latex.SetTextAlign(12);
TLine line_;
TBox box_;
float xx_ = x_l[0];
float yy_ = y_l[0];
latex.DrawLatex(xx_+1.*bwx_,yy_,"Data");
//.........这里部分代码省略.........
示例13: plotPPBalanceAll
void plotPPBalanceAll(){
bool isPF = true;
TString data_tag;
TString mc_tag;
TString jetfinder, jetfinder_tag;
if(!isPF){
data_tag = "hdata_ak5calo_DijetBalance";
mc_tag = "hmc_ak5calo_DijetBalance_histonly";
jetfinder_tag = "calo";
}else{
data_tag = "hdata_ak5pf_DijetBalance";
mc_tag = "hmc_ak5pf_DijetBalance_histonly";
jetfinder_tag ="pf";
}
TFile *fDATA = new TFile(Form("./%s.root",data_tag.Data()));
TFile *fMC = new TFile(Form("./%s.root",mc_tag.Data()));
TH1F *hDijetBal_data = (TH1F*) fDATA->Get("hDataDijetBalance");
TH1F *hDijetBal_mc = (TH1F*) fMC->Get("hQCDDijetBalance");
// normalization should be matched with what's in ANA
hDijetBal_data->Scale(1./hDijetBal_data->Integral());
hDijetBal_data->Rebin(2);
hDijetBal_mc->Scale(1./hDijetBal_mc->Integral());
hDijetBal_mc->Rebin(2);
cout<<"Bin Width = "<<hDijetBal_data->GetBinWidth(1)<<endl;
// canvas setting ---
TCanvas *c1 = new TCanvas("c1","",560,620);
// dum styling ----
TH1F *hDum = new TH1F("hDum","",10,0,1.0);
hDum->SetLineColor(kBlue);
hDum->SetFillColor(kAzure-8);
hDum->SetFillStyle(3005);
hDum->SetStats(0);
hDum->SetXTitle("A_{J} = (p_{T}^{j1}-p_{T}^{j2})/(p_{T}^{j1}+p_{T}^{j2})");
hDum->SetYTitle("Event Fraction");
hDum->GetXaxis()->SetLabelSize(30);
hDum->GetXaxis()->SetLabelFont(43);
hDum->GetXaxis()->SetTitleSize(30);
hDum->GetXaxis()->SetTitleFont(43);
hDum->GetXaxis()->SetTitleOffset(1.4);
hDum->GetXaxis()->CenterTitle();
hDum->GetXaxis()->SetNdivisions(905,true);
hDum->GetYaxis()->SetLabelSize(30);
hDum->GetYaxis()->SetLabelFont(43);
hDum->GetYaxis()->SetTitleSize(30);
hDum->GetYaxis()->SetTitleFont(43);
hDum->GetYaxis()->SetTitleOffset(1.8);
hDum->GetYaxis()->CenterTitle();
hDum->SetAxisRange(0,0.25,"Y");
// data, mc styling
hDijetBal_mc->SetLineColor(kBlue);
hDijetBal_mc->SetFillColor(kAzure-8);
hDijetBal_mc->SetFillStyle(3352);
// 3352
hDum->Draw("hist");
hDijetBal_mc->SetMarkerSize(2.0);
hDijetBal_mc->Draw("histsame");
hDijetBal_data->SetMarkerSize(2.0);
hDijetBal_data->Draw("pzsame");
// Legend
TLegend *t3=new TLegend(0.53,0.57,0.91,0.82);
//t3->SetHeader("ant-k_{T} (R=0.5) CaloJets");
t3->AddEntry(hDijetBal_data,"p + p #sqrt{s}=7.0 TeV","pl");
t3->AddEntry(hDijetBal_mc,"PYTHIA","lf");
t3->SetFillColor(0);
t3->SetBorderSize(0);
t3->SetFillStyle(0);
t3->SetTextFont(63);
t3->SetTextSize(20);
t3->Draw();
// other labeling
TLatex *cms = new TLatex(0.20,0.23,"CMS");
cms->SetTextFont(63);
cms->SetTextSize(20);
cms->Draw();
TLatex *lumi = new TLatex(0.35,0.23,"#intL dt = 35.1 pb^{-1}");
//.........这里部分代码省略.........
示例14: X_Resolution
//.........这里部分代码省略.........
histo__1->SetBinContent(7,29);
histo__1->SetBinContent(8,18);
histo__1->SetBinContent(9,23);
histo__1->SetBinContent(10,45);
histo__1->SetBinContent(11,41);
histo__1->SetBinContent(12,70);
histo__1->SetBinContent(13,122);
histo__1->SetBinContent(14,156);
histo__1->SetBinContent(15,314);
histo__1->SetBinContent(16,471);
histo__1->SetBinContent(17,709);
histo__1->SetBinContent(18,1055);
histo__1->SetBinContent(19,1472);
histo__1->SetBinContent(20,1657);
histo__1->SetBinContent(21,1576);
histo__1->SetBinContent(22,1318);
histo__1->SetBinContent(23,1050);
histo__1->SetBinContent(24,800);
histo__1->SetBinContent(25,511);
histo__1->SetBinContent(26,263);
histo__1->SetBinContent(27,180);
histo__1->SetBinContent(28,110);
histo__1->SetBinContent(29,60);
histo__1->SetBinContent(30,64);
histo__1->SetBinContent(31,41);
histo__1->SetBinContent(32,20);
histo__1->SetBinContent(33,27);
histo__1->SetBinContent(34,17);
histo__1->SetBinContent(35,12);
histo__1->SetBinContent(36,14);
histo__1->SetBinContent(37,27);
histo__1->SetBinContent(38,14);
histo__1->SetBinContent(39,23);
histo__1->SetBinContent(40,17);
histo__1->SetBinContent(41,65);
histo__1->SetEntries(12583);
histo__1->SetStats(0);
TF1 *f1 = new TF1("f","[0]*(TMath::Erf((2*(x-[1])+[2])/([3]*TMath::Sqrt(8))) + TMath::Erf((2*([1]-x)+[2])/([3]*TMath::Sqrt(8))))",-1.8,1.8);
f1->SetFillColor(19);
f1->SetFillStyle(0);
f1->SetLineColor(2);
f1->SetLineWidth(2);
f1->SetChisquare(44.11321);
f1->SetNDF(10);
f1->GetXaxis()->SetLabelFont(42);
f1->GetXaxis()->SetLabelSize(0.035);
f1->GetXaxis()->SetTitleSize(0.035);
f1->GetXaxis()->SetTitleFont(42);
f1->GetYaxis()->SetLabelFont(42);
f1->GetYaxis()->SetLabelSize(0.035);
f1->GetYaxis()->SetTitleSize(0.035);
f1->GetYaxis()->SetTitleFont(42);
f1->SetParameter(0,5944.829);
f1->SetParError(0,4323.748);
f1->SetParLimits(0,0,0);
f1->SetParameter(1,0.002390321);
f1->SetParError(1,0.007416957);
f1->SetParLimits(1,0,0);
f1->SetParameter(2,0.2459713);
f1->SetParError(2,0.1804005);
f1->SetParLimits(2,0,0);
f1->SetParameter(3,0.7402116);
f1->SetParError(3,0.008551957);
f1->SetParLimits(3,0,0);
histo__1->GetListOfFunctions()->Add(f1);
Int_t ci; // for color index setting
TColor *color; // for color definition with alpha
ci = TColor::GetColor("#000099");
histo__1->SetLineColor(ci);
histo__1->SetLineWidth(2);
histo__1->GetXaxis()->SetTitle("X [mm]");
histo__1->GetXaxis()->SetLabelFont(42);
histo__1->GetXaxis()->SetLabelSize(0.035);
histo__1->GetXaxis()->SetTitleSize(0.06);
histo__1->GetXaxis()->SetTitleOffset(0.8);
histo__1->GetXaxis()->SetTitleFont(42);
histo__1->GetYaxis()->SetTitle("entries / 0.25 mm");
histo__1->GetYaxis()->SetLabelFont(42);
histo__1->GetYaxis()->SetLabelSize(0.035);
histo__1->GetYaxis()->SetTitleSize(0.06);
histo__1->GetYaxis()->SetTitleOffset(0.95);
histo__1->GetYaxis()->SetTitleFont(42);
histo__1->GetZaxis()->SetLabelFont(42);
histo__1->GetZaxis()->SetLabelSize(0.035);
histo__1->GetZaxis()->SetTitleSize(0.035);
histo__1->GetZaxis()->SetTitleFont(42);
histo__1->Draw("");
TLatex * tex = new TLatex(0.93,0.88,"#sigma = 0.74 #pm 0.01 [mm]");
tex->SetNDC();
tex->SetTextAlign(31);
tex->SetTextFont(42);
tex->SetTextSize(0.04);
tex->SetLineWidth(2);
tex->Draw();
c->Modified();
c->cd();
c->SetSelected(c);
}
示例15: pi0_HadCorrelations_Projections
//.........这里部分代码省略.........
double _B0 = _hBackground_pPb[iCount]->GetBinContent(_x0,_y0);
_hSignal_pPb[iCount]->Scale(_B0/(_nEvents_pPb));
_hSignal_pPb[iCount]->Scale(1.0/_etabinwidth/_phibinwidth);
c1->cd(iCount+1);
_hSignal_pPb[iCount]->GetXaxis()->SetRange(5,29);
_hSignal_pPb[iCount]->GetXaxis()->SetTitle("#Delta#eta");
_hSignal_pPb[iCount]->GetXaxis()->SetRange(5,29);
_hSignal_pPb[iCount]->GetXaxis()->CenterTitle(true);
_hSignal_pPb[iCount]->GetXaxis()->SetLabelFont(42);
_hSignal_pPb[iCount]->GetXaxis()->SetLabelSize(0.035);
_hSignal_pPb[iCount]->GetXaxis()->SetTitleSize(0.05);
_hSignal_pPb[iCount]->GetXaxis()->SetTitleOffset(1.38);
_hSignal_pPb[iCount]->GetXaxis()->SetTitleFont(42);
_hSignal_pPb[iCount]->GetYaxis()->SetTitle("#Delta#phi");
_hSignal_pPb[iCount]->GetYaxis()->CenterTitle(true);
_hSignal_pPb[iCount]->GetYaxis()->SetLabelFont(42);
_hSignal_pPb[iCount]->GetYaxis()->SetLabelSize(0.035);
_hSignal_pPb[iCount]->GetYaxis()->SetTitleSize(0.05);
_hSignal_pPb[iCount]->GetYaxis()->SetTitleOffset(1.59);
_hSignal_pPb[iCount]->GetYaxis()->SetTitleFont(42);
_hSignal_pPb[iCount]->GetZaxis()->SetTitle("#frac{1}{N_{trig}} #frac{d^{2}N^{pair}}{d#Delta#etad#Delta#phi}");
_hSignal_pPb[iCount]->GetZaxis()->SetLabelFont(42);
_hSignal_pPb[iCount]->GetZaxis()->SetLabelSize(0.035);
_hSignal_pPb[iCount]->GetZaxis()->SetTitleSize(0.035);
_hSignal_pPb[iCount]->GetZaxis()->SetTitleOffset(2.33);
_hSignal_pPb[iCount]->GetZaxis()->SetTitleFont(42);
_hSignal_pPb[iCount]->GetZaxis()->SetNdivisions(505);
_hSignal_pPb[iCount]->Draw("SURF1");
TLatex * tex = new TLatex(-0.8847018,0.9364877,Form("%5.1f < p_{T} < %5.1f (GeV/c)",_ptMin[iCount],_ptMax[iCount]));
tex->SetTextSize(0.06);
tex->Draw();
} // loop over 8 histogram bins
cout <<"\n Now drawing the projections..." << endl;
float etaMin = 2.0;
float etaMax = 3.6;
TString _Name = "projClone";
TString _Name2 = "_pi0HadProj";
TString _Name4 = "FourierDecompose";
TString _Name1, _Name3, _Name5;
TH2D *_projCorrFunc[9];
TH1D * _pi0HadCorrProj[9];
TF1 *_FourierDecompose[9];
const int n = 9;
double _Parameter0[n];
double _Par0Error[n];
double _Parameter2[n];
double _Par2Error[n];
double _Ratio[n];
double _Error[n];
for(long iCount=0; iCount<nPtBins; ++iCount) {
_Name1 = _Name + iCount;
_Name3 = _Name2 + iCount;
_Name5 = _Name4 + iCount;
_projCorrFunc[iCount] = (TH2D*) _hSignal_pPb[iCount]->Clone(_Name1);
Int_t etabin10m=_projCorrFunc[iCount]->GetXaxis()->FindBin(etaMin+0.01);
Int_t etabin10p=_projCorrFunc[iCount]->GetXaxis()->FindBin(etaMax-0.01);