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

Trootinit.h

解説を見る。
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 //inline static TApplication* rootinit( const Tstring& style = "", const Tstring& name = "CLDAQ ROOT Application", Tint* argc = 0, Tchar** argv = 0 )
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     //const Color_t histfillcolor = 21;
00079     const Int_t optstat = 1111110;
00080     const Int_t optfit = 1111;
00081     const Int_t transparence = 10;
00082     //const Int_t titlecolor = transparence;
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     //const Float_t datex = 0.88;
00095     //const Float_t datey = 0.91;
00096     //const Int_t maxdigits = 6;
00097 
00098     const Style_t markerstyle = 21;
00099     //const Color_t markercolor = 2;
00100     //const Size_t markersize = 1;
00101     //const Color_t funccolor = 4;
00102     //const Style_t funcstyle = 1;
00103     //const Width_t funcwidth = 5;
00104     // ===================================================================
00105 
00106 
00107 
00108     // Pad
00109     gStyle -> SetPadTickX( kTRUE );
00110     gStyle -> SetPadTickY( kTRUE );
00111     //gStyle -> SetPadGridX( kTRUE );
00112     //gStyle -> SetPadGridY( kTRUE );
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     // Status
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     // Frame
00131     //gStyle -> SetFrameFillColor( 21 );
00132     //gStyle -> SetFrameFillColor( 3 );
00133     //gStyle -> SetFrameFillStyle( 1001 );
00134     gStyle -> SetFrameBorderMode( 0 );
00135     gStyle -> SetFrameBorderSize( 0 );
00136     gStyle -> SetFrameFillColor( framefillcolor );
00137     gStyle -> SetFrameFillStyle( 0 );
00138 
00139 
00140 
00141     // Canvas
00142     gStyle -> SetCanvasBorderMode( 0 );
00143     gStyle -> SetCanvasBorderSize( 0 );
00144     gStyle -> SetCanvasColor( canvascolor );
00145 
00146 
00147 
00148     // Histogram
00149     //gStyle -> SetHistFillColor( transparence );
00150 
00151     // Marker
00152     gStyle -> SetMarkerStyle( markerstyle );
00153     //gStyle -> SetMarkerColor( markercolor );
00154     //gStyle -> SetMarkerSize( markersize );
00155 
00156 
00157     // Function
00158     //gStyle -> SetFuncColor( funccolor );
00159     //gStyle -> SetFuncStyle( funcstyle );
00160     //gStyle -> SetFuncWidth( funcwidth );
00161 
00162 
00163 
00164 
00165 
00166     // Option
00167     gStyle -> SetOptStat( optstat );
00168     gStyle -> SetOptFit( optfit );
00169 
00170 
00171     // title
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     //  TGaxis *axis;
00182     //  Int_t kCenterTitle = 1<<12;
00183     //TGaxis::SetMaxDigits( maxdigits );
00184     gStyle -> SetPaperSize( TStyle::kA4 );
00185 
00186 
00187     // Date
00188     //gStyle -> SetOptDate( 3 );
00189     //gStyle -> SetDateX( datex );
00190     //gStyle -> SetDateY( datey );
00191 
00192     // Palette
00193     gStyle -> SetPalette( 1 );
00194   }
00195 
00196   return app;
00197 }
00198 
00199 #endif
00200 #endif

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