本文整理汇总了C++中TBox::DrawBox方法的典型用法代码示例。如果您正苦于以下问题:C++ TBox::DrawBox方法的具体用法?C++ TBox::DrawBox怎么用?C++ TBox::DrawBox使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TBox
的用法示例。
在下文中一共展示了TBox::DrawBox方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PlotBF
void HiggsPlot::PlotBF(int iDecay, double tBmH_max, double BF_max){
if(iDecay<0 || iDecay>2) {cout<<"iDecay must be 0, 1 or 2"<<endl; return;}
styles style; style.setPadsStyle(-1); style.setDefaultStyle();
int nBins = 1000;
TString hName, epsName = "public_html/Higgs_BF_TEMP_BaBar.eps", label, Llabel, Rlabel;
TString yTitle[] = {"BF(B#rightarrow#tau#nu) (10^{-5})", "R(D)", "R(D*)"};
TString TagDecay[] = {"BF", "R(D)", "R(D*)"};
TCanvas can;
TH1F *hBF[2];
for(int his=0; his<1; his++) {
hName = "hBF"; hName += his;
hBF[his] = new TH1F(hName,"",nBins,0,tBmH_max);
}
double tBmH, BF[2];
for(int bin=1; bin<=nBins; bin++){
tBmH = hBF[0]->GetBinCenter(bin);
Compute(tBmH,BF,iDecay);
hBF[0]->SetBinContent(bin, BF[0]);
hBF[0]->SetBinError(bin, BF[1]);
}
hBF[0]->SetFillColor(2); hBF[0]->SetLineColor(2);
hName += "1";
hBF[1] = static_cast<TH1F*>(hBF[0]->Clone(hName));
for(int bin=1; bin<=nBins; bin++)hBF[1]->SetBinError(bin,0);
hBF[1]->SetFillColor(0);hBF[1]->SetLineColor(1); hBF[1]->SetLineWidth(2);
TBox box; box.SetLineColor(4);box.SetFillColor(4);
TLine line; line.SetLineStyle(1); line.SetLineColor(4); line.SetLineWidth(3);
if(BF_max>0) hBF[0]->SetMaximum(BF_max);
hBF[0]->Draw("e3");
box.SetFillStyle(3002);
box.DrawBox(0,Measurement[iDecay][0]-Measurement[iDecay][1],
tBmH_max,Measurement[iDecay][0]+Measurement[iDecay][1]);
line.DrawLine(0,Measurement[iDecay][0],tBmH_max,Measurement[iDecay][0]);
hBF[0]->Draw("e3 same");
hBF[1]->Draw("c same");
Compute(0,BF,iDecay);
label = "#splitline{"; label += TagDecay[iDecay]; label += "_{SM} = ";
if(iDecay==0){
label+="(";label+=RoundNumber(BF[0],1); label+=" #pm ";
label+=RoundNumber(BF[1],1); label+=")#times10^{-5}}{BF_{exp} = (";
label+=RoundNumber(Measurement[iDecay][0],1); label+=" #pm ";
label+=RoundNumber(Measurement[iDecay][1],1); label+=")#times10^{-5}}";
Llabel = ""; Rlabel = label;
} else {
label+=RoundNumber(BF[0],3); label+=" #pm ";
label+=RoundNumber(BF[1],3); label+="}{"; label += TagDecay[iDecay]; label += "_{exp} = ";
label+=RoundNumber(Measurement[iDecay][0],3); label+=" #pm ";
label+=RoundNumber(Measurement[iDecay][1],3); label+="}";
Rlabel = ""; Llabel = label;
}
style.setTitles(hBF[0],"tan#beta/m_{H^{+}} (GeV^{-1})",yTitle[iDecay],Llabel,Rlabel);
epsName.ReplaceAll("TEMP",DecayName[iDecay]);
can.SaveAs(epsName);
for(int his=0; his<2; his++) hBF[his]->Delete();
}
示例2: Drawing
//.........这里部分代码省略.........
HBD->Update();
fr->X4.push_back(Coordinates(fr->J4_XStrips[j].XCenter()));
fr->AllX.push_back(Coordinates(fr->J4_XStrips[j].XCenter()));
}
else if(Qfrac>=1 && Qfrac<50)
{
int index = int(Qfrac);
fr->J4_XStrips[j].Draw(x1,y1,x2,y2,index);
HBD->Update();
fr->X4.push_back(Coordinates(fr->J4_XStrips[j].XCenter()));
fr->AllX.push_back(Coordinates(fr->J4_XStrips[j].XCenter()));
}
else if(Qfrac>=50 && Qfrac<99.98)
{
//int index = int(Qfrac)-49;
fr->J4_XStrips[j].Draw(x1,y1,x2,y2,2);
HBD->Update();
fr->X4.push_back(Coordinates(fr->J4_XStrips[j].XCenter()));
fr->AllX.push_back(Coordinates(fr->J4_XStrips[j].XCenter()));
}
x1 = x2 + 100;
x2 = x1 + 700;
}
//Drawing the Central Cross:
X1 = -49100;
Y1 = -675;
X2 = 49050;
Y2 = 675;
TBox Hori (X1,Y1, X2,Y2);
Hori.SetFillColor(15);
Hori.DrawBox(X1,Y1, X2,Y2);
HBD->Update();
X1 = -500;
Y1 = -48975;
X2 = 500;
Y2 = 49025;
TBox Vert (X1,Y1, X2,Y2);
Vert.SetFillColor(15);
Vert.DrawBox(X1,Y1, X2,Y2);
HBD->Update();
//Drawing the real positions of the photons:
for(unsigned int a=0; a<fr->HBDParticles.size(); a++)
{
fr->HBDParticles[a].Draw();
HBD->Update();
}
//Finding the ring:----------------------------------------------------------------------------------
Hough = new TH3D ("Hough","Hough",500,-50000,50000,500,-50000,50000,500,0,50000);
Houghxy = new TH2D ("Houghxy","Houghxy",100,-50000,50000,100,-50000,50000);
Houghxr = new TH2D ("Houghxr","Houghxr",100,-50000,50000,100,0,50000);
Houghyr = new TH2D ("Houghyr","Houghyr",100,-50000,50000,100,0,50000);
//Forming J1234 PseudoPoints:
for(unsigned int s=0; s<fr->Y1.size(); s++)
{
for(unsigned int ps=0; ps<fr->X1.size(); ps++)
{
fr->J1_PseudoPoints.push_back(TVector3(fr->X1[ps].Cor(),fr->Y1[s].Cor(),0));
示例3: PlotgSLTauNu
void HiggsPlot::PlotgSLTauNu(double b, double tBmH_max){
styles style; style.setPadsStyle(-2);
style.PadBottomMargin = 2*b/(1+b);
style.setDefaultStyle();
int nBins = 1000;
double PadLimit[2][2] = {{(1-b)/2.,1}, {0, (1+b)/2.}};
double maxRD[] = {45, 45}, minRD[] = {0., 0.}, TopMargin[] = {0.01, 0};
TString hName, epsName = "public_html/Higgs_TauNu_gSL.eps", label, padName;
TString TagDecay[] = {"BF(B#rightarrow#tau#nu) (10^{-5})", "BF(B#rightarrow#tau#nu) (10^{-5})"};
TBox box; box.SetLineColor(4);box.SetFillColor(4);
TLine line; line.SetLineStyle(1); line.SetLineColor(4); line.SetLineWidth(3);
TCanvas can("can","RD Vs Higgs");
TPad *Pads[2];
TH1F *hBF[4][2];
for(int his=0; his<1; his++) {
for(int isDs=0; isDs<4; isDs++){
hName = "hBF"; hName += his; hName += isDs;
hBF[isDs][his] = new TH1F(hName,"",nBins,0,tBmH_max);
}
}
Vub[1] = 0.0003;
double tBmH, BF[2], gSL;
for(int isDs=0; isDs<2; isDs++){
can.cd(0);
if(isDs==0) Vub[0] = 0.00313; else Vub[0] = 0.00431;
padName = "Pad"; padName += isDs;
Pads[isDs] = new TPad(padName,"",0,PadLimit[isDs][0], 1, PadLimit[isDs][1]);
Pads[isDs]->SetTopMargin(TopMargin[isDs]);
Pads[isDs]->Draw(); Pads[isDs]->cd();
for(int bin=1; bin<=nBins; bin++){
gSL = hBF[isDs][0]->GetBinCenter(bin);
tBmH = sqrt(gSL/4.2);
Compute(tBmH,BF,0);
hBF[isDs][0]->SetBinContent(bin, BF[0]);
hBF[isDs][0]->SetBinError(bin, BF[1]);
}
hBF[isDs][0]->SetFillColor(2); hBF[isDs][0]->SetLineColor(2);
hName += isDs;
hBF[isDs][1] = static_cast<TH1F*>(hBF[isDs][0]->Clone(hName));
for(int bin=1; bin<=nBins; bin++)hBF[isDs][1]->SetBinError(bin,0);
hBF[isDs][1]->SetFillColor(0);hBF[isDs][1]->SetLineColor(1); hBF[isDs][1]->SetLineWidth(2);
hBF[isDs][0]->SetMinimum(minRD[isDs]);
hBF[isDs][0]->SetMaximum(maxRD[isDs]);
hBF[isDs][0]->Draw("e3");
box.SetFillStyle(3002);
box.DrawBox(0,Measurement[0][0]-Measurement[0][1],
tBmH_max,Measurement[0][0]+Measurement[0][1]);
line.DrawLine(0,Measurement[0][0],tBmH_max,Measurement[0][0]);
hBF[isDs][0]->Draw("e3 same");
hBF[isDs][1]->Draw("c same");
_isgS = -1;
for(int bin=1; bin<=nBins; bin++){
gSL = hBF[isDs+2][0]->GetBinCenter(bin);
tBmH = sqrt(gSL/4.2);
Compute(tBmH,BF,0);
hBF[isDs+2][0]->SetBinContent(bin, BF[0]);
hBF[isDs+2][0]->SetBinError(bin, BF[1]);
}
hBF[isDs+2][0]->SetFillColor(8); hBF[isDs][0]->SetLineColor(8);
hName += isDs+2;
hBF[isDs+2][1] = static_cast<TH1F*>(hBF[isDs+2][0]->Clone(hName));
for(int bin=1; bin<=nBins; bin++)hBF[isDs+2][1]->SetBinError(bin,0);
hBF[isDs+2][1]->SetFillColor(0);hBF[isDs+2][1]->SetLineColor(1); hBF[isDs+2][1]->SetLineWidth(2);
hBF[isDs][0]->SetMinimum(minRD[isDs]);
hBF[isDs][0]->SetMaximum(maxRD[isDs]);
hBF[isDs+2][0]->Draw("e3 same");
hBF[isDs+2][0]->Draw("e3 same");
hBF[isDs+2][1]->Draw("c same");
_isgS = 1;
style.setTitles(hBF[isDs][0],"-g (GeV^{-1})",TagDecay[isDs]);
}
can.SaveAs(epsName);
for(int isDs=0; isDs<4; isDs++){
//Pads[isDs]->Delete();
for(int his=0; his<2; his++) hBF[isDs][his]->Delete();
}
}
示例4: FakePhotonSystematic
//.........这里部分代码省略.........
HSigMCRSCl->SetFillColor(0);HSigMCRSCl->SetLineColor(1);
C.Clear();
HDataRSCl->GetYaxis()->SetRangeUser(0,HDataRSCl->GetMaximum()*1.3);
//HDataRSCl->SetTitle(TString("Data Sig =")+(long)(Nw/Ntot)+"."+(long)(1000*(Nw/Ntot-1.)));
HDataRSCl->SetTitle("");
HDataRSCl->GetXaxis()->SetTitle("Reconstruction Multiplicity");
delete HDataRSCl->FindObject("stats");
HDataRSCl->SetStats(0);
HDataRSCl->Draw("pe");
HSigMCRSCl->SetStats(0);
HSigMCRSCl->Draw("same");
C.Print("FakePhotonSystematic.ps");
TH1F*HDataSigMCSigDiff=new TH1F("HDataSigMCSigDiff","",HDataRS->GetXaxis()->GetNbins(),
HDataRS->GetXaxis()->GetXmin(),HDataRS->GetXaxis()->GetXmax());
HDataSigMCSigDiff->Add(HDataRSCl);
HDataSigMCSigDiff->Add(HSigMCRSCl,-1);
C.Clear();
delete HDataSigMCSigDiff->FindObject("stats");
HDataSigMCSigDiff->SetStats(0);
HDataSigMCSigDiff->Draw("");
C.Print("FakePhotonSystematic.ps");
//Signal multiplicity for modified photon backgrounds
C.Clear();
HSigMCRSCl->SetFillColor(0);HSigMCRSCl->SetLineColor(1);
HSigMCRSCl->GetYaxis()->SetRangeUser(0,HSigMCRSCl->GetMaximum()*1.1);
HSigMCRSCl->GetXaxis()->SetRangeUser(.5,3.5);
HSigMCRSCl->SetStats(0);
HSigMCRSCl->Draw("l");
TGraph GMult;
Int_t npts=0;
TH1F* HDiff[21];
TH1F* HSigMCRSMod[21];
for(Int_t m=0;m<11;m++){
HSigMCRSMod[m]=(TH1F*)FMCRSSig.Get(TString("HEvtMultiplicitySigMod")+(long)m);
if(HSigMCRSMod[m]->Integral()>0){
GMult.SetPoint(npts,1+(m-10)*.01,HSigMCRSMod[m]->GetMean());
npts++;
HSigMCRSMod[m]->Scale(HDataRSCl->Integral()/HSigMCRSMod[m]->Integral());
}
HSigMCRSMod[m]->SetLineColor(4);
HSigMCRSMod[m]->SetStats(0);
HSigMCRSMod[m]->Draw("lsame");
HDiff[m]=(TH1F*)HSigMCRSMod[m]->Clone(TString("HEvtMultiplicitySigModCl")+(long)m);
HDiff[m]->Add(HSigMCRSCl,-1);
}
HSigMCRSCl->Draw("lsame");
HDataRSCl->SetLineColor(2);
HDataRSCl->SetStats(0);
HDataRSCl->Draw("lsame");
C.Print("FakePhotonSystematic.ps");
//fix the multiplicity on the plus side
GMult.SetPoint(npts,1.1,HSigMCRSMod[10]->GetMean()+(HSigMCRSMod[10]->GetMean()-HSigMCRSMod[0]->GetMean()));
TH1F* HDataDiff=(TH1F*)HDataRSCl->Clone("HDataDiff");
HDataDiff->Add(HSigMCRSCl,-1);
TH1F* HMCDiff=(TH1F*)HSigMCRSCl->Clone("HMCDiff");
HMCDiff->Add(HSigMCRSCl,-1);
C.Clear();
HMCDiff->GetYaxis()->SetRangeUser(-6000,3000);
HMCDiff->Draw("l");
for(Int_t m=0;m<11;m++) HDiff[m]->Draw("lsame");
HMCDiff->Draw("lsame");
HDataDiff->Draw("lsame");
C.Print("FakePhotonSystematic.ps");
GMult.GetXaxis()->SetTitle("Amount of Fake Photon Background");
GMult.GetYaxis()->SetTitle("Avg. Reconstruction Multiplicity");
C.Clear(); //just the map
GMult.Draw("apl");
C.Print("FakePhotonSystematic.ps");
//no Data error
C.Clear();
GMult.Draw("apl");
TLine line;
line.SetLineColor(2); line.SetLineWidth(2);
line.DrawLine(.9,Nw/Ntot,1.1,Nw/Ntot);
C.Print("FakePhotonSystematic.ps");
//with Data error
C.Clear();
GMult.Draw("apl");
TBox box;
box.SetLineColor(0);
box.SetFillColor(3);
box.SetFillStyle(1001);
box.DrawBox(.9,Nw/Ntot-(1.769-1.763),1.1,Nw/Ntot+(1.769-1.763));
line.DrawLine(.9,Nw/Ntot,1.1,Nw/Ntot);
GMult.Draw("plsame");
C.Print("FakePhotonSystematic.ps");
C.Print("FakePhotonSystematic.ps]");
}
示例5: makeZZPlot
void makeZZPlot(){
const unsigned int n = 15;
float x[n];
float y1[n];
float y2[n];
x[0] =130; y1[0] =27952; y2[0] =3057;
x[1] =150; y1[1] = 2951; y2[1] =1702;
x[2] =170; y1[2] = 993; y2[2] = 994;
x[3] =190; y1[3] = 501; y2[3] = 617;
x[4] =210; y1[4] = 348; y2[4] = 398;
x[5] =230; y1[5] = 287; y2[5] = 264;
x[6] =250; y1[6] = 240; y2[6] = 182;
x[7] =270; y1[7] = 204; y2[7] = 128;
x[8] =290; y1[8] = 197; y2[8] = 91;
x[9] =310; y1[9] = 179; y2[9] = 67;
x[10]=330; y1[10]= 164; y2[10]= 49;
x[11]=350; y1[11]= 159; y2[11]= 37;
x[12]=370; y1[12]= 152; y2[12]= 28;
x[13]=390; y1[13]= 149; y2[13]= 21;
x[14]=410; y1[14]= 142; y2[14]= 17;
TGraph* g1 = new TGraph(n,x,y2);
TGraph* g2 = new TGraph(n,x,y1);
TCanvas *c1 = new TCanvas();
gPad->SetTopMargin(0.1);
gPad->SetRightMargin(0.05);
//gPad->SetLogy();
gPad->SetGridx();
gPad->SetGridy();
TH2F* hdummy = new TH2F("hdummy","",100,130,410,100,0,5000);
hdummy->Draw();
c1->cd();
g1->SetLineColor(4);
g2->SetLineColor(2);
g1->SetLineWidth(2);
g2->SetLineWidth(5);
g2->SetLineStyle(2);
hdummy->GetXaxis()->SetTitle("m_{#chi} [GeV]");
hdummy->GetYaxis()->SetTitle("#sigma #times BR [fb]");
hdummy->GetYaxis()->SetLabelSize(0.04);
hdummy->GetXaxis()->SetLabelSize(0.04);
TBox* box = new TBox();
//box->SetBorderStyle(2);
//box->SetBorderSize(1);
//box->SetFillColor(5);
//box->SetFillStyle(3002);
box->DrawBox(171,0,221,5000);
TLine line;
line.DrawLine(171,0,171,5000);
line.DrawLine(221,0,221,5000);
hdummy->Draw("axissame");
g1->SetMinimum(0);
g1->SetMaximum(5000);
g1->Draw("samec");
g2->Draw("samel");
//g1->Draw("Al");
//g2->Draw("samel");
TLegend *leg = new TLegend(0.5,0.6,0.9,0.8);
leg->AddEntry(g2,"observed UL","l");
leg->AddEntry(g1,"theory","l");
leg->AddEntry(box,"excluded region","f");
leg->SetBorderSize(1);
leg->SetFillColor(0);
leg->Draw();
TLatex *t = new TLatex();
t->SetNDC();
t->SetTextSize(0.04);
t->DrawLatex(0.18,0.92,"CMS Preliminary #sqrt{s} = 7 TeV, #scale[0.6]{#int}Ldt = 4.7 fb^{-1}");
t->SetTextSize(0.04);
t->DrawLatex(0.46,0.5,"#chi^{0}#chi^{0} #rightarrow ZZ + E_{T}^{miss}");
t->SetTextSize(0.038);
t->DrawLatex(0.46,0.45,"GGMSB Z-enriched higgsino");
c1->Print("GMSB.pdf");
c1->Print("GMSB.png");
c1->Print("GMSB.eps");
gROOT->ProcessLine(".! ps2pdf GMSB.eps GMSB_ppt.pdf");
}
示例6: Test_UnfoldQ2
//.........这里部分代码省略.........
hName += RoundNumber(hRes[row]->GetRMS(),2); hName += "}{#sigma_{nor} = ";
hName += RoundNumber(hRes2[row]->GetRMS(),2); hName += "}";
label.DrawLatex(1-RightMargin-0.05, 1-0.37-0.06*(row==0), hName);
if(row==0){
double legXY[2][2] = {{LeftMargin+0.05, LeftMargin+0.25}, {0.67, 0.95}};
leg1[col] = new TLegend(legXY[0][0], legXY[1][0], legXY[0][1], legXY[1][1]);
leg1[col]->SetTextSize(TextSize); leg1[col]->SetFillStyle(0);
leg1[col]->SetTextFont(132); leg1[col]->SetBorderSize(0);
leg1[col]->AddEntry(hRes2[row],"Norm.");
leg1[col]->AddEntry(hRes[row],"Signal");
leg1[col]->Draw();
}
break;
case 2:
double maxH = 0;
for(isNorm=0; isNorm<3; isNorm++){
hName = "hP"; hName += pad; hName += isNorm;
hP[pad][isNorm] = new TH1D(hName,"",nBins, limQ2[0], limQ2[1]);
formatHisto(hP[pad][isNorm], ColorP[isNorm], TextSize);
double q2 = limQ2[0], dq2 = (limQ2[1]-limQ2[0])/(double)nBins;
for(int bin=1; bin<=nBins; bin++){
hName = "weight*(trueQ2>="; hName += q2;
hName += "&&trueQ2<"; hName += q2+dq2; hName += "&&";
TString Cuts = mcCuts[0][2+row+2*(isNorm>1)];
Cuts.ReplaceAll("weight*(", hName);
TString var = "candPLep"; if(isNorm%2==1) var = "candPstarD";
double entries = MC.Project("hTemp",var, Cuts);
//cout<<hTemp.GetMean()<<", "<<Cuts<<endl;
hP[pad][isNorm]->SetBinContent(bin, hTemp.GetMean());
if(entries>1) hP[pad][isNorm]->SetBinError(bin, hTemp.GetRMS()/sqrt(entries));
else hP[pad][isNorm]->SetBinError(bin, hTemp.GetMean());
q2 += dq2;
}
if(hP[pad][isNorm]->GetMaximum()>maxH) maxH = hP[pad][isNorm]->GetMaximum();
}
for(isNorm=0; isNorm<3; isNorm++){
if(isNorm==0) {
hP[pad][isNorm]->SetMaximum(maxH*1.17);
hP[pad][isNorm]->Draw();
if(row==1) hP[pad][isNorm]->SetXTitle(xTitle[0]);
} else{
//hP[pad][isNorm]->Scale(hP[pad][0]->Integral()/hP[pad][isNorm]->Integral());
hP[pad][isNorm]->Draw("same");
}
}
if(row==1){
double legXY[2][2] = {{LeftMargin+0.05, LeftMargin+0.25}, {0.25, 0.5}};
leg1[col] = new TLegend(legXY[0][0], legXY[1][0], legXY[0][1], legXY[1][1]);
leg1[col]->SetTextSize(TextSize); leg1[col]->SetFillStyle(0);
leg1[col]->SetTextFont(132); leg1[col]->SetBorderSize(0);
leg1[col]->AddEntry(hP[pad][0],"ls");
leg1[col]->AddEntry(hP[pad][2],"ln");
leg1[col]->AddEntry(hP[pad][1],"D");
leg1[col]->Draw();
}
break;
}
}
}
can.cd(0);
hName = "Normalized efficiency/(";
if(Type==1) hName = "Events/(";
if(Type==1&&col==1) hName += RoundNumber(2*limRes,2,nBinsRes);
else hName += RoundNumber((limQ2[1]-limQ2[0]),2,nBins);
hName += Units[0];
if(Type==1&&col==2) hName = "Momentum (GeV)";
label.SetTextAlign(23); label.SetTextAngle(90); label.SetTextSize(0.055);
label.DrawLatex(0.01+col/dCols, 0.56, hName);
if(Type==0 || Type==1) {
box.DrawBox(padW*(LeftMargin+col)-0.02, bMargin+padH, padW*(LeftMargin+col)-0.002, bMargin+padH+0.02);
label.SetTextAlign(32); label.SetTextAngle(0); label.SetTextSize(0.044);
label.DrawLatex(padW*(LeftMargin+col)-0.0025, bMargin+padH+0.003, "0");
}
}
TString pName = "public_html/Test_Q2_"; pName += TypeName[Type]; pName += ".eps";
can.SaveAs(pName);
for(int row=0; row<nRows; row++){
if(Type==1){
if(hRes[row]) hRes[row]->Delete();
if(hRes2[row]) hRes2[row]->Delete();
}
for(int col=0; col<nCols; col++){
int pad = nRows*col+row;
//if(Type==1 && hbini[pad]) hbini[pad]->Delete();
for(int isNorm=0; isNorm<3; isNorm++){
if(Type==0){
if(hEff[pad][isNorm]) hEff[pad][isNorm]->Delete();
if(hQ2[pad][isNorm]) hQ2[pad][isNorm]->Delete();
if(hxini[pad][isNorm]) hxini[pad][isNorm]->Delete();
}
}
}
}
}
示例7: overlayParamPlots_report
//.........这里部分代码省略.........
TCanvas *canResFrac[kMaxTels];
TBox *box = new TBox();
box->SetFillColor(col2);
box->SetFillStyle(3002);
int maxVBin;
if( showerParameter ) {
can[0] = new TCanvas("can0","can0", 1200, 800);
can[0]->SetFillColor(10);
can[0]->Divide(3,2);
canResFrac[0] = new TCanvas("canResFrac0","canResFrac0", 1200, 800);
canResFrac[0]->SetFillColor(10);
canResFrac[0]->Divide(3,2);
for(int i=0; i<NofEbins; i++){
can[0]->cd(i+1);
gPad->SetGrid();
h1Params1[paramIdToPlot][i][reportTypeId]->Draw("p");
h1Params1[paramIdToPlot][i][reportTypeId]->GetYaxis()->SetRangeUser(yaxis_min, yaxis_max);
h1Params2[paramIdToPlot][i][reportTypeId]->Draw("psames");
canResFrac[0]->cd(i+1);
gPad->SetGrid();
sprintf( title, "h1%s_%s_Ebin%d_%s_ResFrac",
NameOfParams[paramIdToPlot].c_str(), runType1.c_str(), i, NameOfType[reportTypeId].c_str() );
TH1F *tmp = (TH1F*)h1Params1[paramIdToPlot][i][reportTypeId]->Clone( title );
tmp->Add( h1Params1[paramIdToPlot][i][reportTypeId], h1Params2[paramIdToPlot][i][reportTypeId], -1, 1 );
tmp->Divide( h1Params1[paramIdToPlot][i][reportTypeId] );
sprintf( title, "%s (%s-%s)/%s, Ebin%d",
NameOfParams[paramIdToPlot].c_str(), runType2.c_str(), runType1.c_str(), runType1.c_str(), i);
tmp->SetTitle( title );
tmp->Draw("p");
tmp->GetYaxis()->SetRangeUser(-2,2);
maxVBin = h1Params1[paramIdToPlot][i][reportTypeId]->GetMaximumBin();
box->DrawBox( tmp->GetBinCenter(maxVBin-3), -1, tmp->GetBinCenter(maxVBin+3) , 1);
gPad->Modified();
gPad->Update();
}
} else {
for(int ntel=0; ntel<kMaxTels; ntel++){
sprintf( title, "can%d", ntel+1);
can[ntel] = new TCanvas( title, title, 0, 0, 1200, 800);
can[ntel]->SetFillColor(10);
can[ntel]->Divide(3,2);
sprintf( title, "canResFrac%d", ntel+1);
canResFrac[ntel] = new TCanvas( title, title, 0, 0, 1200, 800);
canResFrac[ntel]->SetFillColor(10);
canResFrac[ntel]->Divide(3,2);
for(int i=0; i<NofEbins; i++){
can[ntel]->cd(i+1);
gPad->SetGrid();
if( paramToPlot.compare("SizeFracLo") == 0 ||
paramToPlot.compare("Size") == 0 ||
paramToPlot.compare("NTube") == 0 ||
paramToPlot.compare("Max3") == 0 ){
h1ParamsPerTel1[paramIdToPlot][i][ntel][reportTypeId]->GetYaxis()->SetRangeUser(yaxis_min, yaxis_max);
gPad->SetLogy();
}
h1ParamsPerTel1[paramIdToPlot][i][ntel][reportTypeId]->Draw("p");
if( paramToPlot.compare("ImpactDist") == 0 ||
paramToPlot.compare("Width") == 0 ||
paramToPlot.compare("Length") == 0
){
h1ParamsPerTel1[paramIdToPlot][i][ntel][reportTypeId]->GetYaxis()->SetRangeUser(yaxis_min, yaxis_max);
}
h1ParamsPerTel2[paramIdToPlot][i][ntel][reportTypeId]->Draw("psames");
示例8: makePlotsPP
//.........这里部分代码省略.........
pp_BinShift->Write();
pp_BinShift_MB->Write();
RpPbSpectrum->Write("RpPb_Published");
c1->SetLogy(0);
//pPbSpectrum->Divide(s.pp);
pPbSpectrum->Divide(pp_BinShift);
pPbSpectrum->Scale(1.0/0.098);//<T_{pPb}> From HIN-012-017
pPbSpectrum->Print("All");
pPbSpectrum->GetYaxis()->SetTitle("RpPb");
pPbSpectrum->GetYaxis()->SetRangeUser(0.5,1.5);
pPbSpectrum->Draw();
pPbSpectrum->Write("RpPb");
c1->SaveAs("plots/png/pp_RpPb.png");
c1->SaveAs("plots/png/pp_RpPb.pdf");
c1->SaveAs("plots/png/pp_RpPb.C");
/*s.pp->Divide(RpPb);
s.pp->GetYaxis()->SetTitle("data/interp");
s.pp->Draw(); */
pp_BinShift->Divide(RpPb);
pp_BinShift->GetYaxis()->SetTitle("data/interp");
pp_BinShift->Scale(0.098);
pp_BinShift->GetYaxis()->SetRangeUser(0.5,1.5);
pp_BinShift->Draw();
pp_BinShift->Write("RpPb_ppVsInterpolation");
float TAAUncert = 0.177;
TBox* bTAA = new TBox(0.15,0.1,0.2,0.2);
bTAA->SetFillColor(kBlue-9);
bTAA->SetFillStyle(1001);
bTAA->SetLineWidth(0);
bTAA->DrawBox(200,1-TAAUncert,300,1+TAAUncert);
c1->SaveAs("plots/png/pp_dataVsInterp.png");
c1->SaveAs("plots/pdf/pp_dataVsInterp.pdf");
c1->SaveAs("plots/png/pp_dataVsInterp.C");
pp_BinShift_MB->Divide(RpPb);
pp_BinShift_MB->GetYaxis()->SetTitle("MB data/interp");
//take lumi normalization from the previous made plot (should be same at low pt)
float MBScale = pp_BinShift_MB->GetBinContent(5)/pp_BinShift->GetBinContent(5);
pp_BinShift_MB->Scale(1/MBScale);
pp_BinShift_MB->GetYaxis()->SetRangeUser(0.5,1.5);
pp_BinShift_MB->SetMarkerColor(kRed);
pp_BinShift_MB->SetLineColor(kRed);
pp_BinShift_MB->Draw("same");
TLegend * ppCompareLeg = new TLegend(0.2,0.2,0.5,0.5);
ppCompareLeg->AddEntry(pp_BinShift,"Trigger Combined","p");
ppCompareLeg->AddEntry(pp_BinShift_MB,"Only MB","p");
ppCompareLeg->Draw("same");
c1->SaveAs("plots/png/pp_dataVsInterp_MBData_PlusTrigger.png");
c1->SaveAs("plots/pdf/pp_dataVsInterp_MBData_PlusTrigger.pdf");
c1->SaveAs("plots/png/pp_dataVsInterp_MBData_PlusTrigger.C");
delete ppCompareLeg;
pp_BinShift_MB->SetMarkerColor(kBlack);
pp_BinShift_MB->SetLineColor(kBlack);
pp_BinShift_MB->Draw();
pp_BinShift_MB->Write("RpPb_ppVsInterpolation_MBData");
c1->SaveAs("plots/png/pp_dataVsInterp_MBData.png");
c1->SaveAs("plots/pdf/pp_dataVsInterp_MBData.pdf");
c1->SaveAs("plots/png/pp_dataVsInterp_MBData.C");
outBinF->Close();
//************************************************************************************************************