本文整理汇总了C++中TGraph::SetFillColor方法的典型用法代码示例。如果您正苦于以下问题:C++ TGraph::SetFillColor方法的具体用法?C++ TGraph::SetFillColor怎么用?C++ TGraph::SetFillColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TGraph
的用法示例。
在下文中一共展示了TGraph::SetFillColor方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getContourFilledX
TGraph* getContourFilledX(TH2D* inputHisto, TCanvas* goodCanvas, int Width, int Style, int FillStyle, double X){
TCanvas* c1 = new TCanvas("temp", "temp",600,600);
TH2D* histo = (TH2D*)inputHisto->Clone("temp");
double levels[] = {X};
histo->SetContour(1, levels);
histo->Draw("CONT LIST");
c1->Update();
TObjArray* contours = (TObjArray*)gROOT->GetListOfSpecials()->FindObject("contours");
Int_t ncontours = contours->GetSize();
TList *list = (TList*)contours->At(0);
delete c1;
goodCanvas->cd();
printf("list size = %i\n", (int)list->GetSize());
if(list->GetSize()<=0)return new TGraph(0);
for(unsigned int i=0;i<list->GetSize();i++){
TGraph* EXCLUSION = (TGraph*)(list->At(i)->Clone("copy"));
EXCLUSION->SetLineColor(1);
EXCLUSION->SetLineWidth(Width);
EXCLUSION->SetLineStyle(Style);
EXCLUSION->SetFillColor(kBlack);
EXCLUSION->SetFillStyle(FillStyle);
//EXCLUSION->Draw("CL F same");
}
return EXCLUSION;
}
示例2: grshade
void grshade() {
TCanvas *c1 = new TCanvas("c1","A Simple Graph Example",200,10,700,500);
c1->SetGrid();
c1->DrawFrame(0,0,2.2,12);
const Int_t n = 20;
Double_t x[n], y[n],ymin[n], ymax[n];
Int_t i;
for (i=0;i<n;i++) {
x[i] = 0.1+i*0.1;
ymax[i] = 10*sin(x[i]+0.2);
ymin[i] = 8*sin(x[i]+0.1);
y[i] = 9*sin(x[i]+0.15);
}
TGraph *grmin = new TGraph(n,x,ymin);
TGraph *grmax = new TGraph(n,x,ymax);
TGraph *gr = new TGraph(n,x,y);
TGraph *grshade = new TGraph(2*n);
for (i=0;i<n;i++) {
grshade->SetPoint(i,x[i],ymax[i]);
grshade->SetPoint(n+i,x[n-i-1],ymin[n-i-1]);
}
grshade->SetFillStyle(3013);
grshade->SetFillColor(16);
grshade->Draw("f");
grmin->Draw("l");
grmax->Draw("l");
gr->SetLineWidth(4);
gr->SetMarkerColor(4);
gr->SetMarkerStyle(21);
gr->Draw("CP");
}
示例3: DrawFitValue
void DrawFitValue( TH2* frame, Double_t mean, Double_t err )
{
Int_t DarkColor = TColor::GetColor( "#115000" );
Int_t LightColor = TColor::GetColor( "#bdff66" );
Double_t xmin = mean - err;
Double_t xmax = mean + err;
Double_t ymin = frame->GetYaxis()->GetXmin();
Double_t ymax = frame->GetYaxis()->GetXmax();
Double_t x[5] = { xmin, xmin, xmax, xmax, xmin };
Double_t y[5] = { ymin, ymax, ymax, ymin, ymin };
TGraph *box = new TGraph( 5, x, y );
box->SetLineColor( DarkColor );
box->SetFillColor( LightColor );
box->Draw("F");
TLine* louter = new TLine;
TLine* linner = new TLine;
louter->SetLineWidth( 1 );
louter->SetLineColor( DarkColor );
linner->SetLineWidth( 1 );
linner->SetLineStyle( 3 );
linner->SetLineColor( DarkColor );
louter->DrawLine( xmin, ymin, xmin, ymax );
louter->DrawLine( xmax, ymin, xmax, ymax );
linner->DrawLine( mean, ymin, mean, ymax );
}
示例4: uncertaintyBand
TGraph* uncertaintyBand( TGraph* gup , TGraph* gdn ){
const unsigned int npoints = gup->GetN();
cout << "npoints " << npoints << endl;
float x[2*npoints];
float y[2*npoints];
Double_t thisx;
Double_t thisy;
for( int i = 0 ; i < npoints; ++i ){
gup->GetPoint(i,thisx,thisy);
x[i] = thisx;
y[i] = thisy;
//cout << x[i] << " " << y[i] << endl;
}
for( int i = 0 ; i < npoints; ++i ){
gdn->GetPoint(npoints-1-i,thisx,thisy);
x[i+npoints] = thisx;
y[i+npoints] = thisy;
//cout << x[i+15] << " " << y[i+15] << endl;
}
TGraph* gr = new TGraph(2*npoints,x,y);
gr->SetFillColor(7);
return gr;
}
示例5: msugra_stauLSP_mglmsq
TGraph* msugra_stauLSP_mglmsq() {
// A quadratic in msq describes the shape of the curve really well!
TF1 thexcl_quad("thexcl_quad","(x-[1])*(x-[1])/[0]+[2]",0,3500);
thexcl_quad.SetParameter(0,7250);
thexcl_quad.SetParameter(1,750);
thexcl_quad.SetParameter(2,100);
TGraph* thexcl = new TGraph(75);
// The lowest allowed mass ratio of m_sq : m_gl is 0.89
thexcl->SetPoint(0,2500,0);
thexcl->SetPoint(1,2500,2225+50);
thexcl->SetPoint(2,2500,2225+50);
//thexcl->SetPoint(1,2500,2225);
//thexcl->SetPoint(2,2500,2225);
thexcl->SetPoint(3,150,150);
for(int i=1; i<68; i++) {
//thexcl->SetPoint(i+3,thexcl_quad.Eval(150+50*i),150+50*i);
thexcl->SetPoint(i+3,thexcl_quad.Eval(150+50*i),150+50*i);
//if( (150+50*i) >thexcl_quad.Eval(150+50*i)) thexcl->SetPoint(i+3,thexcl_quad.Eval(150+50*i),150+50*i);
}
thexcl->SetPoint(71,2500,5400);
thexcl->SetPoint(72,0,5400);
//thexcl->SetPoint(71,2500,5400);
//thexcl->SetPoint(72,0,5400);
thexcl->SetPoint(73,0,0);
thexcl->SetPoint(74,2500,0);
thexcl->SetLineColor(kGray+2);
thexcl->SetLineWidth(1);
thexcl->SetFillColor(kGreen-6);
thexcl->SetFillColor(kMagenta-10);
thexcl->SetLineColor(kGray+1);
//thexcl->SetFillColor(kAzure+1);
//TCanvas* c = new TCanvas;
//thexcl->Draw("af");
//thexcl->Draw("l");
//c->RedrawAxis();
//c->SaveAs("a.eps");
return thexcl;
}
示例6: DummyLegendExpected
void DummyLegendExpected(TLegend* leg, TString what, Int_t fillColor, Int_t fillStyle, Int_t lineColor, Int_t lineStyle, Int_t lineWidth) {
TGraph* gr = new TGraph();
gr->SetFillColor(fillColor);
gr->SetFillStyle(fillStyle);
gr->SetLineColor(lineColor);
gr->SetLineStyle(lineStyle);
gr->SetLineWidth(lineWidth);
leg->AddEntry(gr,what,"LF");
}
示例7: if
//____________________________________________________________________________________
// Plot red band. NEW: with large number of sampling points
TGraph* redBand2( TGraph* graph, double error, double xmin, double step = 0.05 )
{
int norig = graph->GetN();
int npoints = static_cast<int>((graph->GetX()[norig-1]-graph->GetX()[0])/step);
std::cout << "npoints = " << npoints << std::endl;
if ( npoints > MAXPOINTS ) {
std::cerr << "FATAL: npoints = " << npoints << " is greater than MAXPOINTS" << std::endl;
exit(-1);
}
double x1[2*MAXPOINTS+1], y1[2*MAXPOINTS+1];
double x2[MAXPOINTS], y2[MAXPOINTS];
// Find mH at minimum
int i1=0; // iterator for upper curve
int i2=0; // iterator for lower curve
double ix = graph->GetX()[0];
while ( ix<=graph->GetX()[norig-1] )
{
double iy = graph->Eval( ix, 0, "S" );
if ( ix<=xmin-error ) {//-
x1[i1] = ix+error; y1[i1]=iy; ++i1;
x2[i2] = ix-error; y2[i2]=iy; ++i2;
}
else if ( ix>=xmin+error) { //+
x1[i1] = ix-error; y1[i1]=iy; ++i1;
x2[i2] = ix+error; y2[i2]=iy; ++i2;
} else if ( iy>=0. ) {
x2[i2] = (ix<=xmin)?ix-error:ix+error;
y2[i2]=iy;
++i2;
}
ix += step;
}
// Merge arrays
for ( int i=0; i<i2; ++i ) {
x1[i+i1] = x2[i2-i-1];
y1[i+i1] = y2[i2-i-1];
}
TGraph* redband = new TGraph( i1+i2, x1, y1 );
redband->SetFillColor(46);
redband->SetLineColor(46);
redband->SetLineWidth(3);
// redband->Draw("LF");
return redband;
// TGraph* lowband = new TGraph( i2, x2, y2 );
// std::cout << "Value of (low) redband at limit: " << lowband->Eval( LEPLIMIT, 0, "S" )
// << std::endl;
}
示例8: getgraphsig
TGraph * getgraphsig(TH1F * hist_sig,
TH1F * hist_back,
bool const forwards) {
int const nbins = hist_sig->GetNbinsX();
std::vector<double> xvalues;
xvalues.reserve(nbins);
std::vector<double> yvalues;
yvalues.reserve(nbins);
double sig_tot = hist_sig->Integral();
double back_tot = hist_back->Integral();
if(!forwards) {
for(int i = nbins; i >= 1; --i) {
double sig = sig_tot/sqrt(back_tot);
if(back_tot == 0) sig = 0;
xvalues.push_back(hist_sig->GetBinCenter(i));
yvalues.push_back(sig);
sig_tot -= hist_sig->GetBinContent(i);
back_tot -= hist_back->GetBinContent(i);
}
std::reverse(xvalues.begin(), xvalues.end());
std::reverse(yvalues.begin(), yvalues.end());
}
else {
for(int i = 1; i <= nbins; ++i) {
double sig = sig_tot/sqrt(back_tot);
if(back_tot == 0) sig = 0;
xvalues.push_back(hist_sig->GetBinCenter(i));
yvalues.push_back(sig);
sig_tot -= hist_sig->GetBinContent(i);
back_tot -= hist_back->GetBinContent(i);
}
}
TGraph * graph = new TGraph(nbins,
&xvalues[0],
&yvalues[0]);
graph->SetLineColor(0);
graph->SetFillColor(0);
graph->SetMarkerColor(kGreen+2);
graph->SetMarkerStyle(20);
graph->SetMarkerSize(0.625);
return graph;
}
示例9:
TGraph *
GetHydroSpectrum(TFile *file, Int_t part, Int_t charge, Int_t cent)
{
TGraph *h = (TGraph *)file->Get(Form("%s_C%d", HydroPartName[part], cent));
if (!h) return NULL;
h->SetTitle("Hydro");
h->SetLineWidth(2);
h->SetLineColor(kYellow+1);
h->SetMarkerStyle(24);
h->SetMarkerColor(kYellow+1);
h->SetFillStyle(0);
h->SetFillColor(0);
return h;
}
示例10: fopen
TGraph *draw_schiavilla(Int_t opt = 0){
Double_t x, y, dy;
Double_t gen[26];
Double_t Q2[26];
Double_t tau;
Int_t i;
FILE *f = fopen("figure_input/GEn_Schiavilla.dat", "r");
for( i = 0; i < 13; i++ ){
fscanf( f, "%lf%lf%lf", &x, &y, &dy );
Q2[i] = x;
Q2[25-i] = x;
if( opt == 0 ){
gen[i] = y+dy;
gen[25-i]= y-dy;
}
if( opt == 1 ){
gen[i] = y;
gen[25-i]= y;
}
}
TGraph *g = new TGraph( 20, Q2, gen );
g->SetFillColor(kCyan-10);
g->SetFillStyle(1001);
g->SetLineColor(kGreen);
g->SetMarkerStyle(23);
return g;
}
示例11: Final_av_Lambda_VarCoupling_40Percent
void Final_av_Lambda_VarCoupling_40Percent()
{
//=========Macro generated from canvas: c/c
//========= (Sat Feb 27 17:06:04 2016) by ROOT version6.04/06
TCanvas *c = new TCanvas("c", "c",0,0,800,700);
c->SetHighLightColor(2);
c->Range(-0.4813593,1.36281,3.148656,6.672724);
c->SetFillColor(0);
c->SetBorderMode(0);
c->SetBorderSize(2);
c->SetLogx();
c->SetLogy();
c->SetTickx(1);
c->SetTicky(1);
c->SetLeftMargin(0.12);
c->SetRightMargin(0.04);
c->SetTopMargin(0.07);
c->SetBottomMargin(0.12);
c->SetFrameBorderMode(0);
c->SetFrameBorderMode(0);
TMultiGraph *multigraph = new TMultiGraph();
multigraph->SetName("");
multigraph->SetTitle("");
Double_t Graph_fx1[12] = {
1,
10,
100,
400,
700,
1000,
1000,
700,
400,
100,
10,
1};
Double_t Graph_fy1[12] = {
881.525,
896.549,
871.907,
667.806,
471.744,
308.777,
382.832,
584.437,
826.374,
1079.16,
1110.85,
1092.23};
TGraph *graph = new TGraph(12,Graph_fx1,Graph_fy1);
graph->SetName("Graph");
graph->SetTitle("");
Int_t ci; // for color index setting
TColor *color; // for color definition with alpha
ci = TColor::GetColor("#ffcc00");
graph->SetFillColor(ci);
ci = TColor::GetColor("#ff6666");
graph->SetLineColor(ci);
graph->SetLineWidth(3);
TH1F *Graph_Graph1 = new TH1F("Graph_Graph1","",100,0.9,1099.9);
Graph_Graph1->SetMinimum(228.5697);
Graph_Graph1->SetMaximum(1191.057);
Graph_Graph1->SetDirectory(0);
Graph_Graph1->SetStats(0);
ci = TColor::GetColor("#000099");
Graph_Graph1->SetLineColor(ci);
Graph_Graph1->GetXaxis()->SetLabelFont(42);
Graph_Graph1->GetXaxis()->SetLabelSize(0.035);
Graph_Graph1->GetXaxis()->SetTitleSize(0.035);
Graph_Graph1->GetXaxis()->SetTitleFont(42);
Graph_Graph1->GetYaxis()->SetLabelFont(42);
Graph_Graph1->GetYaxis()->SetLabelSize(0.035);
Graph_Graph1->GetYaxis()->SetTitleSize(0.035);
Graph_Graph1->GetYaxis()->SetTitleFont(42);
Graph_Graph1->GetZaxis()->SetLabelFont(42);
Graph_Graph1->GetZaxis()->SetLabelSize(0.035);
Graph_Graph1->GetZaxis()->SetTitleSize(0.035);
Graph_Graph1->GetZaxis()->SetTitleFont(42);
graph->SetHistogram(Graph_Graph1);
multigraph->Add(graph,"");
multigraph->Draw("af");
multigraph->GetXaxis()->SetTitle("M_{#chi} (GeV)");
multigraph->GetXaxis()->SetRange(0,96);
multigraph->GetXaxis()->SetLabelFont(42);
multigraph->GetXaxis()->SetTitleSize(0.05);
multigraph->GetXaxis()->SetTitleOffset(1.1);
multigraph->GetXaxis()->SetTitleFont(42);
multigraph->GetYaxis()->SetTitle("#Lambda (GeV)");
multigraph->GetYaxis()->SetLabelFont(42);
multigraph->GetYaxis()->SetTitleSize(0.05);
multigraph->GetYaxis()->SetTitleOffset(1.05);
multigraph->GetYaxis()->SetTitleFont(42);
//.........这里部分代码省略.........
示例12: fit1
void fit1()
{
//=========Macro generated from canvas: c1/data fits
//========= (Wed Mar 9 00:43:22 2016) by ROOT version6.06/00
TCanvas *c1 = new TCanvas("c1", "data fits",0,0,1200,800);
gStyle->SetOptStat(0);
gStyle->SetOptTitle(0);
c1->Range(0,0,1,1);
c1->SetFillColor(0);
c1->SetBorderMode(0);
c1->SetBorderSize(2);
c1->SetTickx(1);
c1->SetTicky(1);
c1->SetLeftMargin(0.14);
c1->SetRightMargin(0.05);
c1->SetTopMargin(0.05);
c1->SetBottomMargin(0.16);
c1->SetFrameLineWidth(2);
c1->SetFrameBorderMode(0);
// ------------>Primitives in pad: pad2
TPad *pad2 = new TPad("pad2", "pad2",0,0,1,0.3);
pad2->Draw();
pad2->cd();
pad2->Range(3754.321,-26.4,6223.457,8.8);
pad2->SetFillColor(0);
pad2->SetBorderMode(0);
pad2->SetBorderSize(2);
pad2->SetTickx(1);
pad2->SetTicky(1);
pad2->SetLeftMargin(0.14);
pad2->SetRightMargin(0.05);
pad2->SetTopMargin(0);
pad2->SetBottomMargin(0.5);
pad2->SetFrameLineWidth(2);
pad2->SetFrameBorderMode(0);
pad2->SetFrameLineWidth(2);
pad2->SetFrameBorderMode(0);
TH1D *frame_a63bf70__1 = new TH1D("frame_a63bf70__1","",100,4100,6100);
frame_a63bf70__1->SetBinContent(1,269.9669);
frame_a63bf70__1->SetMinimum(-8.8);
frame_a63bf70__1->SetMaximum(8.8);
frame_a63bf70__1->SetEntries(1);
frame_a63bf70__1->SetDirectory(0);
frame_a63bf70__1->SetStats(0);
frame_a63bf70__1->SetLineWidth(2);
frame_a63bf70__1->SetMarkerStyle(20);
frame_a63bf70__1->GetXaxis()->SetTitle("m(J/#psi #Lambda) (MeV)");
frame_a63bf70__1->GetXaxis()->SetNdivisions(505);
frame_a63bf70__1->GetXaxis()->SetLabelFont(132);
frame_a63bf70__1->GetXaxis()->SetLabelOffset(0.01);
frame_a63bf70__1->GetXaxis()->SetLabelSize(0.15);
frame_a63bf70__1->GetXaxis()->SetTitleSize(0.2);
frame_a63bf70__1->GetXaxis()->SetTitleOffset(1.1);
frame_a63bf70__1->GetXaxis()->SetTitleFont(132);
frame_a63bf70__1->GetYaxis()->SetTitle("Pull");
frame_a63bf70__1->GetYaxis()->CenterTitle(true);
frame_a63bf70__1->GetYaxis()->SetNdivisions(505);
frame_a63bf70__1->GetYaxis()->SetLabelFont(132);
frame_a63bf70__1->GetYaxis()->SetLabelOffset(0.01);
frame_a63bf70__1->GetYaxis()->SetLabelSize(0.15);
frame_a63bf70__1->GetYaxis()->SetTitleSize(0.15);
frame_a63bf70__1->GetYaxis()->SetTitleOffset(0.45);
frame_a63bf70__1->GetYaxis()->SetTitleFont(132);
frame_a63bf70__1->GetZaxis()->SetLabelFont(132);
frame_a63bf70__1->GetZaxis()->SetLabelSize(0.06);
frame_a63bf70__1->GetZaxis()->SetTitleSize(0.072);
frame_a63bf70__1->GetZaxis()->SetTitleOffset(1.2);
frame_a63bf70__1->GetZaxis()->SetTitleFont(132);
frame_a63bf70__1->Draw("FUNC");
Double_t pull_Hist_curvetot_fx3001[83] = {
4310,
4330,
4350,
4370,
4390,
4410,
4430,
4450,
4470,
4490,
4510,
4530,
4550,
4570,
4590,
4610,
4630,
4650,
4670,
4690,
4710,
4730,
4750,
4770,
4790,
4810,
4830,
//.........这里部分代码省略.........
示例13: fitWMLL3testbkg
void fitWMLL3testbkg()
{
//=========Macro generated from canvas: c1/data fits
//========= (Sat May 7 17:06:48 2016) by ROOT version6.06/02
TCanvas *c1 = new TCanvas("c1", "data fits",0,0,1200,800);
gStyle->SetOptStat(0);
gStyle->SetOptTitle(0);
c1->Range(0,0,1,1);
c1->SetFillColor(0);
c1->SetBorderMode(0);
c1->SetBorderSize(2);
c1->SetTickx(1);
c1->SetTicky(1);
c1->SetLeftMargin(0.14);
c1->SetRightMargin(0.05);
c1->SetTopMargin(0.05);
c1->SetBottomMargin(0.16);
c1->SetFrameLineWidth(2);
c1->SetFrameBorderMode(0);
// ------------>Primitives in pad: pad2
TPad *pad2 = new TPad("pad2", "pad2",0,0,1,0.3);
pad2->Draw();
pad2->cd();
pad2->Range(230.8642,-26.4,724.6914,8.8);
pad2->SetFillColor(0);
pad2->SetBorderMode(0);
pad2->SetBorderSize(2);
pad2->SetTickx(1);
pad2->SetTicky(1);
pad2->SetLeftMargin(0.14);
pad2->SetRightMargin(0.05);
pad2->SetTopMargin(0);
pad2->SetBottomMargin(0.5);
pad2->SetFrameLineWidth(2);
pad2->SetFrameBorderMode(0);
pad2->SetFrameLineWidth(2);
pad2->SetFrameBorderMode(0);
TH1D *frame_41aab90__1 = new TH1D("frame_41aab90__1","",100,300,700);
frame_41aab90__1->SetBinContent(1,3.66042);
frame_41aab90__1->SetMinimum(-8.8);
frame_41aab90__1->SetMaximum(8.8);
frame_41aab90__1->SetEntries(1);
frame_41aab90__1->SetDirectory(0);
frame_41aab90__1->SetStats(0);
frame_41aab90__1->SetLineWidth(2);
frame_41aab90__1->SetMarkerStyle(20);
frame_41aab90__1->GetXaxis()->SetTitle("m(#pi p#rightarrow#pi) (MeV)");
frame_41aab90__1->GetXaxis()->SetNdivisions(505);
frame_41aab90__1->GetXaxis()->SetLabelFont(132);
frame_41aab90__1->GetXaxis()->SetLabelOffset(0.01);
frame_41aab90__1->GetXaxis()->SetLabelSize(0.15);
frame_41aab90__1->GetXaxis()->SetTitleSize(0.2);
frame_41aab90__1->GetXaxis()->SetTitleOffset(1.1);
frame_41aab90__1->GetXaxis()->SetTitleFont(132);
frame_41aab90__1->GetYaxis()->SetTitle("Pull");
frame_41aab90__1->GetYaxis()->CenterTitle(true);
frame_41aab90__1->GetYaxis()->SetNdivisions(505);
frame_41aab90__1->GetYaxis()->SetLabelFont(132);
frame_41aab90__1->GetYaxis()->SetLabelOffset(0.01);
frame_41aab90__1->GetYaxis()->SetLabelSize(0.15);
frame_41aab90__1->GetYaxis()->SetTitleSize(0.15);
frame_41aab90__1->GetYaxis()->SetTitleOffset(0.45);
frame_41aab90__1->GetYaxis()->SetTitleFont(132);
frame_41aab90__1->GetZaxis()->SetLabelFont(132);
frame_41aab90__1->GetZaxis()->SetLabelSize(0.06);
frame_41aab90__1->GetZaxis()->SetTitleSize(0.072);
frame_41aab90__1->GetZaxis()->SetTitleOffset(1.2);
frame_41aab90__1->GetZaxis()->SetTitleFont(132);
frame_41aab90__1->Draw("FUNC");
Double_t pull_Hist_curvetot_fx3001[35] = {
322,
326,
330,
334,
338,
342,
346,
350,
354,
358,
362,
366,
370,
374,
378,
382,
386,
390,
394,
398,
402,
406,
410,
414,
418,
422,
426,
//.........这里部分代码省略.........
示例14: fit7_testbkg_withtail
void fit7_testbkg_withtail()
{
//=========Macro generated from canvas: c1/data fits
//========= (Thu Mar 10 20:15:02 2016) by ROOT version6.06/00
TCanvas *c1 = new TCanvas("c1", "data fits",0,0,1200,800);
gStyle->SetOptStat(0);
gStyle->SetOptTitle(0);
c1->Range(0,0,1,1);
c1->SetFillColor(0);
c1->SetBorderMode(0);
c1->SetBorderSize(2);
c1->SetTickx(1);
c1->SetTicky(1);
c1->SetLeftMargin(0.14);
c1->SetRightMargin(0.05);
c1->SetTopMargin(0.05);
c1->SetBottomMargin(0.16);
c1->SetFrameLineWidth(2);
c1->SetFrameBorderMode(0);
// ------------>Primitives in pad: pad2
TPad *pad2 = new TPad("pad2", "pad2",0,0,1,0.3);
pad2->Draw();
pad2->cd();
pad2->Range(3754.321,-26.4,6223.457,8.8);
pad2->SetFillColor(0);
pad2->SetBorderMode(0);
pad2->SetBorderSize(2);
pad2->SetTickx(1);
pad2->SetTicky(1);
pad2->SetLeftMargin(0.14);
pad2->SetRightMargin(0.05);
pad2->SetTopMargin(0);
pad2->SetBottomMargin(0.5);
pad2->SetFrameLineWidth(2);
pad2->SetFrameBorderMode(0);
pad2->SetFrameLineWidth(2);
pad2->SetFrameBorderMode(0);
TH1D *frame_49a73f0__1 = new TH1D("frame_49a73f0__1","",100,4100,6100);
frame_49a73f0__1->SetBinContent(1,1.814401);
frame_49a73f0__1->SetMinimum(-8.8);
frame_49a73f0__1->SetMaximum(8.8);
frame_49a73f0__1->SetEntries(1);
frame_49a73f0__1->SetDirectory(0);
frame_49a73f0__1->SetStats(0);
frame_49a73f0__1->SetLineWidth(2);
frame_49a73f0__1->SetMarkerStyle(20);
frame_49a73f0__1->GetXaxis()->SetTitle("m(J/#psi #Lambda) (MeV)");
frame_49a73f0__1->GetXaxis()->SetNdivisions(505);
frame_49a73f0__1->GetXaxis()->SetLabelFont(132);
frame_49a73f0__1->GetXaxis()->SetLabelOffset(0.01);
frame_49a73f0__1->GetXaxis()->SetLabelSize(0.15);
frame_49a73f0__1->GetXaxis()->SetTitleSize(0.2);
frame_49a73f0__1->GetXaxis()->SetTitleOffset(1.1);
frame_49a73f0__1->GetXaxis()->SetTitleFont(132);
frame_49a73f0__1->GetYaxis()->SetTitle("Pull");
frame_49a73f0__1->GetYaxis()->CenterTitle(true);
frame_49a73f0__1->GetYaxis()->SetNdivisions(505);
frame_49a73f0__1->GetYaxis()->SetLabelFont(132);
frame_49a73f0__1->GetYaxis()->SetLabelOffset(0.01);
frame_49a73f0__1->GetYaxis()->SetLabelSize(0.15);
frame_49a73f0__1->GetYaxis()->SetTitleSize(0.15);
frame_49a73f0__1->GetYaxis()->SetTitleOffset(0.45);
frame_49a73f0__1->GetYaxis()->SetTitleFont(132);
frame_49a73f0__1->GetZaxis()->SetLabelFont(132);
frame_49a73f0__1->GetZaxis()->SetLabelSize(0.06);
frame_49a73f0__1->GetZaxis()->SetTitleSize(0.072);
frame_49a73f0__1->GetZaxis()->SetTitleOffset(1.2);
frame_49a73f0__1->GetZaxis()->SetTitleFont(132);
frame_49a73f0__1->Draw("FUNC");
Double_t pull_Hist_curvetot_fx3001[5] = {
5950,
5970,
5990,
6010,
6030};
Double_t pull_Hist_curvetot_fy3001[5] = {
-0.7070745,
0.407049,
0.6467117,
-0.3394017,
-0.6307982};
Double_t pull_Hist_curvetot_felx3001[5] = {
0,
0,
0,
0,
0};
Double_t pull_Hist_curvetot_fely3001[5] = {
1,
1,
1,
1,
1};
Double_t pull_Hist_curvetot_fehx3001[5] = {
0,
0,
0,
//.........这里部分代码省略.........
示例15: draw_mSUGRA_exclusion
void draw_mSUGRA_exclusion(TH2F *ocrosssection, TH2F *oFilterEfficiency, TH2F *oabsXS, TH2F *limitmap, TH2F *expmap, TH2F *expplusmap, TH2F *expminusmap, TH2F *exp2plusmap, TH2F *exp2minusmap, bool isobserved) {
TH2F *crosssection = (TH2F*)ocrosssection->Clone("crosssection");
// TH2F *limitmap = (TH2F*)olimitmap->Clone(((string)olimitmap->GetName()+"clone").c_str());
TH2F *cleanhisto = (TH2F*)limitmap->Clone("clean");
for(int ix=1;ix<=cleanhisto->GetNbinsX();ix++) {
for(int iy=1;iy<=cleanhisto->GetNbinsY();iy++) {
cleanhisto->SetBinContent(ix,iy,0);
}
}
TH2F *FilterEfficiency;
TH2F *absXS;
write_warning(__FUNCTION__,"You'll want to switch off 'wrongwaytodothis')");
if(wrongwaytodothis) {
//this part is the one you want to remove.
TFile *Efficiencies = new TFile("FilterEfficiencyv3.root");
FilterEfficiency = cast_into_shape((TH2F*) Efficiencies->Get("FilterEfficiency"),limitmap);
assert(FilterEfficiency);
assert(crosssection);
absXS=(TH2F*)crosssection->Clone("absXS");
crosssection->Multiply(FilterEfficiency);
} else {
//this part is the one you want to keep!
FilterEfficiency=(TH2F*)oFilterEfficiency->Clone("FilterEfficiency");
absXS=(TH2F*)oabsXS->Clone("absXS");
}
TH2F *limits = (TH2F*)limitmap->Clone("limits");
set_range(limits,true,false);
limitmap->Divide(crosssection);
expminusmap->Divide(crosssection);
expplusmap->Divide(crosssection);
exp2minusmap->Divide(crosssection);
exp2plusmap->Divide(crosssection);
expmap->Divide(crosssection);
TGraph *observed = get_mSUGRA_exclusion_line(limitmap, PlottingSetup::mSUGRA);
observed->SetLineColor(kRed);
TGraph *expminus = get_mSUGRA_exclusion_line(expminusmap, PlottingSetup::mSUGRA);
TGraph *expplus = get_mSUGRA_exclusion_line(expplusmap, PlottingSetup::mSUGRA);
TGraph *exp2minus;
if(draw2sigma) exp2minus = get_mSUGRA_exclusion_line(exp2minusmap, PlottingSetup::mSUGRA);
TGraph *exp2plus;
if(draw2sigma) exp2plus = get_mSUGRA_exclusion_line(exp2plusmap, PlottingSetup::mSUGRA);
TGraph *expected = new TGraph(expminus->GetN()+expplus->GetN());
TGraph *expected2;
if(draw2sigma) expected2 = new TGraph(exp2minus->GetN()+exp2plus->GetN());
for(int i=0;i<=expminus->GetN();i++) {
Double_t x,y;
expminus->GetPoint(i,x,y);
expected->SetPoint(i,x,y);
}
for(int i=0;i<=exp2minus->GetN();i++) {
Double_t x,y;
exp2minus->GetPoint(i,x,y);
expected2->SetPoint(i,x,y);
}
for(int i=exp2plus->GetN()-1;i>=0;i--) {
Double_t x,y;
exp2plus->GetPoint(i,x,y);
expected2->SetPoint(exp2minus->GetN()+(exp2plus->GetN()-i),x,y);
}
for(int i=expplus->GetN()-1;i>=0;i--) {
Double_t x,y;
expplus->GetPoint(i,x,y);
expected->SetPoint(expminus->GetN()+(expplus->GetN()-i),x,y);
}
expected->SetFillColor(TColor::GetColor("#9FF781"));
if(draw2sigma) expected2->SetFillColor(TColor::GetColor("#F3F781"));
smooth_line(observed);
smooth_line(expected);
if(draw2sigma) smooth_line(expected2);
TCanvas *te = new TCanvas("te","te");
te->SetRightMargin(standardmargin);
// decorate_mSUGRA(cleanhisto,te,expected,expected2,observed);
TH2F *noh = new TH2F("noh","noh",1,1,2,1,1,2);
SugarCoatThis(te,10,noh,observed);
// expected->Draw("c");
// observed->Draw("c");
stringstream saveas;
if((int)((string)limitmap->GetName()).find("limitmap")>0) {
saveas << "Limits/";
if(!isobserved) saveas << "expected/expected_";
saveas << "final_exclusion_for_JZB_geq_" << ((string)limitmap->GetName()).substr(((string)limitmap->GetName()).find("limitmap")+8,10);
} else {
saveas << "Limits/";
if(!isobserved) saveas << "expected/expected";
saveas << "final_exclusion_for_bestlimits";
}
//.........这里部分代码省略.........