メインページ   モジュール   クラス階層   アルファベット順一覧   構成   ファイル一覧   構成メンバ   ファイルメンバ   関連ページ    

Trootinit.h

解説を見る。
00001 // =====================================================================
00021 // =====================================================================
00022 #ifndef __TROOTINIT_H
00023 #define __TROOTINIT_H
00024 //#ifdef __CLDAQ_ROOT_USE
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   //const Color_t histfillcolor = 21;
00060   const Int_t optstat = 1111110;
00061   const Int_t optfit = 1111;
00062   const Int_t transparence = 10;
00063   //const Int_t titlecolor = transparence;
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   //const Float_t datex = 0.88;
00076   //const Float_t datey = 0.91;
00077   //const Int_t maxdigits = 6;
00078 
00079   const Style_t markerstyle = 21;
00080   //const Color_t markercolor = 2;
00081   //const Size_t markersize = 1;
00082   //const Color_t funccolor = 4;
00083   //const Style_t funcstyle = 1;
00084   //const Width_t funcwidth = 5;
00085   // ===================================================================
00086 
00087 
00088 
00089   // Pad
00090   gStyle -> SetPadTickX( kTRUE );
00091   gStyle -> SetPadTickY( kTRUE );
00092   //gStyle -> SetPadGridX( kTRUE );
00093   //gStyle -> SetPadGridY( kTRUE );
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   // Status
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   // Frame
00113   //gStyle -> SetFrameFillColor( 21 );
00114   //gStyle -> SetFrameFillColor( 3 );
00115   //gStyle -> SetFrameFillStyle( 1001 );
00116   gStyle -> SetFrameBorderMode( 0 );
00117   gStyle -> SetFrameBorderSize( 0 );
00118   gStyle -> SetFrameFillColor( framefillcolor );
00119   gStyle -> SetFrameFillStyle( 0 );
00120 
00121 
00122 
00123   // Canvas
00124   gStyle -> SetCanvasBorderMode( 0 );
00125   gStyle -> SetCanvasBorderSize( 0 );
00126   gStyle -> SetCanvasColor( canvascolor );
00127 
00128 
00129 
00130   // Histogram
00131   //gStyle -> SetHistFillColor( transparence );
00132 
00133   // Marker
00134   gStyle -> SetMarkerStyle( markerstyle );
00135   //gStyle -> SetMarkerColor( markercolor );
00136   //gStyle -> SetMarkerSize( markersize );
00137 
00138 
00139   // Function
00140   //gStyle -> SetFuncColor( funccolor );
00141   //gStyle -> SetFuncStyle( funcstyle );
00142   //gStyle -> SetFuncWidth( funcwidth );
00143 
00144 
00145 
00146 
00147 
00148   // Option
00149   gStyle -> SetOptStat( optstat );
00150   gStyle -> SetOptFit( optfit );
00151 
00152 
00153   // title
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   //  TGaxis *axis;
00164   //  Int_t kCenterTitle = 1<<12;
00165   //TGaxis::SetMaxDigits( maxdigits );
00166   gStyle -> SetPaperSize( TStyle::kA4 );
00167 
00168 
00169   // Date
00170   //gStyle -> SetOptDate( 3 );
00171   //gStyle -> SetDateX( datex );
00172   //gStyle -> SetDateY( datey );
00173 
00174   // Palette
00175   gStyle -> SetPalette( 1 );
00176 
00177   return app;
00178 }
00179 
00180 //#endif
00181 #endif

CLDAQ - a Class Library for Data AcQuisition (Version 1.11.0)
Go IWAI <goiwai@users.sourceforge.jp>