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


C++ TAxis::GetTitleOffset方法代码示例

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


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

示例1: DrawOne

THStack* DrawOne(TVirtualPad* p, 
		 Double_t     yr,
		 Bool_t       top,
		 TDirectory*  dir, 
		 const char*  name)
{
  p->cd();
  p->SetFillColor(0);
  p->SetFillStyle(0);
  p->SetLineColor(0);
  p->SetRightMargin(0.01);
  p->SetLeftMargin(0.12);
  p->SetGridx();
  if (top) p->SetBottomMargin(0.001);
  else     p->SetBottomMargin(0.2);
  if (top) p->SetTopMargin(0.02);
  else     p->SetTopMargin(0.0001);
  
  
  THStack* s = static_cast<THStack*>(dir->Get(name));
  s->Draw("nostack");
  Double_t sc = (top ? 1-yr : yr);
  TAxis* ya = s->GetHistogram()->GetYaxis();
  ya->SetLabelSize(1/sc*ya->GetLabelSize());
  ya->SetTitleSize(1/sc*ya->GetTitleSize());
  ya->SetTitleOffset(sc*(ya->GetTitleOffset()+.5));
  ya->SetTitleFont(42);
  ya->SetLabelFont(42);
  TAxis* xa = s->GetHistogram()->GetXaxis();
  xa->SetLabelSize(!top ? 1/yr*xa->GetLabelSize() : 0);
  xa->SetTitleSize(!top ? 1/yr*xa->GetTitleSize() : 0);
  xa->SetTitleOffset(yr*(xa->GetTitleOffset()+2));
  xa->SetTitleFont(42);
  xa->SetLabelFont(42);

  p->Modified();
  p->Update();
  p->cd();

  return s;
}
开发者ID:ktf,项目名称:AliPhysics,代码行数:41,代码来源:DrawEmpirical.C

示例2: main


//.........这里部分代码省略.........
    plotGrabBaseName = "h_METX_vs_nVtx_noPhiCorr";
    TCanvas * c_Var;
    TH2F * DataComp, * MCComp;
    TH1F * DataMean, * MCMean;
    TF1 * f1_resp_Lin = new TF1("fb_Lin","[0] + x*[1]",FitLowRange, FitHighRange);
    TFitResultPtr fitres_Lin;
    vector<TH1F *> * DataVec, * MCVec;
    for (int iChan = 0; iChan < 7; ++iChan) {
        subSampName = subSampVec->at(grabChan[iChan]).histNameSuffix;        
        plotGrabName = plotGrabBaseName;
        plotSystGrabName = plotGrabName;                
        plotGrabName += subSampName; 
        dataHistTH1Vec = new vector<TH1 *>;
        mcHistTH1Vec = new vector<TH1 *>;
        mcHistSystTH1Vec = new vector<TH1 *>;
        DataVec = new vector<TH1F *>;
        MCVec = new vector<TH1F *>;
        HistogramVecGrabberCentValGrab(inputFiles, true, dataHistTH1Vec, nVtxBackScaleVec, plotGrabName, subSampName, useDDEstimate, TTBarSF, scaleLumi);        
        HistogramVecGrabberCentValGrab(inputFiles, false, mcHistTH1Vec, nVtxBackScaleVec, plotGrabName, subSampName, useDDEstimate, TTBarSF, scaleLumi);
        DataComp = HistogramAdderDataTwoDee(dataHistTH1Vec);
        MCComp = HistogramAdderDataTwoDee(mcHistTH1Vec);
        VectorDistMakerMean(DataMean, DataVec, DataComp, plotGrabName+TString("_mean"), plotGrabName + TString("_Vec"));
        VectorDistMakerMean(MCMean, DataVec, MCComp, plotGrabName+TString("_MC_mean"), plotGrabName + TString("_MC_Vec"));
        HistMainAttSet(DataMean, 0, 0, kBlue, DataMean->GetLineWidth(), kBlue, 20, DataMean->GetMarkerSize());
        HistMainAttSet(MCMean, 0, 0, kRed, MCMean->GetLineWidth(), kRed, 24, MCMean->GetMarkerSize());
        canvName = canvNameBase;
        canvName += canvNameAdd[iChan];
        canvName += canvSuffixSaveName;        
        c_Var = new TCanvas(canvName, canvName, 0, 0, 700, 700);
        DataMean->Draw();
        MCMean->Draw("same");    
        XAxis = DataMean->GetXaxis();
        YAxis = DataMean->GetYaxis();
        HistAxisAttSet(YAxis, "<E_{x}^{miss}>  [GeV/c]", YAxis->GetTitleSize(), YAxis->GetTitleOffset(), YAxis->GetLabelSize(), YAxis->GetLabelOffset(), -30.0, 30.0);
        leg= new TLegend(0.2,0.65,0.60,0.85);
        f1_resp_Lin->SetLineColor(kBlue);
        f1_resp_Lin->SetLineWidth(2);
        f1_resp_Lin->SetLineStyle(1);
        fitres_Lin = DataMean->Fit(f1_resp_Lin,FitOption,"axis same",FitLowRange, FitHighRange);
        c_0d = fitres_Lin->Parameter(0);
        c_1d = fitres_Lin->Parameter(1);
        sprintf(buf,"data A+B+C+D c_{0} = %0.2f #pm %0.2f",fitres_Lin->Parameter(0),fitres_Lin->ParError(0));
        leg->AddEntry(DataMean,buf,"p");
        sprintf(buf,"data A+B+C+D c_{1} = %0.2f #pm %0.2f",fitres_Lin->Parameter(1),fitres_Lin->ParError(1));
        leg->AddEntry(DataMean,buf,"p");
        f1_resp_Lin->SetLineStyle(2);
        f1_resp_Lin->SetLineColor(kRed);
        fitres_Lin = MCMean->Fit(f1_resp_Lin,FitOption,"axis same",FitLowRange, FitHighRange);
        c_0mc = fitres_Lin->Parameter(0);
        c_1mc = fitres_Lin->Parameter(1);
        sprintf(buf,"sim A+B+C+D c_{0} = %0.2f #pm %0.2f",fitres_Lin->Parameter(0),fitres_Lin->ParError(0));
        leg->AddEntry(MCMean,buf,"p");
        sprintf(buf,"sim A+B+C+D c_{1} = %0.2f #pm %0.2f",fitres_Lin->Parameter(1),fitres_Lin->ParError(1));
        leg->AddEntry(MCMean,buf,"p");
        leg->Draw("same");
        c_Var->SaveAs(canvName + TString(".pdf"));
        if (makeRootCopy) {
            c_Var->SaveAs(canvName + TString(".root"));
        }
        cout << "{c_0 X data, c_1 X data, c_0 X MC, c_1 X MC} is: {" << c_0d << ", " << c_1d << ", " << c_0mc << ", " << c_1mc << "}" << endl; 
    }
    
    canvNameBase = "h_METY_vs_nVtx_noPhiCorr";
    plotGrabBaseName = "h_METY_vs_nVtx_noPhiCorr";
    
    for (int iChan = 0; iChan < 7; ++iChan) {
开发者ID:bcalvert,项目名称:StopDiLepCode,代码行数:67,代码来源:METPhiCorrCalculator.C


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