LISTSERV mailing list manager LISTSERV 16.5

Help for VUB-RECOIL Archives


VUB-RECOIL Archives

VUB-RECOIL Archives


VUB-RECOIL@LISTSERV.SLAC.STANFORD.EDU


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

VUB-RECOIL Home

VUB-RECOIL Home

VUB-RECOIL  January 2002

VUB-RECOIL January 2002

Subject:

TLatex and similar stuff

From:

Urs Langenegger <[log in to unmask]>

Reply-To:

[log in to unmask]

Date:

29 Jan 2002 16:24:30 -0800 (PST)Tue, 29 Jan 2002 16:24:30 -0800 (PST)

Content-Type:

TEXT/PLAIN

Parts/Attachments:

Parts/Attachments

TEXT/PLAIN (95 lines)


Hoi,

the following might be useful in the daily struggle.

  // ----------------------------------------------------------------------
  // I include this in my rootlogon.C (see e.g. ~ursl/rootlogon.C): 

  gROOT->SetStyle("Plain");


  // ----------------------------------------------------------------------
  // axes labelling is 'short' with the following. There is something
  // similiar in recoilAnalysis.cc (recoilAnalysis::setTitles)

  void SetTitles(TH1 *h, char *sx, char *sy, float size = 0.05, 
                 float xoff = 1.1, float yoff = 1.0, 
                 float lsize = 0.05, 
                 int font = 62) {
    h->SetXTitle(sx);                  h->SetYTitle(sy); 
    h->SetTitleOffset(xoff, "x");      h->SetTitleOffset(yoff, "y");
    h->SetTitleSize(size, "x");        h->SetTitleSize(size, "y");
    h->SetLabelSize(lsize, "x");       h->SetLabelSize(lsize, "y");
    h->SetNdivisions(508, "X");
    //  h->SetLabelFont(font, "x");        h->SetLabelFont(font, "y");
    //  h->GetXaxis()->SetTitleFont(font); h->GetYaxis()->SetTitleFont(font);

  }


  // ----------------------------------------------------------------------
  // For a legend: I usually define in global scope

  TLegend *leg;
  TLegendEntry *entry;

  // and then use in a function (where h1 and h2 are TH1D*): 

  leg = new TLegend(0.5,0.74,0.9,0.89);
  leg->SetFillStyle(0); leg->SetBorderSize(0.); leg->SetTextSize(0.06);  leg->SetFillColor(0); 
  leg->SetHeader("No depletion");
  entry = leg->AddEntry(h1," Data","p");  entry->SetTextColor(kBlack);
  entry = leg->AddEntry(h2,"Cocktail","f"); entry->SetTextColor(kBlack);
  leg->Draw();


  // ----------------------------------------------------------------------
  // For lines, in global scope: 

  TLine *pl = new TLine();

  // and then usage ad libitum with (x is some float here)
  pl->SetLineColor(kRed); pl->SetLineWidth(2); pl->DrawLine(x, -5., x, max);


  // ----------------------------------------------------------------------
  // For texts, in global scope: 

  TLatex tl;

  // and then, e.g.
  
  char line[100]; sprintf(line, "normalized to %3.1f/fb", scale);
  c4->cd(11); tl.SetTextSize(0.1); tl.DrawLatex(0., 0.7, line); tl.SetTextSize(bla);
  tl.DrawLatex(0.1, 0.92, "Background Box, no PID, all other cuts");

  // you can also include most (many) of the usual LaTex symbols when
  // preceded with '#'. If the margin at the bottom of a pad is too
  // small, the subscript will not show up. It is (often) necessary,
  // to put the exponent into braces:   GeV^{2} 

  // Note:  you can  set the coordinate  system to  either 'normalized
  // coordinates'  (so  that a  pad  extends  from 0  ..  1),  or to  the
  // histogram coordinates (so  that the values on the  axes are taken as
  // reference system):
  
  tl.SetNDC(kTRUE);  // sets to normalized coordinates


The separation betwen  global scope and local scope  is useful against
CINT's limitations.


Another  useful class  if you  do not  like the  verbosity of  root is
~ursl/macros/FsxUtil/hpl.cc. Still under development, ...


I tried to  remember most of the stumbling blocks,  please let me know
if you run into other problems.

Cheers,
--U.


Top of Message | Previous Page | Permalink

Advanced Options


Options

Log In

Log In

Get Password

Get Password


Search Archives

Search Archives


Subscribe or Unsubscribe

Subscribe or Unsubscribe


Archives

March 2010
December 2009
August 2009
January 2009
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
December 2001
November 2001
October 2001

ATOM RSS1 RSS2



LISTSERV.SLAC.STANFORD.EDU

Secured by F-Secure Anti-Virus CataList Email List Search Powered by the LISTSERV Email List Manager

Privacy Notice, Security Notice and Terms of Use