本文整理汇总了C++中TBox::Clone方法的典型用法代码示例。如果您正苦于以下问题:C++ TBox::Clone方法的具体用法?C++ TBox::Clone怎么用?C++ TBox::Clone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TBox
的用法示例。
在下文中一共展示了TBox::Clone方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: NuclearModification
//.........这里部分代码省略.........
yRpAStat[i]=ySigmapPbStat[i]/yRefPP[i];
yFONLL[i]=yRpA[i];
yPercRpAsystFONLLhigh[i]=(yPercPPsystFONLLlow[i]/(1-yPercPPsystFONLLlow[i]));
yPercRpAsystFONLLlow[i]=(yPercPPsystFONLLhigh[i]/(1+yPercPPsystFONLLhigh[i]));
yRpAsystFONLLhigh[i]=yPercRpAsystFONLLhigh[i]*yRpA[i];
yRpAsystFONLLlow[i]=yPercRpAsystFONLLlow[i]*yRpA[i];
yRpPbSystTotHigh[i]=yPercSigmapPbSystTotHigh[i]*yRpA[i];
yRpPbSystTotLow[i]=yPercSigmapPbSystTotLow[i]*yRpA[i];
std::cout << i << " , " << xbins[i] << " , " << ySigmapPb[i] << " , sta: " << ySigmapPbStat[i] << " , syslow: " << ySigmapPbSystTotLow[i] << " ,syshigh: " << ySigmapPbSystTotHigh[i] << std::endl;
std::cout << "FONLL: " << yRefPP[i] << " - " << yPPsystFONLLlow[i] << " + " << yPPsystFONLLhigh[i] << std::endl;
std::cout << i << " ####### " << xbins[i] << " , " << yRpA[i] << " , sta: " << yRpAStat[i] << " , syslow: " << yRpPbSystTotLow[i] << " ,syshigh: " << yRpPbSystTotHigh[i] << " ,FONLLlow: " << yRpAsystFONLLlow[i] << " , FONLLhigh: " << yRpAsystFONLLhigh[i] << std::endl;
TGraphAsymmErrors *gRpAstat = new TGraphAsymmErrors(nbins,xbins,yRpA,exl0,exl0,yRpAStat,yRpAStat);
TGraphAsymmErrors *gRpAsyst = new TGraphAsymmErrors(nbins,xbins,yRpA,exl,exl,yRpPbSystTotLow,yRpPbSystTotHigh);
TGraphAsymmErrors *gRpAsystFONLL = new TGraphAsymmErrors(nbins,xbins,yFONLL,exl,exl,yRpAsystFONLLlow,yRpAsystFONLLhigh);
}
TGraphAsymmErrors *gSigmasyst = new TGraphAsymmErrors(nbins,xbins,ySigmapPb,exl2,exl2,ySigmapPbSystTotLow,ySigmapPbSystTotHigh);
//###TGraphAsymmErrors *gSigmasyst = new TGraphAsymmErrors(nbins,xbins,ySigmapPb,exl,exl,ySigmapPbSystTotLow,ySigmapPbSystTotHigh);
gSigmasyst->SetTitle("Sigma syst uncertainty from pPb");
gSigmasyst->SetMarkerColor(1);
gSigmasyst->SetLineColor(1);
gSigmasyst->SetLineWidth(1);
gSigmasyst->SetMarkerStyle(21);
gSigmasyst->SetMarkerColor(1);
gSigmasyst->SetFillColor(kYellow-7);//5
gSigmasyst->SetFillStyle(1001);
TGraphAsymmErrors*gSigmasyst2=(TGraphAsymmErrors*)gSigmasyst->Clone();
gSigmasyst2->SetMarkerColor(1);
gSigmasyst2->SetMarkerStyle(25);
gSigmasyst2->SetFillColor(0);
gSigmasyst2->SetFillStyle(0);
gSigmasyst2->SetLineColor(1);//5
gSigmasyst2->SetLineStyle(1);
gSigmasyst2->SetLineWidth(1);
//###TGraphAsymmErrors *gSigmastat = new TGraphAsymmErrors(nbins,xbins,ySigmapPb,exl,exl,ySigmapPbStat,ySigmapPbStat);
TGraphAsymmErrors *gSigmastat = new TGraphAsymmErrors(nbins,xbins,ySigmapPb,exl0,exl0,ySigmapPbStat,ySigmapPbStat);
gSigmastat->SetTitle("Sigma stat uncertainty from pPb");
gSigmastat->SetMarkerColor(1);
gSigmastat->SetLineColor(1);
gSigmastat->SetLineWidth(2);//###
gSigmastat->SetMarkerStyle(21);
gSigmastat->SetMarkerColor(1);
gSigmastat->SetFillColor(0);
gSigmastat->SetFillStyle(0);
gSigmastat->SetFillStyle(0);
Double_t padcorrection;
if (particle=="Bplus") padcorrection=Bp_padratio/Bp_padratio;
else if (particle=="Bzero") padcorrection=Bp_padratio/B0_padratio;
else if (particle=="Bs") padcorrection=Bp_padratio/Bs_padratio;
std::cout << "padcorrection: " << padcorrection << std::endl;
canvasSigma->cd(PadNum);
//canvasSigma->Range(-1.989924,-0.2917772,25.49622,2.212202);
canvasSigma->SetFillColor(0);
示例2: raaExpOpen_pt
void raaExpOpen_pt(const char* inputDir = "../macro_raa/outRoot", // the place where the input root files, with the histograms are
bool bSavePlots = true,
bool bDrawCh = true,
double xMax = 30 // x-axis range limit (ALICE D has x-range maximum value at 36, CMS has it at 30)
)
{
// set the style
gSystem->mkdir(Form("./figs/png"), kTRUE);
gSystem->mkdir(Form("./figs/pdf"), kTRUE);
setTDRStyle();
// read CMS graphs
TFile *pgRaaCms_pt = new TFile(Form("%s/makeRaa_pt.root",inputDir));
// ##################### HIGH PT ############################
TGraphErrors *pgCms = (TGraphErrors *)pgRaaCms_pt->Get("gNonPrJpsi");
TGraphErrors *pgCmsP = (TGraphErrors *)pgRaaCms_pt->Get("gNonPrJpsiP");
TGraphErrors *pgCmsSyst = (TGraphErrors *)pgRaaCms_pt->Get("gNonPrJpsiSyst");
pgCmsSyst->SetFillColorAlpha(kOrange-9,0.5);
pgCms->SetName("gNonPrJpsi");
TBox *lumi = (TBox*)pgRaaCms_pt->Get("lumi");
lumi->SetFillColor(kOrange-9);
lumi->SetFillStyle(1001);
lumi->SetX1(xMax-0.75); lumi->SetX2(xMax);
TBox *lumi_lowpt = (TBox*)lumi->Clone("lumi_lowpt");
lumi_lowpt->SetFillColor(kViolet-9);
lumi_lowpt->SetFillStyle(1001);
lumi_lowpt->SetX1(xMax-1.5); lumi_lowpt->SetX2(xMax-0.75);
// ##################### LOW PT ############################
TGraphErrors *pgCms_lowpt = (TGraphErrors *)pgRaaCms_pt->Get("gNonPrJpsi_pt365y1624");
TGraphErrors *pgCmsP_lowpt = (TGraphErrors *)pgRaaCms_pt->Get("gNonPrJpsiP_pt365y1624");
TGraphErrors *pgCmsSyst_lowpt = (TGraphErrors *)pgRaaCms_pt->Get("gNonPrJpsiSyst_pt365y1624");
pgCmsSyst_lowpt->SetFillColorAlpha(kViolet-9,0.5);
pgCms_lowpt->SetName("gNonPrJpsi_pt365y1624");
//--------------------------------------------------------------------
// *********** CMS Charged particle RAA
TGraphAsymmErrors *p8165_d5x1y1 = new TGraphAsymmErrors(p8165_d5x1y1_numpoints, p8165_d5x1y1_xval, p8165_d5x1y1_yval, p8165_d5x1y1_xerrminus, p8165_d5x1y1_xerrplus, p8165_d5x1y1_ystatminus, p8165_d5x1y1_ystatplus);
TGraphAsymmErrors *p8165_d5x1y1_syst = new TGraphAsymmErrors(p8165_d5x1y1_numpoints, p8165_d5x1y1_xval, p8165_d5x1y1_yval, p8165_d5x1y1_xerrminus, p8165_d5x1y1_xerrplus, p8165_d5x1y1_yerrminus, p8165_d5x1y1_yerrplus);
p8165_d5x1y1->SetName("cms_ch_raa");
// X-axis errors will be discarded
for (int i=0; i<p8165_d5x1y1_numpoints; i++) {
p8165_d5x1y1->SetPointEXlow(i,0);
p8165_d5x1y1->SetPointEXhigh(i,0);
p8165_d5x1y1_syst->SetPointEXlow(i,0.5);
p8165_d5x1y1_syst->SetPointEXhigh(i,0.5);
}
// *********** ALICE D RAA vs. pT
TGraphAsymmErrors *p9059_d15x1y1 = new TGraphAsymmErrors(p9059_d15x1y1_numpoints, p9059_d15x1y1_xval, p9059_d15x1y1_yval, p9059_d15x1y1_xerrminus, p9059_d15x1y1_xerrplus, p9059_d15x1y1_yerrminus, p9059_d15x1y1_yerrplus);
TGraphAsymmErrors *p9059_d15x1y1_syst = new TGraphAsymmErrors(p9059_d15x1y1_numpoints, p9059_d15x1y1_xval, p9059_d15x1y1_yval, p9059_d15x1y1_xerrminus, p9059_d15x1y1_xerrplus, p9059_d15x1y1_yerrminus, p9059_d15x1y1_yerrplus);
p9059_d15x1y1->SetName("alice_d_raa");
// X-axis errors will be discarded
for (int i=0; i<p9059_d15x1y1_numpoints; i++) {
p9059_d15x1y1->SetPointEXlow(i,0);
p9059_d15x1y1->SetPointEXhigh(i,0);
p9059_d15x1y1_syst->SetPointEXlow(i,0.5);
p9059_d15x1y1_syst->SetPointEXhigh(i,0.5);
if (xMax<=30 && (i+1)==p9059_d15x1y1_numpoints) {
double x,y;
p9059_d15x1y1->GetPoint(i,x,y);
p9059_d15x1y1->SetPoint(i,x+5,y);
p9059_d15x1y1_syst->GetPoint(i,x,y);
p9059_d15x1y1_syst->SetPoint(i,x+5,y);
}
}
// Style for graphs
p9059_d15x1y1->SetMarkerStyle(kOpenSquare);
p9059_d15x1y1->SetMarkerSize(1.3);
p9059_d15x1y1->SetMarkerColor(kBlack);
p9059_d15x1y1->SetLineColor(kBlack);
p9059_d15x1y1_syst->SetFillColorAlpha(kGray+1,0.5);
p8165_d5x1y1->SetMarkerStyle(20);
p8165_d5x1y1->SetMarkerSize(1.3);
p8165_d5x1y1->SetMarkerColor(kTeal+3);
p8165_d5x1y1->SetLineColor(kTeal+4);
p8165_d5x1y1_syst->SetFillColorAlpha(kTeal-1,0.5);
//---------------------------------------------------------
TLine *line = new TLine(0.,1,xMax,1);
line->SetLineStyle(1);
line->SetLineWidth(1);
TCanvas *pc = new TCanvas("pc","pc");
TF1 *f4 = new TF1("f4","1",0,xMax);
f4->SetLineWidth(1);
f4->GetXaxis()->SetTitle("p_{T} (GeV/c)");
f4->GetYaxis()->SetTitle("R_{AA}");
f4->GetXaxis()->SetRangeUser(0.0,xMax);
f4->GetYaxis()->SetRangeUser(0.0,1.5);
f4->GetXaxis()->CenterTitle(kTRUE);
f4->Draw();
lumi->Draw();
//.........这里部分代码省略.........
示例3: categories_sig
void categories_sig() {
gStyle->SetOptTitle(0);
gStyle->SetOptStat(0);
gStyle->SetCanvasColor(0);
gStyle->SetFrameBorderMode(0);
gStyle->SetPalette(1);
TText *text = new TText();
text->SetNDC();
text->SetTextSize(0.05);
TFile *file = TFile::Open("histograms_CMS-HGG_categories_sig.root");
file->cd();
TCanvas *c_bdtout = new TCanvas("c_bdtout","BDT output");
bdtout_all_tot = (TH1*)bdtout_cat0_tot->Clone();
bdtout_all_tot->Add(bdtout_cat1_tot);
bdtout_all_tot->Add(bdtout_cat2_tot);
bdtout_all_tot->Add(bdtout_cat3_tot);
cout << bdtout_all_tot->Integral() << endl;
cout << bdtout_all_tot->Integral(49,100)+bdtout_all_tot->GetBinContent(48)/2. << endl;
cout << bdtout_all_tot->GetBinLowEdge(49) << endl;
cout << bdtout_all_tot->GetBinLowEdge(48) << endl;
cout << (bdtout_all_tot->Integral(49,100)+bdtout_all_tot->GetBinContent(48)/2.)/bdtout_all_tot->Integral() << endl;
bdtout_passCiC_all_tot = (TH1*)bdtout_passCiC_cat0_tot->Clone();
bdtout_passCiC_all_tot->Add(bdtout_passCiC_cat1_tot);
bdtout_passCiC_all_tot->Add(bdtout_passCiC_cat2_tot);
bdtout_passCiC_all_tot->Add(bdtout_passCiC_cat3_tot);
bdtout_failpresel_cat0_tot->Rebin(2);
bdtout_failpresel_cat1_tot->Rebin(2);
bdtout_failpresel_cat2_tot->Rebin(2);
bdtout_failpresel_cat3_tot->Rebin(2);
bdtout_failpresel_all_tot = (TH1*)bdtout_failpresel_cat0_tot->Clone();
bdtout_failpresel_all_tot->Add(bdtout_failpresel_cat1_tot);
bdtout_failpresel_all_tot->Add(bdtout_failpresel_cat2_tot);
bdtout_failpresel_all_tot->Add(bdtout_failpresel_cat3_tot);
float nFail_m100180_bdtout005 = bdtout_all_tot->Integral(1,52) + bdtout_all_tot->GetBinContent(53)/2.;
float nFail_m100180 = bdtout_all_tot->Integral(1,100);
float frac_bdtout005 = nFail_m100180_bdtout005/nFail_m100180;
float frac_bdtout005_err = frac_err(nFail_m100180_bdtout005,nFail_m100180);
cout << bdtout_all_tot->Integral(1,52) << " " << bdtout_all_tot->GetBinContent(53)/2. << " " << bdtout_all_tot->Integral(1,100) << " " << bdtout_all_tot->GetBinLowEdge(53) << " " << frac_bdtout005 << " ± " << frac_bdtout005_err << endl;
bdtout_all_tot->SetLineColor(1);
bdtout_cat0_tot->SetLineColor(2);
bdtout_cat1_tot->SetLineColor(3);
bdtout_cat2_tot->SetLineColor(4);
bdtout_cat3_tot->SetLineColor(6);
bdtout_all_tot->SetLineWidth(2);
bdtout_cat0_tot->SetLineWidth(2);
bdtout_cat1_tot->SetLineWidth(2);
bdtout_cat2_tot->SetLineWidth(2);
bdtout_cat3_tot->SetLineWidth(2);
bdtout_cat0_tot->SetMarkerColor(2);
bdtout_cat1_tot->SetMarkerColor(3);
bdtout_cat2_tot->SetMarkerColor(4);
bdtout_cat3_tot->SetMarkerColor(6);
bdtout_all_tot->SetMarkerStyle(20);
bdtout_cat0_tot->SetMarkerStyle(20);
bdtout_cat1_tot->SetMarkerStyle(20);
bdtout_cat2_tot->SetMarkerStyle(20);
bdtout_cat3_tot->SetMarkerStyle(20);
bdtout_all_tot->SetMarkerSize(0.7);
bdtout_cat0_tot->SetMarkerSize(0.7);
bdtout_cat1_tot->SetMarkerSize(0.7);
bdtout_cat2_tot->SetMarkerSize(0.7);
bdtout_cat3_tot->SetMarkerSize(0.7);
bdtout_passCiC_all_tot->SetLineColor(1);
bdtout_passCiC_cat0_tot->SetLineColor(2);
bdtout_passCiC_cat1_tot->SetLineColor(3);
bdtout_passCiC_cat2_tot->SetLineColor(4);
bdtout_passCiC_cat3_tot->SetLineColor(6);
bdtout_passCiC_lowPt_cat0_tot->SetLineColor(2);
bdtout_passCiC_lowPt_cat1_tot->SetLineColor(3);
bdtout_passCiC_lowPt_cat2_tot->SetLineColor(4);
bdtout_passCiC_lowPt_cat3_tot->SetLineColor(6);
bdtout_passCiC_highPt_cat0_tot->SetLineColor(2);
bdtout_passCiC_highPt_cat1_tot->SetLineColor(3);
bdtout_passCiC_highPt_cat2_tot->SetLineColor(4);
bdtout_passCiC_highPt_cat3_tot->SetLineColor(6);
bdtout_failpresel_all_tot->SetLineColor(1);
bdtout_failpresel_cat0_tot->SetLineColor(2);
bdtout_failpresel_cat1_tot->SetLineColor(3);
bdtout_failpresel_cat2_tot->SetLineColor(4);
//.........这里部分代码省略.........
示例4: NuclearModificationY
//.........这里部分代码省略.........
yRpPbSystTotLow[i]=yPercSigmapPbSystTotLow[i]*yRpA[i];
std::cout << i << " , " << xbins[i] << " , " << ySigmapPb[i] << " , sta: " << ySigmapPbStat[i] << " , syslow: " << ySigmapPbSystTotLow[i] << " ,syshigh: " << ySigmapPbSystTotHigh[i] << std::endl;
std::cout << "FONLL: " << yRefPP[i] << " - " << yPPsystFONLLlow[i] << " + " << yPPsystFONLLhigh[i] << std::endl;
std::cout << i << " ####### " << xbins[i] << " , " << yRpA[i] << " , sta: " << yRpAStat[i] << " , syslow: " << yRpPbSystTotLow[i] << " ,syshigh: " << yRpPbSystTotHigh[i] << " ,FONLLlow: " << yRpAsystFONLLlow[i] << " , FONLLhigh: " << yRpAsystFONLLhigh[i] << std::endl;
}
//RFB stuff
//central value
yRFB[0] = ySigmapPb[3]/ySigmapPb[2];
yRFB[1] = ySigmapPb[4]/ySigmapPb[1];
//Stat.
yRFBStat[0] = yRFB[0]*sqrt(pow(ySigmapPbStat[2]/ySigmapPb[2],2)+pow(ySigmapPbStat[3]/ySigmapPb[3],2));
yRFBStat[1] = yRFB[1]*sqrt(pow(ySigmapPbStat[4]/ySigmapPb[4],2)+pow(ySigmapPbStat[1]/ySigmapPb[1],2));
//Syst.
yRFBSystTotHigh[0] = yRFB[0]*yRFBSystTotHighRel[0];
yRFBSystTotLow[0] = yRFB[0]*yRFBSystTotLowRel[0];
yRFBSystTotHigh[1] = yRFB[1]*yRFBSystTotHighRel[1];
yRFBSystTotLow[1] = yRFB[1]*yRFBSystTotLowRel[1];
TGraphAsymmErrors *gSigmasyst = new TGraphAsymmErrors(nbins,xbins,ySigmapPb,exl2,exl2,ySigmapPbSystTotLow,ySigmapPbSystTotHigh);
//###TGraphAsymmErrors *gSigmasyst = new TGraphAsymmErrors(nbins,xbins,ySigmapPb,exl,exl,ySigmapPbSystTotLow,ySigmapPbSystTotHigh);
gSigmasyst->SetTitle("Sigma syst uncertainty from pPb");
gSigmasyst->SetMarkerColor(1);
gSigmasyst->SetLineColor(1);
gSigmasyst->SetLineWidth(3);
gSigmasyst->SetMarkerStyle(21);
gSigmasyst->SetMarkerColor(1);
gSigmasyst->SetFillColor(kYellow-7);//5
gSigmasyst->SetFillStyle(1001);
TGraphAsymmErrors*gSigmasyst2=(TGraphAsymmErrors*)gSigmasyst->Clone();
gSigmasyst2->SetMarkerColor(1);
gSigmasyst2->SetMarkerStyle(25);
gSigmasyst2->SetFillColor(0);
gSigmasyst2->SetFillStyle(0);
gSigmasyst2->SetLineColor(1);//5
gSigmasyst2->SetLineStyle(1);
gSigmasyst2->SetLineWidth(3);
//###TGraphAsymmErrors *gSigmastat = new TGraphAsymmErrors(nbins,xbins,ySigmapPb,exl,exl,ySigmapPbStat,ySigmapPbStat);
TGraphAsymmErrors *gSigmastat = new TGraphAsymmErrors(nbins,xbins,ySigmapPb,exl0,exl0,ySigmapPbStat,ySigmapPbStat);
gSigmastat->SetTitle("Sigma stat uncertainty from pPb");
gSigmastat->SetMarkerColor(1);
gSigmastat->SetLineColor(1);
gSigmastat->SetLineWidth(3);
gSigmastat->SetMarkerStyle(21);
gSigmastat->SetMarkerColor(1);
gSigmastat->SetFillColor(0);
gSigmastat->SetFillStyle(0);
//###TCanvas *canvasSigma=new TCanvas("canvasSigma","canvasSigma",600,500);
TCanvas *canvasSigma=new TCanvas("canvasSigma","canvasSigma",500,500);
canvasSigma->cd();
canvasSigma->Range(-1.989924,-0.2917772,25.49622,2.212202);
canvasSigma->SetFillColor(0);
canvasSigma->SetBorderMode(0);
canvasSigma->SetBorderSize(2);
canvasSigma->SetLeftMargin(0.200);