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


C++ TBox::Draw方法代码示例

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


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

示例1: dessinEnnemi

void Interface::dessinEnnemi(Objet ennemi)
{
    //  Dessin de l'ennemi
    TBox *dessinEnnemi = new TBox(ennemi.getX()-ennemi.getLongueur(),ennemi.getY()-ennemi.getHauteur(),ennemi.getX(),ennemi.getY());
    dessinEnnemi->SetFillColor(kRed);
    dessinEnnemi->Draw();
}
开发者ID:mboutserin,项目名称:flyingTurtles,代码行数:7,代码来源:interface.cpp

示例2: greyscale

void greyscale()
{
   TCanvas *c = new TCanvas("grey", "Grey Scale", 500, 500);
   c->SetBorderMode(0);

   Int_t   n = 200;   // tunable parameter
   Float_t n1 = 1./n;
   for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
         TBox *b = new TBox(n1*j, n1*(n-1-i), n1*(j+1), n1*(n-i));
         Float_t grey = Float_t(i*n+j)/(n*n);
         b->SetFillColor(TColor::GetColor(grey, grey, grey));
         b->Draw();
      }
   }
   TPad *p = new TPad("p","p",0.3, 0.3, 0.7,0.7);
   const char *guibackground = gEnv->GetValue("Gui.BackgroundColor", "");
   p->SetFillColor(TColor::GetColor(guibackground));
   p->Draw();
   p->cd();
   TText *t = new TText(0.5, 0.5, "GUI Background Color");
   t->SetTextAlign(22);
   t->SetTextSize(.09);
   t->Draw();

   c->SetEditable(kFALSE);
}
开发者ID:Y--,项目名称:root,代码行数:27,代码来源:greyscale.C

示例3: drawSysBox

void drawSysBox(TGraph* gr, int fillcolor=TColor::GetColor("#ffff00"), double xwidth=0.3, double percent=0, double xshift=0)
{

  TBox* box;
  for(int n=0;n<gr->GetN();n++)
  {
    double x,y;
    gr->GetPoint(n,x,y);

    //double percent=0;
    //if(x>=260) percent=0.074;
    //else if(x<260 && x>=200) percent=0.055;
    //else percent=0.039;

    double yerr = y*percent*0.01;
    box = new TBox(x+xshift-xwidth,y-fabs(yerr),x+xwidth,y+fabs(yerr));
    //box->SetFillStyle(3001);
  //box->SetFillColor(fillcolor);
    //box->SetFillColor(2);
    box->SetLineWidth(0);
  box->SetFillColor(kGray);
    box->Draw("Fsame");
    //box->Draw();
  }

}
开发者ID:tuos,项目名称:FlowAndCorrelations,代码行数:26,代码来源:v523pt_compareZb.C

示例4: Draw_ALICEFor_JPsi_RaaVsNpart

void Draw_ALICEFor_JPsi_RaaVsNpart(TLegend *lgd)
{
  int nbinsALICE=9;
  Double_t NPartALICE[10]={357,262,187,128,86,53,30,16,8};
  Double_t ErrNPartALICE[10]={0};
  Double_t RaaALICE[10] = {0.47,0.48,0.51,0.51,0.52,0.61,0.70,0.74,0.94}; 
  Double_t SystErrALICE[10] = {0.03,0.02,0.02,0.02,0.03,0.05,0.06,0.09,0.1};
  
  TGraphErrors *grRaaALICE = new TGraphErrors(nbinsALICE, NPartALICE, RaaALICE, ErrNPartALICE, SystErrALICE);  
  grRaaALICE->SetMarkerStyle(20);
  grRaaALICE->SetMarkerColor(4);
  grRaaALICE->GetYaxis()->SetRangeUser(0,1.7);
  
  TAxis *Xaxis2 = grRaaALICE->GetXaxis();
  Xaxis2->SetLimits(0.,430.0);
  
  grRaaALICE->GetXaxis()->SetTitle("N_{Part}");
  grRaaALICE->GetYaxis()->SetTitle("R_{AA}");

  grRaaALICE->Draw("AP");
 
  TLine *lh3 = new TLine(0.0,1.0,420,1.0);
  lh3->SetLineColor(1);
  lh3->SetLineStyle(1);
  lh3->SetLineWidth(1.5);
  lh3->Draw("same");
 
  //TLatex *tb= new TLatex;
  //tb->SetNDC(); 
  //tb->SetTextAlign(12);
  //tb->SetTextColor(1);
  //tb->SetTextSize(0.040);
  //tb->DrawLatex(0.22,0.22,"PbPb #sqrt{s_{NN}} = 2.76 TeV");
  //tb->DrawLatex(0.22,0.16,"J/#psi #rightarrow #mu^{+} #mu^{-}, p_{T}^{J/#psi} > 0.0 GeV/c");  
   
  
  TBox *RaaJPsiALICESys[12];
  for(int j=0;j<9;j++){
    RaaJPsiALICESys[j] = new TBox(NPartALICE[j]-3,  RaaALICE[j]-SystErrALICE[j], NPartALICE[j]+3, RaaALICE[j]+SystErrALICE[j]);
  }
  
  for(int j=0;j<9;j++){
    RaaJPsiALICESys[j]->SetFillStyle(0000);
    RaaJPsiALICESys[j]->SetLineColor(4);
    RaaJPsiALICESys[j]->Draw("same"); 
  }
  
  TBox *ALICEGlobalSysJPsi;
  ALICEGlobalSysJPsi = new TBox(400-5, 1 - 0.14, 400+5, 1 + 0.14);
  ALICEGlobalSysJPsi->SetFillStyle(3001);
  ALICEGlobalSysJPsi->SetLineColor(4);
  ALICEGlobalSysJPsi->SetFillColor(4);
  ALICEGlobalSysJPsi->Draw("same"); 

  Draw_ALICEMid_JPsi_RaaVsNpart(lgd);

  lgd->AddEntry(grRaaALICE,"ALICE Data p_{T}^{J/#psi} > 0.0 GeV/c, 2.5 #leq y^{J/#psi} #leq 4.0","P");

}
开发者ID:vineetsalar,项目名称:JPsiProduction,代码行数:59,代码来源:AbDrawData.C

示例5: Draw_ALICEMid_JPsi_RaaVsNpart

void Draw_ALICEMid_JPsi_RaaVsNpart(TLegend *lgd)
{
  //ALICE MID rapidity
  int nbinsALICEMid=3;
  Double_t NPartALICEMid[3]={357,193,46};
  Double_t ErrNPartALICEMid[3]={0};
  Double_t RaaALICEMid[3] = {0.82,0.65,0.73}; 
  Double_t SystErrALICEMid[3] = {0.15,0.10,0.16};
  
  TGraphErrors *grRaaALICEMid = new TGraphErrors(nbinsALICEMid, NPartALICEMid, RaaALICEMid, ErrNPartALICEMid, SystErrALICEMid);  
  grRaaALICEMid->SetMarkerStyle(20);
  grRaaALICEMid->SetMarkerColor(2);
  //grRaaALICEMid->SetLineColor(2);
  grRaaALICEMid->GetYaxis()->SetRangeUser(0,1.5);
  
  TAxis *Xaxis = grRaaALICEMid->GetXaxis();
  Xaxis->SetLimits(0.,430.0);
  grRaaALICEMid->GetXaxis()->SetTitle("N_{Part}");
  grRaaALICEMid->GetYaxis()->SetTitle("R_{AA}");
  
  grRaaALICEMid->Draw("Psame");
  
  //TLatex *tb= new TLatex;
  //tb->SetNDC(); 
  //tb->SetTextAlign(12);
  //tb->SetTextColor(1);
  //tb->SetTextSize(0.040);
  //tb->DrawLatex(0.55,0.90,"PbPb #sqrt{s_{NN}} = 2.76 TeV");
  //tb->DrawLatex(0.22,0.16,"J/#psi #rightarrow #mu^{+} #mu^{-}, p_{T}^{J/#psi} > 0.0 GeV/c");  
  //tb->DrawLatex(0.55,0.85,"p_{T}^{J/#psi} > 0.0 GeV/c");  
  
  TLine *lh3 = new TLine(0.0,1.0,420,1.0);
  lh3->SetLineColor(1);
  lh3->SetLineStyle(1);
  lh3->SetLineWidth(1.5);
  lh3->Draw("same");
    
  TBox *RaaJPsiALICEMidSys[12];
  for(int j=0;j<3;j++){
    RaaJPsiALICEMidSys[j] = new TBox(NPartALICEMid[j]-3,  RaaALICEMid[j]-SystErrALICEMid[j], NPartALICEMid[j]+3, RaaALICEMid[j]+SystErrALICEMid[j]);
  }
  
  for(int j=0;j<3;j++){
    RaaJPsiALICEMidSys[j]->SetFillStyle(0000);
    RaaJPsiALICEMidSys[j]->SetLineColor(2);
    RaaJPsiALICEMidSys[j]->Draw("same"); 
  }
  
  TBox *ALICEMidGlobalSysJPsi;
  ALICEMidGlobalSysJPsi = new TBox(385-5, 1 - 0.26, 385+5, 1 + 0.26);
  
  ALICEMidGlobalSysJPsi->SetFillStyle(3001);
  ALICEMidGlobalSysJPsi->SetLineColor(2);
  ALICEMidGlobalSysJPsi->SetFillColor(2);
  ALICEMidGlobalSysJPsi->Draw("same"); 

  lgd->AddEntry(grRaaALICEMid,"ALICE Data p_{T}^{J/#psi} > 0.0 GeV/c, |y^{J/#psi}| #leq 1.0","P");
  
}
开发者ID:vineetsalar,项目名称:JPsiProduction,代码行数:59,代码来源:AbDrawData.C

示例6: Draw_CMS_JPsi_RaaVsRap

void Draw_CMS_JPsi_RaaVsRap(TLegend *lgd)
{
  //=============== CMS Raa Vs Rap Data ===============================================================//
  //AvpT 10.92,9.65,8.92
  int nbinsRapCMS=3;
  Double_t RapCMSD[3]={0.6,1.4,2.0};
  Double_t ErrRapCMS[3]={0.6,0.2,0.4};
  Double_t RaaRapCMS[3] = {0.31,0.33,0.36}; 
  Double_t RaaRapStatErrCMS[3] = {0.02,0.03,0.03};
  Double_t RaaRapSystErrCMS[3] = {0.03,0.04,0.04};

  TGraphErrors *grRaaRapCMS = new TGraphErrors(nbinsRapCMS, RapCMSD, RaaRapCMS, ErrRapCMS, RaaRapStatErrCMS);  
  grRaaRapCMS->SetMarkerStyle(20);
  grRaaRapCMS->SetMarkerColor(2);
  grRaaRapCMS->GetYaxis()->SetRangeUser(0,1.5);
  grRaaRapCMS->GetXaxis()->SetTitle("|y|");
  grRaaRapCMS->GetYaxis()->SetTitle("R_{AA}");
  
  TAxis *XaxisgrRaaRapCMS = grRaaRapCMS->GetXaxis();
  XaxisgrRaaRapCMS->SetLimits(0.0,2.4);
  
  grRaaRapCMS->Draw("AP"); 

  TLine *lh_grRaaRapCMS = new TLine(0.0,1.0,2.4,1.0);
  lh_grRaaRapCMS->SetLineColor(1);
  lh_grRaaRapCMS->SetLineStyle(1);
  lh_grRaaRapCMS->SetLineWidth(1.5);
  lh_grRaaRapCMS->Draw("same");

  TLatex *tb= new TLatex;
  tb->SetNDC(); 
  tb->SetTextAlign(12);
  tb->SetTextColor(1);
  tb->SetTextSize(0.040);
  tb->DrawLatex(0.20,0.20,"Pb+Pb #sqrt{s_{NN}} = 2.76 TeV");
  tb->DrawLatex(0.20,0.15,"J/#psi #rightarrow #mu^{+} #mu^{-}, p_{T}^{J/#psi} > 6.5 GeV/c");  
  
  TBox *RaaRapJPsiCMSSys[4];
  for(int j=0;j<3;j++){
    RaaRapJPsiCMSSys[j] = new TBox(RapCMSD[j]-0.05,  RaaRapCMS[j]-RaaRapSystErrCMS[j], RapCMSD[j]+0.05,  RaaRapCMS[j]+RaaRapSystErrCMS[j]);
  }
  
  for(int j=0;j<3;j++){
    RaaRapJPsiCMSSys[j]->SetFillStyle(0000);
    RaaRapJPsiCMSSys[j]->SetLineColor(2);
    RaaRapJPsiCMSSys[j]->Draw("same"); 
  }
  
  TBox *CMSGlobalSysJPsiRap;
  CMSGlobalSysJPsiRap = new TBox(0.2-0.05, 1 - 0.05, 0.2+0.05, 1 + 0.05);
  CMSGlobalSysJPsiRap->SetFillStyle(3001);
  CMSGlobalSysJPsiRap->SetLineColor(2);
  CMSGlobalSysJPsiRap->SetFillColor(2);
  CMSGlobalSysJPsiRap->Draw("same"); 


  lgd->AddEntry(grRaaRapCMS,"CMS Data", "P");
}
开发者ID:vineetsalar,项目名称:JPsiProduction,代码行数:58,代码来源:AbDrawData.C

示例7: Draw_CMS_JPsi_RaaVsNpart

void Draw_CMS_JPsi_RaaVsNpart(TLegend *lgd)
{

int nbins = 12;
  Double_t RaaCMS[20]={0.23,0.24,0.29,0.33,0.38,0.40,0.45,0.41,0.52,0.52,0.64,0.64};
  Double_t StatErrCMS[20]={0.01,0.01,0.02,0.02,0.02,0.03,0.03,0.03,0.04,0.04,0.05,0.05};
  Double_t SystErrCMS[20]={0.02,0.03,0.03,0.03,0.04,0.04,0.05,0.04,0.05,0.05,0.07,0.13};
  Double_t NPartCMS[20]={Npart(0,2),Npart(2,4),Npart(4,6),Npart(6,8),Npart(8,10),Npart(10,12),
			 Npart(12,14),Npart(14,16),Npart(16,18),Npart(18,20),Npart(20,24),
			 Npart(24,40)};
  Double_t ErrNPartCMS[20]={0};
  
  TGraphErrors *grRaaCMS = new TGraphErrors(nbins, NPartCMS, RaaCMS, ErrNPartCMS, StatErrCMS);  
  grRaaCMS->SetMarkerStyle(21);
  grRaaCMS->SetMarkerColor(2);
  grRaaCMS->GetYaxis()->SetRangeUser(0,1.7);
  grRaaCMS->GetXaxis()->SetTitle("N_{Part}");
  grRaaCMS->GetYaxis()->SetTitle("R_{AA}");
  
  grRaaCMS->Draw("AP");
  TBox *RaaJPsiSys[12];
  for(int j=0;j<12;j++){
    RaaJPsiSys[j] = new TBox(NPartCMS[j]-3,  RaaCMS[j]-SystErrCMS[j], NPartCMS[j]+3, RaaCMS[j]+SystErrCMS[j]);
  }
  
  for(int j=0;j<12;j++){
    RaaJPsiSys[j]->SetFillStyle(0000);
    RaaJPsiSys[j]->SetLineColor(6);
    RaaJPsiSys[j]->Draw("same"); 
  }
  
  TLine *lh2 = new TLine(0.0,1.0,400,1.0);
  lh2->SetLineColor(1);
  lh2->SetLineStyle(1);
  lh2->SetLineWidth(2);
  lh2->Draw("same");
  
  TBox *GlobalSysJPsi;
  GlobalSysJPsi = new TBox(400-5, 1 - 0.06, 400+5, 1 + 0.06);
  GlobalSysJPsi->SetFillStyle(3001);
  GlobalSysJPsi->SetLineColor(6);
  GlobalSysJPsi->SetFillColor(6);
  GlobalSysJPsi->Draw("same"); 
  
  TLatex *tb= new TLatex;
  tb->SetNDC(); 
  tb->SetTextAlign(12);
  tb->SetTextColor(1);
  tb->SetTextSize(0.040);
  tb->DrawLatex(0.17,0.23,"PbPb #sqrt{s_{NN}} = 2.76 TeV");
  tb->DrawLatex(0.17,0.17,"p_{T}^{J/#psi} > 6.5 GeV/c");

  lgd->AddEntry(grRaaCMS,"CMS Data", "P");

}
开发者ID:vineetsalar,项目名称:JPsiProduction,代码行数:55,代码来源:AbDrawData.C

示例8: DrawPeriod

//______________________________________________________________________________
void DrawPeriod(int runmin, int runmax, int run1, int run2, double ymin, double ymax, const char* label)
{
  if ( run1 < runmin || run1 > runmax || run2 < runmin || run2 > runmax ) return;

  TBox* b = new TBox(run1,ymin,run2,ymax);
  b->SetFillColor(5);
  b->Draw();
  TText* text = new TText((run1+run2)/2.0,ymax*0.6,label);
  text->SetTextAlign(22);
  text->SetTextSize(0.02);
  text->Draw();
}
开发者ID:ktf,项目名称:AliRoot,代码行数:13,代码来源:MUONStatusMap.C

示例9: drawTheory

void drawTheory(int i, double mean, double nErr, double pErr, double vstep) {
    
    double lowY = (i+1)*vstep; // margins are 1 vstep each
    double uppY = (i+2)*vstep;

    TBox* band = new TBox(mean-nErr,lowY+0.1*vstep,mean+pErr,uppY-0.1*vstep);
    band->SetFillColor(kYellow-4);
    band->Draw();
    TLine* center = new TLine(mean, 0, mean, 1);
    center->SetLineStyle(2); // dash
    center->SetLineWidth(4);
    center->SetLineColor(2);
    center->Draw();
  return;
}
开发者ID:cranelli,项目名称:WGamGam,代码行数:15,代码来源:ratio.C

示例10: drawBkgBox

void drawBkgBox(int i, int aux[6], double vstep, TH2F* histo) {

  double lowY = (i+1)*vstep; // margins are 1 vstep each
  double uppY = (i+2)*vstep;

  double lowX =LOW_X;
  double uppX =UPP_X;
  //double lowX = histo->GetBinLowEdge(1);
  //double uppX = histo->GetBinLowEdge(histo->GetNbinsX()) +
  //              histo->GetBinWidth(histo->GetNbinsX());

  TBox* band = new TBox(lowX,lowY,uppX,uppY);
  band->SetFillColor(aux[1]);
  band->Draw();


  return;
}
开发者ID:cranelli,项目名称:WGamGam,代码行数:18,代码来源:ratio.C

示例11: drawSysBoxValue

void drawSysBoxValue(TGraph* gr, int fillcolor=TColor::GetColor("#ffff00"), double xwidth=0.3, double *percent, double xshift=0)
{

  TBox* box;
  for(int n=0;n<gr->GetN();n++)
  {
    double x,y;
    gr->GetPoint(n,x,y);

    double yerr = percent[n]*1.0;
    box = new TBox(x+xshift-xwidth,y-fabs(yerr),x+xwidth,y+fabs(yerr));
    //box->SetFillStyle(3001);
  //box->SetFillColor(fillcolor);
    //box->SetFillColor(2);
    box->SetLineWidth(0);
  box->SetFillColor(kGray);
    box->Draw("Fsame");
    //box->Draw();
  }

}
开发者ID:tuos,项目名称:FlowAndCorrelations,代码行数:21,代码来源:v523pt_compareZb.C

示例12: DrawTargetBoundaries

//--------------------------
// DrawTargetBoundaries
//--------------------------
void DrawTargetBoundaries(int color=target_color)
{
  double Zlo = 50.0;
  double Zhi = Zlo + 30.0;
  double Rlo = 0.0;
  double Rhi = Rlo + 1.5;
  if (full) { Rlo=-1.5; Rhi=Rlo+3; }

  TBox *box = new TBox(Zlo, Rlo, Zhi, Rhi);
  box->SetLineWidth(2.0);
  if (fill_detectors) { box->SetFillColor(color); box->SetFillStyle(1001); }
  else box->SetFillStyle(0);
  box->SetLineColor(color);
  box->Draw();

  TLatex *lab = new TLatex(Zlo-5, 0, "target");
  if (full) lab->SetTextAlign(32); else lab->SetTextAlign(31);
  lab->SetTextSize(0.02);
  lab->SetTextColor(color);
  lab->Draw();
}
开发者ID:noemi8a,项目名称:sim-recon,代码行数:24,代码来源:GlueX_boundaries.C

示例13: drawTransition

void drawTransition(){
  TBox *bTrans = new TBox(0., 0., 0.97, 0.97);
  if(iColor)bTrans->SetFillColor(kYellow-9);
  if (! iColor)bTrans->SetFillStyle(4017);
  bTrans->Draw();

  TEllipse *eTrans1 = new TEllipse(0., 0., 0.9, 0.7, 70., 90., 0.);
  eTrans1->SetNoEdges();
  eTrans1->SetFillColor(17);
  eTrans1->SetLineWidth(2);
  eTrans1->SetLineStyle(7);
  eTrans1->Draw();

  TEllipse *eTrans2 = new TEllipse(0., 0., 0.9, 0.7, 0., 70., 0.);
  eTrans2->SetNoEdges();
  eTrans2->SetFillColor(17);
  eTrans2->SetLineWidth(2);
  eTrans2->Draw();

  TMarker *mCrit = new TMarker(0.29, 0.6625, 20);
  mCrit->SetMarkerSize(1.4);
  mCrit->Draw();
}
开发者ID:skymeson,项目名称:root_macros,代码行数:23,代码来源:phaseDiagram.C

示例14: plotScan

//____________________________________________________________________________________
// Plot mH scan: main entry point
int plotScan( TString* filenames,int* styles, double* mins, bool* bands, int nfiles=1, int index = 68,
              TString drawOpt = "C", double mHmin = 85, double mHmax = 140 )
{

  // Styles
  gROOT->SetStyle("Pub");
  gStyle->SetCanvasColor(0);
  gStyle->SetCanvasDefH( 500 );
  gStyle->SetCanvasDefW( 600 );
  

  double chi2min = -0., chi2max = 4;  // Delta-chi2 range
  double threshold = 1e-4;

  for(int i = 0; i<nfiles; i++ )
  {
    std::cout << "Opening " << filenames[i]; 
    TFile* file = new TFile(filenames[i]);
      if ( !(file->IsOpen()) ) {
      std::cerr << "*** Couldn't open " << filenames[i] << std::endl;
      return -1;
    }
    // Retrieve and correct graph
    TString gName("graph1d");
    gName += index;
    TGraph *gChi2[4];
    gChi2[i] = (TGraph*)file->Get( gName );
    if ( !gChi2 ) {
      std::cerr << "*** Couldn't find graph \"" << gName << "\"" << std::endl;
      return -1;
    }
    if(i==0) zeroSuppress( gChi2[i] );
  }

  // Set plot range
  TH2F* range = new TH2F("range","#chi^{2} fit of lightest Higgs mass",
                         2,mHmin,mHmax,2,chi2min,chi2max);
  range->GetXaxis()->SetTitle("M_{h} [GeV]");
  range->GetYaxis()->SetTitle("#Delta#chi^{2}");
  range->Draw();


  // Find preferred value
//  double mHfavour = findMh( gChi2, 0., mHmin );
//  double negError = mHfavour-findMh( gChi2, 1., mHmin );
//  double posError = findMh( gChi2, 1., mHfavour )-mHfavour;
//  std::cout << "Favoured value: " << mHfavour << "+" << posError << "-" << negError << std::endl;

  // Include LEP limit
  TBox* bLepLimit = new TBox( mHmin, chi2min+0.01, LEPLIMIT, chi2max-0.01 );
  bLepLimit->SetFillColor( 5 );
  bLepLimit->Draw();

  // Find value at lep limit
//  double chi2limit = gChi2->Eval( LEPLIMIT, 0, "S" );
//  std::cout << "Value at limit (" << LEPLIMIT << "): " << chi2limit << std::endl;

  // Include upper theoretical limit
  double theoLimit = 130;
  TBox* bTheoLimit = new TBox( theoLimit, chi2min+0.01, mHmax, chi2max-0.01 );
  bTheoLimit->SetFillColor( 42 );
  bTheoLimit->Draw();

  TGraph* rB[4];
  for (int i=0; i<nfiles; i++)
  { 
    if ( bands[i] ) {
      rB[i]=redBand2( gChi2[i], 1.5, mins[i],0.05);
    }
    gChi2[i]->SetLineWidth(3);
    gChi2[i]->SetMarkerStyle(2);
    gChi2[i]->SetLineColor(4);
    gChi2[i]->SetLineStyle(styles[i]);
  }

  for( int i = 0; i<nfiles; ++i){
    if(bands[i]) rB[i]->Draw("LF");
  }
  for( int i = 0; i<nfiles; ++i) gChi2[i]->Draw(drawOpt);

  // Forbidden regions
  TLatex tt;
  tt.SetTextSize(0.7*gStyle->GetTextSize());
  tt.SetTextAlign(12);
  tt.DrawLatex( mHmin+4, chi2min+0.4, "#splitline{LEP}{excluded}" );
  tt.SetTextAlign(22);
  tt.DrawLatex( (theoLimit+mHmax)/2.01, chi2min+0.4, "#splitline{Theoretically}{inaccessible}" );


  
  return 0;
  
}
开发者ID:samrogerson,项目名称:mastercode-plotting-old,代码行数:95,代码来源:redBand.C

示例15: plotOverlay

//____________________________________________________________________________________
// Plot overlay mH scan (SM + mSugra)
int plotOverlay( TString fileName = "output/msugra-noMH-cut20-v5.root", int index = 68, TString drawOpt = "C" )
{

  // Styles
  gROOT->SetStyle("Pub");
  gStyle->SetCanvasColor(0);
  gStyle->SetCanvasDefH( 500 );
  gStyle->SetCanvasDefW( 600 );
  

  double chi2min = -0., chi2max = 4;  // Delta-chi2 range
  double mHmin   = 30, mHmax = 200;
  double threshold = 1e-4;

  TCanvas* myCanvas = new TCanvas("myCanvas","Pseudo-exps contour",10,10,600,600);
  myCanvas->SetTopMargin(0.02);
  myCanvas->SetLogx(1);
  
  // Retrieve and correct graph
  TFile* file = new TFile(fileName);
  if ( !file->IsOpen() ) {
    std::cerr << "*** Couldn't open " << fileName << std::endl;
    return -1;
  }
  TString gName("graph1d");
  gName += index;
  TGraph* gChi2 = file->Get( gName );
  if ( !gChi2 ) {
    std::cerr << "*** Couldn't find graph \"" << gName << "\"" << std::endl;
    return -1;
  }
  zeroSuppress( gChi2 );

  // Set plot range
  TH2F* range = new TH2F("range","#chi^{2} fit of lightest Higgs mass",
                         2,mHmin,mHmax,2,chi2min,chi2max);
  if ( !doPub ) {
    range->GetXaxis()->SetTitle("M_{h} [GeV/c^{2}]");
    range->GetYaxis()->SetTitle("#Delta#chi^{2}");
    range->GetYaxis()->SetTitleOffset(1.1);
  }
  range->GetXaxis()->SetNoExponent();
  range->GetXaxis()->SetMoreLogLabels(1);
  range->Draw();

  // Find preferred value
  double mHfavour = findMh( gChi2, 0., 100. );
  double negError = mHfavour-findMh( gChi2, 1., 100. );
  double posError = findMh( gChi2, 1., mHfavour )-mHfavour;
  std::cout << "Favoured value: " << mHfavour << "+" << posError << "-" << negError << std::endl;

  
  // Include LEP limit
  int LepColor = 5;
  TBox* bLepLimit = new TBox( mHmin, chi2min+0.01, LEPLIMIT, chi2max-0.01 );
  bLepLimit->SetFillColor( LepColor );
  bLepLimit->Draw();

  TLatex tt;
  if (doPub) tt.SetTextFont(133);
  tt.SetTextSize(14);

  // Blue band
  blueBand();

  // Plot red band (1.5 GeV)
  if ( doBands ) {
    redBand2( gChi2, 1.5, mHfavour, 0.005 );
    gChi2->SetLineColor(4);
    gChi2->SetLineWidth(3);
  } else {
    gChi2->SetLineColor(kMagenta);
    gChi2->SetLineWidth(5);
  }


  // Plot scan
  gChi2->SetMarkerStyle(2);
  gChi2->Draw(drawOpt);
  TMultiGraph* mg = new TMultiGraph();

  // Forbidden regions
  tt.SetTextSize(18);
  tt.SetTextAlign(12);
  tt.DrawLatex( mHmin+4, chi2min+0.4, "#splitline{LEP}{excluded}" );
  tt.SetTextAngle(0);


  // Printout
  // hep-ph number
  TLatex tt;
  tt.SetTextFont(83);
  tt.SetTextSize(18);
  tt.SetTextAlign(32);
  //  tt.DrawTextNDC( 0.89, 0.88, "arXiv:0707.3447" );

//   TString name = "mh-scan-overlay";
//   if ( !doPub ) name += "_label";
//.........这里部分代码省略.........
开发者ID:samrogerson,项目名称:mastercode-plotting-old,代码行数:101,代码来源:redBand.C


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