JG ROOT Tools libraries  version 5.0 - august 2014
RBaseFunctions.hh File Reference
#include "GGlobal.hh"
#include "GBaseFunctions.hh"
#include "GStringFunctions.hh"
#include "GLogMessage.hh"
#include <Rtypes.h>
#include <TObject.h>
#include <TColor.h>
#include <TAttFill.h>
#include <TSystem.h>
#include <TH1.h>

Go to the source code of this file.

Functions

string RFileExt (const string &name)
 
string RFileBaseName (const string &name)
 
string RFileDirName (const string &name)
 
string RSetFileExt (const string &name, const string &ext)
 
Color_t RGetColor (const string &color_str, Color_t default_val=0)
 
string RColorString (Color_t c, Color_t c_max=50)
 
void RSetPaletteZero (const Double_t vmin, const Double_t vmax, const Double_t vctr=0., const Int_t ncol=20, const Double_t *rgb_min=NULL, const Double_t *rgb_max=NULL, const Double_t *rgb_ctr=NULL)
 
void RSetPaletteZero (const TH1 *hptr, const Double_t vctr=0., const Int_t ncol=20, const Double_t *rgb_min=NULL, const Double_t *rgb_max=NULL, const Double_t *rgb_ctr=NULL)
 
void RSetPaletteZero (const Double_t vmin, const Double_t vmax, const Double_t vctr, const Int_t ncol, const Int_t col_min, const Int_t col_max, const Int_t col_ctr)
 
void RSetPaletteZero (const TH1 *hptr, const Double_t vctr, const Int_t ncol, const Int_t col_min, const Int_t col_max, const Int_t col_ctr)
 

Variables

const char * rExportFileTypes []
 ! File types for graphics exports
 
const char * rTextFileTypes []
 ! File types for text files
 
const char * rRootFileTypes []
 ! File types for ROOT files
 
const char * rFitFileTypes []
 ! File types for fit results
 

Detailed Description

Include file for general purpose functions and global variables.

Function Documentation

string RFileExt ( const string &  name)

Function returning file name extansion.

Parameters
namefile name

Referenced by RAnimSequence3D::CreateSequences(), and RSetFileExt().

string RFileBaseName ( const string &  name)

Function returning base file name, without directory and without extansion.

Parameters
namefile name

Referenced by RAnimSequence3D::CreateSequences().

string RFileDirName ( const string &  name)

Function returning the file directory from the file name.

Parameters
namefile name
string RSetFileExt ( const string &  name,
const string &  ext 
)

Function that sets a selected extansio to a file name. If the file name does not already have an extansion, it is added.

Parameters
namebase name
extextansion

References RFileExt().

Referenced by RGFitDisplayer::ExportPlot(), RGFitBase1D::GuiWriteFct(), RGFitBase2D::GuiWriteFct(), and RGTextMessageRequester::SaveButtonClicked().

Color_t RGetColor ( const string &  color_str,
Color_t  default_val 
)

Read a ROOT color code in a string, either as an integer color code, either as a #RRGGBB code, where RR, GG and BB are the hexadecimal values for color components.

Parameters
color_strinput string
default_valdefault value in case of error

Referenced by RString::ReadColor(), and RString::ReadSubColor().

string RColorString ( Color_t  c,
Color_t  c_max 
)

Write a ROOT color definition in a string. The color is written as a ROOT color number if the color number is lower than c_max, else it is written as its components: #RRGGBB.

Parameters
ccolor number
c_maxmaximum color number for color codes, after which #RRGGBB is written
void RSetPaletteZero ( const Double_t  vmin,
const Double_t  vmax,
const Double_t  vctr,
const Int_t  ncol,
const Double_t *  rgb_min,
const Double_t *  rgb_max,
const Double_t *  rgb_ctr 
)

Function that defines a color palette, from a central color to colors defined for lowest and highest values.

For example, for an histogram with values ranging from -1 to +1, using default values, the functions creates a palette ranging from blue to white for values between -1 and 0, and from white to red for values ranging from 0 to 1.

Colors are defined with RGB values.

Parameters
vminlower value (histograme scale)
vmaxupper value (histograme scale)
vctrcentral value
ncolnumber of colors for the palette
rgb_minRGB color at lower value
rgb_maxRGB color at upper value
rgb_ctrRGB color at central value

Referenced by RFitBase2D::DrawDifResult(), and RSetPaletteZero().

void RSetPaletteZero ( const TH1 *  hptr,
const Double_t  vctr,
const Int_t  ncol,
const Double_t *  rgb_min,
const Double_t *  rgb_max,
const Double_t *  rgb_ctr 
)

Function that defines a color palette, from a central color to colors defined for lowest and highest values.

For example, for an histogram with values ranging from -1 to +1, using default values, the functions creates a palette ranging from blue to white for values between -1 and 0, and from white to red for values ranging from 0 to 1.

Colors are defined with RGB values.

Parameters
hptrhistogram from whiwh lower and upper values are taken
vctrcentral value
ncolnumber of colors for the palette
rgb_minRGB color at lower value
rgb_maxRGB color at upper value
rgb_ctrRGB color at central value

References RSetPaletteZero().

void RSetPaletteZero ( const Double_t  vmin,
const Double_t  vmax,
const Double_t  vctr,
const Int_t  ncol,
const Int_t  col_min,
const Int_t  col_max,
const Int_t  col_ctr 
)

Function that defines a color palette, from a central color to colors defined for lowest and highest values.

For example, for an histogram with values ranging from -1 to +1, using default values, the functions creates a palette ranging from blue to white for values between -1 and 0, and from white to red for values ranging from 0 to 1.

Colors are defined with RGB values.

Parameters
vminlower value (histograme scale)
vmaxupper value (histograme scale)
vctrcentral value
ncolnumber of colors for the palette
col_mincolor number for lower value
col_maxcolor number for upper value
col_ctrcolor number for central value

References RSetPaletteZero().

void RSetPaletteZero ( const TH1 *  hptr,
const Double_t  vctr,
const Int_t  ncol,
const Int_t  col_min,
const Int_t  col_max,
const Int_t  col_ctr 
)

Function that defines a color palette, from a central color to colors defined for lowest and highest values.

For example, for an histogram with values ranging from -1 to +1, using default values, the functions creates a palette ranging from blue to white for values between -1 and 0, and from white to red for values ranging from 0 to 1.

Colors are defined with RGB values.

Parameters
hptrhistogram from whiwh lower and upper values are taken
vctrcentral value
ncolnumber of colors for the palette
col_mincolor number for lower value
col_maxcolor number for upper value
col_ctrcolor number for central value

References RSetPaletteZero().