• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ TText类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: GetChildWindow

void TMainMenu::SetWelcomeName()
{
	if(TSettings::GetInstance()->GetNumUsers() == 0)
	{
		TWindow *window = GetChildWindow("welcome", -1);
		if (window)
		{
			window->SetFlags(window->GetFlags() & ~kEnabled);
		}

		window = GetChildWindow("changeplayer", -1);
		if (window)
		{
			window->SetFlags(window->GetFlags() & ~kEnabled);
		}

	}
	else
	{
		TWindow *window = GetChildWindow("welcome", -1);
		if (window)
		{
			TText *text = window->GetCast<TText>();
			text->SetText(TPlatform::GetInstance()->GetStringTable()->GetString("welcome", TSettings::GetInstance()->GetCurrentUserName()));
		}
		
	}
}
开发者ID:ForestMan,项目名称:DefenceGarden,代码行数:28,代码来源:mainmenu.cpp


示例2: PaintOverflow

void PaintOverflow(TH1 *h)
{
   // This function paint the histogram h with an extra bin for overflows

   char* name  = h->GetName();
   char* title = h->GetTitle();
   Int_t nx    = h->GetNbinsX()+1;
   Double_t x1 = h->GetBinLowEdge(1);
   Double_t bw = h->GetBinWidth(nx);
   Double_t x2 = h->GetBinLowEdge(nx)+bw;

   // Book a temporary histogram having ab extra bin for overflows
   TH1F *htmp = new TH1F(name, title, nx, x1, x2);

   // Fill the new hitogram including the extra bin for overflows
   for (Int_t i=1; i<=nx; i++) {
      htmp->Fill(htmp->GetBinCenter(i), h->GetBinContent(i));
   }

   // Fill the underflows
   htmp->Fill(x1-1, h->GetBinContent(0));

   // Restore the number of entries
   htmp->SetEntries(h->GetEntries());

   // Draw the temporary histogram
   htmp->Draw();
   TText *t = new TText(x2-bw/2,h->GetBinContent(nx),"Overflow");
   t->SetTextAngle(90);
   t->SetTextAlign(12);
   t->SetTextSize(0.03);;
   t->Draw();
}
开发者ID:frmeier,项目名称:usercode,代码行数:33,代码来源:testoverflow.C


示例3: 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


示例4: highlight1

void highlight1()
{
   TCanvas *ch = new TCanvas("ch", "ch", 0, 0, 700, 500);
   const Int_t n = 500;
   Double_t x[n], y[n];
   TH1F *h[n];

   for (Int_t i = 0; i < n; i++) {
      h[i] = new TH1F(TString::Format("h_%02d", i), "", 100, -3.0, 3.0);
      // in practice gaus need reset parameters
      h[i]->FillRandom("gaus", 1000);
      h[i]->Fit("gaus", "Q");
      h[i]->SetMaximum(250); // for n > 200
      x[i] = i;
      y[i] = h[i]->GetFunction("gaus")->GetParameter(2);
   }

   TGraph *g = new TGraph(n, x, y);
   g->SetMarkerStyle(6);
   for (Int_t i = 0; i < n; i++) g->AddHighlight(i, h[i]);
   g->Draw("AP");
   g->SetHighlight();

   TPad *ph = new TPad("ph", "ph", 0.3, 0.4, 1.0, 1.0);
   ph->SetFillColor(kBlue - 10);
   ph->Draw();
   ph->cd();
   TText *info = new TText(0.5, 0.5, "please move the mouse over the graph");
   info->SetTextAlign(22);
   info->Draw();
   ch->cd();

   TGraph::SetHighlightPad(ph);
}
开发者ID:musinsky,项目名称:ROOTHighlight,代码行数:34,代码来源:highlight1.C


示例5: ratioPlots

void ratioPlots( TCanvas* c1, TH1* h_r, TH1* h_i, 
		 string xTitle, string yTitle, 	string savePath, 
		 double fitMin=-100000, double fitMax=100000, bool doubleColFit=0 ){

	double xMaximum = h_r->GetXaxis()->GetBinUpEdge(h_r->GetXaxis()->GetLast());
	double xMinimum = h_r->GetXaxis()->GetBinLowEdge(h_r->GetXaxis()->GetFirst());
	double yMaximum;
	double yMinimum;

	h_i->Sumw2();
	h_r->Sumw2();

	TLine* line1 = new TLine(xMinimum,1,xMaximum,1);
	line1->SetLineColor(1);
	line1->SetLineWidth(2);
	line1->SetLineStyle(7);
	
	TF1* fpol1  = new TF1("fpol1", "pol1", fitMin, fitMax);	
	fpol1->SetLineColor(2);
	fpol1->SetLineWidth(3);
	fpol1->SetLineStyle(7);
	
	TH1* hRatio = (TH1*)h_r->Clone("clone_record");
	hRatio->Divide(h_i);
	yMaximum = hRatio->GetMaximum();
	yMinimum = hRatio->GetMinimum(0);
	hRatio->GetYaxis()->SetRangeUser(yMinimum/2.5,yMaximum+yMaximum/5);
	hRatio->SetXTitle(xTitle.c_str());
	hRatio->SetYTitle(yTitle.c_str());
	hRatio->SetLineColor(9); 
	hRatio->SetLineWidth(2); 
	hRatio->SetMarkerStyle(8); 
	hRatio->Draw("e");
	hRatio->Fit("fpol1", "L");
	line1->Draw("SAME");
	
	if(doubleColFit){
		double p0=fpol1->GetParameter(0);
		double p1=fpol1->GetParameter(1);
		double endPoint=double(fitMax*p1)+p0;
		double p1new=(endPoint-1)/(fitMax-fitMin);
		char fun[100], text[100];
		sprintf(fun,"x*(%f)+1",p1new);	
		sprintf(text,"Tangent: %f",p1new);	
		TF1* fnew = new TF1("fnew", fun, fitMin, fitMax);
		fnew->SetLineColor(2);
		fnew->SetLineWidth(3);
		fnew->Draw("SAME");
	
			
		TText* Title = new TText( fitMax/12, yMinimum, text);
		Title->SetTextColor(2);
		Title->SetTextSize(0.035);
		Title->Draw("SAME");
	}

	c1->SaveAs(savePath.c_str());
	c1->cd();
}
开发者ID:alphatsai,项目名称:pixelCheck,代码行数:59,代码来源:ratioPlots.C


示例6: Draw_KL_Test

void Draw_KL_Test(){

  TChain* ch = new TChain("Tree");
  TChain* ch1 = new TChain("Tree");
  
  TH1D* his  = new TH1D("Klong6g","Klong6g",20,450,550);
  TH1D* his1 = new TH1D("Klong4g","Klong4g",20,450,550);
  TH1D* his2 = new TH1D("Klong4gAll","Klong4gAll",60,250,550);

  for( int i = 0; i< 68; i++){
    ch->Add(Form("klongRootFile/kl%d.root" ,4162+i));
    ch1->Add(Form("klongRootFile/ks%d.root",4162+i));
  }
  ch->Project(his->GetName()  ,"KlongMass[0]","CutCondition==0");
  ch1->Project(his1->GetName(),"KlongMass[0]","CutCondition==0");
  ch1->Project(his2->GetName(),"KlongMass[0]","CutCondition==0");
  
  TF1* func = new TF1("func","gaus(0)+expo(3)",0,550);
  func->SetParameter(1,498);
  func->SetParameter(2,5);
  TF1* func2 = new TF1("func2","gaus(0)",0,550);
  func2->SetParameter(1,498);
  func2->SetParameter(2,5);



  TCanvas* can = new TCanvas("can","",1200,600);
  can->Divide(2,1);
  can->cd(1);
  his2->Fit(func->GetName(),"","",450,550);
  his2->Draw();
  TF1* func1 = new TF1("Test","gaus",450,550);
  func1->SetParameter(0,func->GetParameter(0));
  func1->SetParameter(1,func->GetParameter(1));
  func1->SetParameter(2,func->GetParameter(2));

  can->cd(2);
  his1->SetLineColor(2);  
  his->Draw();
  his->Fit(func2->GetName(),"","",450,550);
  func->Draw("same");
  his1->Draw("same");

  std::cout<< func2->GetParameter(0) << " " 
	   << func->GetParameter(0)  << " " 
	   << func->GetParameter(0)/func2->GetParameter(0)<< std::endl;
  std::cout<< func2->Integral(450,550) << " " 
	   << func1->Integral(450,550)  << " " 
	   << func1->Integral(450,550)/func2->Integral(450,550)
	   << std::endl;
  //ch->Draw("KlongPt[0]:KlongMass[0]>>(400,200,600,50,0,20)","(CutCondition&(1|2|4|8))==0","colz");
  gPad->SetLogz();
  TText* text = new TText(0.5,0.5,"");
  TText* text1 = new TText(0.5,0.5,"");
  text->DrawTextNDC(0.5,0.5,Form("Integral:%2.3lf",func1->Integral(450,550)));
  text1->DrawTextNDC(0.5,0.6,Form("Integral:%2.3lf",func2->Integral(450,550)));
  
}
开发者ID:laerad84,项目名称:Analysis,代码行数:58,代码来源:Draw_KL_Test.C


示例7: s_intersection

void s_intersection()
{
   gROOT->GetListOfCanvases()->Delete();
   TCanvas *c = new TCanvas("composite shape", "Intersection boolean operation", 700, 1000);

   c->Divide(1,2,0,0);
   c->cd(2);
   gPad->SetPad(0,0,1,0.4);
   c->cd(1);
   gPad->SetPad(0,0.4,1,1);
   
   if (gGeoManager) delete gGeoManager;
   
   new TGeoManager("xtru", "poza12");
   TGeoMaterial *mat = new TGeoMaterial("Al", 26.98,13,2.7);
   TGeoMedium *med = new TGeoMedium("MED",1,mat);
   TGeoVolume *top = gGeoManager->MakeBox("TOP",med,100,100,100);
   gGeoManager->SetTopVolume(top);

   // define shape components with names
   TGeoBBox *box = new TGeoBBox("bx", 40., 40., 40.); 
   TGeoSphere *sph = new TGeoSphere("sph", 40., 45.);
   // define named geometrical transformations with names
   TGeoTranslation *tr = new TGeoTranslation(0., 0., 45.);
   tr->SetName("tr");
   // register all used transformations
   tr->RegisterYourself();
   // create the composite shape based on a Boolean expression
   TGeoCompositeShape *cs = new TGeoCompositeShape("mir", "sph:tr * bx");

   TGeoVolume *vol = new TGeoVolume("COMP2",cs);
   top->AddNode(vol,1);
   gGeoManager->CloseGeometry();
   gGeoManager->SetNsegments(100);
   top->Draw();
   MakePicture();

   c->cd(2);

   TPaveText *pt = new TPaveText(0.01,0.01,0.99,0.99);

   pt->SetLineColor(1);

   TText *text = pt->AddText("TGeoCompositeShape - composite shape class");

   text->SetTextColor(2);
   pt->AddText("----- Here is an example of boolean intersection operation : A * B");
   pt->AddText("----- A == sphere (with inner radius non-zero), B == box");
   pt->AddText(" ");
   pt->SetAllWith("-----","color",4);
   pt->SetAllWith("-----","font",72);
   pt->SetAllWith("-----","size",0.04);
   pt->SetTextAlign(12);
   pt->SetTextSize(0.044);
   pt->Draw();
   c->cd(1);
}
开发者ID:alcap-org,项目名称:AlcapDAQ,代码行数:57,代码来源:csgdemo.C


示例8: do2DPlots

void do2DPlots(bool muon, TString variable, TString ytitle){

	TString leptonFolder;
	if(muon == true){
		leptonFolder = "MuonMET/";
	}else{
		leptonFolder = "ElectronMET/";
		}	
		
  	setTDRStyle();
  	gStyle->SetPalette(1);

	TString dir = "rootFilesV4/central/";
	TFile* tt_file = new TFile(dir + sample+"_19584pb_PFElectron_PFMuon_PF2PATJets_PFMET.root");

cout << "Getting histo: " << "Binning/"+leptonFolder+variable+"/GenMET_vs_RecoMET"<<endl;
	TH2D* tt_2d = (TH2D*) tt_file->Get("Binning/"+leptonFolder+variable+"/GenMET_vs_RecoMET_2btags");
	TH2D* tt_2d_3b = (TH2D*) tt_file->Get("Binning/"+leptonFolder+variable+"/GenMET_vs_RecoMET_3btags");
	TH2D* tt_2d_4b = (TH2D*) tt_file->Get("Binning/"+leptonFolder+variable+"/GenMET_vs_RecoMET_4orMoreBtags");

	tt_2d->Add(tt_2d_3b);
	tt_2d->Add(tt_2d_4b);

	tt_2d->Rebin2D(5,5);
  	tt_2d->GetYaxis()->SetTitle(ytitle);
  	tt_2d->GetXaxis()->SetTitle("Gen MET (GeV)");
	tt_2d->GetYaxis()->SetTitleOffset(1.8);
	tt_2d->GetXaxis()->SetTitleOffset(1.5);

        TCanvas *c= new TCanvas("c","c",10,10,800,600);
	tt_2d->Draw("COLZ");
			
	int bin[5] = {25, 45, 70, 100, 150};//MET
	for(int i = 0; i < 5; i++){
	TLine *line = new TLine(bin[i],0,bin[i],300);
	TLine *liney = new TLine(0,bin[i],300,bin[i]);
	//TLine *line = new TLine(bin[i],0,bin[i],500);
	//TLine *liney = new TLine(0,bin[i],500,bin[i]);
	line->SetLineWidth(2);
	liney->SetLineWidth(2);
	liney->Draw();
	line->Draw();
	}
	
	TText* textPrelim = doPrelim(0.2,0.96);
	textPrelim->Draw();
	
  	TString plotName("plots/"+leptonFolder);
        plotName += sample+"_"+variable;
        plotName += "_2btags.pdf";
 
  c->SaveAs(plotName);
  delete c;


}
开发者ID:phy6phs,项目名称:DailyCScripts,代码行数:56,代码来源:do2DMET.C


示例9: compareHistos

void compareHistos( char *Current, char *Reference=0 ) {

    TText* te = new TText();
    te->SetTextSize(0.1);

    TFile * curfile = new TFile( TString(Current)+".root" );
    TFile * reffile = curfile;
    if (Reference) reffile = new TFile(TString(Reference)+".root");


    char * prefix="DQMData/MixingV/Mixing";
//1-Dimension Histogram
    TDirectory * refDir=reffile->GetDirectory(prefix);
    TDirectory * curDir=curfile->GetDirectory(prefix);
    TList* list = refDir->GetListOfKeys();
    TObject*  object = list->First();
    int iHisto = 0;
    char title[50];
    while (object) {
        // find histo objects
        std::cout << " object :" << object->GetName() << std::endl;
        TProfile * h1 = dynamic_cast<TProfile*>( refDir->Get(object->GetName()));
        TProfile * h2 = dynamic_cast<TProfile*>( curDir->Get(object->GetName()));
        bool isHisto = (refDir->Get(object->GetName()))->InheritsFrom("TProfile");
        std::cout << " isHisto = " << isHisto << std::endl;
        if (isHisto && h1 && h2 && *h1->GetName()== *h2->GetName()) {
            iHisto++;
            char title[50];
            // draw and  compare
            std::cout << " Start draw and compare" << std::endl;
            TCanvas c1;
            TProfile htemp2;
            h2->Copy(htemp2);// to keep 2 distinct histos

            h1->SetLineColor(2);
            htemp2.SetLineColor(3);
            h1->SetLineStyle(3);
            h1->SetMarkerColor(3);
            htemp2.SetLineStyle(5);
            htemp2.SetMarkerColor(5);
            TLegend leg(0.1, 0.15, 0.2, 0.25);
            leg.AddEntry(h1, "Reference", "l");
            leg.AddEntry(&htemp2, "New ", "l");

            h1->Draw();
            htemp2.Draw("Same");
            leg.Draw();
            sprintf(title,"%s%s", object->GetName(),".gif");
            c1.Print(title);
        }

        // go to next object
        object = list->After(object);
    }
}
开发者ID:nsahoo,项目名称:cmssw-1,代码行数:55,代码来源:compareHistos.C


示例10: 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


示例11: s_difference

void s_difference()
{
   gROOT->GetListOfCanvases()->Delete();
   TCanvas *c = new TCanvas("composite shape", "Difference boolean operation", 700, 1000);

   c->Divide(1,2,0,0);
   c->cd(2);
   gPad->SetPad(0,0,1,0.4);
   c->cd(1);
   gPad->SetPad(0,0.4,1,1);
   
   if (gGeoManager) delete gGeoManager;
   
   new TGeoManager("xtru", "poza12");
   TGeoMaterial *mat = new TGeoMaterial("Al", 26.98,13,2.7);
   TGeoMedium *med = new TGeoMedium("MED",1,mat);
   TGeoVolume *top = gGeoManager->MakeBox("TOP",med,100,100,100);
   gGeoManager->SetTopVolume(top);

   // define shape components with names
   TGeoTorus *tor = new TGeoTorus("tor", 45., 15., 20., 45., 145.); 
   TGeoSphere *sph = new TGeoSphere("sph", 20., 45., 0., 180., 0., 270.);
   // create the composite shape based on a Boolean expression
   TGeoCompositeShape *cs = new TGeoCompositeShape("mir", "sph - tor");

   TGeoVolume *vol = new TGeoVolume("COMP3",cs);
   top->AddNode(vol,1);
   gGeoManager->CloseGeometry();
   gGeoManager->SetNsegments(60);
   top->Draw();
   MakePicture();

   c->cd(2);

   TPaveText *pt = new TPaveText(.01, .01, .99, .99);

   pt->SetLineColor(1);

   TText *text = pt->AddText("TGeoCompositeShape - composite shape class");

   text->SetTextColor(2);

   pt->AddText("----- It's an example of boolean difference: A - B");
   pt->AddText("----- A == part of sphere (0-180, 0-270), B == partial torus (45-145)");
   pt->AddText(" ");
   pt->SetAllWith("-----","color",4);
   pt->SetAllWith("-----","font",72);
   pt->SetAllWith("-----","size",0.04);
   pt->SetTextAlign(12);
   pt->SetTextSize(0.044);
   pt->Draw();
   c->cd(1);
}
开发者ID:alcap-org,项目名称:AlcapDAQ,代码行数:53,代码来源:csgdemo.C


示例12: DoCompare

void DoCompare( char *Current, char *Reference=0 ){

 TText* te = new TText();
 te->SetTextSize(0.1);
 
 gROOT->ProcessLine(".x HistoCompare.C");
 HistoCompare * myPV = new HistoCompare();

 TFile * curfile = new TFile( TString(Current)+".root" );
 TFile * reffile = curfile;
 if (Reference) reffile = new TFile(TString(Reference)+".root");


 char * prefix="DQMData/MixingV/";
 //1-Dimension Histogram
 TDirectory * refDir=reffile->GetDirectory(prefix);
 TDirectory * curDir=curfile->GetDirectory(prefix);
 TList* list = refDir->GetListOfKeys();  
 TObject*  object = list->First();
 int iHisto = 0; char title[50];
 while (object) {
   // find histo objects
   TH1F * h1 = dynamic_cast<TH1F*>( refDir->Get(object->GetName()));
   TH1F * h2 = dynamic_cast<TH1F*>( curDir->Get(object->GetName()));
   bool isHisto = (refDir->Get(object->GetName()))->InheritsFrom("TH1F");
   if (isHisto && h1 && h2 && *h1->GetName()== *h2->GetName()) {
     iHisto++;
      char title[50];
      // draw and  compare
   TCanvas c1;
   TH1F htemp2;
   h2->Copy(htemp2);// to keep 2 distinct histos

   h1->SetLineColor(2);
   htemp2.SetLineColor(3);
   h1->SetLineStyle(3);
   htemp2.SetLineStyle(5);
   TLegend leg(0.1, 0.15, 0.2, 0.25);
   leg.AddEntry(h1, "Reference", "l");
   leg.AddEntry(&htemp2, "New ", "l");

   h1->Draw();
   htemp2.Draw("Same"); 
   leg.Draw();
   myPV->PVCompute(h1,&htemp2, te);
   sprintf(title,"%s%s", object->GetName(),".eps");
   c1.Print(title);
   }
   // go to next object
   object = list->After(object);
   }
}
开发者ID:Andrej-CMS,项目名称:cmssw,代码行数:52,代码来源:DoCompare.C


示例13: test

void test(void){

  TCanvas *c = new TCanvas("c","font test");
  TH1D *h = new TH1D("h","h",10,0,10);
  TText *t = new TText();
  h->SetTitle("Title");
  h->GetXaxis()->SetTitle("X axis daze");
  h->GetYaxis()->SetTitle("Y axis yade");
  h->Draw();
  t->DrawTextNDC(0.4, 0.4 ,"abcdef");


}
开发者ID:ekawa,项目名称:test,代码行数:13,代码来源:test.c


示例14: overlayFrame

//--------------------------------------------------------------------------------------------------
void overlayFrame(TString text, bool align)
{
  // Overlay a linear frame from user coordinates (0 - 1, 0 - 1) and put the frame text

  // Create new transparent pad for the text
  TPad *transPad = new TPad("transPad","Transparent Pad",0,0,1,1);
  transPad->SetFillStyle(4000);
  transPad->Draw();
  transPad->cd();

  // Overlay the text in a well defined frame
  TText *plotText = new TText();
  plotText->SetTextColor(kBlue);
  plotText->SetTextSize(0.04);
  plotText->SetNDC();

  // Draw text at top right
  if (align) {
    plotText->SetTextColor(kBlack);
    plotText->SetTextAlign(33);
    plotText->DrawText(0.92,0.95,text.Data());
  }
  // Draw text at bottom left
  else
    plotText->DrawText(0.01,0.01,text.Data());

  return;
}
开发者ID:BambuPhysics,项目名称:MitPlots,代码行数:29,代码来源:plotSmartCacheRequests.C


示例15: postprocess

void postprocess(TCanvas* c2, const char* name, Int_t rWrite, Int_t rPerformance) {

        if (rPerformance){

                TLatex *alice = new TLatex(0.65,0.47,"Performance");
                alice->SetNDC();
                alice->SetTextColor(myDarkRed);
                alice->SetTextFont(42);
                alice->SetTextSize(0.05);
                alice->SetLineWidth(2);
                alice->Draw();

                TLatex *alice2 = new TLatex(0.62,0.41,"LHC10h - Pass2");
                alice2->SetNDC();
                alice2->SetTextColor(myDarkRed);
                alice->SetTextFont(42);
                alice2->SetTextSize(0.05);
                alice2->SetLineWidth(2);
                alice2->Draw();

                TText *date = new TText(0.68,0.35,cStamp2);
                date->SetNDC();
                date->SetTextFont(42);
                date->SetTextSize(0.04);
                date->Draw();

                //Acquire canvas proportions
                Double_t AliLogo_LowX = 0.67;
                Double_t AliLogo_LowY = 0.53;
                Double_t AliLogo_Height = 0.22;
                //ALICE logo is a png file that is 821x798 pixels->should be wider than a square
                Double_t AliLogo_Width  = (821./798.) * AliLogo_Height * gPad->GetWh() / gPad->GetWw();

                TPad *myPadLogo = new TPad("myPadLogo", "Pad for ALICE Logo",AliLogo_LowX,AliLogo_LowY,AliLogo_LowX+AliLogo_Width,AliLogo_LowY+AliLogo_Height);
                //    myPadLogo->SetFillColor(2); // color to first figure out where is the pad then comment !
                myPadSetUp(myPadLogo,0,0,0,0);
                //myPadLogo->SetFixedAspectRatio(1);
                myPadLogo->Draw();
                myPadLogo->cd();
                TASImage *myAliceLogo = new TASImage("alice_logo_transparent.png");
                myAliceLogo->Draw();
        }

        if (rWrite == 1)
                c2->SaveAs(Form("%s.png",name));

        if (rWrite == 2)
                c2->SaveAs(Form("%s.eps",name));

}
开发者ID:maszyman,项目名称:PlotMacros,代码行数:50,代码来源:drawDist.C


示例16: fill_with_text

void fill_with_text(TGraph *real, TGraph *down, TGraph *up, TVirtualPad *can, int scantype, std::string scanx = "") {
  can->cd();
  float xpos_of_text = 0.22;
  TLegend* this_leg = new TLegend(xpos_of_text,0.6,0.38,0.75);
  //TLegend* this_leg = new TLegend(xpos_of_text,0.55,0.45,0.75,"n_{jets} #geq 3"); // this was the style of the paper. 
  this_leg->SetFillColor(0);
  this_leg->SetBorderSize(0);
  this_leg->SetTextSize(0.035);
  //this_leg->SetTextSize(0.04); // paper style. 
  if(scantype==PlottingSetup::SMS||scantype==PlottingSetup::GMSB) {
    //this_leg->AddEntry(real,"#sigma^{prod} = #sigma^{NLO-QCD}" , "l");
    //this_leg->AddEntry(up,"#sigma^{prod} = 3 #times #sigma^{NLO-QCD}" , "l");
    //this_leg->AddEntry(down,"#sigma^{prod} = 1/3 #times #sigma^{NLO-QCD}" , "l");
    this_leg->AddEntry(real,"#sigma^{NLO-QCD}" , "l");
    this_leg->AddEntry(up,"3 #times #sigma^{NLO-QCD}" , "l");
    this_leg->AddEntry(down,"1/3 #times #sigma^{NLO-QCD}" , "l");
  } else {
    write_warning(__FUNCTION__,"Not implemented yet for mSUGRA");
  }
    
  this_leg->Draw();
  TText *title = write_text(xpos_of_text+0.005,0.52,"JZB");
  title->SetTextSize(0.04);
  title->SetTextAlign(13);
  title->SetTextFont(62);
  title->Draw();
  
  write_SMS_text( scantype, scanx, xpos_of_text );
  
//  //string legT5zz="pp #rightarrow  #tilde{g} #tilde{g}, #tilde{g} #rightarrow 2j + #chi^{0}_{1}, #chi^{0}_{1} #rightarrow Z + #tilde{G}";
//  string legT5zz="pp #rightarrow  #tilde{g} #tilde{g}, #tilde{g} #rightarrow 2j + #chi^{0}_{2}, #chi^{0}_{2} #rightarrow Z #chi^{0}_{1}";
//  string legT5zzl2="m(#tilde{q}) >> m(#tilde{g}), x = "+scanx;
//  string legT5zzl3=" GMSB";
//  TText *title = write_text(xpos_of_text,0.85,legT5zz);
//  title->SetTextAlign(11);
//  title->SetTextSize(0.035);
//  if(scantype!=PlottingSetup::mSUGRA) title->Draw("same");
//  TText *title2 = write_text(xpos_of_text,0.79,legT5zzl2);
//  title2->SetTextAlign(11);
//  title2->SetTextSize(0.035);
//  if(scantype!=PlottingSetup::mSUGRA) title2->Draw("same");
//  TText *title3 = write_text(0.40,0.79,legT5zzl3);
//  title3->SetTextAlign(11);
//  title3->SetTextSize(0.035);
//  title3->SetTextColor(kRed);
////  if(scantype==PlottingSetup::GMSB) title3->Draw("same");
  DrawPrelim();
  draw_diagonal_xchange( scantype, scanx );
}
开发者ID:MarcoAndreaBuchmann,项目名称:CBAF,代码行数:49,代码来源:ExclusionPlot.C


示例17: AddText

//______________________________________________________________________________
void AddText(TPaveText *pave, const char *datamember, Int_t value, const char *comment)
{
   char line[128];
   for (Int_t i=0; i<128; i++) line[i] = ' ';
   memcpy(&line[0], datamember, strlen(datamember));
   line[10] = '=';
   char number[20];
   sprintf(number, "%5i", value);
   memcpy(&line[12], number, strlen(number));
   line[26] = '=';
   line[27] = '>';
   sprintf(&line[30], "%s",comment);
   TText *text = pave->AddText(line);
   text->SetTextAlign(12);
}
开发者ID:alcap-org,项目名称:AlcapDAQ,代码行数:16,代码来源:csgdemo.C


示例18: bexec

void bexec(TString &dir,const char *macro)
{
   if (gROOT->IsBatch()) printf("Processing benchmark: %s%s\n",dir.Data(),macro);
   TPaveText *summary = (TPaveText*)bench1->GetPrimitive("TPave");
   TText *tmacro = summary->GetLineWith(macro);
   if (tmacro) tmacro->SetTextColor(4);
   bench1->Modified(); bench1->Update();

   gROOT->Macro(Form("%s%s",dir.Data(),macro));

   TPaveText *summary2 = (TPaveText*)bench1->GetPrimitive("TPave");
   TText *tmacro2 = summary2->GetLineWith(macro);
   if (tmacro2) tmacro2->SetTextColor(2);
   bench1->Modified(); bench1->Update();
}
开发者ID:MycrofD,项目名称:root,代码行数:15,代码来源:benchmarks.C


示例19: table

void table(Float_t x1, Float_t x2, Float_t yrange, TText *t, 
   const char **symbol, Bool_t octal)
{
   Int_t i;
   Int_t n = 0;
   for (i=0;i<1000;i++) {
      if (!strcmp(symbol[i],"END")) break;
      n++;
   }
   Float_t y1  = 2.5;
   Float_t y2  = yrange - 0.5;
   Float_t dx  = (x2-x1)/5;
   Float_t dy  = (y2 - 1 -y1)/(n+1);
   Float_t y   = y2 - 1 - 0.7*dy;
   Float_t xc0 = x1  + 0.5*dx;
   Float_t xc1 = xc0 + dx;
   Float_t xc2 = xc1 + dx;
   Float_t xc3 = xc2 + dx;
   Float_t xc4 = xc3 + dx;
   TLine *line = new TLine();
   line->DrawLine(x1,y1,x1,y2);
   line->DrawLine(x1,y1,x2,y1);
   line->DrawLine(x1,y2,x2,y2);
   line->DrawLine(x2,y1,x2,y2);
   line->DrawLine(x1,y2-1,x2,y2-1);
   line->DrawLine(x1+  dx,y1,x1+  dx,y2);
   line->DrawLine(x1+2*dx,y1,x1+2*dx,y2);
   line->DrawLine(x1+3*dx,y1,x1+3*dx,y2);
   line->DrawLine(x1+4*dx,y1,x1+4*dx,y2);
   TText *tit = new TText(0,0,"a");
   tit->SetTextSize(0.015);
   tit->SetTextFont(72);
   tit->SetTextAlign(22);
   tit->DrawText(xc0,y2-0.6,"Input");
   tit->DrawText(xc1,y2-0.6,"Roman");
   tit->DrawText(xc2,y2-0.6,"Greek");
   tit->DrawText(xc3,y2-0.6,"Special");
   tit->DrawText(xc4,y2-0.6,"Zapf");
   char text[12];
   for (i=0;i<n;i++) {
      if (octal) {
         unsigned char value = *symbol[i];
         sprintf(text,"@\\ %3o",value);
      } else {
         strcpy(text,symbol[i]);
      }
      t->DrawText(xc0,y,text);
      sprintf(text,"%s",symbol[i]);
      t->DrawText(xc1,y,text);
      sprintf(text,"`%s",symbol[i]);
      t->DrawText(xc2,y,text);
      sprintf(text,"'%s",symbol[i]);
      t->DrawText(xc3,y,text);
      sprintf(text,"~%s",symbol[i]);
      t->DrawText(xc4,y,text);
      y -= dy;
   }
}
开发者ID:adevress,项目名称:root-1,代码行数:58,代码来源:pstable.C


示例20: pHitSpecDet

TCanvas* pHitSpecDet(const std::string& s)
{
  TCanvas* c = new TCanvas( ("HitSpecDet"+s).c_str(), ("HitSpecDet"+s).c_str(), -2);
  c->SetLogx();
  TH2D* h = (TH2D*)gROOT->FindObject(s.c_str());
  h->GetXaxis()->SetRange(4,32);
  std::stringstream str;
  str<<h->GetTitle();
  TText t;
  t.SetTextColor(4);
  t.SetTextAlign(11);
  t.SetTextSize(0.035);
  h->DrawCopy("box");
  t.DrawTextNDC(0.17,0.2, str.str().c_str());
  return c;
}
开发者ID:konec,项目名称:usercode-L1RpcTriggerAnalysis,代码行数:16,代码来源:plotsHitSpec.C



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ TThinkerIterator类代码示例发布时间:2022-05-31
下一篇:
C++ TTeamMenuItem类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap