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


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

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


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

示例1: resizeStatBox

// Resize any histograms (they all inherit from h1) stat box. Uses NDC coordinates (e.g. 0.65, 0.5)
bool resizeStatBox( TCanvas *c1, TH1* h1, float x1, float y1, float x2=-1, float y2=-1, 
		    TString newname = "", int color = -1, TString oldname = "", int iDebug = 0 ) 
{ 
  if( !c1 || !h1 ) {cerr<<"Null pointer given to resizeStatBox!"<<endl; return 0;}
  c1->Update();
  if( oldname.Length() <= 0 ) oldname = "stats";
  if( iDebug > 20 ) print_list_of_functions( *h1 );
  TPaveStats *stats = (TPaveStats*) h1->FindObject( oldname );
  if( iDebug ) cout<<"Found old name (\""<<oldname<<"\"? "<<( stats != 0 )<<endl;
  if( (!stats) && newname.Length() > 0 ){ // maybe it was already renamed
    stats = (TPaveStats*) h1->FindObject( newname );
    if( iDebug ) cout<<"Found new name (\""<<newname<<"\"? "<<(stats != 0)<<endl;
  }
  if( !stats ) {cerr<<"Can't find stat box"<<endl; return 0;}
  stats->SetX1NDC( x1 );
  stats->SetY1NDC( y1 );
  if( x2 >= 0 ) stats->SetX2NDC( x2 );
  if( y2 >= 0 ) stats->SetY2NDC( y2 );
  if( newname.Length() > 0 ) {
    stats->SetName( newname );
    if( iDebug ) cout<<"SetName to "<<newname<<endl;
  }
  if( color != -1 ) stats->SetTextColor (color);
  stats->Draw(); // maybe, just maybe, this will finally make them appear every time, even with draw "same"
  return 1;
}
开发者ID:aashaqshah,项目名称:cmssw-1,代码行数:27,代码来源:jc_util.c

示例2: repositionStatbox

void repositionStatbox(std::string name)
{
    // Reposition and resize statbox
    TH2F *h = (TH2F*)gDirectory->GetList()->FindObject(name.c_str());
    TPaveStats *st = (TPaveStats*)h->GetListOfFunctions()->FindObject("stats");
    st->SetX1NDC(0.63);
    st->SetY1NDC(0.72);
    st->SetX2NDC(0.99);
    st->SetY2NDC(0.99);
    st->Draw();
}
开发者ID:frmeier,项目名称:usercode,代码行数:11,代码来源:dataPlots01.C

示例3: drawStatBox

// überladen: Statbox-Größen manuell eingeben
void drawStatBox(int& step, TH1D* histo, int color = -1, double statboxHeight = 0.1,  double statboxSpacing = 0.15){
  TPaveStats* statBox = dynamic_cast<TPaveStats*>( histo->GetListOfFunctions()->FindObject("stats") );
  
  if(color == -1) color = step+1;
  statBox->SetX1NDC(0.80);
  statBox->SetX2NDC(0.99);
  statBox->SetY2NDC(0.95-step*statboxSpacing);
  statBox->SetY1NDC(0.95-step*statboxSpacing-statboxHeight);
  statBox->SetTextColor(color);
  statBox->Draw();
  step++;
}
开发者ID:bkargoll,项目名称:usercode,代码行数:13,代码来源:littleHelpers.hpp

示例4: relocateStatBox

// ---------------------------------------------------------------------------------------------
// The SLAC version
bool relocateStatBox (float x1, float y1, float x2=-1, float y2=-1, TString newname = "") 
{ 
  TPaveStats *st = (TPaveStats*)gPad->GetPrimitive("stats");
  if (0 == st) {cerr<<"Can't find stat box in pad"<<endl; return 0;}
  if (newname.Length() > 0) st->SetName(newname);
  st->SetX1NDC(x1);
  if (x2 != -1) st->SetX2NDC(x2);
  st->SetY1NDC(y1);
  if (y2 != -1) st->SetY2NDC(y2);
  st->Draw();
  return 1;
}
开发者ID:aashaqshah,项目名称:cmssw-1,代码行数:14,代码来源:jc_util.c

示例5: hw1

int hw1(){
  //define landau formula
  TF1* myf = new TF1("mylandau",landauf,-3,10,3);
  myf->SetParameters(1.0,2,1);

  //get ready to initial hist
  /*
  const int num = 3;
  string histvName[num] = {"ld_1e2","ld_1e3","ld_1e4"};
  string histvTitle[num] = {"Landau 100 entris","Landau 1000 entris","Landau 10000 entris"};
  int histEntries[num] = {100,1000,10000};

  //new hist and fill them
  TCanvas* canvas = new TCanvas("myc","HW1",800,600);
  TMultiGraph* mg = new TMultiGraph();
  for(int i = 0;i<num;i++){
    TH1F* tmp=new TH1F(histvName[i].c_str(),histvTitle[i].c_str(),100,-3,10);
    tmp->FillRandom("mylandau",histEntries[i]);
  }

  gDirectory->Get(histvName[2])->Draw("e");
  gDirectory->Get(histvName[1])->Draw("esame");
  gDirectory->Get(histvName[0])->Draw("esame");
  */
  TCanvas* canvas = new TCanvas("myc","HW1",800,600);

  TH1F* h1 = new TH1F("h1","Landau 100 entries",15,-3,10);
  TH1F* h2 = new TH1F("h2","Landau 1000 entries",60,-3,10);
  TH1F* h3 = new TH1F("h3","Landau 10000 entries",200,-3,10);
  h1->FillRandom("mylandau",100);
  h2->FillRandom("mylandau",1000);
  h3->FillRandom("mylandau",10000);
  h3->GetXaxis()->SetTitle("x");
  h3->GetXaxis()->CenterTitle(true);
  h3->GetYaxis()->SetTitle("Entries");
  h3->GetYaxis()->CenterTitle(true);
  h3->SetStats(kFALSE);

  TF1* fit3 = new TF1("fit3",landauf,-3,10,3);
  fit3->SetParameters(1.0,2,1);
  h3->SetMarkerColor(kRed);
  h3->SetLineColor(kRed);
  fit3->SetLineColor(kRed+2);
  h3->Fit("fit3","q","e");

  TF1* fit2 = new TF1("fit2",landauf,-3,10,3);
  fit2->SetParameters(1.0,2,1);
  h2->SetMarkerColor(kBlue);
  h2->SetLineColor(kBlue);
  fit2->SetLineColor(kBlue+2);
  h2->Fit("fit2","q","esame");

  TF1* fit1 = new TF1("fit1",landauf,-3,10,3);
  fit1->SetParameters(1.0,2,1);
  h1->SetMarkerColor(kGreen);
  h1->SetLineColor(kGreen);
  fit1->SetLineColor(kGreen+2);
  h1->Fit("fit1","q","esame");

  double h1M = h1->GetMean();
  double h1R = h1->GetRMS();
  double h1S = h1->GetSkewness();
  double h2M = h2->GetMean();
  double h2R = h2->GetRMS();
  double h2S = h2->GetSkewness();
  double h3M = h3->GetMean();
  double h3R = h3->GetRMS();
  double h3S = h3->GetSkewness();

  cout<<setprecision(4);
  cout<<"+----+--------+--------+--------+"<<endl;
  cout<<"|hist|  Mean  |  RMS   |skewness|"<<endl;
  cout<<"+----+--------+--------+--------+"<<endl;
  cout<<"+  1 |"<<setw(8)<<h1M<<"|"<<setw(8)<<h1R<<"|"<<setw(8)<<h1S<<"|"<<endl;
  cout<<"+----+--------+--------+--------+"<<endl;
  cout<<"+  2 |"<<setw(8)<<h2M<<"|"<<setw(8)<<h2R<<"|"<<setw(8)<<h2S<<"|"<<endl;
  cout<<"+----+--------+--------+--------+"<<endl;
  cout<<"+  3 |"<<setw(8)<<h3M<<"|"<<setw(8)<<h3R<<"|"<<setw(8)<<h3S<<"|"<<endl;
  cout<<"+----+--------+--------+--------+"<<endl;

  TPaveStats *ptstats = new TPaveStats(0.5747126,0.6334746,0.9353448,0.934322,"brNDC");
  ptstats->SetName("stats");
  ptstats->SetBorderSize(1);
  ptstats->SetFillColor(0);
  ptstats->SetLineWidth(2);
  ptstats->SetTextAlign(12);
  ptstats->SetTextFont(132);
  ptstats->AddText(" hist   Mean     RMS    skewness ");
  ostringstream os;
  cout<<setprecision(4);
  os<<"   1  "<<setw(8)<<h1M<<" "<<setw(8)<<h1R<<" "<<setw(8)<<h1S<<" ";
  ptstats->AddText(os.str().c_str());
  os.str(string());
  os<<"   2  "<<setw(8)<<h2M<<" "<<setw(8)<<h2R<<" "<<setw(8)<<h2S<<" ";
  ptstats->AddText(os.str().c_str());
  os.str(string());
  os<<"   3  "<<setw(8)<<h3M<<" "<<setw(8)<<h3R<<" "<<setw(8)<<h3S<<" ";
  ptstats->AddText(os.str().c_str());
  ptstats->SetOptStat(0);
  ptstats->SetOptFit(111);
//.........这里部分代码省略.........
开发者ID:DingXuefeng,项目名称:hw1,代码行数:101,代码来源:hw1.C

示例6: c


//.........这里部分代码省略.........
   hist__1__1->SetBinContent(56,4531);
   hist__1__1->SetBinContent(57,4598);
   hist__1__1->SetBinContent(58,4456);
   hist__1__1->SetBinContent(59,4341);
   hist__1__1->SetBinContent(60,4654);
   hist__1__1->SetBinContent(61,4672);
   hist__1__1->SetBinContent(62,4511);
   hist__1__1->SetBinContent(63,4446);
   hist__1__1->SetBinContent(64,4356);
   hist__1__1->SetBinContent(65,4380);
   hist__1__1->SetBinContent(66,4383);
   hist__1__1->SetBinContent(67,4469);
   hist__1__1->SetBinContent(68,4606);
   hist__1__1->SetBinContent(69,4563);
   hist__1__1->SetBinContent(70,4413);
   hist__1__1->SetBinContent(71,4701);
   hist__1__1->SetBinContent(72,4643);
   hist__1__1->SetBinContent(73,4427);
   hist__1__1->SetBinContent(74,3933);
   hist__1__1->SetBinContent(75,3939);
   hist__1__1->SetBinContent(76,4093);
   hist__1__1->SetBinContent(77,3913);
   hist__1__1->SetBinContent(78,4026);
   hist__1__1->SetBinContent(79,3843);
   hist__1__1->SetBinContent(80,3641);
   hist__1__1->SetBinContent(81,3916);
   hist__1__1->SetBinContent(82,4042);
   hist__1__1->SetBinContent(83,3798);
   hist__1__1->SetBinContent(84,3601);
   hist__1__1->SetBinContent(85,3249);
   hist__1__1->SetBinContent(86,3146);
   hist__1__1->SetBinContent(87,3199);
   hist__1__1->SetBinContent(88,3035);
   hist__1__1->SetBinContent(89,3021);
   hist__1__1->SetBinContent(90,2861);
   hist__1__1->SetBinContent(91,2848);
   hist__1__1->SetBinContent(92,2819);
   hist__1__1->SetBinContent(93,2744);
   hist__1__1->SetBinContent(94,2542);
   hist__1__1->SetBinContent(95,2198);
   hist__1__1->SetBinContent(96,1717);
   hist__1__1->SetBinContent(97,1743);
   hist__1__1->SetBinContent(98,1585);
   hist__1__1->SetBinContent(99,1504);
   hist__1__1->SetBinContent(100,1475);
   hist__1__1->SetBinContent(101,12137);
   hist__1__1->SetEntries(397426);
   
   TPaveStats *ptstats = new TPaveStats(0.78,0.775,0.98,0.935,"brNDC");
   ptstats->SetName("stats");
   ptstats->SetBorderSize(1);
   ptstats->SetFillColor(0);
   ptstats->SetTextAlign(12);
   ptstats->SetTextFont(42);
   TText *AText = ptstats->AddText("hist__1");
   AText->SetTextSize(0.0368);
   AText = ptstats->AddText("Entries = 397426 ");
   AText = ptstats->AddText("Mean  = -0.08411");
   AText = ptstats->AddText("Std Dev   =  66.16");
   ptstats->SetOptStat(1111);
   ptstats->SetOptFit(0);
   ptstats->Draw();
   hist__1__1->GetListOfFunctions()->Add(ptstats);
   ptstats->SetParent(hist__1__1);

   Int_t ci;      // for color index setting
   TColor *color; // for color definition with alpha
   ci = 926;
   color = new TColor(ci, 0, 0, 1, " ", 0.273);
   hist__1__1->SetFillColor(ci);
   hist__1__1->SetLineColor(4);
   hist__1__1->SetLineWidth(2);
   hist__1__1->GetXaxis()->SetTitle("#DeltaY [cm]");
   hist__1__1->GetXaxis()->SetLabelFont(42);
   hist__1__1->GetXaxis()->SetLabelSize(0.05);
   hist__1__1->GetXaxis()->SetTitleSize(0.05);
   hist__1__1->GetXaxis()->SetTitleOffset(0.93);
   hist__1__1->GetXaxis()->SetTitleFont(22);
   hist__1__1->GetYaxis()->SetLabelFont(42);
   hist__1__1->GetYaxis()->SetLabelSize(0.05);
   hist__1__1->GetYaxis()->SetTitleSize(0.035);
   hist__1__1->GetYaxis()->SetTitleFont(42);
   hist__1__1->GetZaxis()->SetLabelFont(42);
   hist__1__1->GetZaxis()->SetLabelSize(0.035);
   hist__1__1->GetZaxis()->SetTitleSize(0.035);
   hist__1__1->GetZaxis()->SetTitleFont(42);
   hist__1__1->Draw("");
   
   TPaveText *pt = new TPaveText(0.15,0.9368947,0.85,0.995,"blNDC");
   pt->SetName("title");
   pt->SetBorderSize(0);
   pt->SetFillColor(0);
   pt->SetFillStyle(0);
   pt->SetTextFont(42);
   AText = pt->AddText("Difference in PMT-constructed position and mc-truth start position");
   pt->Draw();
   c->Modified();
   c->cd();
   c->SetSelected(c);
}
开发者ID:nikihowe,项目名称:flash,代码行数:101,代码来源:c.C

示例7: plot_PbPb_fit_ratio_eff

void plot_PbPb_fit_ratio_eff()
{
//=========Macro generated from canvas: Fit/Fit on Efficiency Ratio
//=========  (Mon Aug 29 17:39:14 2016) by ROOT version6.02/10
   TCanvas *Fit = new TCanvas("Fit", "Fit on Efficiency Ratio",0,0,800,500);
   gStyle->SetOptFit(1);
   Fit->Range(1.625,-0.3125,55.375,2.8125);
   Fit->SetFillColor(0);
   Fit->SetBorderMode(0);
   Fit->SetBorderSize(2);
   Fit->SetFrameBorderMode(0);
   Fit->SetFrameBorderMode(0);
   Double_t xAxis1[6] = {7, 10, 15, 20, 30, 50}; 
   
   TH1D *PbPb_fit1 = new TH1D("PbPb_fit1","",5, xAxis1);
   PbPb_fit1->SetBinContent(1,0.8304669);
   PbPb_fit1->SetBinContent(2,0.8392248);
   PbPb_fit1->SetBinContent(3,0.8551938);
   PbPb_fit1->SetBinContent(4,0.8559738);
   PbPb_fit1->SetBinContent(5,0.8749088);
   PbPb_fit1->SetBinError(1,0.06688803);
   PbPb_fit1->SetBinError(2,0.03626477);
   PbPb_fit1->SetBinError(3,0.03301156);
   PbPb_fit1->SetBinError(4,0.02217037);
   PbPb_fit1->SetBinError(5,0.01963207);
   PbPb_fit1->SetMinimum(0);
   PbPb_fit1->SetMaximum(2.5);
   PbPb_fit1->SetEntries(2335.214);
   
   TF1 *myfit1 = new TF1("myfit","pow(10,[0]+[1]*x+x*x*[2])+pow(10,[3]*x*x+[4]*x*x*x+[5])",2,100);
   myfit1->SetFillColor(19);
   myfit1->SetFillStyle(0);
   myfit1->SetMarkerStyle(20);
   myfit1->SetLineColor(2);
   myfit1->SetLineWidth(2);
   myfit1->SetChisquare(5.134234e-08);
   myfit1->SetNDF(0);
   myfit1->GetXaxis()->SetLabelFont(42);
   myfit1->GetXaxis()->SetLabelSize(0.035);
   myfit1->GetXaxis()->SetTitleSize(0.035);
   myfit1->GetXaxis()->SetTitleFont(42);
   myfit1->GetYaxis()->SetLabelFont(42);
   myfit1->GetYaxis()->SetLabelSize(0.035);
   myfit1->GetYaxis()->SetTitleSize(0.035);
   myfit1->GetYaxis()->SetTitleFont(42);
   myfit1->SetParameter(0,-0.1325891);
   myfit1->SetParError(0,0.07303413);
   myfit1->SetParLimits(0,0,0);
   myfit1->SetParameter(1,-0.004821085);
   myfit1->SetParError(1,0.00252747);
   myfit1->SetParLimits(1,0,0);
   myfit1->SetParameter(2,0.0001629026);
   myfit1->SetParError(2,6.139007e-05);
   myfit1->SetParLimits(2,0,0);
   myfit1->SetParameter(3,0.001400688);
   myfit1->SetParError(3,0.0009400359);
   myfit1->SetParLimits(3,0,0);
   myfit1->SetParameter(4,-4.985927e-05);
   myfit1->SetParError(4,3.268586e-05);
   myfit1->SetParLimits(4,0,0);
   myfit1->SetParameter(5,-0.9198558);
   myfit1->SetParError(5,0.3015603);
   myfit1->SetParLimits(5,0,0);
   PbPb_fit1->GetListOfFunctions()->Add(myfit1);
   
   TPaveStats *ptstats = new TPaveStats(0.558,0.6,0.9,0.9,"brNDC");
   ptstats->SetName("stats");
   ptstats->SetBorderSize(1);
   ptstats->SetFillColor(0);
   ptstats->SetTextAlign(12);
   ptstats->SetTextFont(42);
   TText *AText = ptstats->AddText("PbPb_fit");
   AText->SetTextSize(0.01971428);
   AText = ptstats->AddText("Entries = 2335   ");
   AText = ptstats->AddText("Mean  =  20.89");
   AText = ptstats->AddText("RMS   =  11.16");
   AText = ptstats->AddText("Underflow =      0");
   AText = ptstats->AddText("Overflow  =      0");
   AText = ptstats->AddText("Integral =  4.256");
   AText = ptstats->AddText("#chi^{2} / ndf = 5.134e-08 / 0");
   AText = ptstats->AddText("p0       = -0.1326 #pm 0.0730 ");
   AText = ptstats->AddText("p1       = -0.004821 #pm 0.002527 ");
   AText = ptstats->AddText("p2       = 0.0001629 #pm 0.0000614 ");
   AText = ptstats->AddText("p3       = 0.001401 #pm 0.000940 ");
   AText = ptstats->AddText("p4       = -4.986e-05 #pm 3.269e-05 ");
   AText = ptstats->AddText("p5       = -0.9199 #pm 0.3016 ");
   ptstats->SetOptStat(1111111);
   ptstats->SetOptFit(111);
   ptstats->Draw();
   PbPb_fit1->GetListOfFunctions()->Add(ptstats);
   ptstats->SetParent(PbPb_fit1);

   Int_t ci;      // for color index setting
   TColor *color; // for color definition with alpha
   ci = TColor::GetColor("#000099");
   PbPb_fit1->SetLineColor(ci);
   PbPb_fit1->SetMarkerStyle(20);
   PbPb_fit1->GetXaxis()->SetTitle("Gen p_{T}(GeV)");
   PbPb_fit1->GetXaxis()->CenterTitle(true);
   PbPb_fit1->GetXaxis()->SetLabelFont(42);
//.........这里部分代码省略.........
开发者ID:boundino,项目名称:BntupleRunII,代码行数:101,代码来源:plot_PbPb_fit_ratio_eff.C

示例8: QCDHT_cutflow_weighted

void QCDHT_cutflow_weighted()
{
//=========Macro generated from canvas: c1/c1
//=========  (Wed Feb 24 17:48:49 2016) by ROOT version6.02/05
   TCanvas *c1 = new TCanvas("c1", "c1",65,52,700,500);
   c1->Range(-1.25,-2351156,16.25,2.11604e+07);
   c1->SetFillColor(0);
   c1->SetBorderMode(0);
   c1->SetBorderSize(2);
   c1->SetFrameBorderMode(0);
   c1->SetFrameBorderMode(0);
   
   TH1D *cutflow1 = new TH1D("cutflow1","cut flow",14,0.5,14.5);
   cutflow1->SetBinContent(1,1.791357e+07);
   cutflow1->SetBinContent(2,1.791357e+07);
   cutflow1->SetBinContent(3,1.482016e+07);
   cutflow1->SetBinContent(4,1.397007e+07);
   cutflow1->SetBinContent(5,8159947);
   cutflow1->SetBinContent(6,1368453);
   cutflow1->SetBinContent(7,12035.83);
   cutflow1->SetBinContent(8,10653.79);
   cutflow1->SetBinContent(9,4100.401);
   cutflow1->SetBinContent(10,4323.004);
   cutflow1->SetBinContent(11,1820.803);
   cutflow1->SetBinContent(12,374.2397);
   cutflow1->SetBinContent(13,35.33991);
   cutflow1->SetBinContent(14,214.6597);
   cutflow1->SetEntries(1.137194e+08);
   
   TPaveStats *ptstats = new TPaveStats(0.78,0.775,0.98,0.935,"brNDC");
   ptstats->SetName("stats");
   ptstats->SetBorderSize(1);
   ptstats->SetFillColor(0);
   ptstats->SetTextAlign(12);
   ptstats->SetTextFont(42);
   TText *AText = ptstats->AddText("cutflow");
   AText->SetTextSize(0.0368);
   AText = ptstats->AddText("Entries =   1.137194e+08");
   AText = ptstats->AddText("Mean  =      0");
   AText = ptstats->AddText("RMS   =      0");
   ptstats->SetOptStat(1111);
   ptstats->SetOptFit(0);
   ptstats->Draw();
   cutflow1->GetListOfFunctions()->Add(ptstats);
   ptstats->SetParent(cutflow1);

   Int_t ci;      // for color index setting
   TColor *color; // for color definition with alpha
   ci = TColor::GetColor("#000099");
   cutflow1->SetLineColor(ci);
   cutflow1->GetXaxis()->SetBinLabel(1,"All");
   cutflow1->GetXaxis()->SetBinLabel(2,"Trigger");
   cutflow1->GetXaxis()->SetBinLabel(3,"p_{T}");
   cutflow1->GetXaxis()->SetBinLabel(4,"|#eta|");
   cutflow1->GetXaxis()->SetBinLabel(5,"|#Delta#eta|");
   cutflow1->GetXaxis()->SetBinLabel(6,"M(jet_{0},jet(1))");
   cutflow1->GetXaxis()->SetBinLabel(7,"M(jets)");
   cutflow1->GetXaxis()->SetBinLabel(8,"#tau_{21}");
   cutflow1->GetXaxis()->SetBinLabel(9,"0b");
   cutflow1->GetXaxis()->SetBinLabel(10,"1b");
   cutflow1->GetXaxis()->SetBinLabel(11,"2b");
   cutflow1->GetXaxis()->SetBinLabel(12,"3b");
   cutflow1->GetXaxis()->SetBinLabel(13,"4b");
   cutflow1->GetXaxis()->SetBinLabel(14,"3b+HPHP");
   cutflow1->GetXaxis()->SetLabelFont(42);
   cutflow1->GetXaxis()->SetLabelSize(0.035);
   cutflow1->GetXaxis()->SetTitleSize(0.035);
   cutflow1->GetXaxis()->SetTitleFont(42);
   cutflow1->GetYaxis()->SetLabelFont(42);
   cutflow1->GetYaxis()->SetLabelSize(0.035);
   cutflow1->GetYaxis()->SetTitleSize(0.035);
   cutflow1->GetYaxis()->SetTitleFont(42);
   cutflow1->GetZaxis()->SetLabelFont(42);
   cutflow1->GetZaxis()->SetLabelSize(0.035);
   cutflow1->GetZaxis()->SetTitleSize(0.035);
   cutflow1->GetZaxis()->SetTitleFont(42);
   cutflow1->Draw("");
   
   TPaveText *pt = new TPaveText(0.4246264,0.94,0.5753736,0.995,"blNDC");
   pt->SetName("title");
   pt->SetBorderSize(0);
   pt->SetFillColor(0);
   pt->SetFillStyle(0);
   pt->SetTextFont(42);
   AText = pt->AddText("cut flow");
   pt->Draw();
   c1->Modified();
   c1->cd();
   c1->SetSelected(c1);
}
开发者ID:CMS-HHVH-RUNII,项目名称:HH4b,代码行数:90,代码来源:QCDHT_cutflow_weighted.C

示例9: x_dist_cuts


//.........这里部分代码省略.........
   hist__1->SetBinContent(52,13155);
   hist__1->SetBinContent(53,10318);
   hist__1->SetBinContent(54,7953);
   hist__1->SetBinContent(55,6143);
   hist__1->SetBinContent(56,4420);
   hist__1->SetBinContent(57,3422);
   hist__1->SetBinContent(58,2687);
   hist__1->SetBinContent(59,2027);
   hist__1->SetBinContent(60,1643);
   hist__1->SetBinContent(61,1359);
   hist__1->SetBinContent(62,1189);
   hist__1->SetBinContent(63,1057);
   hist__1->SetBinContent(64,929);
   hist__1->SetBinContent(65,840);
   hist__1->SetBinContent(66,792);
   hist__1->SetBinContent(67,759);
   hist__1->SetBinContent(68,719);
   hist__1->SetBinContent(69,673);
   hist__1->SetBinContent(70,702);
   hist__1->SetBinContent(71,769);
   hist__1->SetBinContent(72,693);
   hist__1->SetBinContent(73,728);
   hist__1->SetBinContent(74,719);
   hist__1->SetBinContent(75,698);
   hist__1->SetBinContent(76,729);
   hist__1->SetBinContent(77,695);
   hist__1->SetBinContent(78,732);
   hist__1->SetBinContent(79,692);
   hist__1->SetBinContent(80,620);
   hist__1->SetBinContent(81,592);
   hist__1->SetBinContent(82,525);
   hist__1->SetBinContent(83,463);
   hist__1->SetBinContent(84,407);
   hist__1->SetBinContent(85,357);
   hist__1->SetBinContent(86,300);
   hist__1->SetBinContent(87,229);
   hist__1->SetBinContent(88,192);
   hist__1->SetBinContent(89,154);
   hist__1->SetBinContent(90,113);
   hist__1->SetBinContent(91,123);
   hist__1->SetBinContent(92,73);
   hist__1->SetBinContent(93,55);
   hist__1->SetBinContent(94,41);
   hist__1->SetBinContent(95,27);
   hist__1->SetBinContent(96,27);
   hist__1->SetBinContent(97,18);
   hist__1->SetBinContent(98,14);
   hist__1->SetBinContent(99,8);
   hist__1->SetBinContent(100,11);
   hist__1->SetBinContent(101,55);
   hist__1->SetEntries(173117);
   
   TPaveStats *ptstats = new TPaveStats(0.78,0.775,0.98,0.935,"brNDC");
   ptstats->SetName("stats");
   ptstats->SetBorderSize(1);
   ptstats->SetFillColor(0);
   ptstats->SetTextAlign(12);
   ptstats->SetTextFont(42);
   TText *AText = ptstats->AddText("hist");
   AText->SetTextSize(0.0368);
   AText = ptstats->AddText("Entries = 173117 ");
   AText = ptstats->AddText("Mean  = 0.6933");
   AText = ptstats->AddText("Std Dev   =  34.33");
   ptstats->SetOptStat(1111);
   ptstats->SetOptFit(0);
   ptstats->Draw();
   hist__1->GetListOfFunctions()->Add(ptstats);
   ptstats->SetParent(hist__1);

   Int_t ci;      // for color index setting
   TColor *color; // for color definition with alpha
   ci = TColor::GetColor("#000099");
   hist__1->SetLineColor(ci);
   hist__1->GetXaxis()->SetTitle("#DeltaZ [cm]");
   hist__1->GetXaxis()->SetLabelFont(42);
   hist__1->GetXaxis()->SetLabelSize(0.035);
   hist__1->GetXaxis()->SetTitleSize(0.035);
   hist__1->GetXaxis()->SetTitleFont(42);
   hist__1->GetYaxis()->SetLabelFont(42);
   hist__1->GetYaxis()->SetLabelSize(0.035);
   hist__1->GetYaxis()->SetTitleSize(0.035);
   hist__1->GetYaxis()->SetTitleFont(42);
   hist__1->GetZaxis()->SetLabelFont(42);
   hist__1->GetZaxis()->SetLabelSize(0.035);
   hist__1->GetZaxis()->SetTitleSize(0.035);
   hist__1->GetZaxis()->SetTitleFont(42);
   hist__1->Draw("");
   
   TPaveText *pt = new TPaveText(0.3779599,0.9368947,0.6220401,0.995,"blNDC");
   pt->SetName("title");
   pt->SetBorderSize(0);
   pt->SetFillColor(0);
   pt->SetFillStyle(0);
   pt->SetTextFont(42);
   AText = pt->AddText("Worry Later");
   pt->Draw();
   c->Modified();
   c->cd();
   c->SetSelected(c);
}
开发者ID:nikihowe,项目名称:flash,代码行数:101,代码来源:x_dist_cuts.C

示例10: CaloL3


//.........这里部分代码省略.........
    //c98[nj]->Divide(7,4,0,0);
    //c98[nj]->Divide(6,4,0,0);
    ipad=0;
    for(int ip=0;ip<nbins;ip++){      
      if(ptbins[ip]<minx)continue;
      c98[nj]->cd(++ipad);
      gPad->SetLeftMargin(0.15);
      gPad->SetRightMargin(0.01);
      gPad->SetBottomMargin(0.15);
      gPad->SetLogy();
      //if(ipad%10==0)gPad->SetRightMargin(0.02);
      //if(ipad%(ip+1)==0)gPad->SetLeftMargin(0.15);
    
      //hrsp[nj][ip]->SetMaximum(hrsp[nj][ip]->GetMaximum() + 0.25*hrsp[nj][ip]->GetMaximum());
      hrsp[nj][ip]->SetMaximum(hrsp[nj][ip]->Integral()*2e-00);
      hrsp[nj][ip]->SetMinimum(hrsp[nj][ip]->Integral()*1e-07);
      hrsp[nj][ip]->SetTitle(0);
      hrsp[nj][ip]->GetXaxis()->SetTitle("<reco jet p_{T} / gen jet p_{T}>");
      hrsp[nj][ip]->GetXaxis()->SetTitleFont(42);
      hrsp[nj][ip]->GetXaxis()->SetLabelFont(42);
      hrsp[nj][ip]->GetXaxis()->SetLabelSize(0.08);
      hrsp[nj][ip]->GetXaxis()->SetTitleSize(0.07);
      hrsp[nj][ip]->GetXaxis()->SetNdivisions(507);
      hrsp[nj][ip]->GetYaxis()->SetTitle("");
      hrsp[nj][ip]->GetYaxis()->SetTitleFont(42);
      hrsp[nj][ip]->GetYaxis()->SetLabelFont(42);
      hrsp[nj][ip]->GetYaxis()->SetLabelSize(0.08);
      hrsp[nj][ip]->GetYaxis()->SetNdivisions(507);
      
      hrsp[nj][ip]->SetMarkerStyle(20);
      hrsp[nj][ip]->SetMarkerColor(1);
      hrsp[nj][ip]->SetLineColor(1);
      hrsp[nj][ip]->SetMarkerSize(1.1);
      hrsp[nj][ip]->Draw("hist");  
      
      TF1 *fdscb = (TF1*)hrsp[nj][ip]->GetFunction("fdscb");
      if(fdscb){
	fdscb->SetLineWidth(1);
   	fdscb->SetLineColor(2);
   	fdscb->SetLineColor(2);
   	fdscb->Draw("lsame");
      }
      TF1 *fgaus = (TF1*)hrsp[nj][ip]->GetFunction("fgaus");
      if(fgaus){
	fgaus->SetLineWidth(1);
   	fgaus->SetLineColor(4);
   	fgaus->Draw("lsame");
      }
      // TF1 *fdg = (TF1*)hrsp[nj][ip]->GetFunction("fdgaus");
      // if(fdg){
      // 	TF1 *fg1 = (TF1*)hrsp[nj][ip]->GetFunction("fg1");      
      // 	TF1 *fg2 = (TF1*)hrsp[nj][ip]->GetFunction("fg2");      
      // 	fdg->Draw("lsame");
      // 	fg1->Draw("lsame");
      // 	fg2->Draw("lsame");
      // }
      
      std::ostringstream strs; 
      strs << ptbins[ip] << "< p_{T} (GeV/c) <" << ptbins[ip+1];
      std::string spt = strs.str();
      
      if(ipad==1){drawText2(Form("%s%s",calgo[nj],ctype),0.28,0.90,18);      
	
   	drawText2(spt.c_str(),0.22,0.80,15);		
      } else drawText2(spt.c_str(),0.17,0.80,15);		
    }
开发者ID:pawannetrakanti,项目名称:UserCode,代码行数:67,代码来源:CaloL3.C

示例11: BSA_InCoherent_t

void BSA_InCoherent_t()
{
//=========Macro generated from canvas: c17/Incoherent channe
//=========  (Tue Aug 21 12:00:26 2018) by ROOT version6.09/01
   TCanvas *c17 = new TCanvas("c17", "Incoherent channe",0,0,1200,400);
   gStyle->SetOptFit(1);
   c17->Range(0,0,1,1);
   c17->SetFillColor(0);
   c17->SetBorderMode(0);
   c17->SetBorderSize(2);
   c17->SetLeftMargin(0.025);
   c17->SetRightMargin(0.02325581);
   c17->SetFrameBorderMode(0);
  
// ------------>Primitives in pad: c17_1
   TPad *c17_1 = new TPad("c17_1", "Incoherent channe_1",0,0,0.262936,0.9);
   c17_1->Draw();
   c17_1->cd();
   c17_1->Range(-32.86883,-0.4888889,353.6809,0.4);
   c17_1->SetFillColor(0);
   c17_1->SetBorderMode(0);
   c17_1->SetBorderSize(2);
   c17_1->SetGridx();
   c17_1->SetGridy();
   c17_1->SetRightMargin(0);
   c17_1->SetTopMargin(0);
   c17_1->SetFrameBorderMode(0);
   c17_1->SetFrameBorderMode(0);
   
   TMultiGraph *multigraph = new TMultiGraph();
   multigraph->SetName("");
   multigraph->SetTitle("0.05<-t<0.21 [GeV^{2}/c^{2}]");
   
   Double_t Graph_fx1154[9] = {
   21.59954,
   59.03178,
   96.06391,
   141.7703,
   179.2242,
   222.8541,
   259.5793,
   303.38,
   337.8675};
   Double_t Graph_fy1154[9] = {
   0.1020231,
   0.03114899,
   0.2309077,
   0.1341245,
   0.01684177,
   -0.1267998,
   -0.2824572,
   -0.2260703,
   -0.0186068};
   Double_t Graph_fex1154[9] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t Graph_fey1154[9] = {
   0.04242532,
   0.05165487,
   0.05483741,
   0.07646672,
   0.1006626,
   0.09089962,
   0.05905575,
   0.04462244,
   0.05521722};
   TGraphErrors *gre = new TGraphErrors(9,Graph_fx1154,Graph_fy1154,Graph_fex1154,Graph_fey1154);
   gre->SetName("Graph");
   gre->SetTitle("Graph");
   gre->SetFillColor(1);

   Int_t ci;      // for color index setting
   TColor *color; // for color definition with alpha
   ci = TColor::GetColor("#00ff00");
   gre->SetMarkerColor(ci);
   gre->SetMarkerStyle(21);
   
   TH1F *Graph_Graph1154 = new TH1F("Graph_Graph1154","Graph",100,0,369.4943);
   Graph_Graph1154->SetMinimum(-0.4042387);
   Graph_Graph1154->SetMaximum(0.3484709);
   Graph_Graph1154->SetDirectory(0);
   Graph_Graph1154->SetStats(0);

   ci = TColor::GetColor("#000099");
   Graph_Graph1154->SetLineColor(ci);
   Graph_Graph1154->GetXaxis()->SetLabelFont(42);
   Graph_Graph1154->GetXaxis()->SetLabelSize(0.035);
   Graph_Graph1154->GetXaxis()->SetTitleSize(0.035);
   Graph_Graph1154->GetXaxis()->SetTitleFont(42);
   Graph_Graph1154->GetYaxis()->SetLabelFont(42);
   Graph_Graph1154->GetYaxis()->SetLabelSize(0.035);
   Graph_Graph1154->GetYaxis()->SetTitleSize(0.035);
   Graph_Graph1154->GetYaxis()->SetTitleFont(42);
//.........这里部分代码省略.........
开发者ID:Hattawy,项目名称:He-DVCS-Analysis-note-v2,代码行数:101,代码来源:BSA_InCoherent_t.C

示例12: BSA_InCoherent_xB

void BSA_InCoherent_xB()
{
//=========Macro generated from canvas: c16/Incoherent channe
//=========  (Tue Aug 21 12:00:25 2018) by ROOT version6.09/01
   TCanvas *c16 = new TCanvas("c16", "Incoherent channe",0,0,1200,400);
   gStyle->SetOptFit(1);
   c16->Range(0,0,1,1);
   c16->SetFillColor(0);
   c16->SetBorderMode(0);
   c16->SetBorderSize(2);
   c16->SetLeftMargin(0.025);
   c16->SetRightMargin(0.02325581);
   c16->SetFrameBorderMode(0);
  
// ------------>Primitives in pad: c16_1
   TPad *c16_1 = new TPad("c16_1", "Incoherent channe_1",0,0,0.262936,0.9);
   c16_1->Draw();
   c16_1->cd();
   c16_1->Range(-29.34641,-0.4888889,350.2581,0.4);
   c16_1->SetFillColor(0);
   c16_1->SetBorderMode(0);
   c16_1->SetBorderSize(2);
   c16_1->SetGridx();
   c16_1->SetGridy();
   c16_1->SetRightMargin(0);
   c16_1->SetTopMargin(0);
   c16_1->SetFrameBorderMode(0);
   c16_1->SetFrameBorderMode(0);
   
   TMultiGraph *multigraph = new TMultiGraph();
   multigraph->SetName("");
   multigraph->SetTitle("0.12<x_{B}<0.21 ");
   
   Double_t Graph_fx1134[9] = {
   24.14331,
   62.70082,
   96.14623,
   141.7289,
   180.8857,
   220.5862,
   258.7856,
   303.3336,
   334.7288};
   Double_t Graph_fy1134[9] = {
   0.1330996,
   -0.03883743,
   0.1388413,
   0.2120595,
   0.03749243,
   -0.09129921,
   -0.1273289,
   -0.1643618,
   0.03103783};
   Double_t Graph_fex1134[9] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t Graph_fey1134[9] = {
   0.07077824,
   0.06445297,
   0.05939535,
   0.06833722,
   0.08559024,
   0.08401363,
   0.06136237,
   0.05845869,
   0.08718727};
   TGraphErrors *gre = new TGraphErrors(9,Graph_fx1134,Graph_fy1134,Graph_fex1134,Graph_fey1134);
   gre->SetName("Graph");
   gre->SetTitle("Graph");
   gre->SetFillColor(1);

   Int_t ci;      // for color index setting
   TColor *color; // for color definition with alpha
   ci = TColor::GetColor("#00ff00");
   gre->SetMarkerColor(ci);
   gre->SetMarkerStyle(21);
   
   TH1F *Graph_Graph1134 = new TH1F("Graph_Graph1134","Graph",100,0,365.7873);
   Graph_Graph1134->SetMinimum(-0.2731422);
   Graph_Graph1134->SetMaximum(0.3307184);
   Graph_Graph1134->SetDirectory(0);
   Graph_Graph1134->SetStats(0);

   ci = TColor::GetColor("#000099");
   Graph_Graph1134->SetLineColor(ci);
   Graph_Graph1134->GetXaxis()->SetLabelFont(42);
   Graph_Graph1134->GetXaxis()->SetLabelSize(0.035);
   Graph_Graph1134->GetXaxis()->SetTitleSize(0.035);
   Graph_Graph1134->GetXaxis()->SetTitleFont(42);
   Graph_Graph1134->GetYaxis()->SetLabelFont(42);
   Graph_Graph1134->GetYaxis()->SetLabelSize(0.035);
   Graph_Graph1134->GetYaxis()->SetTitleSize(0.035);
   Graph_Graph1134->GetYaxis()->SetTitleFont(42);
//.........这里部分代码省略.........
开发者ID:Hattawy,项目名称:He-DVCS-Analysis-note-v2,代码行数:101,代码来源:BSA_InCoherent_xB.C

示例13: TCanvas


//.........这里部分代码省略.........
   hist__1->SetBinContent(52,17962);
   hist__1->SetBinContent(53,14130);
   hist__1->SetBinContent(54,10947);
   hist__1->SetBinContent(55,8303);
   hist__1->SetBinContent(56,6081);
   hist__1->SetBinContent(57,4643);
   hist__1->SetBinContent(58,3602);
   hist__1->SetBinContent(59,2825);
   hist__1->SetBinContent(60,2235);
   hist__1->SetBinContent(61,1955);
   hist__1->SetBinContent(62,1716);
   hist__1->SetBinContent(63,1461);
   hist__1->SetBinContent(64,1266);
   hist__1->SetBinContent(65,1191);
   hist__1->SetBinContent(66,1098);
   hist__1->SetBinContent(67,1054);
   hist__1->SetBinContent(68,999);
   hist__1->SetBinContent(69,957);
   hist__1->SetBinContent(70,982);
   hist__1->SetBinContent(71,980);
   hist__1->SetBinContent(72,932);
   hist__1->SetBinContent(73,910);
   hist__1->SetBinContent(74,873);
   hist__1->SetBinContent(75,812);
   hist__1->SetBinContent(76,785);
   hist__1->SetBinContent(77,748);
   hist__1->SetBinContent(78,649);
   hist__1->SetBinContent(79,593);
   hist__1->SetBinContent(80,459);
   hist__1->SetBinContent(81,400);
   hist__1->SetBinContent(82,321);
   hist__1->SetBinContent(83,244);
   hist__1->SetBinContent(84,198);
   hist__1->SetBinContent(85,180);
   hist__1->SetBinContent(86,147);
   hist__1->SetBinContent(87,93);
   hist__1->SetBinContent(88,73);
   hist__1->SetBinContent(89,50);
   hist__1->SetBinContent(90,43);
   hist__1->SetBinContent(91,37);
   hist__1->SetBinContent(92,22);
   hist__1->SetBinContent(93,15);
   hist__1->SetBinContent(94,10);
   hist__1->SetBinContent(95,7);
   hist__1->SetBinContent(96,7);
   hist__1->SetBinContent(97,3);
   hist__1->SetBinContent(98,2);
   hist__1->SetBinContent(99,3);
   hist__1->SetBinContent(100,3);
   hist__1->SetBinContent(101,28);
   hist__1->SetEntries(227323);
   
   TPaveStats *ptstats = new TPaveStats(0.78,0.775,0.98,0.935,"brNDC");
   ptstats->SetName("stats");
   ptstats->SetBorderSize(1);
   ptstats->SetFillColor(0);
   ptstats->SetTextAlign(12);
   ptstats->SetTextFont(42);
   TText *AText = ptstats->AddText("hist");
   AText->SetTextSize(0.0368);
   AText = ptstats->AddText("Entries = 227323 ");
   AText = ptstats->AddText("Mean  = 0.5797");
   AText = ptstats->AddText("Std Dev   =  28.66");
   ptstats->SetOptStat(1111);
   ptstats->SetOptFit(0);
   ptstats->Draw();
   hist__1->GetListOfFunctions()->Add(ptstats);
   ptstats->SetParent(hist__1);

   Int_t ci;      // for color index setting
   TColor *color; // for color definition with alpha
   ci = TColor::GetColor("#000099");
   hist__1->SetLineColor(ci);
   hist__1->GetXaxis()->SetTitle("#DeltaZ [cm]");
   hist__1->GetXaxis()->SetLabelFont(42);
   hist__1->GetXaxis()->SetLabelSize(0.035);
   hist__1->GetXaxis()->SetTitleSize(0.035);
   hist__1->GetXaxis()->SetTitleFont(42);
   hist__1->GetYaxis()->SetLabelFont(42);
   hist__1->GetYaxis()->SetLabelSize(0.035);
   hist__1->GetYaxis()->SetTitleSize(0.035);
   hist__1->GetYaxis()->SetTitleFont(42);
   hist__1->GetZaxis()->SetLabelFont(42);
   hist__1->GetZaxis()->SetLabelSize(0.035);
   hist__1->GetZaxis()->SetTitleSize(0.035);
   hist__1->GetZaxis()->SetTitleFont(42);
   hist__1->Draw("");
   
   TPaveText *pt = new TPaveText(0.3779599,0.9368947,0.6220401,0.995,"blNDC");
   pt->SetName("title");
   pt->SetBorderSize(0);
   pt->SetFillColor(0);
   pt->SetFillStyle(0);
   pt->SetTextFont(42);
   AText = pt->AddText("Worry Later");
   pt->Draw();
   c->Modified();
   c->cd();
   c->SetSelected(c);
}
开发者ID:nikihowe,项目名称:flash,代码行数:101,代码来源:yz-plane-length.C

示例14: DrawAllHistos

void DrawAllHistos(TString filename,Bool_t isMC,TString format){
  
  //  setTDRStyle("logredblue");

  std::vector<TH1F*> h1vec;
  std::vector<TH2F*> h2vec;
  
  h1vec.clear();
  h2vec.clear();

  TFile *file = TFile::Open(filename);

  // to get the names of the conditions
  TObjArray *conditions_from_name = filename.Tokenize("_"); 
  TString sa = conditions_from_name->At(1)->GetName();
  TString sb = conditions_from_name->At(3)->GetName();
  sb.ReplaceAll(".root","");

  file->cd();
  
  TDirectory *stardir = gDirectory;
  TObject *thesourcedir;
  TIter nextdir(stardir->GetListOfKeys());

  while((thesourcedir=nextdir())){
    
    TString dirName = thesourcedir->GetName();
    
    stardir->cd(dirName);
    TDirectory *current_sourcedir = gDirectory;
    TH1::AddDirectory(kFALSE);

    std::cout << "*************************" <<std::endl;
    std::cout << "Reading Directory: " << dirName <<std::endl;
    
    TObject *obj;
    TIter next(current_sourcedir->GetListOfKeys());

    while ((obj=next())) {
      
      TString objName =obj->GetName();

      if(objName.Contains("pfx")) continue;

      if (objName.Contains("h2") && !objName.Contains("pfx")) {

	//std::cout << "Reading: " << obj->GetName() <<std::endl;

	TH2F* h2 = (TH2F*)file->Get(dirName+"/"+objName);
	h2->SetName(objName+dirName);
	h2vec.push_back(h2);

	TCanvas *c = new TCanvas(h2->GetName(),h2->GetName(),800,600);
	c->cd();
	gPad->SetTopMargin(0.08);
	gPad->SetRightMargin(0.15);
	h2->SetStats(kFALSE);
	h2->Draw("colz");
	c->Draw();
	
	c->cd();
	TProfile *hpfx_tmp = (TProfile*) h2->ProfileX("_pfx",1,-1,"o");
	hpfx_tmp->SetStats(kFALSE);
	//hpfx_tmp->SetMarkerColor(kBlack);
	hpfx_tmp->SetMarkerColor(kRed);
	hpfx_tmp->SetMarkerSize(1.2); 
	hpfx_tmp->SetMarkerStyle(20); 
	hpfx_tmp->Draw("psame");
	
	c->Draw();
	cmsPrel(60.,sa,sb, isMC);
	
	TString canvName = h2->GetName();
	c->cd()->SetLogz();
	c->SaveAs(canvName+"."+format);
	  
      } else { 
	
	TH1F* h1 = (TH1F*)file->Get(dirName+"/"+objName);
	h1->SetName(objName+dirName);
	h1vec.push_back(h1);
	
	TCanvas *c = new TCanvas(h1->GetName(),h1->GetName(),600,600);
	c->cd()->SetLogy();
	
	h1->SetMarkerColor(kBlack);
	h1->SetMarkerStyle(20);
	h1->SetLineWidth(1.5); 
	h1->SetFillColor(393);
	//h1->SetFillStyle(3005);
	h1->Draw("hist");
	h1->Draw("e1same");
	c->Draw();
	
	TObject    *statObj;
	TPaveStats *stats;
  
	statObj = h1->GetListOfFunctions()->FindObject("stats");
	stats= static_cast<TPaveStats*>(statObj);
	stats->SetFillColor(10);
//.........这里部分代码省略.........
开发者ID:mmusich,项目名称:usercode,代码行数:101,代码来源:DrawAllHistos.C

示例15: JetEtaBC


//.........这里部分代码省略.........
    out_1 << "Entries = " << entries1 << " ";
    out1_1 << "Mean = " << mean1 << " ";
    out2_1 << "RMS = " << RMS1 << " ";
    s_1 = out_1.str();
    s1_1 = out1_1.str();
    s2_1 = out2_1.str();

    std::string s_2,s1_2,s2_2;
    std::stringstream out_2,out1_2,out2_2;
    out_2 << "Entries = " << entries2 << " ";
    out1_2 << "Mean = " << mean2 << " ";
    out2_2 << "RMS = " << RMS2 << " ";
    s_2 = out_2.str();
    s1_2 = out1_2.str();
    s2_2 = out2_2.str();

    std::string s_3,s1_3,s2_3;
    std::stringstream out_3,out1_3,out2_3;
    out_3 << "Entries = " << entries3 << " ";
    out1_3 << "Mean = " << mean3 << " ";
    out2_3 << "RMS = " << RMS3 << " ";
    s_3 = out_3.str();
    s1_3 = out1_3.str();
    s2_3 = out2_3.str();

    TText *text = ptstats->AddText(s.c_str());
    text = ptstats->AddText(s1.c_str());
    text = ptstats->AddText(s2.c_str());
    ptstats->SetOptStat(1110);
    ptstats->SetOptFit(0);

    TText *text1 = ptstats1->AddText(s_1.c_str());
    text1 = ptstats1->AddText(s1_1.c_str());
    text1 = ptstats1->AddText(s2_1.c_str());
    ptstats1->SetOptStat(1110);
    ptstats1->SetOptFit(0);

    TText *text2 = ptstats2->AddText(s_2.c_str());
    text2 = ptstats2->AddText(s1_2.c_str());
    text2 = ptstats2->AddText(s2_2.c_str());
    ptstats2->SetOptStat(1110);
    ptstats2->SetOptFit(0);

    TText *text3 = ptstats3->AddText(s_3.c_str());
    text3 = ptstats3->AddText(s1_3.c_str());
    text3 = ptstats3->AddText(s2_3.c_str());
    ptstats3->SetOptStat(1110);
    ptstats3->SetOptFit(0);

    TPaveText *pt = new TPaveText(0.3066092,0.8061864,0.7255747,0.87055085,"blNDC");
    pt->SetName("title");
    pt->SetBorderSize(0);
    pt->SetTextFont(42);
    pt->SetFillColor(0);
    pt->SetTextColor(1);
    text = pt->AddText("PF Number of Jets before cuts");
    text = pt->AddText("PF Jets Pt > 10 GeV  Before Cuts");
  
    TPaveText *pt1 = new TPaveText(0.3066092,0.7261864,0.7055747,0.77055085,"blNDC");
    pt1->SetName("title");
    pt1->SetBorderSize(0);
    pt1->SetTextFont(42);
    pt1->SetFillColor(0);
    pt1->SetTextColor(2);
    text1 = pt1->AddText("PAT Jets Eta Before Cuts");

    TPaveText *pt2 = new TPaveText(0.3066092,0.6561864,0.7055747,0.70055085,"blNDC");
    pt2->SetName("title");
    pt2->SetBorderSize(0);
    pt2->SetTextFont(42);
    pt2->SetFillColor(0);
    pt2->SetTextColor(3);
    text2 = pt2->AddText("PF IC5 Pt > 0 GeV Jets Eta Before Cuts");

    TPaveText *pt3 = new TPaveText(0.3266092,0.5861864,0.7055747,0.63055085,"blNDC");
    pt3->SetName("title");
    pt3->SetBorderSize(0);
    pt3->SetTextFont(42);
    pt3->SetFillColor(0);
    pt3->SetTextColor(4);
    text3 = pt3->AddText("PF ak5 Eta Before Cuts");

    c1->Modified();

    f4->Draw();
    f2->Draw("SAME");
    f3->Draw("SAME");
    f1->Draw("SAME");
    pt->Draw("SAME");
    ptstats->Draw("SAME");
    pt1->Draw("SAME");
    ptstats1->Draw("SAME");
    pt2->Draw("SAME");
    ptstats2->Draw("SAME");
    pt3->Draw("SAME");
    ptstats3->Draw("SAME");
    c1->SaveAs("JetEtaBeforeCutsComparisonAllIhaverightnow.gif");

    return 0;
};
开发者ID:aocampor,项目名称:usercode,代码行数:101,代码来源:JetEtaBC.C


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