Cheers,
Nick.
*----------------------------------------------------------------------*
Dr. Nick van Eijndhoven Department of Subatomic Physics
email : nick@fys.ruu.nl Utrecht University / NIKHEF
tel. +31-30-2532331 (direct) P.O. Box 80.000
tel. +31-30-2531492 (secr.) NL-3508 TA Utrecht
fax. +31-30-2518689 The Netherlands
WWW : http://www.fys.ruu.nl/~nick Office : Ornstein lab. 172
----------------------------------------------------------------------
tel. +41-22-7679751 (direct) CERN PPE Division / ALICE exp.
tel. +41-22-7675857 (secr.) CH-1211 Geneva 23
fax. +41-22-7679480 Switzerland
CERN beep : 13+7294 Office : B 160 1-012
*----------------------------------------------------------------------*
#################################################################
# Global .rootrc for ROOT sessions/jobs.
# More specific functionality can be obtained by providing a
# customized file ".rootrc" in the working directory.
#
# --- NvE 09-oct-1997 UU-SAP Utrecht
#################################################################
### Set search paths
WinNT.*.Root.DynamicPath: .;c:\nick\libs\root;%ROOTSYS%\lib
WinNT.*.Root.MacroPath: .;c:\nick
### Identify logon etc... files
Rint.Load: c:\nick\rootalias.cc
Rint.Logon: c:\nick\rootlogon.cc
Rint.Logoff: c:\nick\rootlogoff.cc
### (De)Activate memory statistics
Rint.Root.MemStat: 0
///////////////////////////////////////////////////////////////////////////
// General ROOT logon facility.
// More specific logon functionality can be obtained by providing a
// customized file "rootlogon.cc" in the working directory.
//
// --- NvE 09-oct-1997 UU-SAP Utrecht
///////////////////////////////////////////////////////////////////////////
void rootlogon()
{
#include <iostream.h>
TDatime start;
int idate=start.GetDate();
int itime=start.GetTime();
int year=idate/10000;
int month=(idate%10000)/100;
int day=idate%100;
int hh=itime/10000;
int mm=(itime%10000)/100;
int ss=itime%100;
char* c[12]={"jan","feb","mar","apr","may","jun",
"jul","aug","sep","oct","nov","dec"}
cout << endl;
cout << endl;
cout << " --- Welcome to the ROOT general session --- " << endl;
cout << endl;
cout << " --- Tree and RALICE classes are loaded by default --- " << endl;
cout << endl;
cout << " *** Start at Date : " << day << "-" << c[month-1] << "-" << year
<< " Time : " << hh << ":" << mm << ":" << ss << " ***" << endl;
cout << endl;
// Make the Tree facilities available
gSystem->Load("Root_Tree.dll");
// Make the RALICE facilities available
gSystem->Load("ralice.dll");
// Default white background for all plots
gStyle->SetCanvasColor(10);
gStyle->SetStatColor(10);
gStyle->SetTitleColor(10);
gStyle->SetPadColor(10);
// Settings for statistics information
gStyle->SetOptFit(1);
gStyle->SetOptStat(1);
}
///////////////////////////////////////////////////////////////////////////
// General ROOT logoff facility.
// More specific logoff functionality can be obtained by providing a
// customized file "rootlogoff.cc" in the working directory.
//
// --- NvE 09-oct-1997 UU-SAP Utrecht
///////////////////////////////////////////////////////////////////////////
void rootlogoff()
{
TDatime stop;
int idate=stop.GetDate();
int itime=stop.GetTime();
int year=idate/10000;
int month=(idate%10000)/100;
int day=idate%100;
int hh=itime/10000;
int mm=(itime%10000)/100;
int ss=itime%100;
char* c[12]={"jan","feb","mar","apr","may","jun",
"jul","aug","sep","oct","nov","dec"}
cout << endl;
cout << endl;
cout << " --- General ROOT session ended --- " << endl;
cout << endl;
cout << " *** Stop at Date : " << day << "-" << c[month-1] << "-" << year
<< " Time : " << hh << ":" << mm << ":" << ss << " ***" << endl;
cout << endl;
}
///////////////////////////////////////////////////////////////////////////
// File to load various global aliases and utilities at ROOT startup
// This file is loaded by .rootrc
// --- NvE 27-mar-1997 UU-SAP Utrecht
///////////////////////////////////////////////////////////////////////////
// The chi-distribution facility
void chi(TH1* histo)
{
//*** Plot the chi=val/err distribution of a certain histo ***
// Obtain number of bins
int nbx=histo->GetNbinsX();
TH1F* chi_dist = gROOT->FindObject("chi_dist");
if (chi_dist) chi_dist->Delete();
chi_dist = new TH1F("chi_dist","Chi distribution",100,-10.,10.);
float val,err,chi;
for (int i=0; i<nbx; i++)
{
val=histo->GetBinContent(i+1);
err=histo->GetBinError(i+1);
chi=0.;
if (fabs(err) > 0) chi=val/err;
chi_dist->Fill(chi);
}
// Draw the resulting chi distribution
chi_dist->Draw();
}
///////////////////////////////////////////////////////////////////////////