My Root configuration

First read ROOT_Installation/Architecture.
The files rootlogon.C and myRootFunctions.C should be linked everywhere you have some pieces of code.

1. rootlogon.C

Here's my rootlogon.C.

2. myRootFunctions.C

Here's one of the function in myRootFunctions.C:

----------------------------------------------------------------------------
void MRF_setStatsPosition (TH1 *histo, Int_t color, Double_t x1, Double_t y1, Double_t x2, Double_t y2, Double_t textSize=-1., Bool_t fill=kFALSE, Bool_t setoptfit=kFALSE, Int_t borderSize=1) { TPaveStats *statbox = (TPaveStats*) histo->GetListOfFunctions()->FindObject("stats") ; if ( !statbox ) { fprintf (stderr, "\n\n!!! Error in 'MRF_setStatsPosition': histogram '%s' does not have a statbox. \n\n",histo->GetName()) ; getchar() ; exit(1) ; } else { statbox->SetTextColor(color) ; statbox->SetLineColor(color) ; statbox->SetShadowColor(kWhite) ; statbox->SetX1NDC(x1) ; statbox->SetY1NDC(y1) ; statbox->SetX2NDC(x2) ; statbox->SetY2NDC(y2) ; if ( textSize != -1. ) { statbox->SetTextSize(textSize) ; } statbox->SetShadowColor(kWhite) ; statbox->SetBorderSize(borderSize) ; if ( fill ) { statbox->SetFillStyle(1) ; statbox->SetFillColor(kWhite) ; } else { statbox->SetFillStyle(0) ; } if ( !setoptfit ) { statbox->SetOptFit(0) ; } } return ; } ----------------------------------------------------------------------------

It should be called this way in your program:

----------------------------------------------------------------------------
#include "myRootFunctions.C" // ... void myFunction () { // TH1F* histo = new TH1F ... // histo->Draw() ; MRF_setStatsPosition (histo, kRed, 0.66,0.55,0.91,0.87) ; return ; } ----------------------------------------------------------------------------

3. Coding conventions

For proper Root coding, please see here
If you use NEdit, please see here.


Back to Table of Contents
Copyright: Mathieu Trocmé, Mon 28 Dec 2009 (14:13:46)