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