本文整理汇总了C++中TPaveText::AddText方法的典型用法代码示例。如果您正苦于以下问题:C++ TPaveText::AddText方法的具体用法?C++ TPaveText::AddText怎么用?C++ TPaveText::AddText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TPaveText
的用法示例。
在下文中一共展示了TPaveText::AddText方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LCTsigma_2016B_June22all_sameYrange
//.........这里部分代码省略.........
LCTsigma_6__66->SetBinContent(93,0.001997626);
LCTsigma_6__66->SetBinContent(94,0.000908012);
LCTsigma_6__66->SetBinContent(95,0.0009988132);
LCTsigma_6__66->SetBinContent(96,0.000908012);
LCTsigma_6__66->SetBinContent(97,0.001180416);
LCTsigma_6__66->SetBinContent(98,0.001089614);
LCTsigma_6__66->SetBinContent(99,0.00154362);
LCTsigma_6__66->SetBinContent(100,0.00154362);
LCTsigma_6__66->SetBinContent(101,0.08925758);
LCTsigma_6__66->SetEntries(1102290);
LCTsigma_6__66->SetStats(0);
ci = TColor::GetColor("#0000ff");
LCTsigma_6__66->SetLineColor(ci);
ci = TColor::GetColor("#0000ff");
LCTsigma_6__66->SetMarkerColor(ci);
LCTsigma_6__66->GetXaxis()->SetTitle("cm");
LCTsigma_6__66->GetYaxis()->SetTitle("scaled number of entries");
LCTsigma_6__66->Draw("H,same");
leg = new TLegend(0.5,0.7,0.9,0.9,NULL,"brNDC");
leg->SetBorderSize(1);
leg->SetTextFont(62);
leg->SetTextSize(0.02);
leg->SetLineColor(1);
leg->SetLineStyle(1);
leg->SetLineWidth(1);
leg->SetFillColor(0);
leg->SetFillStyle(1001);
entry=leg->AddEntry("LCTsigma_1","ME11A: mean:2.4cm;RMS:4.7cm","l");
ci = TColor::GetColor("#ff00ff");
entry->SetLineColor(ci);
entry->SetLineStyle(1);
entry->SetLineWidth(1);
entry->SetMarkerColor(1);
entry->SetMarkerStyle(21);
entry->SetMarkerSize(1);
entry->SetTextFont(62);
entry=leg->AddEntry("LCTsigma_2","ME11B: mean:2.1cm;RMS:4.0cm","l");
ci = TColor::GetColor("#ff9999");
entry->SetLineColor(ci);
entry->SetLineStyle(1);
entry->SetLineWidth(1);
entry->SetMarkerColor(1);
entry->SetMarkerStyle(21);
entry->SetMarkerSize(1);
entry->SetTextFont(62);
entry=leg->AddEntry("LCTsigma_3","ME12+13: mean:1.5cm;RMS:2.4cm","l");
entry->SetLineColor(1);
entry->SetLineStyle(1);
entry->SetLineWidth(1);
entry->SetMarkerColor(1);
entry->SetMarkerStyle(21);
entry->SetMarkerSize(1);
entry->SetTextFont(62);
entry=leg->AddEntry("LCTsigma_4","ME2: mean:1.4cm;RMS:2.2cm","l");
ci = TColor::GetColor("#ff0000");
entry->SetLineColor(ci);
entry->SetLineStyle(1);
entry->SetLineWidth(1);
entry->SetMarkerColor(1);
entry->SetMarkerStyle(21);
entry->SetMarkerSize(1);
entry->SetTextFont(62);
entry=leg->AddEntry("LCTsigma_5","ME3: mean:1.3cm;RMS:1.6cm","l");
ci = TColor::GetColor("#00ff00");
entry->SetLineColor(ci);
entry->SetLineStyle(1);
entry->SetLineWidth(1);
entry->SetMarkerColor(1);
entry->SetMarkerStyle(21);
entry->SetMarkerSize(1);
entry->SetTextFont(62);
entry=leg->AddEntry("LCTsigma_6","ME4: mean:1.3cm;RMS:1.3cm","l");
ci = TColor::GetColor("#0000ff");
entry->SetLineColor(ci);
entry->SetLineStyle(1);
entry->SetLineWidth(1);
entry->SetMarkerColor(1);
entry->SetMarkerStyle(21);
entry->SetMarkerSize(1);
entry->SetTextFont(62);
leg->Draw();
TPaveText *pt = new TPaveText(0.01,0.9390678,0.2437097,0.995,"blNDC");
pt->SetName("title");
pt->SetBorderSize(1);
pt->SetFillColor(0);
TText *AText = pt->AddText("LCTsigma");
pt->Draw();
LCTsigma->Modified();
LCTsigma->cd();
LCTsigma->SetSelected(LCTsigma);
}
示例2: ptBestFit
//.........这里部分代码省略.........
double YMIN = -1.1*frame2->GetMaximum();
hUnc2H->GetYaxis()->SetRangeUser(YMIN,YMAX);
hUnc2H->GetYaxis()->SetNdivisions(507);
// hUnc2H->GetXaxis()->SetTitleOffset(0.9);
// hUnc2H->GetYaxis()->SetTitleOffset(1.0);
hUnc2H->GetYaxis()->SetTickLength(0.0);
// hUnc2H->GetYaxis()->SetTitleSize(0.05);
// hUnc2H->GetYaxis()->SetLabelSize(0.04);
hUnc2H->GetYaxis()->CenterTitle(kTRUE);
hUnc2H->SetFillColor(kGreen);
hUnc2L->SetFillColor(kGreen);
hUncH->SetFillColor(kYellow);
hUncL->SetFillColor(kYellow);
hUncC->SetLineColor(kBlack);
hUncC->SetLineStyle(7);
hUnc2H->Draw("HIST");
hUnc2L->Draw("same HIST");
hUncH->Draw("same HIST");
hUncL->Draw("same HIST");
hUncC->Draw("same HIST");
frame2->GetYaxis()->SetTickLength(0.03/0.4);
frame2->Draw("same");
TList *list1 = (TList*)gPad->GetListOfPrimitives();
//list1->Print();
RooCurve *gSigFit = (RooCurve*)list1->FindObject("shapeSig_qqH_"+ds_name+"_Norm[mbbReg_"+ds_name+"]");
TLegend *leg = new TLegend(0.70,0.61,0.94,1.-gStyle->GetPadTopMargin()-0.01);
leg->SetTextFont(42);
leg->SetFillStyle(-1);
//leg->SetHeader(ds_name+" (m_{H}="+MASS+")");
leg->SetHeader(TString::Format("Category %d",atoi(ds_name(3,1).Data())+1));
leg->AddEntry(hBlind,"Data","P");
if (!BLIND) {
leg->AddEntry(gSigFit,"Fitted signal","L");
}
TLine *gEmpty = new TLine(0.0,0.0,0.0,0.0);
gEmpty->SetLineWidth(0);
TLegendEntry *l1 = leg->AddEntry(gEmpty,"(m_{H} = "+MASS+" GeV)","");
l1->SetTextSize(0.038*0.97*0.85);
leg->AddEntry(gFit,"Bkg. + signal","L");
leg->AddEntry(gBkgFit,"Bkg.","L");
leg->AddEntry(gQCDFit,"QCD","L");
leg->AddEntry(hUnc2H,"2#sigma bkg. unc.","F");
leg->AddEntry(hUncH,"1#sigma bkg. unc.","F");
leg->SetFillColor(0);
leg->SetBorderSize(0);
leg->SetTextFont(42);
leg->SetTextSize(0.038*0.98);
leg->Draw();
leg->SetY1(leg->GetY2()-leg->GetNRows()*0.045*0.96);
TPaveText *paveCMS = new TPaveText(gStyle->GetPadLeftMargin()+0.02,0.7,gStyle->GetPadLeftMargin()+0.15,1.-gStyle->GetPadTopMargin()-0.01,"NDC");
paveCMS->SetTextFont(62);
paveCMS->SetTextSize(gStyle->GetPadTopMargin()*3./4.);
paveCMS->SetBorderSize(0);
paveCMS->SetFillStyle(-1);
paveCMS->SetTextAlign(12);
paveCMS->AddText("CMS");
paveCMS->Draw();
gPad->Update();
paveCMS->SetY1NDC(paveCMS->GetY2NDC()-paveCMS->GetListOfLines()->GetSize()*gStyle->GetPadTopMargin());
TPaveText *paveLumi = new TPaveText(0.5,1.-gStyle->GetPadTopMargin(),0.98,1.00,"NDC");
paveLumi->SetTextFont(42);
paveLumi->SetTextSize(gStyle->GetPadTopMargin()*3./4.);
paveLumi->SetBorderSize(0);
paveLumi->SetFillStyle(-1);
paveLumi->SetTextAlign(32);
paveLumi->AddText(TString::Format("%.1f fb^{-1} (8TeV)",(atoi(ds_name(3,1).Data())<4 ? 19.8 : 18.3)).Data());//+ 18.2 ;
paveLumi->Draw();
TString path=".";
//TString path="BiasV10_limit_BRN5p4_dX0p1_B80-200_CAT0-6/output/";
system(TString::Format("[ ! -d %s/plot ] && mkdir %s/plot",path.Data(),path.Data()).Data());
system(TString::Format("[ ! -d %s/plot/fits ] && mkdir %s/plot/fits",path.Data(),path.Data()).Data());
canFit->SaveAs(TString::Format("%s/plot/fits/Fit_mH%s_%s.pdf",path.Data(),MASS.Data(),ds_name.Data()).Data());
canFit->SaveAs(TString::Format("%s/plot/fits/Fit_mH%s_%s.png",path.Data(),MASS.Data(),ds_name.Data()).Data());
canFit->SaveAs(TString::Format("%s/plot/fits/Fit_mH%s_%s.eps",path.Data(),MASS.Data(),ds_name.Data()).Data());
TText *l = (TText*)paveCMS->AddText("Preliminary");
l->SetTextFont(52);
paveCMS->Draw();
gPad->Update();
paveCMS->SetY1NDC(paveCMS->GetY2NDC()-paveCMS->GetListOfLines()->GetSize()*gStyle->GetPadTopMargin());
canFit->SaveAs(TString::Format("%s/plot/fits/Fit_mH%s_%s_prelim.pdf",path.Data(),MASS.Data(),ds_name.Data()).Data());
canFit->SaveAs(TString::Format("%s/plot/fits/Fit_mH%s_%s_prelim.png",path.Data(),MASS.Data(),ds_name.Data()).Data());
canFit->SaveAs(TString::Format("%s/plot/fits/Fit_mH%s_%s_prelim.eps",path.Data(),MASS.Data(),ds_name.Data()).Data());
delete ds;
}
cout << "chi2sumS: " << chi2sumS << endl;
cout << "chi2sumB: " << chi2sumB << endl;
cout << "nparS: " << nparS << endl;
cout << "nparB: " << nparB << endl;
cout << "nbinsum: " << nparsum << endl;
cout << "chi2sumS/(nbinsum - nparS): " << chi2sumS / (float)(nparsum - nparS) << endl;
cout << "chi2sumB/(nbinsum - nparB): " << chi2sumB / (float)(nparsum - nparB) << endl;
delete datasets;
}
示例3: getEff3Stats
//Assume heff_mct, htp, htpd, rat
void getEff3Stats(TH1D* h1, TH1D* h2, TH1D* h3, TH1D* h4, bool isData, TString varType, TString INPUTDIR_PREFIX, double from, double to) {
gStyle->SetOptTitle(0);
gStyle->SetEndErrorSize(2);
gStyle->SetErrorX(0.5);
TLegend* leg = MakeLegend();
TPaveText* pt = MakeTPave();
TCanvas* c1 = new TCanvas("c1","c1",800,600);
c1->cd();
if (varType != "rapidity") c1->SetLogx();
h1->SetMarkerSize(0);
h1->SetLineWidth(1.2);
//range
if (varType == "pt") h1->GetXaxis()->SetRangeUser(8,180);
else if (varType == "vtx") h1->GetXaxis()->SetRangeUser(0,20.4);
else if (varType == "mass") h1->GetXaxis()->SetRangeUser(15, 999);
h1->GetYaxis()->SetRangeUser(from,to);
h1->GetXaxis()->SetMoreLogLabels();
h1->GetYaxis()->SetTitle("#epsilon");
h1->SetLineColor(kRed);
h1->SetFillColor(kRed);
h2->SetLineColor(kBlue);
h2->SetFillColor(kBlue);
h4->SetLineColor(kGreen);
h4->SetFillColor(kGreen);
h4->SetFillStyle(3144);
//if you compare data to data
h1->Draw("E2");
h1->GetXaxis()->SetTitle(getTitle(varType, true));
h2->Draw("E2same");
h4->Draw("E2same");
leg->AddEntry(h1,"MC Truth","f");
leg->AddEntry(h2,"MC T&P","f");
leg->AddEntry(h4,"Ratio","f");
leg->Draw("same");
//if (dataOnly && !(varType == "rrr")) pt->Draw("same");
//if (varType == "pt") c1->SetLogx();
gROOT->ProcessLine(".L ../tools/stattools.C");
//Make TPave
ostringstream tmpstrm1;
ostringstream tmpstrm2;
ostringstream tmpstrm3;
tmpstrm3 << INPUTDIR_PREFIX << " " << h1->GetName();
tmpstrm1 << estimatorPerMassHisto1(h2,h3);
tmpstrm2 << estimatorPerMassHisto2(h2,h3,h1);
TPaveText *pt = new TPaveText(0.25,0.77,0.40,0.92,"brNDC");
pt->SetFillColor(0);
// pt->SetTextFont(72);
pt->SetTextSize(0.040);
pt->SetBorderSize(0);
pt->SetTextAlign(12);
pt->AddText(TString(tmpstrm3.str().c_str()));
pt->AddText("Simple estimator: "+TString(tmpstrm1.str().c_str()));
pt->AddText("Combined estimator: "+TString(tmpstrm2.str().c_str()));
pt->Draw("same");
//Save
c1->SaveAs(INPUTDIR_PREFIX+"/stats"+h1->GetName()+varType+".png");
}
示例4: bdt_in_regions
//.........这里部分代码省略.........
// delete dsfr_full_cont;
///////////
// Plots //
///////////
// signal sl //
RooPlot* bdtgSigslFrame = bdtgsl.frame();
hslpdf_s_sig->plotOn(bdtgSigslFrame,LineWidth(2),LineColor(kRed));
hslpdf_side_sig->plotOn(bdtgSigslFrame,LineWidth(2));
hslpdf_full_sig->plotOn(bdtgSigslFrame,LineWidth(2),LineColor(kBlack));
TCanvas* cbdtgs_sl = new TCanvas("bdtgs_sl","BDTg signal soft cut",700,500);
cbdtgs_sl->cd();
TPad *pad1 = new TPad("pad1","pad1",0.01,0.01,0.99,0.99);
pad1->Draw();
pad1->cd();
pad1->SetLeftMargin(0.15);
pad1->SetFillColor(0);
pad1->SetLogy();
bdtgSigslFrame->GetXaxis()->SetTitleSize(0.05);
bdtgSigslFrame->GetXaxis()->SetTitleOffset(0.85);
bdtgSigslFrame->GetXaxis()->SetLabelSize(0.04);
bdtgSigslFrame->GetYaxis()->SetTitleOffset(1.6);
bdtgSigslFrame->Draw();
out << setprecision(4);
TPaveText *pt = new TPaveText(0.4,0.84,0.6,0.91,"brNDC");
pt->SetFillColor(0);
pt->SetTextAlign(12);
out.str("");
out << "SR: " << sl_eff_s;
pt->AddText(out.str().c_str());
pt->SetTextColor(kRed);
pt->Draw();
TPaveText *pt2 = new TPaveText(0.4,0.77,0.6,0.84,"brNDC");
pt2->SetFillColor(0);
pt2->SetTextAlign(12);
out.str("");
out << "SC: " << sl_eff_sl;
pt2->AddText(out.str().c_str());
pt2->SetTextColor(kBlue);
pt2->Draw();
TPaveText *pt3 = new TPaveText(0.4,0.70,0.6,0.77,"brNDC");
pt3->SetFillColor(0);
pt3->SetTextAlign(12);
out.str("");
out << "FR: " << sl_eff_fr;
pt3->AddText(out.str().c_str());
pt3->SetTextColor(kBlack);
pt3->Draw();
TLine *line_s = new TLine(bdtgsl_cut,0,bdtgsl_cut,0.1);
line_s->SetLineColor(kBlue);
line_s->SetLineStyle(1);
line_s->SetLineWidth((Width_t)2.);
line_s->Draw();
if(save_flag) cbdtgs_sl->Print("../Reports/pics/bdtg_diff_sl_sig.png");
// signal fr //
RooPlot* bdtgSigfrFrame = bdtgfr.frame();
hfrpdf_s_sig->plotOn(bdtgSigfrFrame,LineWidth(2),LineColor(kRed));
hfrpdf_side_sig->plotOn(bdtgSigfrFrame,LineWidth(2));
hfrpdf_full_sig->plotOn(bdtgSigfrFrame,LineWidth(2),LineColor(kBlack));
示例5: METJets
//.........这里部分代码省略.........
ci = TColor::GetColor("#0000ff");
METJets30->SetFillColor(ci);
ci = TColor::GetColor("#0000ff");
METJets30->SetLineColor(ci);
ci = TColor::GetColor("#0000ff");
METJets30->SetMarkerColor(ci);
METJets30->SetMarkerStyle(21);
METJets30->GetXaxis()->SetTitle("METJets");
METJets30->GetXaxis()->SetLabelFont(42);
METJets30->GetXaxis()->SetLabelSize(0.035);
METJets30->GetXaxis()->SetTitleSize(0.035);
METJets30->GetXaxis()->SetTitleFont(42);
METJets30->GetYaxis()->SetTitle("Events/pb");
METJets30->GetYaxis()->SetLabelFont(42);
METJets30->GetYaxis()->SetLabelSize(0.035);
METJets30->GetYaxis()->SetTitleSize(0.035);
METJets30->GetYaxis()->SetTitleFont(42);
METJets30->GetZaxis()->SetLabelFont(42);
METJets30->GetZaxis()->SetLabelSize(0.035);
METJets30->GetZaxis()->SetTitleSize(0.035);
METJets30->GetZaxis()->SetTitleFont(42);
METJets->Add(METJets,"");
METJets->Draw("nostack");
TPaveText *pt = new TPaveText(0.3872701,0.94,0.6127299,0.995,"blNDC");
pt->SetName("title");
pt->SetBorderSize(0);
pt->SetFillColor(0);
pt->SetFillStyle(0);
pt->SetTextFont(42);
TText *AText = pt->AddText("METJets");
pt->Draw();
TLegend *leg = new TLegend(0.54023,0.639881,0.938218,0.924107,NULL,"brNDC");
leg->SetBorderSize(1);
leg->SetTextSize(0.034965);
leg->SetLineColor(1);
leg->SetLineStyle(1);
leg->SetLineWidth(1);
leg->SetFillColor(0);
leg->SetFillStyle(1001);
TLegendEntry *entry=leg->AddEntry("METJets","METJets_QCD","lp");
ci = TColor::GetColor("#00cc00");
entry->SetLineColor(ci);
entry->SetLineStyle(1);
entry->SetLineWidth(1);
ci = TColor::GetColor("#00cc00");
entry->SetMarkerColor(ci);
entry->SetMarkerStyle(22);
entry->SetMarkerSize(1);
entry->SetTextFont(42);
entry=leg->AddEntry("METJets","METJets_WJetsToLNu","lp");
ci = TColor::GetColor("#00ffff");
entry->SetLineColor(ci);
entry->SetLineStyle(1);
entry->SetLineWidth(1);
ci = TColor::GetColor("#00ffff");
entry->SetMarkerColor(ci);
entry->SetMarkerStyle(20);
示例6: draw_qa_sim
void draw_qa_sim(TString inFileName="sim.qa.root")
{
gStyle->SetPalette(1);
TFile* inFile = new TFile(inFileName.Data());
TH1F* fhNofEvents = (TH1F*)inFile->Get("STSSimulationQA/hNofEvents");
TH1F* fhNofStsStations = (TH1F*)inFile->Get("STSSimulationQA/hNofStsStations");
Int_t nofStations = fhNofStsStations->GetBinContent(1);
Int_t fShowStation = 4;
Int_t fNEvents = fhNofEvents->GetBinContent(1);
TH1F* fhMomAll = (TH1F*)inFile->Get("STSSimulationQA/hMomAll");
TH1F* fhMomRec = (TH1F*)inFile->Get("STSSimulationQA/hMomRec");
TH2F* fhYPtMapRec = (TH2F*)inFile->Get("STSSimulationQA/hYPtMapRec");
TH1F* fhStsPointsRec = (TH1F*)inFile->Get("STSSimulationQA/hStsPointsRec");
TH3F* fhStsPointsPosition = (TH3F*)inFile->Get("STSSimulationQA/hStsPointsPosition");
TH2F* fhStationPoints[10];
for ( Int_t ist = 0 ; ist < nofStations ; ist++ )
fhStationPoints[ist] = (TH2F*)inFile->Get(Form("STSSimulationQA/hStationPoints%i",ist+1));
Double_t tracksPerEvent = (Double_t)(fhMomAll->GetEntries())/((Double_t)fNEvents);
Double_t pointsPerEvent = (Double_t)(fhStsPointsPosition->GetEntries())/((Double_t)fNEvents);
TCanvas* simCanvas = new TCanvas("StsSim","Sts simulation",10,10,600,900);
TPad* simPad[10];
simPad[0] = new TPad("titlePad", "Title pad" ,0.01,0.91,0.99,0.99);
simPad[1] = new TPad("momentumPad","Momentum pad" ,0.01,0.46,0.49,0.89);
simPad[2] = new TPad("yptPad", "y-pt pad" ,0.01,0.01,0.49,0.44);
simPad[3] = new TPad("pointPad", "Points per track pad" ,0.51,0.61,0.99,0.89);
simPad[4] = new TPad("stationPad", "Points on 1st station pad",0.51,0.31,0.99,0.59);
simPad[5] = new TPad("printoutPad","Print information pad ",0.51,0.01,0.99,0.29);
simPad[1]->SetLogy();
for ( Int_t ipad = 0 ; ipad < 6 ; ipad++ ) {
simPad[ipad]->SetFillColor(0);
simPad[ipad]->SetBorderMode(0);
simPad[ipad]->Draw();
}
simPad[0]->cd();
TLegend* brp = new TLegend(0.1,0.1,0.9,0.9,"STS simulation");
brp->SetTextAlign(22);
brp->SetTextSize(0.6);
brp->SetTextColor(1);
brp->SetBorderSize(0);
brp->SetFillColor(0);
brp->Draw();
simPad[0]->Update();
simPad[1]->cd();
// fhMomAll->Draw();
fhMomRec->Draw();
simPad[1]->Update();
simPad[2]->cd();
fhYPtMapRec->Draw("colz");
simPad[2]->Update();
simPad[3]->cd();
fhStsPointsRec->Draw();
simPad[3]->Update();
simPad[4]->cd();
fhStationPoints[0]->Draw();
fhStationPoints[0]->Draw("colz");
simPad[4]->Update();
simPad[5]->cd();
TPaveText* printoutPave = new TPaveText(0.1,0.1,0.9,0.9);
printoutPave->SetTextAlign(22);
printoutPave->SetTextSize(0.1);
printoutPave->SetTextColor(1);
printoutPave->SetBorderSize(0);
printoutPave->SetFillColor(0);
printoutPave->AddText(Form("%i events",fNEvents));
printoutPave->AddText(Form("tracks/event = %3.2f",tracksPerEvent));
printoutPave->AddText(Form("points/event = %3.2f",pointsPerEvent));
simPad[5]->Clear();
printoutPave->Draw();
simPad[5]->Update();
}
示例7: TracktoLCTX_2015all_sameYrange
//.........这里部分代码省略.........
TracktoLCTX_6__114->SetBinContent(93,0.005594552);
TracktoLCTX_6__114->SetBinContent(94,0.001748298);
TracktoLCTX_6__114->SetBinContent(95,0.002797276);
TracktoLCTX_6__114->SetBinContent(96,0.004895233);
TracktoLCTX_6__114->SetBinContent(97,0.003146936);
TracktoLCTX_6__114->SetBinContent(98,0.002097957);
TracktoLCTX_6__114->SetBinContent(99,0.003846255);
TracktoLCTX_6__114->SetBinContent(100,0.003146936);
TracktoLCTX_6__114->SetBinContent(101,0.06888293);
TracktoLCTX_6__114->SetEntries(1328499);
TracktoLCTX_6__114->SetStats(0);
ci = TColor::GetColor("#0000ff");
TracktoLCTX_6__114->SetLineColor(ci);
ci = TColor::GetColor("#0000ff");
TracktoLCTX_6__114->SetMarkerColor(ci);
TracktoLCTX_6__114->GetXaxis()->SetTitle("cm");
TracktoLCTX_6__114->GetYaxis()->SetTitle("scaled number of entries");
TracktoLCTX_6__114->Draw("H,same");
leg = new TLegend(0.5,0.7,0.9,0.9,NULL,"brNDC");
leg->SetBorderSize(1);
leg->SetTextFont(62);
leg->SetTextSize(0.02);
leg->SetLineColor(1);
leg->SetLineStyle(1);
leg->SetLineWidth(1);
leg->SetFillColor(0);
leg->SetFillStyle(1001);
entry=leg->AddEntry("TracktoLCTX_1","ME11A: mean:-0.0cm;RMS:4.7cm","l");
ci = TColor::GetColor("#ff00ff");
entry->SetLineColor(ci);
entry->SetLineStyle(1);
entry->SetLineWidth(1);
entry->SetMarkerColor(1);
entry->SetMarkerStyle(21);
entry->SetMarkerSize(1);
entry->SetTextFont(62);
entry=leg->AddEntry("TracktoLCTX_2","ME11B: mean:-0.0cm;RMS:4.6cm","l");
ci = TColor::GetColor("#ff9999");
entry->SetLineColor(ci);
entry->SetLineStyle(1);
entry->SetLineWidth(1);
entry->SetMarkerColor(1);
entry->SetMarkerStyle(21);
entry->SetMarkerSize(1);
entry->SetTextFont(62);
entry=leg->AddEntry("TracktoLCTX_3","ME12+13: mean:0.0cm;RMS:3.5cm","l");
entry->SetLineColor(1);
entry->SetLineStyle(1);
entry->SetLineWidth(1);
entry->SetMarkerColor(1);
entry->SetMarkerStyle(21);
entry->SetMarkerSize(1);
entry->SetTextFont(62);
entry=leg->AddEntry("TracktoLCTX_4","ME2: mean:0.0cm;RMS:4.0cm","l");
ci = TColor::GetColor("#ff0000");
entry->SetLineColor(ci);
entry->SetLineStyle(1);
entry->SetLineWidth(1);
entry->SetMarkerColor(1);
entry->SetMarkerStyle(21);
entry->SetMarkerSize(1);
entry->SetTextFont(62);
entry=leg->AddEntry("TracktoLCTX_5","ME3: mean:0.1cm;RMS:2.8cm","l");
ci = TColor::GetColor("#00ff00");
entry->SetLineColor(ci);
entry->SetLineStyle(1);
entry->SetLineWidth(1);
entry->SetMarkerColor(1);
entry->SetMarkerStyle(21);
entry->SetMarkerSize(1);
entry->SetTextFont(62);
entry=leg->AddEntry("TracktoLCTX_6","ME4: mean:0.0cm;RMS:2.3cm","l");
ci = TColor::GetColor("#0000ff");
entry->SetLineColor(ci);
entry->SetLineStyle(1);
entry->SetLineWidth(1);
entry->SetMarkerColor(1);
entry->SetMarkerStyle(21);
entry->SetMarkerSize(1);
entry->SetTextFont(62);
leg->Draw();
TPaveText *pt = new TPaveText(0.01,0.945,0.3062097,0.995,"blNDC");
pt->SetName("title");
pt->SetBorderSize(1);
pt->SetFillColor(0);
TText *AText = pt->AddText("TracktoLCTX");
pt->Draw();
TracktoLCTX->Modified();
TracktoLCTX->cd();
TracktoLCTX->SetSelected(TracktoLCTX);
}
示例8: single
//.........这里部分代码省略.........
hFitTauL2__9__1->GetXaxis()->SetTitle("mus");
hFitTauL2__9__1->GetXaxis()->CenterTitle(true);
hFitTauL2__9__1->GetXaxis()->SetNdivisions(505);
hFitTauL2__9__1->GetXaxis()->SetLabelFont(42);
hFitTauL2__9__1->GetXaxis()->SetLabelOffset(-0.005);
hFitTauL2__9__1->GetXaxis()->SetLabelSize(0.07);
hFitTauL2__9__1->GetXaxis()->SetTitleSize(0.07);
hFitTauL2__9__1->GetXaxis()->SetTitleOffset(0.7);
hFitTauL2__9__1->GetXaxis()->SetTitleFont(42);
hFitTauL2__9__1->GetYaxis()->SetNdivisions(506);
hFitTauL2__9__1->GetYaxis()->SetLabelFont(42);
hFitTauL2__9__1->GetYaxis()->SetLabelSize(0.07);
hFitTauL2__9__1->GetYaxis()->SetTitleSize(0.035);
hFitTauL2__9__1->GetYaxis()->SetTitleFont(42);
hFitTauL2__9__1->GetZaxis()->SetLabelFont(42);
hFitTauL2__9__1->GetZaxis()->SetLabelSize(0.035);
hFitTauL2__9__1->GetZaxis()->SetTitleSize(0.035);
hFitTauL2__9__1->GetZaxis()->SetTitleFont(42);
hFitTauL2__9__1->Draw("");
TLine *line = new TLine(2.197175,0,2.197175,60);
ci = TColor::GetColor("#006600");
line->SetLineColor(ci);
line->SetLineWidth(3);
line->Draw();
TPaveText *pt = new TPaveText(0.4700392,0.94,0.5299608,0.995,"blNDC");
pt->SetName("title");
pt->SetBorderSize(0);
pt->SetFillColor(0);
pt->SetFillStyle(0);
pt->SetTextFont(42);
pt->SetTextSize(0.1009779);
TText *AText = pt->AddText("#tau_{+}");
pt->Draw();
METODO2_1->Modified();
METODO2->cd();
// ------------>Primitives in pad: METODO2_2
TPad *METODO2_2 = new TPad("METODO2_2", "METODO2_2",0.26,0.51,0.49,0.99);
METODO2_2->Draw();
METODO2_2->cd();
METODO2_2->Range(0.7088825,-8.793751,1.086034,79.14375);
METODO2_2->SetFillColor(0);
METODO2_2->SetBorderMode(0);
METODO2_2->SetBorderSize(2);
METODO2_2->SetFrameBorderMode(0);
METODO2_2->SetFrameBorderMode(0);
TH1D *hFitTauShortL2__10__2 = new TH1D("hFitTauShortL2__10__2","#tau_{-}",40,0.7465977,1.048319);
hFitTauShortL2__10__2->SetBinContent(1,2);
hFitTauShortL2__10__2->SetBinContent(2,6);
hFitTauShortL2__10__2->SetBinContent(3,8);
hFitTauShortL2__10__2->SetBinContent(4,11);
hFitTauShortL2__10__2->SetBinContent(5,12);
hFitTauShortL2__10__2->SetBinContent(6,15);
hFitTauShortL2__10__2->SetBinContent(7,20);
hFitTauShortL2__10__2->SetBinContent(8,28);
hFitTauShortL2__10__2->SetBinContent(9,21);
hFitTauShortL2__10__2->SetBinContent(10,32);
hFitTauShortL2__10__2->SetBinContent(11,30);
hFitTauShortL2__10__2->SetBinContent(12,35);
hFitTauShortL2__10__2->SetBinContent(13,32);
hFitTauShortL2__10__2->SetBinContent(14,46);
hFitTauShortL2__10__2->SetBinContent(15,49);
hFitTauShortL2__10__2->SetBinContent(16,41);
示例9: zj_dphi_8TeV_log
//.........这里部分代码省略.........
ci = TColor::GetColor("#ffff00");
entry->SetFillColor(ci);
entry->SetFillStyle(1001);
entry->SetLineStyle(1);
entry->SetLineWidth(2);
entry->SetMarkerColor(1);
entry->SetMarkerStyle(21);
entry->SetMarkerSize(1);
entry->SetTextFont(132);
entry=leg->AddEntry("powheg_temp","POWHEG","p");
entry->SetLineColor(1);
entry->SetLineStyle(1);
entry->SetLineWidth(1);
entry->SetMarkerColor(1);
entry->SetMarkerStyle(20);
entry->SetMarkerSize(1);
entry->SetTextFont(132);
entry=leg->AddEntry("amcatnlo_temp","[email protected]","p");
entry->SetLineColor(1);
entry->SetLineStyle(1);
entry->SetLineWidth(1);
entry->SetMarkerColor(1);
entry->SetMarkerStyle(24);
entry->SetMarkerSize(1);
entry->SetTextFont(132);
leg->Draw();
TPaveText *pt = new TPaveText(0.2,0.8,0.55,0.95,"brNDC");
pt->SetBorderSize(0);
pt->SetFillStyle(0);
pt->SetLineWidth(2);
pt->SetTextFont(132);
TText *AText = pt->AddText("LHCb, #sqrt{s} = 8 TeV");
pt->Draw();
TH1F *z_dphi_toterr_copy__39 = new TH1F("z_dphi_toterr_copy__39","z_dphi",6,0,3.141593);
z_dphi_toterr_copy__39->SetBinContent(1,0.261202);
z_dphi_toterr_copy__39->SetBinContent(2,0.3162337);
z_dphi_toterr_copy__39->SetBinContent(3,0.3852335);
z_dphi_toterr_copy__39->SetBinContent(4,0.7150939);
z_dphi_toterr_copy__39->SetBinContent(5,1.796506);
z_dphi_toterr_copy__39->SetBinContent(6,7.258657);
z_dphi_toterr_copy__39->SetBinContent(7,3.800624);
z_dphi_toterr_copy__39->SetBinError(1,0.03375302);
z_dphi_toterr_copy__39->SetBinError(2,0.03634611);
z_dphi_toterr_copy__39->SetBinError(3,0.0427511);
z_dphi_toterr_copy__39->SetBinError(4,0.05747346);
z_dphi_toterr_copy__39->SetBinError(5,0.1278198);
z_dphi_toterr_copy__39->SetBinError(6,0.3295685);
z_dphi_toterr_copy__39->SetBinError(7,0.1725617);
z_dphi_toterr_copy__39->SetEntries(14);
z_dphi_toterr_copy__39->SetDirectory(0);
z_dphi_toterr_copy__39->SetStats(0);
ci = TColor::GetColor("#ffff00");
z_dphi_toterr_copy__39->SetFillColor(ci);
ci = TColor::GetColor("#ffff00");
z_dphi_toterr_copy__39->SetLineColor(ci);
z_dphi_toterr_copy__39->SetLineWidth(2);
ci = TColor::GetColor("#ffff00");
z_dphi_toterr_copy__39->SetMarkerColor(ci);
z_dphi_toterr_copy__39->SetMarkerStyle(0);
z_dphi_toterr_copy__39->GetXaxis()->SetNdivisions(4);
示例10: TCanvas_Name
void Rapid2DLL::Plot_Contours( TString controlled_parameter1, TString controlled_parameter2, TH1* nll_hist, vector<pair<TMultiGraph*,TString> > nll_contours,
TString filename, TRandom* rand, vector<string> other_params )
{
if( rand == NULL ) rand = gRandom;
//TPaveText* label = NULL;
string addLHCb="--isFinal";
string addSMPhisString="--addPhis";
bool addSMPhis = StringOperations::VectorContains( &other_params, &addSMPhisString ) != -1;
/*
if( StringOperations::VectorContains( &other_params, &addLHCb ) != -1 ) label = Histogram_Processing::addLHCbLabel( "", true );
else label = Histogram_Processing::addLHCbLabel( "", false );
*/
TPaveText* label = EdStyle::LHCbLabel();
if( StringOperations::VectorContains( &other_params, &addLHCb ) == -1 )
{
label->AddText( "" );
label->AddText( "Preliminary" );
}
//TLegend* leg = EdStyle::LHCbLegend();//0.65, 0.65, 0.9, 0.9 );
TLegend* leg = new TLegend( 0.675, 0.725, 0.9, 0.925 );
leg->SetFillColor( kWhite );
leg->SetFillStyle( EdStyle::GetTransparentFillStyle() );
leg->SetTextSize( 0.050 );//EdStyle::GetLHCbTextSize() );
leg->SetTextFont( EdStyle::GetLHCbFont() );
//TString TCanvas_Namea("TCanvas_");TCanvas_Namea+=rand->Rndm();
//TCanvas* c1a = EdStyle::RapidFitCanvas( TCanvas_Namea, TCanvas_Namea );
//nll_hist->Draw("AXIS");
//c1a->Update();
TString TCanvas_Name("TCanvas_"); TCanvas_Name+=rand->Rndm();
TCanvas_Name = StringOperations::Clean( TCanvas_Name );
TCanvas* c1 = EdStyle::RapidFitCanvas( TCanvas_Name, TCanvas_Name );
nll_hist->Draw("AXIS");
//nll_contours.back().first->Draw("AXIS");
//c1->Update();
//nll_contours.back().first->GetXaxis()->SetRangeUser( nll_hist->GetXaxis()->GetXmin(), nll_hist->GetXaxis()->GetXmax() );
//nll_contours.back().first->GetYaxis()->SetRangeUser( nll_hist->GetYaxis()->GetXmin(), nll_hist->GetYaxis()->GetXmax() );
c1->Update();
unsigned int cont_num=0;
for( vector<pair<TMultiGraph*,TString> >::iterator cont_i = nll_contours.begin(); cont_i != nll_contours.end(); ++cont_i, ++cont_num )
{
cont_i->first->Draw("C");
TList* this_cont = cont_i->first->GetListOfGraphs();
for( unsigned int i=0; i< (unsigned)this_cont->GetSize(); ++i )
{
TGraph* this_part = (TGraph*) this_cont->At( i );
this_part->SetLineColor( (Color_t)Rapid2DLL::GetColors( cont_num ) );
this_part->SetLineStyle( (Style_t)Rapid2DLL::GetStyle( cont_num ) );
this_part->SetLineWidth( (Width_t)Rapid2DLL::GetFunctionLineWidth() );
}
leg->AddEntry( cont_i->first->GetListOfGraphs()->First() , nll_contours[cont_num].second, "L" );
}
nll_hist->GetXaxis()->SetTitle( EdStyle::GetParamRootName(controlled_parameter1) + " " + EdStyle::GetParamRootUnit(controlled_parameter1) );
nll_hist->GetYaxis()->SetTitle( EdStyle::GetParamRootName(controlled_parameter2) + " " + EdStyle::GetParamRootUnit(controlled_parameter2) );
c1->Update();
leg->Draw();
if( label ) label->Draw();
if( addSMPhis )
{
double* px=NULL;
double* xerr=NULL;
double* py=NULL;
double* yerr=NULL;
if( controlled_parameter1 == "Phi_s" )
{
px = new double[1]; px[0] = -0.036;//0.087;
xerr = new double[1]; xerr[0] = 0.002;//0.021;
py = new double[1]; py[0] = 0.087;//0.036;
yerr = new double[1]; yerr[0] = 0.021;//0.002;
}
else
{
px = new double[1]; px[0] = 0.087;
xerr = new double[1]; xerr[0] = 0.021;
py = new double[1]; py[0] = -0.036;
yerr = new double[1]; yerr[0] = 0.002;
}
if( ( controlled_parameter1 == "Phi_s" || controlled_parameter1 == "deltaGamma" )&&( controlled_parameter2 == "Phi_s" || controlled_parameter2 == "deltaGamma" ) )
{
TGraphErrors* CV = new TGraphErrors( 1, px, py, xerr, yerr );
CV->SetName( "Standard Model" );
leg->AddEntry( CV, "Standard Model", "PE" );
CV->Draw("LP SAME");
}
}
c1->Update();
//.........这里部分代码省略.........
示例11: PlotField2D
//.........这里部分代码省略.........
// Define the frames for plotting
Int_t fonttype = 43;
Int_t fontsize = 28;
Int_t tfontsize = 30;
Float_t txoffset = 1.3;
Float_t lxoffset = 0.02;
Float_t tyoffset = 1.0;
Float_t lyoffset = 0.01;
Float_t tylength = 0.02;
Float_t txlength = 0.04;
TH2F *hFrame = (TH2F*) gROOT->FindObject("hFrame");
if(hFrame) delete hFrame;
hFrame = (TH2F*) hE2D[index]->Clone("hFrame");
hFrame->Reset();
// Format for y axis
hFrame->GetYaxis()->SetTitleFont(fonttype);
hFrame->GetYaxis()->SetTitleSize(tfontsize);
hFrame->GetYaxis()->SetTitleOffset(tyoffset);
hFrame->GetYaxis()->SetLabelFont(fonttype);
hFrame->GetYaxis()->SetLabelSize(fontsize);
hFrame->GetYaxis()->SetLabelOffset(lyoffset);
hFrame->GetYaxis()->SetTickLength(tylength);
// Format for x axis
hFrame->GetXaxis()->SetTitleFont(fonttype);
hFrame->GetXaxis()->SetTitleSize(tfontsize+2);
hFrame->GetXaxis()->SetTitleOffset(txoffset);
hFrame->GetXaxis()->SetLabelFont(fonttype);
hFrame->GetXaxis()->SetLabelSize(fontsize+2);
hFrame->GetXaxis()->SetLabelOffset(lxoffset);
hFrame->GetXaxis()->SetTickLength(txlength);
hFrame->Draw("col");
// hE2D[index]->GetZaxis()->SetNdivisions(505);
hE2D[index]->GetZaxis()->SetTitleFont(fonttype);
hE2D[index]->Draw("colz same");
// Re-touchs
gPad->Update();
Float_t y1 = gPad->GetBottomMargin();
Float_t y2 = 1 - gPad->GetTopMargin();
Float_t x1 = gPad->GetLeftMargin();
Float_t x2 = 1 - gPad->GetRightMargin();
Float_t gap = 0.005;
TPaletteAxis *palette = (TPaletteAxis*)hE2D[index]->GetListOfFunctions()->FindObject("palette");
if(palette) {
palette->SetY2NDC(y2 - gap);
palette->SetY1NDC(y1 + gap);
palette->SetX1NDC(x2 + 0.005);
palette->SetX2NDC(x2 + 0.03);
palette->SetTitleOffset(tyoffset);
palette->SetTitleSize(tfontsize);
palette->SetLabelFont(fonttype);
palette->SetLabelSize(fontsize);
if(opt.Contains("logz"))
palette->SetLabelOffset(0);
else
palette->SetLabelOffset(lyoffset);
palette->SetBorderSize(2);
palette->SetLineColor(1);
}
// Text objects
TPaveText *textTime = new TPaveText(xMax - 0.30*xRange, yMax-0.10*yRange, xMax-0.02*xRange, yMax-0.02*yRange);
PGlobals::SetPaveTextStyle(textTime,32);
char ctext[128];
if(opt.Contains("units") && n0)
sprintf(ctext,"z = %5.1f #mum", Time * skindepth / PUnits::um);
else
sprintf(ctext,"#omega_{p} t = %5.1f",Time);
textTime->AddText(ctext);
TPaveText *textDen = new TPaveText(xMin + 0.02*xRange, yMax-0.10*yRange, xMin + 0.40*xRange, yMax-0.02*yRange);
PGlobals::SetPaveTextStyle(textDen,12);
textDen->SetTextColor(kOrange+10);
if(opt.Contains("units") && n0) {
sprintf(ctext,"n_{0} = %5.2f x 10^{17} / cm^{3}", 1e-17 * n0 * PUnits::cm3);
textDen->AddText(ctext);
textDen->Draw();
}
textTime->Draw();
gPad->RedrawAxis();
C->cd();
// Print to a file
PGlobals::imgconv(C,fOutName,opt);
// ---------------------------------------------------------
}
示例12: theoryStudy_separate
//.........这里部分代码省略.........
RatioPowhegPDFErrBand->SetFillStyle(3001);
//FEWZ
FEWZ_Xsec->SetFillColor(kGreen);
FEWZ_Xsec->SetFillStyle(3444);
RatioFEWZStatErrBand->SetFillColor(kGreen);
RatioFEWZStatErrBand->SetFillStyle(3001);
RatioFEWZQCDScaleErrBand->SetFillColor(kGreen+7);
RatioFEWZQCDScaleErrBand->SetFillStyle(3001);
RatioFEWZScalePDFErrBand->SetFillColor(kGreen+3);
RatioFEWZScalePDFErrBand->SetFillStyle(3001);
//ResBos
Resb30_CentralXsec->SetFillColor(kBlue);
Resb30_CentralXsec->SetFillStyle(3354);
RatioResbosErrBand->SetFillColor(kBlue-7);
RatioResbosErrBand->SetFillStyle(3001);
TLegend *lL =new TLegend(0.2,0.2,0.52,0.38); lL->SetFillColor(0); lL->SetBorderSize(0);
lL->AddEntry(Data_Xsec_Born,"data","PL");
lL->AddEntry(Powheg_Xsec_Born,"POWHEG CT10 NLO","f");
lL->AddEntry(FEWZ_Xsec,"FEWZ CT10 NNLO","f");
lL->AddEntry(Resb30_CentralXsec,"ResBos CT10 NNLL","f");
TPaveText *tb = new TPaveText(0.2,0.39,0.52,0.5,"NDC");
tb->SetBorderSize(0);
tb->SetFillStyle(0);
tb->AddText("18.4 pb^{-1} at #sqrt{s} = 8 TeV");
if (BaseName=="WpToMuNu")
tb->AddText("W^{+} #rightarrow #mu^{+} #nu");
if (BaseName=="WmToMuNu")
tb->AddText("W^{-} #rightarrow #mu^{-} #bar{#nu}");
if (BaseName=="WpToEleNu")
tb->AddText("W^{+} #rightarrow e^{+} #nu");
if (BaseName=="WmToEleNu")
tb->AddText("W^{-} #rightarrow e^{-} #bar{#nu}");
TCanvas *lC1 = new TCanvas("Can","Can",800,840); lC1->cd(); lC1->SetLogy();
lC1->cd(1)->SetPad(0,0.05,0.95,1.0);
lC1->cd(1)->SetTopMargin(0.05);
lC1->cd(1)->SetBottomMargin(0.1);
lC1->cd(1)->SetLeftMargin(0.15);
lC1->cd(1)->SetRightMargin(0.07);
lC1->cd(1)->SetTickx(1);
lC1->cd(1)->SetTicky(1);
gStyle->SetLineWidth(2.);
gStyle->SetOptStat(0);
gStyle->SetHatchesSpacing(0.75);
gStyle->SetHatchesLineWidth(2);
gPad->SetLogx(1);
gPad->SetLogy(1);
Powheg_Xsec_Born->GetYaxis()->SetRangeUser(1e-3,5*hResb30_CentralXsec[0]);
Powheg_Xsec_Born->SetTitle("");
Powheg_Xsec_Born->GetYaxis()->SetTitle("d#sigma/dp_{T}^{W} [pb/GeV]");
Powheg_Xsec_Born->GetYaxis()->SetTitleOffset(1.8);
Powheg_Xsec_Born->GetXaxis()->SetTitle("p_{T}^{W} [GeV]");
TPaveText *cmspre = new TPaveText(0.63,0.95,0.95,0.99,"NDC");
cmspre->SetBorderSize(0);
示例13: TCanvas
{
//
//This macro produces the flowchart of TFormula::Analyze
//Author: Rene Brun
gROOT->Reset();
c1 = new TCanvas("c1","Analyze.mac",620,790);
c1->Range(-1,0,19,30);
TPaveLabel pl1(0,27,3.5,29,"Analyze");
pl1.SetFillColor(42);
pl1.Draw();
TPaveText pt1(0,22.8,4,25.2);
TText *t1=pt1.AddText("Parenthesis matching");
TText *t2=pt1.AddText("Remove unnecessary");
TText *t2a=pt1.AddText("parenthesis");
pt1.Draw();
TPaveText pt2(6,23,10,25);
TText *t3=pt2.AddText("break of");
TText *t4=pt2.AddText("Analyze");
pt2.Draw();
TPaveText pt3(0,19,4,21);
t4=pt3.AddText("look for simple");
TText *t5=pt3.AddText("operators");
pt3.Draw();
TPaveText pt4(0,15,4,17);
TText *t6=pt4.AddText("look for an already");
TText *t7=pt4.AddText("defined expression");
pt4.Draw();
TPaveText pt5(0,11,4,13);
TText *t8=pt5.AddText("look for usual");
TText *t9=pt5.AddText("functions :cos sin ..");
示例14: proj_npe_7
//.........这里部分代码省略.........
2371.061,
2594.067,
2630.891,
2704.654,
2727.792,
2773.388,
2784.73,
2845.592,
2924.958,
3198.695};
Double_t _fy8[40] = {
2.75,
2.65,
2.65,
2.7,
2.35,
2.45,
140.25,
2.65,
2.15,
2.55,
2.35,
2.45,
2.3,
2.5,
2.65,
4.05,
2.55,
2.5,
2.35,
2.25,
2.6,
2.7,
2.7,
2.6,
2.4,
2.35,
2.8,
2.55,
2.35,
2.8,
2.4,
2.35,
2.6,
2.6,
2.45,
2.45,
2.65,
2.55,
2.55,
2.65};
TGraph *graph = new TGraph(40,_fx8,_fy8);
graph->SetName("");
graph->SetTitle("npe values of flashes in event: 7");
graph->SetFillColor(1);
Int_t ci; // for color index setting
TColor *color; // for color definition with alpha
ci = TColor::GetColor("#0000ff");
graph->SetMarkerColor(ci);
graph->SetMarkerStyle(20);
TH1F *Graph_Graph8 = new TH1F("Graph_Graph8","npe values of flashes in event: 7",100,-2006.917,3671.932);
Graph_Graph8->SetMinimum(0);
Graph_Graph8->SetMaximum(154.06);
Graph_Graph8->SetDirectory(0);
Graph_Graph8->SetStats(0);
ci = TColor::GetColor("#000099");
Graph_Graph8->SetLineColor(ci);
Graph_Graph8->GetXaxis()->SetTitle("flash_t");
Graph_Graph8->GetXaxis()->SetLabelFont(42);
Graph_Graph8->GetXaxis()->SetLabelSize(0.035);
Graph_Graph8->GetXaxis()->SetTitleSize(0.035);
Graph_Graph8->GetXaxis()->SetTitleFont(42);
Graph_Graph8->GetYaxis()->SetTitle("flash_npe");
Graph_Graph8->GetYaxis()->SetLabelFont(42);
Graph_Graph8->GetYaxis()->SetLabelSize(0.035);
Graph_Graph8->GetYaxis()->SetTitleSize(0.035);
Graph_Graph8->GetYaxis()->SetTitleFont(42);
Graph_Graph8->GetZaxis()->SetLabelFont(42);
Graph_Graph8->GetZaxis()->SetLabelSize(0.035);
Graph_Graph8->GetZaxis()->SetTitleSize(0.035);
Graph_Graph8->GetZaxis()->SetTitleFont(42);
graph->SetHistogram(Graph_Graph8);
graph->Draw("ap");
TPaveText *pt = new TPaveText(0.1823077,0.9368947,0.8176923,0.995,"blNDC");
pt->SetName("title");
pt->SetBorderSize(0);
pt->SetFillColor(0);
pt->SetFillStyle(0);
pt->SetTextFont(42);
TText *AText = pt->AddText("npe values of flashes in event: 7");
pt->Draw();
c->Modified();
c->cd();
c->SetSelected(c);
}
示例15: PlotField1D
//.........这里部分代码省略.........
//htemp->Smooth(1,"R");
Int_t binMax = htemp->GetMinimumBin();
EMaxPos[i] = (Float_t) htemp->GetBinCenter(binMax);
EMaxValue[i] = (Float_t) htemp->GetBinContent(binMax);
delete htemp;
}
// Tunning the Histograms
// ---------------------
// Plotting
// -----------------------------------------------
// Output file
TString fOutName = Form("./%s/Plots/Field1D/Field1D",sim.Data());
fOutName += Form("-%s_%i",sim.Data(),time);
// Canvas setup
TCanvas *C = new TCanvas("C","Electric wakefield on axis",850,1000);
C->Divide(1,2);
// Draw objects
TPaveText *textTime = new TPaveText(0.70,0.87,0.85,0.92,"NDC");
PlasmaGlob::SetPaveTextStyle(textTime);
char ctext[128];
if(opt.Contains("units") && n0)
sprintf(ctext,"Z = %5.1f mm", 1e3 * skindepth * Time);
else
sprintf(ctext,"T = %5.1f 1/#omega_{p}",Time);
textTime->AddText(ctext);
// Colors
Int_t fieldC = PlasmaGlob::fieldLine;
Int_t phaseC = kGray+1;
// Actual Plotting!
// ------------------------------------------------------------
// More makeup
C->cd(1);
gPad->SetGridy(0);
gPad->SetGridx(0);
gPad->SetFrameLineWidth(2);
hE1D[0]->SetLineWidth(1);
hE1D[0]->GetYaxis()->CenterTitle();
hE1D[0]->GetXaxis()->CenterTitle();
hE1D[0]->SetLineStyle(1);
hE1D[0]->SetLineWidth(3);
hE1D[0]->SetLineColor(fieldC);
hE1D[0]->SetMarkerStyle(20);
if(Nfields>1) {
hE1D[1]->GetYaxis()->CenterTitle();
hE1D[1]->GetXaxis()->CenterTitle();
hE1D[1]->SetLineStyle(1);
hE1D[1]->SetLineWidth(1);
hE1D[1]->SetLineColor(fieldC);
hE1D[1]->SetMarkerStyle(24);
}
Float_t factor = 1.5;