当前位置: 首页>>代码示例>>C++>>正文


C++ TGraph::SetFillStyle方法代码示例

本文整理汇总了C++中TGraph::SetFillStyle方法的典型用法代码示例。如果您正苦于以下问题:C++ TGraph::SetFillStyle方法的具体用法?C++ TGraph::SetFillStyle怎么用?C++ TGraph::SetFillStyle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TGraph的用法示例。


在下文中一共展示了TGraph::SetFillStyle方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: 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");
}
开发者ID:TomHadavizadeh,项目名称:DsPhiFitter,代码行数:33,代码来源:twographs.c

示例2: 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;
}
开发者ID:AlexandreMertens,项目名称:ZAPlotters,代码行数:30,代码来源:Plotter_sbatb2.C

示例3: 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");
}
开发者ID:lawrenceleejr,项目名称:ZeroLeptonAnalysis,代码行数:10,代码来源:SUSY_bRPV_m0_vs_m12_all_withBand_cls.C

示例4: contour

void contour(Double_t x1,Double_t x2,Double_t s1, Double_t s2,Double_t rho,TString name, bool charge) {

    // MC values
    Double_t th1=0.322;
    Double_t th2=0.225;

    // by hand
    /*
    // lookup the 2x2 covariance matrix elements for these variables
    Double_t x1= 0.310;//par1->getVal();
    Double_t x2= 0.171;//par2->getVal();
    Double_t s1= 0.038;//par1->getError();
    Double_t s2= 0.125;//par2->getError();
    Double_t rho= -0.3;//correlation(parName1, parName2);
    */
    RooPlot *contour1=ellipse(x1,x2,s1,s2,rho,"E");
    //RooPlot *contour2=ellipse(x1,x2,0.04,0.13,rho,"EC",th1,th2);

    gROOT->SetStyle("Plain");
    gStyle->SetOptTitle(0);
    gStyle->SetOptStat(0);

    TCanvas *c= new TCanvas(name,name,600,600);
    contour1->Draw();
    if(charge==true) {
        contour1->GetXaxis()->SetTitle("(f_{L} - f_{R})^{ +}");
        contour1->GetYaxis()->SetTitle("f_{0}^{ +}");
    }
    else {
        contour1->GetXaxis()->SetTitle("(f_{L}} - f_{R})^{ -}");
        contour1->GetYaxis()->SetTitle("f_{0}^{ -}");
    }
    contour1->GetXaxis()->SetTitleSize(0.05);
    contour1->GetYaxis()->SetTitleSize(0.05);
    contour1->GetXaxis()->SetTitleOffset(.9);
    contour1->GetYaxis()->SetTitleOffset(.85);

    const  int n = 2000;
    Double_t x[n], y[n];
    for (Int_t i=0; i<n; i++) {
        x[i] = -1+i*0.001;
        y[i] = i*0.001;
        if(i*0.001>1) y[i] = 2-i*0.001;
        //cout << " x :"<<x[i]  << " y :"<< y[i]  <<endl;
    }

    TGraph * excl = new TGraph(n,x,y);
    excl->SetLineWidth(9903);
    excl->SetFillStyle(3005);
    excl->Draw("SAMEC");
    // contour2->Draw("SAME");
}
开发者ID:brynmathias,项目名称:AnalysisV2,代码行数:52,代码来源:contour.C

示例5:

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;
}
开发者ID:ktf,项目名称:AliPhysics,代码行数:14,代码来源:CompareSpectra.C

示例6: SetStyle

void SetStyle(TGraph& g, double size, int color, int style, int fillstyle=0, int linestyle=1){
	g.SetMarkerSize(size);
	g.SetMarkerColor(color);
	g.SetLineColor(color);
	g.SetMarkerStyle(style);
	g.SetFillStyle(fillstyle);
	g.SetLineStyle(linestyle);
	g.GetXaxis()->SetTitleFont(42);
	g.GetYaxis()->SetTitleFont(42);
	g.GetXaxis()->SetTitleSize(0.048);
	g.GetYaxis()->SetTitleSize(0.048);
	g.GetXaxis()->CenterTitle();
	g.GetYaxis()->CenterTitle();
}
开发者ID:XuQiao,项目名称:phenix,代码行数:14,代码来源:SimplifyLife.C

示例7: auto_lednic_input_new

void auto_lednic_input_new()
{
  gROOT->SetStyle("Plain");
  Double_t ZR_min = 0.5;
  Double_t ZR_max = 3.0;
  const Int_t n   = 100;

  // lednic_input default values (ZT = 0.01, V = 0.001)
  Double_t ZT_min = 0.001;
  Double_t ZT_max = 2.0;
  Double_t V_min  = 0.0001;
  Double_t V_max  = 0.3;

  Double_t x[n], y_min[n], y_max[n], step = (ZR_max - ZR_min)/n;
  for (Int_t i = 0; i < n; i++) {
    x[i]     = ZR_min + i*step;
    y_min[i] = CalcLednicR(x[i], ZT_min, V_min);
    y_max[i] = CalcLednicR(x[i], ZT_max, V_max);
  }

  TGraph *g_min = new TGraph(n, x, y_min);
  TGraph *g_max = new TGraph(n, x, y_max);
  TGraph *gg    = new TGraph(2*n);
  for (Int_t i = 0; i < n; i++) {
    gg->SetPoint(i, x[i], y_max[i]);
    gg->SetPoint(n+i, x[n-i-1], y_min[n-i-1]);
  }

  gg->SetTitle(";r_{0} [fm];R (k = 0.02 GeV/c)");
  gg->GetYaxis()->CenterTitle(); gg->SetMinimum(0); gg->SetFillStyle(3003);
  gg->Draw("AF");
  g_min->Draw("C");
  g_max->SetLineStyle(2);
  g_max->Draw("C");
  TLegend *leg = new TLegend(0.50, 0.70, 0.85, 0.85);
  leg->AddEntry(g_min, Form("t_{0} = %.3f fm, v = %.4fc", ZT_min, V_min), "L");
  leg->AddEntry(g_max, Form("t_{0} = %.3f fm, v = %.4fc", ZT_max, V_max), "L");
  leg->SetFillColor(0);
  leg->Draw();
  gPad->Print("pp_correl_r0.pdf");
}
开发者ID:musinsky,项目名称:oxygen,代码行数:41,代码来源:auto_lednic_input_new.C

示例8: 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;
}
开发者ID:ellie-long,项目名称:analysis-scripts,代码行数:38,代码来源:geugd_riordan.C

示例9: max

    TGraph*
DrawExpectedBand( TGraph* gr1,  TGraph* gr2, Int_t fillColor, Int_t fillStyle, Int_t cut = 0)
{
    //  TGraph* gr1 = new TGraph( *graph1 );
    //  TGraph* gr2 = new TGraph( *graph2 );

    int number_of_bins = max(gr1->GetN(),gr2->GetN());

    const Int_t gr1N = gr1->GetN();
    const Int_t gr2N = gr2->GetN();

    const Int_t N = number_of_bins;
    Double_t x1[N], y1[N], x2[N], y2[N];

    Double_t xx0, yy0;

    for(int j=0; j<gr1N; j++) {
        gr1->GetPoint(j,xx0,yy0);
        x1[j] = xx0;
        y1[j] = yy0;
    }
    if (gr1N < N) {
        for(int i=gr1N; i<N; i++) {
            x1[i] = x1[gr1N-1];
            y1[i] = y1[gr1N-1];
        }
    }

    Double_t xx1, yy1;

    for(int j=0; j<gr2N; j++) {
        gr2->GetPoint(j,xx1,yy1);
        x2[j] = xx1;
        y2[j] = yy1;
    }
    if (gr2N < N) {
        for(int i=gr2N; i<N; i++) {
            x2[i] = x2[gr1N-1];
            y2[i] = y2[gr1N-1];
        }
    }

    TGraph *grshade = new TGraphAsymmErrors(2*N);
    for (int i=0;i<N;i++) {

        if (x1[i] > cut)
            grshade->SetPoint(i,x1[i],y1[i]);
        //cout<<"grshade x1="<< x1[i] <<" y1="<<y1[i]<<endl;

        if (x2[N-i-1] > cut)
            grshade->SetPoint(N+i,x2[N-i-1],y2[N-i-1]);
    }


    // Apply the cut in the shade plot if there is something that doesn't look good...
    int Nshade = grshade->GetN();
    double x0, y0;
    double x00, y00;

    for(int j=0; j<Nshade; j++) {
        grshade->GetPoint(j,x0,y0);
        if ((x0 != 0) && (y0 != 0)) {
            x00 = x0;
            y00 = y0;
            break;
        }
    }

    for(int j=0; j<Nshade; j++) {
        grshade->GetPoint(j,x0,y0);
        if ((x0 == 0) && (y0 == 0))
            grshade->SetPoint(j,x00,y00);
    }


    // Now draw the plot...
    grshade->SetFillStyle(fillStyle);
    grshade->SetFillColor(fillColor);
    grshade->SetMarkerStyle(21);
    grshade->Draw("F");

    return grshade;
}
开发者ID:lawrenceleejr,项目名称:ZeroLeptonAnalysis,代码行数:83,代码来源:SUSY_bRPV_m0_vs_m12_all_withBand_cls.C

示例10: makePlots


//.........这里部分代码省略.........
 final1->SetLineStyle(7);
 final1->SetLineColor(kBlue);
 final1->SetRange(200,600);

 TGraph *beta_vs_m_7TeV = new TGraph(size, m, beta_7TeV);
 TGraph *beta_vs_m_7TeV_fit = new TGraph(size, m, beta_7TeV_ln);
 beta_vs_m_7TeV->SetLineWidth(2);
 beta_vs_m_7TeV->SetLineStyle(7);
 beta_vs_m_7TeV->SetLineColor(kRed);
 beta_vs_m_7TeV->SetMarkerSize(.9);
 beta_vs_m_7TeV->SetMarkerStyle(22);
 beta_vs_m_7TeV->SetMarkerColor(kRed); 
 beta_vs_m_7TeV_fit->Fit("fit2");
 TF1 *final2 = new TF1("final2","exp(fit2)",200,600);
 final2->SetLineWidth(2);
 final2->SetLineStyle(7);
 final2->SetLineColor(kRed);
 final2->SetRange(200,600);

 const Int_t n = 21;
 Double_t x[n], ymin[n], ymin_sys[n], ymax[n];
 for(Int_t i=0;i<n;i++) {
   x[i] = 200+20*i;
   if (plot10TeV) ymin[i] = final1->Eval(x[i]);
   else if (plot7TeV) ymin[i] = final2->Eval(x[i]);
   ymax[i] = 1;
 }
 TGraph *grshade = new TGraph(2*n);
 TGraph *grshade_sys = new TGraph(2*n);
 for(Int_t 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_sys->SetPoint(i,x[i],ymax[i]);
    grshade_sys->SetPoint(n+i,x[n-i-1],ymin_sys[n-i-1]);
 }
 grshade->SetFillStyle(3004);
 if (plot10TeV) grshade->SetFillColor(kBlue);
 if (plot10TeV) grshade->SetLineColor(kBlue);
 if (plot7TeV) grshade->SetFillColor(kRed);
 if (plot7TeV) grshade->SetLineColor(kRed);
 grshade->Draw("F");
 
 gPad->RedrawAxis();
 
 if (plot10TeV) beta_vs_m->Draw("P");
 if (plot10TeV) final1->Draw("same");
 if (plot7TeV) beta_vs_m_7TeV->Draw("Psame");
 if (plot7TeV) final2->Draw("same");
 
 TLegend *legend = new TLegend(.14,.65,.54,.85);
 legend->SetBorderSize(1);
 legend->SetFillColor(0);
 //legend->SetFillStyle(0);
 legend->SetMargin(0.2);
 legend->SetHeader("LQ #rightarrow eq");
 legend->AddEntry(grexcl,"Tevatron exclusion (250 pb^{-1})","f");
 legend->AddEntry(NEWexcl,"Tevatron exclusion (1 fb^{-1})","l");
 if (plot10TeV) legend->AddEntry(beta_vs_m,"95% C.L. (no sys. unc.)","lp");
 if (plot7TeV) legend->AddEntry(beta_vs_m_7TeV,"95% C.L. (no sys. unc.)","lp");
 legend->Draw();

 TLatex l1;
 l1.SetTextAlign(12);
 l1.SetTextSize(0.04);
 l1.SetTextFont(62);
 l1.SetNDC();
 l1.DrawLatex(0.6,0.34,"CMS Preliminary");

 TLatex l2;
 l2.SetTextAlign(12);
 l2.SetTextSize(0.04);
 l2.SetTextFont(62);
 l2.SetNDC();
 l2.DrawLatex(0.6,0.25,"#intLdt=100 pb^{-1}");

 if (plot7TeV){
 TLatex l3;
 l3.SetTextAlign(12);
 l3.SetTextSize(0.035);
 l3.SetTextFont(62);
 l3.SetNDC();
 l3.DrawLatex(0.4,0.16,"EXO-08-010 scaled to #sqrt{s} = 7 TeV");
 }

 c->SetGridx();
 c->SetGridy();
 c->SaveAs(fileName.c_str());

 
 delete fit1;
 delete final1;
 delete fit2;
 delete grexcl;
 delete grshade;
 delete legend;
 delete beta_vs_m;
 delete beta_vs_m_fit;
 delete bg;
 delete c;
}
开发者ID:CMSLQ,项目名称:CommonTools,代码行数:101,代码来源:rescaled_exclusion_plot_beta_vs_m_100.C

示例11: Polarization


//.........这里部分代码省略.........
   hSum->SetLineColor(ci);
   hSum->SetLineStyle(0);
   hSum->SetMarkerStyle(20);
   hSum->GetXaxis()->SetTitle("m_{#tilde{t}} [GeV]");
   //hSum->GetXaxis()->SetBit(TAxis::kLabelsVert);
   hSum->GetXaxis()->SetLabelFont(42);
   //hSum->GetXaxis()->SetLabelOffset(0.005);
   hSum->GetXaxis()->SetLabelSize(0.035);
   hSum->GetXaxis()->SetTitleSize(0.06);
   hSum->GetXaxis()->SetTitleOffset(1.2);
   hSum->GetXaxis()->SetTitleFont(42);
   hSum->GetYaxis()->SetTitle("m_{#tilde{#chi}}_{1}^{0} [GeV]");
   hSum->GetYaxis()->SetLabelFont(42);
   //hSum->GetYaxis()->SetLabelOffset(0.007);
   hSum->GetYaxis()->SetLabelSize(0.035);
   hSum->GetYaxis()->SetTitleSize(0.05);
   hSum->GetYaxis()->SetTitleOffset(1.3);
   hSum->GetYaxis()->SetTitleFont(42);
    
    //TLegend *leg = new TLegend(0.4992416,0.4811189,0.898906,0.7503497,NULL,"brNDC");
    //TLegend *leg = new TLegend(0.4992416,0.4811189,0.698906,0.7503497,NULL,"brNDC");
    //TLegend *leg = new TLegend(0.6992416,0.2811189,0.898906,0.4503497,NULL,"brNDC");
    //TLegend *leg = new TLegend(0.6992416,0.3311189,0.898906,0.7903497,NULL,"brNDC");
    //TLegend *leg = new TLegend(0.7582416,0.4211189,0.912,0.8043497,NULL,"brNDC");
    TLegend *legE = new TLegend(0.51,0.675,0.81,0.855,NULL,"brNDC");
    //leg-> SetNColumns(2);
    legE->SetBorderSize(0);
    legE->SetTextSize(0.04);
    legE->SetTextFont(42);
    legE->SetLineColor(1);
    legE->SetLineStyle(1);
    legE->SetLineWidth(2);
    legE->SetFillColor(0);
    legE->SetFillStyle(1001);
    legE->SetHeader("Expected");
    legE->AddEntry(gExp, "unpolarized","l");
    legE->AddEntry(gExpR, "right-handed","l");
    legE->AddEntry(gExpL, "left-handed","l");
    
    TLegend *legO = new TLegend(0.175,0.675,0.50,0.855,NULL,"brNDC");
    //legO-> SetNColumns(2);
    legO->SetBorderSize(0);
    legO->SetTextSize(0.04);
    legO->SetTextFont(42);
    legO->SetLineColor(1);
    legO->SetLineStyle(1);
    legO->SetLineWidth(2);
    legO->SetFillColor(0);
    legO->SetFillStyle(1001);
    legO->SetHeader("Observed");
    legO->AddEntry(gObs, "unpolarized","l");
    legO->AddEntry(gObsR, "right-handed","l");
    legO->AddEntry(gObsL, "left-handed","l");
    
    
    TGraph* graphWhite = new TGraph(5);
    graphWhite->SetName("white");
    graphWhite->SetTitle("white");
    graphWhite->SetFillColor(kWhite);
    graphWhite->SetFillStyle(1001);
    graphWhite->SetLineColor(kBlack);
    graphWhite->SetLineStyle(1);
    graphWhite->SetLineWidth(3);
    graphWhite->SetPoint(0,150, 500);
    graphWhite->SetPoint(1,950, 500);
    graphWhite->SetPoint(2,950, 500*0.6666666667);
开发者ID:haweber,项目名称:OneLepStop,代码行数:67,代码来源:Polarization.C

示例12: runBATCalculator


//.........这里部分代码省略.........

    modelconfig.SetPdf(*(myWS->pdf("model")));
    modelconfig.SetParametersOfInterest(*(myWS->set("poiSet")));
    modelconfig.SetPriorPdf(*(myWS->pdf("prior")));
    modelconfig.SetNuisanceParameters(*(myWS->set("nuisanceSet")));
    modelconfig.SetObservables(*(myWS->set("obsSet")));


    // use BATCalculator to the derive credibility intervals as a function of the observed number of
    // events in the hypothetical experiment

    // define vector with tested numbers of events
    TVectorD obsEvents;
    // define vectors which will be filled with the lower and upper limits for each tested number
    // of observed events
    TVectorD BATul;
    TVectorD BATll;

    // fix upper limit of tested observed number of events
    int obslimit = 10;

    obsEvents.ResizeTo(obslimit);
    BATul.ResizeTo(obslimit);
    BATll.ResizeTo(obslimit);


    cout << "starting the calculation of Bayesian credibility intervals with BATCalculator" << endl;
    // loop over observed number of events in the hypothetical experiment
    for (int obs = 1; obs <= obslimit; obs++) {

        obsEvents[obs - 1] = (static_cast<double>(obs));

        // prepare data input for the the observed number of events
        // adjust number of observed events in the workspace. This is communicated to ModelConfig!
        myWS->var("n")->setVal(obs);
        // create data
        RooDataSet data("data", "", *(modelconfig.GetObservables()));
        data.add( *(modelconfig.GetObservables()));

        // prepare BATCalulator
        BATCalculator batcalc(data, modelconfig);

        // give the BATCalculator a unique name (always a good idea in ROOT)
        TString namestring = "mybatc_";
        namestring += obs;
        batcalc.SetName(namestring);

        // fix amount of posterior probability in the calculated interval.
        // the name confidence level is incorrect here
        batcalc.SetConfidenceLevel(0.90);

        // fix length of the Markov chain. (in general: the longer the Markov chain the more
        // precise will be the results)
        batcalc.SetnMCMC(20000);

        // retrieve SimpleInterval object containing the information about the interval (this
        // triggers the actual calculations)
        SimpleInterval* interval = batcalc.GetInterval1D("sigma_s");

        std::cout << "BATCalculator: 90% credibility interval: [ " << interval->LowerLimit() << " - " << interval->UpperLimit() << " ] or 95% credibility upper limit\n";

        // add the interval borders for the current number of observed events to the vectors
        // containing the lower and upper limits
        BATll[obs - 1] = interval->LowerLimit();
        BATul[obs - 1] = interval->UpperLimit();

        // clean up for next loop element
        batcalc.CleanCalculatorForNewData();
        delete interval;
    }
    cout << "all limits calculated" << endl;

    // summarize the results in a plot

    TGraph* grBATll = new TGraph(obsEvents, BATll);
    grBATll->SetLineColor(kGreen);
    grBATll->SetLineWidth(200);
    grBATll->SetFillStyle(3001);
    grBATll->SetFillColor(kGreen);

    TGraph* grBATul = new TGraph(obsEvents, BATul);
    grBATul->SetLineColor(kGreen);
    grBATul->SetLineWidth(-200);
    grBATul->SetFillStyle(3001);
    grBATul->SetFillColor(kGreen);

    // create and draw multigraph
    TMultiGraph* mg = new TMultiGraph("BayesianLimitsBATCalculator", "BayesianLimitsBATCalculator");
    mg->SetTitle("example of Bayesian credibility intervals derived with BATCAlculator ");

    mg->Add(grBATll);
    mg->Add(grBATul);

    mg->Draw("AC");

    mg->GetXaxis()->SetTitle ("# observed events");
    mg->GetYaxis()->SetTitle("limits on signal S (size of test: 0.1)");

    mg->Draw("AC");
}
开发者ID:Kaoschuks,项目名称:bat,代码行数:101,代码来源:runBATCalculator.C

示例13: rsLimit7TeV


//.........这里部分代码省略.........
//    graph->SetMarkerColor(ci);
//    graph->SetMarkerStyle(21);
//    graph->SetMarkerSize(1.3);
//    graph->SetPoint(0,750,0.02431275);
//    graph->SetPoint(1,1000,0.05519538);
//    graph->SetPoint(2,1250,0.1117521);
   
//    TH1 *Graph8 = new TH1F("Graph8","",100,700,1300);
//    Graph8->SetMinimum(0.01556881);
//    Graph8->SetMaximum(0.1204961);
//    Graph8->SetDirectory(0);
//    Graph8->SetStats(0);
//    Graph8->GetXaxis()->SetTitle("Graviton Mass (GeV/c^{2})");
//    Graph8->GetYaxis()->SetTitle("Coupling k/#bar{M}_{Pl}");
//    graph->SetHistogram(Graph8);
   
//    graph->Draw("pc");
   
//    TF1 *LambdaPi = new TF1("LambdaPi","pol1",500,2500);
//    LambdaPi->SetFillColor(15);
//    LambdaPi->SetFillStyle(3004);
//    LambdaPi->SetLineColor(15);
//    LambdaPi->SetLineWidth(1);
//    LambdaPi->SetParameter(0,0);
//    LambdaPi->SetParError(0,0);
//    LambdaPi->SetParLimits(0,0,0);
//    LambdaPi->SetParameter(1,2.61097e-05);
//    LambdaPi->SetParError(1,0);
//    LambdaPi->SetParLimits(1,0,0);
//    LambdaPi->Draw("same");
// 
    TF1 *LambdaPi = new TF1("LambdaPi","pol1",250,2500);
    LambdaPi->SetFillColor(15);
    LambdaPi->SetFillStyle(3004);
    LambdaPi->SetLineColor(15);
    LambdaPi->SetLineWidth(1);
    LambdaPi->SetParameter(0,0);
    LambdaPi->SetParError(0,0);
    LambdaPi->SetParLimits(0,0,0);
    LambdaPi->SetParameter(1,2.61097e-05);
    LambdaPi->SetParError(1,0);
    LambdaPi->SetParLimits(1,0,0);
    LambdaPi->GetXaxis()->SetLabelFont(42);
    LambdaPi->GetYaxis()->SetLabelFont(42);
    LambdaPi->Draw("same");
   
    graph = new TGraph(27);
    graph->SetName("Graph");
    graph->SetTitle("Graph");
    graph->SetFillColor(1);
    graph->SetFillStyle(3004);    
    graph->SetLineStyle(5);
    graph->SetLineWidth(3);
    graph->SetPoint(0,180,0.1071);
    graph->SetPoint(1,183,0.1062);
    graph->SetPoint(2,190,0.1043);
    graph->SetPoint(3,200,0.1016);
    graph->SetPoint(4,210,0.0989);
    graph->SetPoint(5,220,0.0963);
    graph->SetPoint(6,230,0.0938);
    graph->SetPoint(7,240,0.0913);
    graph->SetPoint(8,250,0.0889);
    graph->SetPoint(9,260,0.0866);
    graph->SetPoint(10,270,0.0843);
    graph->SetPoint(11,280,0.0821);
    graph->SetPoint(12,290,0.0799);
开发者ID:cms-exotica-diphotons,项目名称:DiPhotonAnalysis,代码行数:67,代码来源:rsLimit7TeV.C

示例14: SignfificanceT2tt


//.........这里部分代码省略.........
    hSum->GetXaxis()->SetRangeUser(100,900);

   Int_t ci;   // for color index setting
   ci = TColor::GetColor("#000099");
   hSum->SetLineColor(ci);
   hSum->SetLineStyle(0);
   hSum->SetMarkerStyle(20);
   hSum->GetXaxis()->SetTitle("m_{#tilde{t}} [GeV]");
   //hSum->GetXaxis()->SetBit(TAxis::kLabelsVert);
   hSum->GetXaxis()->SetLabelFont(42);
   //hSum->GetXaxis()->SetLabelOffset(0.005);
   hSum->GetXaxis()->SetLabelSize(0.035);
   hSum->GetXaxis()->SetTitleSize(0.06);
   hSum->GetXaxis()->SetTitleOffset(1.2);
   hSum->GetXaxis()->SetTitleFont(42);
   hSum->GetYaxis()->SetTitle("m_{#tilde{#chi}}_{1}^{0} [GeV]");
   hSum->GetYaxis()->SetLabelFont(42);
   //hSum->GetYaxis()->SetLabelOffset(0.007);
   hSum->GetYaxis()->SetLabelSize(0.035);
   hSum->GetYaxis()->SetTitleSize(0.05);
   hSum->GetYaxis()->SetTitleOffset(1.3);
   hSum->GetYaxis()->SetTitleFont(42);
    
   /*
    TLegend *legO = new TLegend(0.175,0.675,0.50,0.855,NULL,"brNDC");
    //legO-> SetNColumns(2);
    legO->SetBorderSize(0);
    legO->SetTextSize(0.04);
    legO->SetTextFont(42);
    legO->SetLineColor(1);
    legO->SetLineStyle(1);
    legO->SetLineWidth(2);
    legO->SetFillColor(0);
    legO->SetFillStyle(1001);
    legO->SetHeader("Observed");
    legO->AddEntry(gObs, "unpolarized","l");
    legO->AddEntry(gObsR, "right-handed","l");
    legO->AddEntry(gObsL, "left-handed","l");
    */
    
    TGraph* graphWhite = new TGraph(5);
    graphWhite->SetName("white");
    graphWhite->SetTitle("white");
    graphWhite->SetFillColor(kWhite);
    graphWhite->SetFillStyle(1001);
    graphWhite->SetLineColor(kBlack);
    graphWhite->SetLineStyle(1);
    graphWhite->SetLineWidth(3);
    graphWhite->SetPoint(0,100, 500);
    graphWhite->SetPoint(1,900, 500);
    graphWhite->SetPoint(2,900, 500*0.75);
    graphWhite->SetPoint(3,100, 500*0.75);
    graphWhite->SetPoint(4,100, 500);
    
    Float_t diagX[4] = {175.+25.,175.+25.+5000,175.-25.+5000,175.-25.};
    Float_t diagY[4] = {0,5000,5000,0};
    TGraph *gdiagonal = new TGraph(4, diagX, diagY);
    gdiagonal->SetName("MtopDiagonal");
    gdiagonal->SetFillColor(kWhite);
    //#gdiagonal->SetFillColor(18);
    TLine* ldiagonal = new TLine(175,0.,650-25.,450);
    //TLine* ldiagonal = new TLine(175.,25,175+500,500);
    ldiagonal->SetLineColor(kGray);
    ldiagonal->SetLineStyle(2);
    TLatex* tdiagonal = new TLatex(400-2.5, 400-172.5,"m_{#tilde{t}} = m_{t} + m_{#tilde{#chi}_{1}^{0}}");
    //tdiagonal->SetTextAngle(TMath::RadToDeg()*TMath::ATan(float(800)/float(500)));
开发者ID:haweber,项目名称:OneLepStop,代码行数:67,代码来源:SignificanceT2tt.C

示例15: wmj_fit_stack

void wmj_fit_stack()
{
//=========Macro generated from canvas: default_Canvas/defaultCanvas
//=========  (Tue May  3 07:35:30 2016) by ROOT version6.04/10
   TCanvas *default_Canvas = new TCanvas("default_Canvas", "defaultCanvas",0,0,700,500);
   gStyle->SetOptStat(0);
   gStyle->SetOptTitle(0);
   default_Canvas->SetHighLightColor(2);
   default_Canvas->Range(0,0,1,1);
   default_Canvas->SetFillColor(0);
   default_Canvas->SetBorderMode(0);
   default_Canvas->SetBorderSize(2);
   default_Canvas->SetTickx(1);
   default_Canvas->SetTicky(1);
   default_Canvas->SetLeftMargin(0.14);
   default_Canvas->SetRightMargin(0.05);
   default_Canvas->SetTopMargin(0.05);
   default_Canvas->SetBottomMargin(0.16);
   default_Canvas->SetFrameLineWidth(2);
   default_Canvas->SetFrameBorderMode(0);
  
// ------------>Primitives in pad: upperPad
   TPad *upperPad = new TPad("upperPad", "upperPad",0.005,0.05,0.995,0.995);
   upperPad->Draw();
   upperPad->cd();
   upperPad->Range(-0.1730123,-5358.989,1.06279,32919.5);
   upperPad->SetFillColor(0);
   upperPad->SetFillStyle(4000);
   upperPad->SetBorderMode(0);
   upperPad->SetBorderSize(2);
   upperPad->SetTickx(1);
   upperPad->SetTicky(1);
   upperPad->SetLeftMargin(0.14);
   upperPad->SetRightMargin(0.05);
   upperPad->SetTopMargin(0.05);
   upperPad->SetBottomMargin(0.14);
   upperPad->SetFrameLineWidth(2);
   upperPad->SetFrameBorderMode(0);
   upperPad->SetFrameLineWidth(2);
   upperPad->SetFrameBorderMode(0);
   
   Double_t h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]_fx3005[20] = {
   0.025,
   0.075,
   0.125,
   0.175,
   0.225,
   0.275,
   0.325,
   0.375,
   0.425,
   0.475,
   0.525,
   0.575,
   0.625,
   0.675,
   0.725,
   0.775,
   0.825,
   0.875,
   0.925,
   0.975};
   Double_t h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]_fy3005[20] = {
   0,
   0,
   9,
   26,
   118,
   315,
   881,
   1812,
   3086,
   4575,
   5856,
   6537,
   6824,
   6348,
   5662,
   4769,
   4941,
   6726,
   13179,
   28019};
   Double_t h_combData_Cut[samples == samples::fitW_etam_0 || samples == samples::fitW_etam_1 || samples == samples::fitW_etam_2 || samples == samples::fitW_etam_3]_felx3005[20] = {
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
   0.025,
//.........这里部分代码省略.........
开发者ID:s-farry,项目名称:workspaces,代码行数:101,代码来源:wmj_fit_stack.C


注:本文中的TGraph::SetFillStyle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。