00001
00021
00022 #ifndef __TROOTINIT_H
00023 #define __TROOTINIT_H
00024
00025
00026 #include <TROOT.h>
00027 #include <TSystem.h>
00028 #include <TApplication.h>
00029 #include <TStyle.h>
00030 #include <TGraph.h>
00031 #include <TGraphErrors.h>
00032 #include <TH1.h>
00033 #include <TH2.h>
00034 #include <TCanvas.h>
00035 #include <TNtuple.h>
00036 #include <TFile.h>
00037 #include <TPad.h>
00038 #include <TF1.h>
00039 #include <TLegend.h>
00040 #include <TPaveText.h>
00041 #include <TRandom.h>
00042 #include <TStopwatch.h>
00043 #include <TGaxis.h>
00044 #include <TLatex.h>
00045 #include <TPaveStats.h>
00046
00047 #include "Tglobals.h"
00048
00049 inline static TApplication* rootinit( const Tstring& name = "ROOTANALYSER", Tint* argc = 0, Tchar** argv = 0 )
00050 {
00051 TApplication* app = new TApplication( name.c_str(), argc, argv );
00052 gROOT -> Reset( 0 );
00053
00054
00055 const Float_t padmargint = 0.12;
00056 const Float_t padmarginb = 0.12;
00057 const Float_t padmarginr = 0.04;
00058 const Float_t padmarginl = 0.12;
00059
00060 const Int_t optstat = 1111110;
00061 const Int_t optfit = 1111;
00062 const Int_t transparence = 10;
00063
00064 const Float_t titlew = 1.0 - padmarginl - padmarginr;
00065 const Float_t titleh = padmargint / 2.0;
00066 const Float_t titlex = padmarginl;
00067 const Float_t titley = 1.0 - titleh + padmargint / 10.0;
00068
00069 const Int_t statcolor = transparence;
00070 const Float_t statx = 1.0 - padmarginr;
00071 const Float_t statw = 0.32;
00072 const Float_t staty = 1.0 - padmargint;
00073 const Int_t framefillcolor = transparence;
00074 const Int_t canvascolor = transparence;
00075
00076
00077
00078
00079 const Style_t markerstyle = 21;
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090 gStyle -> SetPadTickX( kTRUE );
00091 gStyle -> SetPadTickY( kTRUE );
00092
00093
00094 gStyle -> SetPadBorderSize( 0 );
00095 gStyle -> SetPadBorderMode( 0 );
00096 gStyle -> SetPadTopMargin( padmargint );
00097 gStyle -> SetPadBottomMargin( padmarginb );
00098 gStyle -> SetPadRightMargin( padmarginr );
00099 gStyle -> SetPadLeftMargin( padmarginl );
00100
00101
00102
00103
00104 gStyle -> SetStatBorderSize( 1 );
00105 gStyle -> SetStatColor( statcolor );
00106 gStyle -> SetStatStyle( 0 );
00107 gStyle -> SetStatX( statx );
00108 gStyle -> SetStatW( statw );
00109 gStyle -> SetStatY( staty );
00110
00111
00112
00113
00114
00115
00116 gStyle -> SetFrameBorderMode( 0 );
00117 gStyle -> SetFrameBorderSize( 0 );
00118 gStyle -> SetFrameFillColor( framefillcolor );
00119 gStyle -> SetFrameFillStyle( 0 );
00120
00121
00122
00123
00124 gStyle -> SetCanvasBorderMode( 0 );
00125 gStyle -> SetCanvasBorderSize( 0 );
00126 gStyle -> SetCanvasColor( canvascolor );
00127
00128
00129
00130
00131
00132
00133
00134 gStyle -> SetMarkerStyle( markerstyle );
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149 gStyle -> SetOptStat( optstat );
00150 gStyle -> SetOptFit( optfit );
00151
00152
00153
00154 gStyle -> SetTitleBorderSize( 0 );
00155 gStyle -> SetTitleStyle( 0 );
00156 gStyle -> SetTitleX( titlex );
00157 gStyle -> SetTitleY( titley );
00158 gStyle -> SetTitleW( titlew );
00159 gStyle -> SetTitleH( titleh );
00160
00161
00162
00163
00164
00165
00166 gStyle -> SetPaperSize( TStyle::kA4 );
00167
00168
00169
00170
00171
00172
00173
00174
00175 gStyle -> SetPalette( 1 );
00176
00177 return app;
00178 }
00179
00180
00181 #endif