/*############################################################################ # # Set global ROOT sytle settings, as the bg. color of the canvases. instead of root.logon.C # ###########################################################################*/ void MyStyle() { //Added by me some settings for graphics and plots /* //Default for Title gStyle->SetOptTitle(0); gStyle->SetTitleFillColor(0); gStyle->SetTitleBorderSize(1); //Default for Canvas gStyle->SetCanvasBorderMode(0); gStyle->SetCanvasColor(0); //Default for Frame gStyle->SetFrameBorderMode(0); //Default for Pad gStyle->SetPadBorderMode(0); gStyle->SetPadColor(0); //Default for ColorPalette being used for 2D Histograms gStyle->SetPalette(1); //Default for Statistics gStyle->SetOptStat(0); gStyle->SetStatColor(0); //Default for Y-Axis gStyle->SetLabelOffset(0,"Y"); //Set maximal amounts of digits drawn at each axis gStyle->TGaxis::SetMaxDigits(3);*/ printf("Using MyStyle.C\n"); // // Set stats // gStyle->SetOptFit(0); // // Set colors // //gStyle->SetPalette(1); gStyle->SetCanvasColor(10); gStyle->SetPadColor(10); gStyle->SetFillColor(10); // eg. Pave test fill box color gStyle->SetTitleFillColor(10); // Hist title box color gStyle->SetStatColor(10); // Stats box fill color // // Set border width // gStyle->SetDrawBorder(0); gStyle->SetPadBorderSize(0); gStyle->SetPadBorderMode(0); gStyle->SetCanvasBorderSize(0); gStyle->SetCanvasBorderMode(0); // Not display as yellow the selected pad // // Set pad margins // //gStyle->SetPadLeftMargin(0.11); //gStyle->SetPadRightMargin(0.1); //gStyle->SetPadTopMargin(0.1); //gStyle->SetPadBottomMargin(0.1); // // Set axis titles offsets // gStyle->SetTitleYOffset(1.15); gStyle->SetTitleXOffset(1.1); // // Set Histogram title size // //gStyle->SetTitleFontSize(0.1); // // Extends the available line styles // gStyle->SetLineStyleString(5,"20 12 4 12"); gStyle->SetLineStyleString(6,"20 12 4 12 4 12 4 12"); gStyle->SetLineStyleString(7,"20 20"); gStyle->SetLineStyleString(8,"20 12 4 12 4 12"); gStyle->SetLineStyleString(9,"80 20"); } //----------------------------------------------- // // Center Histogram titles // CenterTitles() { gStyle->SetTitleX(0.1f); gStyle->SetTitleW(0.8f); gStyle->SetTitleBorderSize(0); // Hist title box border } //----------------------------------------------- // // MarginsOnePad() { gStyle->SetPadRightMargin(0.05); //gStyle->SetPadTopMargin(0.05); } // --------------------------------------------------------------------------- // // Make the current pad symetric (addapted from MHCamera::SetRange() // MakeSymmetric(const Float_t ratio=1.05) { // // Create an own pad for the MHCamera-Object which can be // resized in paint to keep the correct aspect ratio // gPad->Divide(1, 1, 0, 0, 10); gPad->cd(1); const Float_t range = 1.0; // // Maintain aspect ratio: width=ratio*height // // const float ratio = 1.05; // slighly greater than 1 to account for // the palette // // Calculate width and height of the current pad in pixels // Float_t w = gPad->GetWw(); Float_t h = gPad->GetWh()*ratio; // // This prevents the pad from resizing itself wrongly // if (gPad->GetMother() != gPad) { w *= gPad->GetMother()->GetAbsWNDC(); h *= gPad->GetMother()->GetAbsHNDC(); } // // Set Range (coordinate system) of pad // gPad->Range(-range, -range, (2*ratio-1)*range, range); // // Resize Pad to given ratio // if (hSetPad((1.-h/w)/2, 0, (h/w+1.)/2, 1); else gPad->SetPad(0, (1.-w/h)/2, 1, (w/h+1.)/2); }