AliPhysics  914d8ff (914d8ff)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliceLogo Struct Reference

Public Types

enum  ETag { kNone = 0, kPreliminary, kPerformance }
 
enum  {
  kBW = 0, kText = 0x1, kL3 = 0x2, kParticles = 0x4,
  kMany = 0x8, kPad = 0x10, kReverse = 0x20
}
 

Public Member Functions

 AliceLogo (Bool_t debug=false)
 
void Draw (TVirtualPad *p, Double_t x=.77, Double_t y=.35, Double_t h=.25, const TString &tag="", const TString &colors="")
 
void Draw (TVirtualPad *p, Double_t x, Double_t y, Double_t h, UShort_t tag, UInt_t color)
 
void DrawL3 (UInt_t color, Int_t bg)
 
void DrawSpoke (Int_t ang, Double_t w, Double_t len, Int_t fg)
 
void DrawALICE (Int_t fg, Int_t bg)
 
void DrawA (Double_t x, Double_t y, Double_t w, Double_t a, Int_t fg, Int_t bg)
 
void DrawL (Double_t x, Double_t y, Double_t w, Double_t a, Int_t fg)
 
void DrawI (Double_t x, Double_t y, Double_t w, Double_t a, Int_t fg)
 
void DrawC (Double_t x, Double_t y, Double_t a, Int_t fg, Int_t bg)
 
void DrawE (Double_t x, Double_t y, Double_t w, Double_t a, Int_t fg)
 
void DrawF (Double_t x, Double_t y, Double_t w, Double_t a, Int_t fg)
 
void DrawLabel (Int_t fg, Int_t bg, bool preliminary=true)
 
void DrawO (Double_t x, Double_t y, Double_t w, Double_t a, Int_t fg, Int_t bg)
 
void DrawP (Double_t x, Double_t y, Double_t w, Double_t a, Int_t fg, Int_t bg)
 
void DrawR (Double_t x, Double_t y, Double_t w, Double_t a, Int_t fg, Int_t bg)
 
void DrawM (Double_t x, Double_t y, Double_t w, Double_t a, Int_t fg)
 
void DrawN (Double_t x, Double_t y, Double_t w, Double_t a, Int_t fg)
 
void DrawY (Double_t x, Double_t y, Double_t w, Double_t a, Int_t fg)
 
void SetAttr (TAttLine *lne, TAttFill *fll, Int_t col)
 
Double_t GetX1 () const
 
Double_t GetX2 () const
 
Double_t GetY1 () const
 
Double_t GetY2 () const
 
Double_t GetCX () const
 
Double_t GetCY () const
 

Static Public Member Functions

static UInt_t ParseColors (const TString &what)
 
static UShort_t ParseTag (const TString &what)
 
static void Test (const TString &what)
 
static void Test (UShort_t tag, UInt_t col, Bool_t debug)
 
static void Check (const TString &what)
 
static void Check (UShort_t tag, UInt_t col, Bool_t debug=true)
 

Public Attributes

TVirtualPad * fPad
 
Double_t fAspect
 
Double_t fL3Thick
 
Double_t fL3Height
 
Double_t fL3Width
 
Bool_t fDebug
 
Int_t fRed
 
Int_t fYellow
 
Int_t fPink
 
Int_t fBlue
 

Detailed Description

Structure to draw the ALICE logo on a pad (canvas). The logo and text is drawn using ROOT primitives and the result is somewhat scalable.

Note, you can save the logo as a PNG, PDF, or SVG to include it in some other document or the like.

How to use

{
TH1* h = new TH1F("h", "h", 60, -3, 3);
h->SetFillColor(kRed+1);
h->SetFillStyle(3001);
h->FillRandom("gaus");
h->Draw();
gROOT->LoadMacro("AliceLogo.C");
AliceLogo* al = new AliceLogo();
// al->Draw(0, .75, .4, .25, "preliminary");
// al->Draw(0, .75, .4, .25, "performance");
// al->Draw(0, .75, .4, .25, "","text l3 many particles");
al->Draw(0, .75, .4, .25, "preliminary", "text l3 many particles");
}

There are many options for colours and options for preliminary, performance and just the logo.

The logo produced does not exactly match the logos found on the ALICE web-site

https://aliceinfo.cern.ch/Figure/alice_logo

In particular, the 'C' was hard to get right. However, the logo does follow the charter as described in

http://aliweb.cern.ch/system/files/documents/charter/charte_A5_120628.pdf

Use the static member function(s) AliceLogo::Check to see how well this code reproduces the logos. Note, you need the official logos in PNG format for this. Here's a list of places to get them:

Author
Christian Holm Christensen cholm.nosp@m.@nbi.nosp@m..dk

Definition at line 65 of file AliceLogo.C.

Member Enumeration Documentation

anonymous enum

Colour options

Enumerator
kBW 
kText 
kL3 
kParticles 
kMany 
kPad 
kReverse 

Definition at line 78 of file AliceLogo.C.

Tags

Enumerator
kNone 
kPreliminary 
kPerformance 

Definition at line 70 of file AliceLogo.C.

Constructor & Destructor Documentation

AliceLogo::AliceLogo ( Bool_t  debug = false)
inline

Constructor

Definition at line 90 of file AliceLogo.C.

Referenced by Check(), and Test().

Member Function Documentation

static void AliceLogo::Check ( const TString what)
inlinestatic

Check compatiblity by overlaying this logo on 'official' images

Parameters
what

Definition at line 967 of file AliceLogo.C.

static void AliceLogo::Check ( UShort_t  tag,
UInt_t  col,
Bool_t  debug = true 
)
inlinestatic

Check compatiblity by overlaying this logo on 'official' images

Parameters
tag
col
debug

Definition at line 979 of file AliceLogo.C.

void AliceLogo::Draw ( TVirtualPad *  p,
Double_t  x = .77,
Double_t  y = .35,
Double_t  h = .25,
const TString tag = "",
const TString colors = "" 
)
inline

Draw everything

Parameters
pPad to draw in
xStarting X position
yStarting Y position
hRelative height
tagTag
colorsColor options

Definition at line 145 of file AliceLogo.C.

Referenced by Check(), and Test().

void AliceLogo::Draw ( TVirtualPad *  p,
Double_t  x,
Double_t  y,
Double_t  h,
UShort_t  tag,
UInt_t  color 
)
inline

Draw everything

Parameters
pPad to draw in
xStarting X position
yStarting Y position
hRelative height
tagTag
colorColor options

Definition at line 160 of file AliceLogo.C.

void AliceLogo::DrawA ( Double_t  x,
Double_t  y,
Double_t  w,
Double_t  a,
Int_t  fg,
Int_t  bg 
)
inline

Draw the letter A

Parameters
xBase X coordinate
yBase Y coordinate
wLine width
aAspect ratio of pad
fgForeground colour
bgBackground colour

Definition at line 476 of file AliceLogo.C.

Referenced by DrawALICE(), and DrawLabel().

void AliceLogo::DrawALICE ( Int_t  fg,
Int_t  bg 
)
inline

Draw the text ALICE in a separate pad

Definition at line 409 of file AliceLogo.C.

Referenced by Draw().

void AliceLogo::DrawC ( Double_t  x,
Double_t  y,
Double_t  a,
Int_t  fg,
Int_t  bg 
)
inline

Draw the letter C

Parameters
xBase X coordinate
yBase Y coordinate
aAspect ratio of pad
fgForeground colour
bgBackground colour

Definition at line 559 of file AliceLogo.C.

Referenced by DrawALICE(), and DrawLabel().

void AliceLogo::DrawE ( Double_t  x,
Double_t  y,
Double_t  w,
Double_t  a,
Int_t  fg 
)
inline

Draw the letter E

Parameters
xBase X coordinate
yBase Y coordinate
wLine width
aAspect ratio of pad
fgForeground colour

Definition at line 629 of file AliceLogo.C.

Referenced by DrawALICE(), and DrawLabel().

void AliceLogo::DrawF ( Double_t  x,
Double_t  y,
Double_t  w,
Double_t  a,
Int_t  fg 
)
inline

Draw the letter F

Parameters
xBase X coordinate
yBase Y coordinate
wLine width
aAspect ratio of pad
fgForeground colour

Definition at line 648 of file AliceLogo.C.

Referenced by DrawLabel().

void AliceLogo::DrawI ( Double_t  x,
Double_t  y,
Double_t  w,
Double_t  a,
Int_t  fg 
)
inline

Draw the letter I

Parameters
xBase X coordinate
yBase Y coordinate
wLine width
aAspect ratio of pad
fgForeground colour

Definition at line 542 of file AliceLogo.C.

Referenced by DrawALICE(), and DrawLabel().

void AliceLogo::DrawL ( Double_t  x,
Double_t  y,
Double_t  w,
Double_t  a,
Int_t  fg 
)
inline

Draw the letter L

Parameters
xBase X coordinate
yBase Y coordinate
wLine width
aAspect ratio of pad
fgForeground colour

Definition at line 526 of file AliceLogo.C.

Referenced by DrawALICE(), and DrawLabel().

void AliceLogo::DrawL3 ( UInt_t  color,
Int_t  bg 
)
inline

Draw the L3 outline. Note, this is put in a sub-pad of it's own.

Parameters
colorColour flags
bgBackground color

Definition at line 253 of file AliceLogo.C.

Referenced by Draw().

void AliceLogo::DrawLabel ( Int_t  fg,
Int_t  bg,
bool  preliminary = true 
)
inline

Draw the label text ("Preliminary" or "Performance") in it's own pad

Parameters
fgForeground colour
bgBackground colour
preliminaryIf true, draw preliminary, otherwise performance

Definition at line 664 of file AliceLogo.C.

Referenced by Draw().

void AliceLogo::DrawM ( Double_t  x,
Double_t  y,
Double_t  w,
Double_t  a,
Int_t  fg 
)
inline

Draw the letter M

Parameters
xBase X coordinate
yBase Y coordinate
wLine width
aAspect ratio of pad
fgForeground colour

Definition at line 811 of file AliceLogo.C.

Referenced by DrawLabel().

void AliceLogo::DrawN ( Double_t  x,
Double_t  y,
Double_t  w,
Double_t  a,
Int_t  fg 
)
inline

Draw the letter N

Parameters
xBase X coordinate
yBase Y coordinate
wLine width
aAspect ratio of pad
fgForeground colour

Definition at line 842 of file AliceLogo.C.

Referenced by DrawLabel().

void AliceLogo::DrawO ( Double_t  x,
Double_t  y,
Double_t  w,
Double_t  a,
Int_t  fg,
Int_t  bg 
)
inline

Draw the letter O

Parameters
xBase X coordinate
yBase Y coordinate
wLine width
aAspect ratio of pad
fgForeground colour
bgBackground colour

Definition at line 731 of file AliceLogo.C.

Referenced by DrawLabel().

void AliceLogo::DrawP ( Double_t  x,
Double_t  y,
Double_t  w,
Double_t  a,
Int_t  fg,
Int_t  bg 
)
inline

Draw the letter P

Parameters
xBase X coordinate
yBase Y coordinate
wLine width
aAspect ratio of pad
fgForeground colour
bgBackground colour

Definition at line 752 of file AliceLogo.C.

Referenced by DrawLabel(), and DrawR().

void AliceLogo::DrawR ( Double_t  x,
Double_t  y,
Double_t  w,
Double_t  a,
Int_t  fg,
Int_t  bg 
)
inline

Draw the letter R

Parameters
xBase X coordinate
yBase Y coordinate
wLine width
aAspect ratio of pad
fgForeground colour
bgBackground colour

Definition at line 780 of file AliceLogo.C.

Referenced by DrawLabel().

void AliceLogo::DrawSpoke ( Int_t  ang,
Double_t  w,
Double_t  len,
Int_t  fg 
)
inline

Draw a spoke in the L3 outline.

Parameters
angRotation angle in degrees.
wWidth
lenLength of spoke
fgForeground colour

Definition at line 367 of file AliceLogo.C.

Referenced by DrawL3().

void AliceLogo::DrawY ( Double_t  x,
Double_t  y,
Double_t  w,
Double_t  a,
Int_t  fg 
)
inline

Draw the letter Y

Parameters
xBase X coordinate
yBase Y coordinate
wLine width
aAspect ratio of pad
fgForeground colour

Definition at line 874 of file AliceLogo.C.

Referenced by DrawLabel().

Double_t AliceLogo::GetCX ( ) const
inline

Definition at line 926 of file AliceLogo.C.

Double_t AliceLogo::GetCY ( ) const
inline

Definition at line 927 of file AliceLogo.C.

Double_t AliceLogo::GetX1 ( ) const
inline

Definition at line 922 of file AliceLogo.C.

Referenced by Draw(), GetCX(), and GetX2().

Double_t AliceLogo::GetX2 ( ) const
inline

Definition at line 923 of file AliceLogo.C.

Referenced by Draw(), and GetCX().

Double_t AliceLogo::GetY1 ( ) const
inline

Definition at line 924 of file AliceLogo.C.

Referenced by Draw(), GetCY(), and GetY2().

Double_t AliceLogo::GetY2 ( ) const
inline

Definition at line 925 of file AliceLogo.C.

Referenced by Draw(), and GetCY().

static UInt_t AliceLogo::ParseColors ( const TString what)
inlinestatic

Parse a string with colour options

Parameters
what
Returns
Colour flags

Definition at line 110 of file AliceLogo.C.

Referenced by Check(), Draw(), and Test().

static UShort_t AliceLogo::ParseTag ( const TString what)
inlinestatic

Parse a tag string

Parameters
whatString to parse
Returns
Tag

Definition at line 128 of file AliceLogo.C.

Referenced by Check(), Draw(), and Test().

void AliceLogo::SetAttr ( TAttLine *  lne,
TAttFill *  fll,
Int_t  col 
)
inline

Set Line and Fill attributes

Parameters
lneLine attribute interface
fllFill attribute interface
colColour

Definition at line 911 of file AliceLogo.C.

Referenced by DrawA(), DrawC(), DrawE(), DrawF(), DrawI(), DrawL(), DrawL3(), DrawM(), DrawN(), DrawO(), DrawP(), DrawR(), DrawSpoke(), and DrawY().

static void AliceLogo::Test ( const TString what)
inlinestatic

run a simple test

Parameters
what

Definition at line 933 of file AliceLogo.C.

static void AliceLogo::Test ( UShort_t  tag,
UInt_t  col,
Bool_t  debug 
)
inlinestatic

Run a simple test

Parameters
tag
col
debug

Definition at line 945 of file AliceLogo.C.

Member Data Documentation

Double_t AliceLogo::fAspect

Definition at line 1030 of file AliceLogo.C.

Referenced by Draw().

Int_t AliceLogo::fBlue

Definition at line 1038 of file AliceLogo.C.

Referenced by AliceLogo(), Draw(), and DrawL3().

Bool_t AliceLogo::fDebug

Definition at line 1034 of file AliceLogo.C.

Referenced by Draw(), DrawALICE(), DrawC(), DrawL3(), DrawLabel(), DrawN(), DrawY(), and SetAttr().

Double_t AliceLogo::fL3Height

Definition at line 1032 of file AliceLogo.C.

Referenced by Draw(), DrawALICE(), and DrawL3().

Double_t AliceLogo::fL3Thick

Definition at line 1031 of file AliceLogo.C.

Referenced by Draw(), DrawALICE(), and DrawL3().

Double_t AliceLogo::fL3Width

Definition at line 1033 of file AliceLogo.C.

Referenced by Draw(), DrawALICE(), and DrawL3().

TVirtualPad* AliceLogo::fPad

Definition at line 1029 of file AliceLogo.C.

Referenced by Draw(), DrawALICE(), DrawL3(), DrawLabel(), GetCX(), GetCY(), GetX1(), GetX2(), GetY1(), and GetY2().

Int_t AliceLogo::fPink

Definition at line 1037 of file AliceLogo.C.

Referenced by AliceLogo(), and DrawL3().

Int_t AliceLogo::fRed

Definition at line 1035 of file AliceLogo.C.

Referenced by AliceLogo(), and DrawL3().

Int_t AliceLogo::fYellow

Definition at line 1036 of file AliceLogo.C.

Referenced by AliceLogo(), and DrawL3().


The documentation for this struct was generated from the following file: