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