I am drawing (many) fitted histograms with many points (over 5000 points). One thing I encountered is that it takes long time to draw the histograms with option “PE” but not “HIST”.
This happens only if I put ROOT.gROOT.Macro("rootlogon.C")
.
Am I lefting out something in the rootlogon.C
so it lead to this kind of situation ?
the rootlogon.C
contents are as below:
{
// Definition of new styles
TStyle *MyStyle = new TStyle("MyStyle","MyStyle");
TStyle *MyStyle_work = new TStyle("MyStyle_Work","MyStyle_work");
// Set the default parameters for style MyStyle
MyStyle->SetCanvasBorderMode(0); // Removes Canvas Border
MyStyle->SetPadBorderMode(0); // Removes Pad Border
MyStyle->SetCanvasColor(0); // Changes Canvas color to white
MyStyle->SetPadColor(0); // Changes Pad color to white
MyStyle->SetStatColor(0); // Changes Stats bg color to white
MyStyle->SetTitleFillColor(0); // Changes Title bg color to white
MyStyle->SetFrameLineWidth(2); // make frame pop
MyStyle->SetLabelSize(0.04,"xyz"); // increase size for redability
MyStyle->SetTitleSize(0.04,"xyz"); // "
MyStyle->SetLabelFont(62,"xyz"); // helvetica bold for redability
MyStyle->SetTitleFont(62,"xyz"); // "
MyStyle->SetPadTickX(1); // Sets tic marks on both horizontal axes
MyStyle->SetPadTickY(1); // Sets tic marks on both vertical axes
MyStyle->SetTickLength(0.02,"xyz"); // Sets tic length
MyStyle->SetOptStat(0); // Turns off Statistics display
MyStyle->SetOptTitle(0); // Turns off Title display
MyStyle->SetHistLineWidth(2); // Changes Histogram Line width
MyStyle->SetFrameBorderMode(0); // Removes the Frame Border
MyStyle->SetFrameFillStyle(0);
MyStyle->SetCanvasDefH(600); // Sets Default Canva Height
MyStyle->SetCanvasDefW(900); // Sets Default Canvas Width
MyStyle->SetPalette(1);
// The next for commands set the default margin size
// n.b. the margins do not take axis labels into account! grr!!
MyStyle->SetPadTopMargin(0.1); // Set Margin Top
MyStyle->SetPadRightMargin(0.1); // Set Margin Right
MyStyle->SetPadBottomMargin(0.1); // Set Margin Bottom
MyStyle->SetPadLeftMargin(0.1); // Set Margin Left
//make a nice palette
int NRGBs = 7, NCont = 999;
MyStyle->SetNumberContours(NCont);
Double_t stops[7] = { 0.00, 0.10, 0.25, 0.45, 0.60, 0.75, 1.00 };
Double_t red[7] = { 1.00, 0.00, 0.00, 0.00, 0.97, 0.97, 0.10 };
Double_t green[7] = { 1.00, 0.97, 0.30, 0.40, 0.97, 0.00, 0.00 };
Double_t blue[7] = { 1.00, 0.97, 0.97, 0.00, 0.00, 0.00, 0.00 };
TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
// Make MyStyle_work a copy of MyStyle and remove stats
MyStyle->Copy(*MyStyle_work);
MyStyle_work->SetOptStat(1);
MyStyle_work->SetOptTitle(1);
// MyStyle_work->SetPadTopMargin(0.1);
// MyStyle_work->SetPadRightMargin(0.1);
MyStyle_work->SetMarkerStyle(20);
MyStyle_work->SetTitleOffset(1,"xyz");
// Select Which style to use
gROOT->SetStyle("MyStyle_Work");
// gROOT->SetStyle("MyStyle");
// Use the RooFit functions
// using namespace RooFit;
// Force Root to run MyStyle/MyStyle_Work style
gROOT->ForceStyle();
}
update: I tried to add My_Style->SetMarkerSize(0);
in the rootlogon.C
and it seems to be drawing faster.
_ROOT Version:6.26.00 (conda-forge)
_Platform:ubuntu 20.04 (wsl)
_Compiler:gcc