void Style_Toby_2() { // Add the saved style to the current ROOT session. delete gROOT->GetStyle("Toby_2"); TStyle *tmpStyle = new TStyle("Toby_2", "Style for posters and talks"); tmpStyle->SetNdivisions(510, "x"); tmpStyle->SetNdivisions(510, "y"); tmpStyle->SetNdivisions(510, "z"); tmpStyle->SetAxisColor(1, "x"); tmpStyle->SetAxisColor(1, "y"); tmpStyle->SetAxisColor(1, "z"); tmpStyle->SetLabelColor(1, "x"); tmpStyle->SetLabelColor(1, "y"); tmpStyle->SetLabelColor(1, "z"); tmpStyle->SetLabelFont(42, "x"); tmpStyle->SetLabelFont(42, "y"); tmpStyle->SetLabelFont(42, "z"); tmpStyle->SetLabelOffset(0.005, "x"); tmpStyle->SetLabelOffset(0.005, "y"); tmpStyle->SetLabelOffset(0.005, "z"); tmpStyle->SetLabelSize(0.035, "x"); tmpStyle->SetLabelSize(0.035, "y"); tmpStyle->SetLabelSize(0.035, "z"); tmpStyle->SetTickLength(0.03, "x"); tmpStyle->SetTickLength(0.03, "y"); tmpStyle->SetTickLength(0.03, "z"); tmpStyle->SetTitleOffset(1, "x"); tmpStyle->SetTitleOffset(1, "y"); tmpStyle->SetTitleOffset(1, "z"); tmpStyle->SetTitleSize(0.035, "x"); tmpStyle->SetTitleSize(0.035, "y"); tmpStyle->SetTitleSize(0.035, "z"); tmpStyle->SetTitleColor(1, "x"); tmpStyle->SetTitleColor(1, "y"); tmpStyle->SetTitleColor(1, "z"); tmpStyle->SetTitleFont(42, "x"); tmpStyle->SetTitleFont(42, "y"); tmpStyle->SetTitleFont(42, "z"); tmpStyle->SetBarWidth(1); tmpStyle->SetBarOffset(0); tmpStyle->SetDrawBorder(0); tmpStyle->SetOptLogx(0); tmpStyle->SetOptLogy(0); tmpStyle->SetOptLogz(0); tmpStyle->SetOptDate(0); tmpStyle->SetOptStat(111); tmpStyle->SetOptTitle(kTRUE); tmpStyle->SetOptFit(0); tmpStyle->SetNumberContours(20); tmpStyle->GetAttDate()->SetTextFont(62); tmpStyle->GetAttDate()->SetTextSize(0.025); tmpStyle->GetAttDate()->SetTextAngle(0); tmpStyle->GetAttDate()->SetTextAlign(11); tmpStyle->GetAttDate()->SetTextColor(1); tmpStyle->SetDateX(0.01); tmpStyle->SetDateY(0.01); tmpStyle->SetEndErrorSize(2); tmpStyle->SetErrorX(0.5); tmpStyle->SetFuncColor(2); tmpStyle->SetFuncStyle(1); tmpStyle->SetFuncWidth(2); tmpStyle->SetGridColor(0); tmpStyle->SetGridStyle(3); tmpStyle->SetGridWidth(1); tmpStyle->SetLegendBorderSize(1); tmpStyle->SetLegendFillColor(0); tmpStyle->SetLegendFont(42); tmpStyle->SetHatchesLineWidth(1); tmpStyle->SetHatchesSpacing(1); tmpStyle->SetFrameFillColor(0); tmpStyle->SetFrameLineColor(1); tmpStyle->SetFrameFillStyle(1001); tmpStyle->SetFrameLineStyle(1); tmpStyle->SetFrameLineWidth(1); tmpStyle->SetFrameBorderSize(1); tmpStyle->SetFrameBorderMode(0); tmpStyle->SetHistFillColor(0); tmpStyle->SetHistLineColor(602); tmpStyle->SetHistFillStyle(1001); tmpStyle->SetHistLineStyle(1); tmpStyle->SetHistLineWidth(1); tmpStyle->SetHistMinimumZero(kFALSE); tmpStyle->SetCanvasPreferGL(kFALSE); tmpStyle->SetCanvasColor(0); tmpStyle->SetCanvasBorderSize(2); tmpStyle->SetCanvasBorderMode(0); tmpStyle->SetCanvasDefH(500); tmpStyle->SetCanvasDefW(700); tmpStyle->SetCanvasDefX(10); tmpStyle->SetCanvasDefY(10); tmpStyle->SetPadColor(0); tmpStyle->SetPadBorderSize(2); tmpStyle->SetPadBorderMode(0); tmpStyle->SetPadBottomMargin(0.1); tmpStyle->SetPadTopMargin(0.1); tmpStyle->SetPadLeftMargin(0.1); tmpStyle->SetPadRightMargin(0.1); tmpStyle->SetPadGridX(kFALSE); tmpStyle->SetPadGridY(kFALSE); tmpStyle->SetPadTickX(0); tmpStyle->SetPadTickY(0); tmpStyle->SetPaperSize(20, 26); tmpStyle->SetScreenFactor(1); tmpStyle->SetStatColor(0); tmpStyle->SetStatTextColor(1); tmpStyle->SetStatBorderSize(1); tmpStyle->SetStatFont(42); tmpStyle->SetStatFontSize(0); tmpStyle->SetStatStyle(1001); tmpStyle->SetStatFormat("6.4g"); tmpStyle->SetStatX(0.9); tmpStyle->SetStatY(0.97); tmpStyle->SetStatW(0.15); tmpStyle->SetStatH(0.16); tmpStyle->SetStripDecimals(kTRUE); tmpStyle->SetTitleAlign(23); tmpStyle->SetTitleFillColor(0); tmpStyle->SetTitleTextColor(1); tmpStyle->SetTitleBorderSize(0); tmpStyle->SetTitleFont(42); tmpStyle->SetTitleFontSize(0.05); tmpStyle->SetTitleStyle(0); tmpStyle->SetTitleX(0.5); tmpStyle->SetTitleY(0.995); tmpStyle->SetTitleW(0); tmpStyle->SetTitleH(0); tmpStyle->SetLegoInnerR(0.5); Int_t fPaletteColor[50] = {51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100}; tmpStyle->SetPalette(50, fPaletteColor); TString fLineStyleArrayTmp[30] = {"", " ", " 12 12", " 4 8", " 12 16 4 16", " 20 12 4 12", " 20 12 4 12 4 12 4 12", " 20 20", " 20 12 4 12 4 12", " 80 20", " 80 40 4 40", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "}; for (Int_t i=0; i<30; i++) tmpStyle->SetLineStyleString(i, fLineStyleArrayTmp[i]); tmpStyle->SetHeaderPS(""); tmpStyle->SetTitlePS(""); tmpStyle->SetFitFormat("5.4g"); tmpStyle->SetPaintTextFormat("g"); tmpStyle->SetLineScalePS(3); tmpStyle->SetColorModelPS(0); tmpStyle->SetTimeOffset(788918400); tmpStyle->SetLineColor(1); tmpStyle->SetLineStyle(1); tmpStyle->SetLineWidth(1); tmpStyle->SetFillColor(19); tmpStyle->SetFillStyle(1001); tmpStyle->SetMarkerColor(1); tmpStyle->SetMarkerSize(1); tmpStyle->SetMarkerStyle(1); tmpStyle->SetTextAlign(11); tmpStyle->SetTextAngle(0); tmpStyle->SetTextColor(1); tmpStyle->SetTextFont(62); tmpStyle->SetTextSize(0.05); }
TStyle* createMyStyle() { TStyle *myStyle = new TStyle("myStyle", "myStyle"); // For the canvas: myStyle->SetCanvasBorderMode(0); myStyle->SetCanvasColor(kWhite); myStyle->SetCanvasDefH(800); //Height of canvas myStyle->SetCanvasDefW(800); //Width of canvas myStyle->SetCanvasDefX(0); //POsition on screen myStyle->SetCanvasDefY(0); // For the Pad: myStyle->SetPadBorderMode(0); myStyle->SetPadColor(kWhite); myStyle->SetPadGridX(false); myStyle->SetPadGridY(false); myStyle->SetGridColor(0); myStyle->SetGridStyle(3); myStyle->SetGridWidth(1); // For the frame: myStyle->SetFrameBorderMode(0); myStyle->SetFrameBorderSize(1); myStyle->SetFrameFillColor(0); myStyle->SetFrameFillStyle(0); myStyle->SetFrameLineColor(1); myStyle->SetFrameLineStyle(1); myStyle->SetFrameLineWidth(1); // For the histo: myStyle->SetHistLineStyle(1); myStyle->SetHistLineWidth(2); myStyle->SetEndErrorSize(2); //For the fit/function: myStyle->SetFitFormat("5.4g"); myStyle->SetFuncColor(2); myStyle->SetFuncStyle(1); myStyle->SetFuncWidth(1); // For the statistics box: myStyle->SetOptFile(0); myStyle->SetStatColor(kWhite); //myStyle->SetStatFont(43); //myStyle->SetStatFontSize(0.025); myStyle->SetStatTextColor(1); myStyle->SetStatFormat("6.4g"); myStyle->SetStatBorderSize(1); myStyle->SetStatH(0.12); myStyle->SetStatW(0.3); myStyle->SetStatY(0.92); myStyle->SetStatX(0.94); //For the date: myStyle->SetOptDate(0); // Margins: myStyle->SetPadTopMargin(TOP_MARGIN); myStyle->SetPadBottomMargin(BOTTOM_MARGIN); myStyle->SetPadLeftMargin(LEFT_MARGIN); myStyle->SetPadRightMargin(RIGHT_MARGIN); // For the Global title: myStyle->SetOptTitle(0); myStyle->SetTitleFont(63); myStyle->SetTitleColor(1); myStyle->SetTitleTextColor(1); myStyle->SetTitleFillColor(10); myStyle->SetTitleBorderSize(0); myStyle->SetTitleAlign(33); myStyle->SetTitleX(1); myStyle->SetTitleFontSize(TITLE_FONTSIZE); // For the axis titles: myStyle->SetTitleColor(1, "XYZ"); myStyle->SetTitleFont(43, "XYZ"); myStyle->SetTitleSize(TITLE_FONTSIZE, "XYZ"); myStyle->SetTitleYOffset(2.); myStyle->SetTitleXOffset(1.25); myStyle->SetLabelColor(1, "XYZ"); myStyle->SetLabelFont(43, "XYZ"); myStyle->SetLabelOffset(0.01, "YZ"); myStyle->SetLabelOffset(0.015, "X"); myStyle->SetLabelSize(LABEL_FONTSIZE, "XYZ"); myStyle->SetAxisColor(1, "XYZ"); myStyle->SetStripDecimals(kTRUE); myStyle->SetTickLength(0.03, "XYZ"); myStyle->SetNdivisions(510, "XYZ"); myStyle->SetPadTickX(1); // To get tick marks on the opposite side of the frame myStyle->SetPadTickY(1); myStyle->SetOptLogx(0); myStyle->SetOptLogy(0); myStyle->SetOptLogz(0); myStyle->SetHatchesSpacing(1.3); myStyle->SetHatchesLineWidth(1); myStyle->cd(); return myStyle; }
// Create my custom FORMAL style //********************************************************************// void getMyStyle(void) { std::cout << " *** void getMyStyle(void) *** Custom TStyle initialized!" << std::endl; TStyle *myStyle = new TStyle("myStyle","Style for AN09"); // For the canvas: myStyle->SetCanvasBorderMode(0); myStyle->SetCanvasColor(kWhite); myStyle->SetCanvasDefH(600); //Height of canvas myStyle->SetCanvasDefW(600); //Width of canvas myStyle->SetCanvasDefX(0); //POsition on screen myStyle->SetCanvasDefY(0); // For the Pad: myStyle->SetPadBorderMode(0); // myStyle->SetOptTitle(0); // delete histogram titles // myStyle->SetPadBorderSize(Width_t size = 1); myStyle->SetPadColor(kWhite); myStyle->SetPadGridX(true); myStyle->SetPadGridY(true); myStyle->SetGridColor(0); myStyle->SetGridStyle(3); myStyle->SetGridWidth(1); // For the frame: myStyle->SetFrameBorderMode(0); myStyle->SetFrameBorderSize(1); myStyle->SetFrameFillColor(0); myStyle->SetFrameFillStyle(0); myStyle->SetFrameLineColor(1); myStyle->SetFrameLineStyle(1); myStyle->SetFrameLineWidth(1); // For the histo: // myStyle->SetHistFillColor(1); // myStyle->SetHistFillStyle(0); myStyle->SetHistLineColor(1); myStyle->SetHistLineStyle(0); myStyle->SetHistLineWidth(1); // myStyle->SetLegoInnerR(Float_t rad = 0.5); // myStyle->SetNumberContours(Int_t number = 20); myStyle->SetEndErrorSize(2); //myStyle->SetErrorMarker(20); myStyle->SetErrorX(0.); myStyle->SetMarkerStyle(20); //For the fit/function: myStyle->SetOptFit(1); myStyle->SetFitFormat("5.4g"); myStyle->SetFuncColor(2); myStyle->SetFuncStyle(1); myStyle->SetFuncWidth(1); //For the date: myStyle->SetOptDate(1); // myStyle->SetDateX(Float_t x = 0.01); // myStyle->SetDateY(Float_t y = 0.01); // For the statistics box: myStyle->SetOptFile(0); myStyle->SetOptStat("miourne"); // stats box myStyle->SetOptFit(1111); // fit box myStyle->SetStatColor(kWhite); myStyle->SetStatFont(42); myStyle->SetStatFontSize(0.025); myStyle->SetStatTextColor(1); myStyle->SetStatFormat("6.4g"); myStyle->SetStatBorderSize(1); myStyle->SetStatH(0.1); myStyle->SetStatW(0.15); // myStyle->SetStatStyle(Style_t style = 1001); // myStyle->SetStatX(Float_t x = 0); // myStyle->SetStatY(Float_t y = 0); // Margins: myStyle->SetPadTopMargin(0.15); myStyle->SetPadBottomMargin(0.13); myStyle->SetPadLeftMargin(0.13); myStyle->SetPadRightMargin(0.15); // For the Global title: // myStyle->SetOptTitle(0); myStyle->SetTitleFont(42); myStyle->SetTitleColor(1); myStyle->SetTitleTextColor(1); myStyle->SetTitleFillColor(10); myStyle->SetTitleFontSize(0.05); // myStyle->SetTitleH(0); // Set the height of the title box // myStyle->SetTitleW(0); // Set the width of the title box // myStyle->SetTitleX(0); // Set the position of the title box // myStyle->SetTitleY(0.985); // Set the position of the title box // myStyle->SetTitleStyle(Style_t style = 1001); // myStyle->SetTitleBorderSize(2); // For the axis titles: myStyle->SetTitleColor(1, "XYZ"); myStyle->SetTitleFont(42, "XYZ"); myStyle->SetTitleSize(0.06, "XYZ"); // myStyle->SetTitleXSize(Float_t size = 0.02); // Another way to set the size? // myStyle->SetTitleYSize(Float_t size = 0.02); myStyle->SetTitleXOffset(1.2); myStyle->SetTitleYOffset(1.2); myStyle->SetTitleOffset(1.2, "Y"); // Another way to set the Offset // For the axis labels: myStyle->SetLabelColor(1, "XYZ"); myStyle->SetLabelFont(42, "XYZ"); myStyle->SetLabelOffset(0.007, "XYZ"); myStyle->SetLabelSize(0.05, "XYZ"); // For the axis: myStyle->SetAxisColor(1, "XYZ"); myStyle->SetStripDecimals(kTRUE); myStyle->SetTickLength(0.03, "XYZ"); myStyle->SetNdivisions(510, "XYZ"); myStyle->SetPadTickX(0); // To get tick marks on the opposite side of the frame myStyle->SetPadTickY(0); // Change for log plots: myStyle->SetOptLogx(0); myStyle->SetOptLogy(0); myStyle->SetOptLogz(0); myStyle->SetPalette(1,0); // Postscript options: // myStyle->SetPaperSize(15.,15.); // myStyle->SetLineScalePS(Float_t scale = 3); // myStyle->SetLineStyleString(Int_t i, const char* text); // myStyle->SetHeaderPS(const char* header); // myStyle->SetTitlePS(const char* pstitle); // myStyle->SetBarOffset(Float_t baroff = 0.5); // myStyle->SetBarWidth(Float_t barwidth = 0.5); // myStyle->SetPaintTextFormat(const char* format = "g"); // myStyle->SetPalette(Int_t ncolors = 0, Int_t* colors = 0); // myStyle->SetTimeOffset(Double_t toffset); // myStyle->SetHistMinimumZero(kTRUE); myStyle->cd(); } //end of: void getMyStyle(void){
void set_plot_style() { TStyle* style = new TStyle("style", "Style for P-TDR"); // For the canvas: style->SetCanvasBorderMode(0); style->SetCanvasColor(kWhite); style->SetCanvasDefX(0); //Position on screen style->SetCanvasDefY(0); // For the Pad: style->SetPadBorderMode(0); style->SetPadColor(kWhite); style->SetPadGridX(false); style->SetPadGridY(false); style->SetGridColor(kBlack); style->SetGridStyle(3); style->SetGridWidth(1); // For the frame: style->SetFrameBorderMode(0); style->SetFrameBorderSize(1); style->SetFrameFillColor(kWhite); style->SetFrameFillStyle(0); style->SetFrameLineColor(kBlack); style->SetFrameLineStyle(1); style->SetFrameLineWidth(1); // For the histo: // style->SetHistFillColor(1); style->SetHistFillStyle(0); // style->SetHistLineColor(kBlack); style->SetHistLineStyle(0); style->SetHistLineWidth(1); style->SetEndErrorSize(2); style->SetErrorX(0.); style->SetMarkerStyle(20); //For the fit/function: style->SetOptFit(1); style->SetFitFormat("5.4g"); style->SetFuncColor(kRed); style->SetFuncStyle(1); style->SetFuncWidth(1); //For the date: style->SetOptDate(0); // For the statistics box: style->SetOptFile(0); style->SetOptStat(0); // To display the mean and RMS: SetOptStat("mr"); style->SetStatColor(kWhite); style->SetStatFont(42); style->SetStatFontSize(0.025); style->SetStatTextColor(kBlack); style->SetStatFormat("6.4g"); style->SetStatBorderSize(1); style->SetStatH(0.1); style->SetStatW(0.15); // Margins: style->SetPadTopMargin(1 - 0.95); style->SetPadBottomMargin(0.1); style->SetPadLeftMargin(0.12); style->SetPadRightMargin(1 - 0.96); // For the Global title: style->SetOptTitle(0); style->SetTitleFont(42); style->SetTitleColor(kBlack); style->SetTitleTextColor(kBlack); style->SetTitleFillColor(kWhite); //10 is roughly kWhite, 10% grey? style->SetTitleFontSize(0.05); // For the axis titles: style->SetTitleColor(kBlack, "XYZ"); style->SetTitleFont(42, "XYZ"); style->SetTitleSize(0.06, "XYZ"); style->SetTitleXOffset(0.9); style->SetTitleYOffset(1.25); // For the axis labels: style->SetLabelColor(kBlack, "XYZ"); style->SetLabelFont(42, "XYZ"); style->SetLabelOffset(0.007, "XYZ"); style->SetLabelSize(0.05, "XYZ"); // For the axis: style->SetAxisColor(kBlack, "XYZ"); style->SetStripDecimals(true); style->SetTickLength(0.03, "XYZ"); style->SetNdivisions(510, "XYZ"); style->SetPadTickX(true); // To get tick marks on the opposite side of the frame style->SetPadTickY(true); // Change for log plots: style->SetOptLogx(false); style->SetOptLogy(false); style->SetOptLogz(false); // Set the style style->cd(); }
void setHHStyle(TStyle& HHStyle) { const int fontstyle=42; HHStyle.SetPalette(1); // ============== // Canvas // ============== HHStyle.SetCanvasBorderMode(0); HHStyle.SetCanvasColor(kWhite); HHStyle.SetCanvasDefH(600); //Height of canvas HHStyle.SetCanvasDefW(600); //Width of canvas HHStyle.SetCanvasDefX(0); //Position on screen HHStyle.SetCanvasDefY(0); // ============== // Pad // ============== HHStyle.SetPadBorderMode(0); // HHStyle.SetPadBorderSize(Width_t size = 1); HHStyle.SetPadColor(kWhite); HHStyle.SetPadGridX(false); HHStyle.SetPadGridY(false); HHStyle.SetGridColor(kGray); HHStyle.SetGridStyle(3); HHStyle.SetGridWidth(1); // ============== // Frame // ============== HHStyle.SetFrameBorderMode(0); HHStyle.SetFrameBorderSize(1); HHStyle.SetFrameFillColor(0); HHStyle.SetFrameFillStyle(0); HHStyle.SetFrameLineColor(1); HHStyle.SetFrameLineStyle(1); HHStyle.SetFrameLineWidth(1); // ============== // Histo // ============== HHStyle.SetErrorX(0.0); HHStyle.SetEndErrorSize(8); // HHStyle.SetHistFillColor(1); // HHStyle.SetHistFillStyle(0); // HHStyle.SetHistLineColor(1); HHStyle.SetHistLineStyle(0); HHStyle.SetHistLineWidth(1); // HHStyle.SetLegoInnerR(Float_t rad = 0.5); // HHStyle.SetNumberContours(Int_t number = 20); // HHStyle.SetErrorMarker(20); HHStyle.SetMarkerStyle(20); // ============== // Fit/function // ============== HHStyle.SetOptFit(0); HHStyle.SetFitFormat("5.4g"); HHStyle.SetFuncColor(2); HHStyle.SetFuncStyle(1); HHStyle.SetFuncWidth(1); // ============== // Date // ============== HHStyle.SetOptDate(0); // HHStyle.SetDateX(Float_t x = 0.01); // HHStyle.SetDateY(Float_t y = 0.01); // ===================== // Statistics Box // ===================== HHStyle.SetOptFile(0); HHStyle.SetOptStat(0); // To display the mean and RMS: SetOptStat("mr"); HHStyle.SetStatColor(kWhite); HHStyle.SetStatFont(fontstyle); HHStyle.SetStatFontSize(0.025); HHStyle.SetStatTextColor(1); HHStyle.SetStatFormat("6.4g"); HHStyle.SetStatBorderSize(1); HHStyle.SetStatH(0.1); HHStyle.SetStatW(0.15); // HHStyle.SetStatStyle(Style_t style = 1001); // HHStyle.SetStatX(Float_t x = 0); // HHStyle.SetStatY(Float_t y = 0); // ============== // Margins // ============== HHStyle.SetPadTopMargin(0.1); HHStyle.SetPadBottomMargin(0.15); HHStyle.SetPadLeftMargin(0.20); HHStyle.SetPadRightMargin(0.05); // ============== // Global Title // ============== HHStyle.SetOptTitle(0); HHStyle.SetTitleFont(fontstyle); HHStyle.SetTitleColor(1); HHStyle.SetTitleTextColor(1); HHStyle.SetTitleFillColor(10); HHStyle.SetTitleFontSize(0.05); // HHStyle.SetTitleH(0); // Set the height of the title box // HHStyle.SetTitleW(0); // Set the width of the title box // HHStyle.SetTitleX(0); // Set the position of the title box // HHStyle.SetTitleY(0.985); // Set the position of the title box // HHStyle.SetTitleStyle(Style_t style = 1001); // HHStyle.SetTitleBorderSize(2); // ============== // Axis titles // ============== HHStyle.SetTitleColor(1, "XYZ"); HHStyle.SetTitleFont(fontstyle, "XYZ"); HHStyle.SetTitleSize(0.05, "XYZ"); // HHStyle.SetTitleXSize(Float_t size = 0.02); // Another way to set the size? // HHStyle.SetTitleYSize(Float_t size = 0.02); HHStyle.SetTitleXOffset(1.0); HHStyle.SetTitleYOffset(1.7); // HHStyle.SetTitleOffset(1.1, "Y"); // Another way to set the Offset // ============== // Axis Label // ============== //HHStyle.SetLabelColor(1, "XYZ"); HHStyle.SetLabelFont(fontstyle, "XYZ"); HHStyle.SetLabelOffset(0.007, "XYZ"); HHStyle.SetLabelSize(0.04, "XYZ"); // ============== // Axis // ============== HHStyle.SetAxisColor(1, "XYZ"); HHStyle.SetStripDecimals(kTRUE); HHStyle.SetTickLength(0.03, "XYZ"); HHStyle.SetNdivisions(510, "XYZ"); HHStyle.SetPadTickX(1); // To get tick marks on the opposite side of the frame HHStyle.SetPadTickY(1); // Change for log plots: HHStyle.SetOptLogx(0); HHStyle.SetOptLogy(0); HHStyle.SetOptLogz(0); // ============== // Text // ============== HHStyle.SetTextAlign(11); HHStyle.SetTextAngle(0); HHStyle.SetTextColor(1); HHStyle.SetTextFont(fontstyle); HHStyle.SetTextSize(0.05); // ===================== // Postscript options: // ===================== HHStyle.SetPaperSize(20.,20.); // HHStyle.SetLineScalePS(Float_t scale = 3); // HHStyle.SetLineStyleString(Int_t i, const char* text); // HHStyle.SetHeaderPS(const char* header); // HHStyle.SetTitlePS(const char* pstitle); // HHStyle.SetBarOffset(Float_t baroff = 0.5); // HHStyle.SetBarWidth(Float_t barwidth = 0.5); // HHStyle.SetPaintTextFormat(const char* format = "g"); // HHStyle.SetPalette(Int_t ncolors = 0, Int_t* colors = 0); // HHStyle.SetTimeOffset(Double_t toffset); // HHStyle.SetHistMinimumZero(kTRUE); }
bool // returns true if success processStyleSection(FILE *fp,string& theline, bool& new_section) { vector<string> v_tokens; string *sid = NULL; TStyle *thestyle = NULL; if (gl_verbose) cout << "Processing style section" << endl; new_section=false; while (getLine(fp,theline,"style")) { if (!theline.size()) continue; if (theline[0] == '#') continue; // comments are welcome if (theline[0] == '[') { new_section=true; return true; } string key, value; if (!getKeyValue(theline,key,value)) continue; if (key == "id") { if (sid != NULL) { cerr << "no more than one id per style section allowed " << value << endl; break; } sid = new string(value); thestyle = new TStyle(*gStyle); // Assume current attributes, let user override specifics thestyle->SetNameTitle(sid->c_str(),sid->c_str()); glmap_id2style.insert(pair<string,TStyle*>(*sid,thestyle)); continue; } else if (!sid) { // assume the style is the global style thestyle = gStyle; sid = new string("using global"); // so as to pass this check the next time cerr << "No style ID defined, assuming global style" << endl; continue; } if (key == "style") { if (value == "TDR") setTDRStyle(); else if (value == "Plain") gROOT->SetStyle("Plain"); else cerr << "unknown style name " << value << endl; } else if (key == "optstat") { if (gl_verbose) cout << "OptStat = " << thestyle->GetOptStat() << endl; thestyle->SetOptStat(value.c_str()); if (gl_verbose) cout << "OptStat = " << thestyle->GetOptStat() << endl; } else if (key == "opttitle") thestyle->SetOptTitle(str2int(value)); else if (key == "padrightmargin") thestyle->SetPadRightMargin (str2flt(value)); else if (key == "padleftmargin") thestyle->SetPadLeftMargin (str2flt(value)); else if (key == "padtopmargin") thestyle->SetPadTopMargin (str2flt(value)); else if (key == "padbottommargin") thestyle->SetPadBottomMargin(str2flt(value)); else if (key == "padgridx") thestyle->SetPadGridX (str2int(value)); else if (key == "padgridy") thestyle->SetPadGridY (str2int(value)); // Set the position/size of the title box else if (key == "titlexndc") thestyle->SetTitleX(str2flt(value)); else if (key == "titleyndc") thestyle->SetTitleY(str2flt(value)); else if (key == "titlewndc") thestyle->SetTitleW(str2flt(value)); else if (key == "titlehndc") thestyle->SetTitleH(str2flt(value)); else if (key == "titlefont") thestyle->SetTitleFont(str2int(value)); else if (key == "titlebordersize") thestyle->SetTitleBorderSize(str2int(value)); else if (key == "markercolor") thestyle->SetMarkerColor(str2int(value)); else if (key == "markerstyle") thestyle->SetMarkerStyle(str2int(value)); else if (key == "markersize") thestyle->SetMarkerSize(str2int(value)); else if (key == "linecolor") thestyle->SetLineColor(str2int(value)); else if (key == "linestyle") thestyle->SetLineStyle(str2int(value)); else if (key == "linewidth") thestyle->SetLineWidth(str2int(value)); else if (key == "fillcolor") thestyle->SetFillColor(str2int(value)); else if (key == "fillstyle") thestyle->SetFillStyle(str2int(value)); // axes else if (key == "xtitlesize") thestyle->SetTitleSize(str2flt(value),"X"); else if (key == "ytitlesize") thestyle->SetTitleSize(str2flt(value),"Y"); else if (key == "ztitlesize") thestyle->SetTitleSize(str2flt(value),"Z"); else if (key == "xtitleoffset") thestyle->SetTitleOffset(str2flt(value),"X"); else if (key == "ytitleoffset") thestyle->SetTitleOffset(str2flt(value),"Y"); else if (key == "ztitleoffset") thestyle->SetTitleOffset(str2flt(value),"Z"); else if (key == "xlabeloffset") thestyle->SetLabelOffset(str2flt(value),"X"); else if (key == "ylabeloffset") thestyle->SetLabelOffset(str2flt(value),"Y"); else if (key == "zlabeloffset") thestyle->SetLabelOffset(str2flt(value),"Z"); else if (key == "xtitlefont") thestyle->SetTitleFont(str2int(value),"X"); else if (key == "ytitlefont") thestyle->SetTitleFont(str2int(value),"Y"); else if (key == "ztitlefont") thestyle->SetTitleFont(str2int(value),"Z"); else if (key == "xlabelsize") thestyle->SetLabelSize(str2flt(value),"X"); else if (key == "ylabelsize") thestyle->SetLabelSize(str2flt(value),"Y"); else if (key == "zlabelsize") thestyle->SetLabelSize(str2flt(value),"Z"); else if (key == "xlabelfont") thestyle->SetLabelFont(str2int(value),"X"); else if (key == "ylabelfont") thestyle->SetLabelFont(str2int(value),"Y"); else if (key == "zlabelfont") thestyle->SetLabelFont(str2int(value),"Z"); else if (key == "xndiv") thestyle->SetNdivisions(str2int(value),"X"); else if (key == "yndiv") thestyle->SetNdivisions(str2int(value),"Y"); else if (key == "zndiv") thestyle->SetNdivisions(str2int(value),"Z"); // Set the position of the statbox else if (key == "statx2ndc") thestyle->SetStatX(str2flt(value)); else if (key == "staty2ndc") thestyle->SetStatY(str2flt(value)); else if (key == "statwndc") thestyle->SetStatW(str2flt(value)); else if (key == "stathndc") thestyle->SetStatH(str2flt(value)); else if (key == "statfont") thestyle->SetStatFont (str2int(value)); else if (key == "statfontsize") thestyle->SetStatFontSize(str2flt(value)); else if (key == "statformat") thestyle->SetStatFormat (value.c_str()); else if (key == "statstyle") thestyle->SetStatStyle (str2int(value.c_str())); else if (key == "fitformat") thestyle->SetFitFormat (value.c_str()); else if (key == "painttextfmt") thestyle->SetPaintTextFormat(value.c_str()); else if (key == "markersize") thestyle->SetMarkerSize(str2flt(value)); else if (key == "palette") thestyle->SetPalette(str2int(value)); else { cerr << "Unknown key " << key << endl; } } // while loop return true; } // processStyleSection
void met(){ TStyle *tdrStyle = new TStyle("tdrStyle","Style for P-TDR"); // For the canvas: tdrStyle->SetCanvasBorderMode(0); tdrStyle->SetCanvasColor(kWhite); tdrStyle->SetCanvasDefH(600); //Height of canvas tdrStyle->SetCanvasDefW(600); //Width of canvas tdrStyle->SetCanvasDefX(0); //POsition on screen tdrStyle->SetCanvasDefY(0); // For the Pad: tdrStyle->SetPadBorderMode(0); // tdrStyle->SetPadBorderSize(Width_t size = 1); tdrStyle->SetPadColor(kWhite); tdrStyle->SetPadGridX(true); tdrStyle->SetPadGridY(true); tdrStyle->SetGridColor(0); tdrStyle->SetGridStyle(3); tdrStyle->SetGridWidth(1); // For the frame: tdrStyle->SetFrameBorderMode(0); tdrStyle->SetFrameBorderSize(1); tdrStyle->SetFrameFillColor(0); tdrStyle->SetFrameFillStyle(0); tdrStyle->SetFrameLineColor(1); tdrStyle->SetFrameLineStyle(1); tdrStyle->SetFrameLineWidth(1); // For the histo: // tdrStyle->SetHistFillColor(1); // tdrStyle->SetHistFillStyle(0); tdrStyle->SetHistLineColor(1); tdrStyle->SetHistLineStyle(0); tdrStyle->SetHistLineWidth(1); // tdrStyle->SetLegoInnerR(Float_t rad = 0.5); // tdrStyle->SetNumberContours(Int_t number = 20); tdrStyle->SetEndErrorSize(2); // tdrStyle->SetErrorMarker(20); tdrStyle->SetErrorX(0.); tdrStyle->SetMarkerStyle(20); //For the fit/function: tdrStyle->SetOptFit(1); tdrStyle->SetFitFormat("5.4g"); tdrStyle->SetFuncColor(2); tdrStyle->SetFuncStyle(1); tdrStyle->SetFuncWidth(1); //For the date: tdrStyle->SetOptDate(0); // tdrStyle->SetDateX(Float_t x = 0.01); // tdrStyle->SetDateY(Float_t y = 0.01); // For the statistics box: tdrStyle->SetOptFile(0); tdrStyle->SetOptStat("emr"); // To display the mean and RMS: SetOptStat("mr"); tdrStyle->SetStatColor(kWhite); tdrStyle->SetStatFont(42); tdrStyle->SetStatFontSize(0.025); tdrStyle->SetStatTextColor(1); tdrStyle->SetStatFormat("6.4g"); tdrStyle->SetStatBorderSize(1); tdrStyle->SetStatH(0.1); tdrStyle->SetStatW(0.15); // tdrStyle->SetStatStyle(Style_t style = 1001); // tdrStyle->SetStatX(Float_t x = 0); // tdrStyle->SetStatY(Float_t y = 0); // Margins: tdrStyle->SetPadTopMargin(0.07); tdrStyle->SetPadBottomMargin(0.13); tdrStyle->SetPadLeftMargin(0.13); tdrStyle->SetPadRightMargin(0.05); // For the Global title: //tdrStyle->SetOptTitle(0); tdrStyle->SetTitleFont(35); tdrStyle->SetTitleColor(1); tdrStyle->SetTitleTextColor(1); tdrStyle->SetTitleFillColor(10); tdrStyle->SetTitleFontSize(0.045); // tdrStyle->SetTitleH(0); // Set the height of the title box // tdrStyle->SetTitleW(0); // Set the width of the title box tdrStyle->SetTitleX(0.15); // Set the position of the title box // tdrStyle->SetTitleY(0.985); // Set the position of the title box // tdrStyle->SetTitleStyle(Style_t style = 1001); tdrStyle->SetTitleBorderSize(0); // For the axis titles: tdrStyle->SetTitleColor(1, "XYZ"); tdrStyle->SetTitleFont(42, "XYZ"); tdrStyle->SetTitleSize(0.04, "XYZ"); // tdrStyle->SetTitleXSize(Float_t size = 0.02); // Another way to set the size? // tdrStyle->SetTitleYSize(Float_t size = 0.02); tdrStyle->SetTitleXOffset(1.05); tdrStyle->SetTitleYOffset(1.45); // tdrStyle->SetTitleOffset(1.1, "Y"); // Another way to set the Offset // For the axis labels: tdrStyle->SetLabelColor(1, "XYZ"); tdrStyle->SetLabelFont(42, "XYZ"); tdrStyle->SetLabelOffset(0.007, "XYZ"); tdrStyle->SetLabelSize(0.03, "XYZ"); // For the axis: tdrStyle->SetAxisColor(1, "XYZ"); tdrStyle->SetStripDecimals(kTRUE); tdrStyle->SetTickLength(0.03, "XYZ"); tdrStyle->SetNdivisions(510, "XYZ"); tdrStyle->SetPadTickX(1); // To get tick marks on the opposite side of the frame tdrStyle->SetPadTickY(1); // Change for log plots: tdrStyle->SetOptLogx(0); tdrStyle->SetOptLogy(0); tdrStyle->SetOptLogz(0); // Postscript options: tdrStyle->SetPaperSize(20.,20.); // tdrStyle->SetLineScalePS(Float_t scale = 3); // tdrStyle->SetLineStyleString(Int_t i, const char* text); // tdrStyle->SetHeaderPS(const char* header); // tdrStyle->SetTitlePS(const char* pstitle); //tdrStyle->SetBarOffset(Float_t baroff = 0.5); //tdrStyle->SetBarWidth(Float_t barwidth = 0.5); //tdrStyle->SetPaintTextFormat(const char* format = "g"); tdrStyle->SetPalette(1); //tdrStyle->SetTimeOffset(Double_t toffset); //tdrStyle->SetHistMinimumZero(kTRUE); const Int_t NRGBs = 5; const Int_t NCont = 255; Double_t stops[NRGBs] = { 0.00, 0.34, 0.61, 0.84, 1.00 }; Double_t red[NRGBs] = { 0.00, 0.00, 0.87, 1.00, 0.51 }; Double_t green[NRGBs] = { 0.00, 0.81, 1.00, 0.20, 0.00 }; Double_t blue[NRGBs] = { 0.51, 1.00, 0.12, 0.00, 0.00 }; TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont); TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont); tdrStyle->SetNumberContours(NCont); gROOT -> ForceStyle(); tdrStyle->cd(); gStyle->SetOptStat(kFALSE); TFile *f_sig = new TFile("../../rootFiles/higgsHistograms_susyHiggs.root","READ"); f_sig->cd("Analyzer"); TH1F *h_sig_pf = new TH1F("h_sig_pf","h_sig_pf;Events;MET [GeV]",200,0,200); TH1F *h_sig_gen = new TH1F("h_sig_gen","h_sig_gen;MET [GeV]; Events",200,0,200); TH1F *h_sig_min = new TH1F("h_sig_min","h_sig_min",200,0,200); AnalyzerTree->Draw("sum_genPt>>h_sig_gen","",""); h_sig_gen->SetTitle(""); h_sig_gen->SetLineColor(1); h_sig_gen->SetLineWidth(2); AnalyzerTree->Draw("MET>>h_sig_pf","",""); h_sig_pf->SetLineColor(4); h_sig_pf->SetLineWidth(2); AnalyzerTree->Draw("minMET>>h_sig_min","",""); h_sig_min->SetLineColor(2); h_sig_min->SetLineWidth(2); h_sig_gen->Draw(); h_sig_pf->Draw("sames"); h_sig_min->Draw("sames"); TLegend *leg = new TLegend(0.6879195,0.7482517,0.9496644,0.9300699,NULL,"brNDC"); leg->AddEntry(h_sig_gen,"Generated MET","l"); leg->AddEntry(h_sig_pf,"PFMET","l");//"DM_M10_V x 10000","l"); leg->AddEntry(h_sig_min,"Minimized MET","l"); leg->SetFillColor(0); leg->SetShadowColor(0); leg->Draw(); }
void setTDRStyle() { TStyle *tdrStyle = new TStyle("tdrStyle","Style for P-TDR"); tdrStyle->SetCanvasColor (0); tdrStyle->SetCanvasBorderSize(10); tdrStyle->SetCanvasBorderMode(0); tdrStyle->SetCanvasDefH (700); tdrStyle->SetCanvasDefW (700); tdrStyle->SetCanvasDefX (100); tdrStyle->SetCanvasDefY (100); // color palette for 2D temperature plots tdrStyle->SetPalette(1,0); // Pads tdrStyle->SetPadColor (0); tdrStyle->SetPadBorderSize (5); tdrStyle->SetPadBorderMode (0); tdrStyle->SetPadBorderMode (0); tdrStyle->SetPadBottomMargin(0.15); tdrStyle->SetPadTopMargin (0.08); tdrStyle->SetPadLeftMargin (0.12); tdrStyle->SetPadRightMargin (0.07); tdrStyle->SetPadGridX (0); tdrStyle->SetPadGridY (0); tdrStyle->SetPadTickX (1); tdrStyle->SetPadTickY (1); // Frames tdrStyle->SetLineWidth(3); tdrStyle->SetFrameFillStyle ( 0); tdrStyle->SetFrameFillColor ( 0); tdrStyle->SetFrameLineColor ( 1); tdrStyle->SetFrameLineStyle ( 0); tdrStyle->SetFrameLineWidth ( 2); tdrStyle->SetFrameBorderSize(5); tdrStyle->SetFrameBorderMode( 0); tdrStyle->SetFillStyle( 0); // Histograms tdrStyle->SetHistFillColor(2); tdrStyle->SetHistFillStyle(0); tdrStyle->SetHistLineColor(1); tdrStyle->SetHistLineStyle(0); tdrStyle->SetHistLineWidth(4); tdrStyle->SetNdivisions(510); // Functions tdrStyle->SetFuncColor(1); tdrStyle->SetFuncStyle(0); tdrStyle->SetFuncWidth(2); // Various tdrStyle->SetMarkerStyle(20); tdrStyle->SetMarkerColor(kBlack); tdrStyle->SetMarkerSize (1.4); tdrStyle->SetTitleBorderSize(0); tdrStyle->SetTitleFillColor (0); tdrStyle->SetTitleX (0.2); tdrStyle->SetTitleSize (0.055,"X"); tdrStyle->SetTitleOffset(1.200,"X"); tdrStyle->SetLabelOffset(0.005,"X"); tdrStyle->SetLabelSize (0.050,"X"); tdrStyle->SetLabelFont (42 ,"X"); tdrStyle->SetStripDecimals(kFALSE); tdrStyle->SetTitleSize (0.055,"Y"); tdrStyle->SetTitleOffset(1.000,"Y"); tdrStyle->SetLabelOffset(0.010,"Y"); tdrStyle->SetLabelSize (0.050,"Y"); tdrStyle->SetLabelFont (42 ,"Y"); tdrStyle->SetTextSize (0.055); tdrStyle->SetTextFont (42); tdrStyle->SetStatFont (42); tdrStyle->SetTitleFont (42); tdrStyle->SetTitleFont (42,"X"); tdrStyle->SetTitleFont (42,"Y"); tdrStyle->SetOptStat (0); tdrStyle->SetOptTitle (0); tdrStyle->SetLineStyleString(11,"20 10"); tdrStyle->SetLegendBorderSize(0); tdrStyle->cd(); }
void SetOKStyle() { TStyle* OKStyle = new TStyle("OKStyle", "OK Default Style"); // Colors //set the background color to white OKStyle->SetFillColor(10); OKStyle->SetFrameFillColor(kWhite); OKStyle->SetFrameFillStyle(0); OKStyle->SetFillStyle(0); OKStyle->SetCanvasColor(kWhite); OKStyle->SetPadColor(kWhite); OKStyle->SetTitleFillColor(0); OKStyle->SetStatColor(kWhite); // Get rid of drop shadow on legends // This doesn't seem to work. Call SetBorderSize(1) directly on your TLegends OKStyle->SetLegendBorderSize(1); //don't put a colored frame around the plots OKStyle->SetFrameBorderMode(0); OKStyle->SetCanvasBorderMode(0); OKStyle->SetPadBorderMode(0); //use the primary color palette OKStyle->SetPalette(1, 0); //set the default line color for a histogram to be black OKStyle->SetHistLineColor(kBlack); //set the default line color for a fit function to be red OKStyle->SetFuncColor(kBlue); //make the axis labels black OKStyle->SetLabelColor(kBlack, "xyz"); //set the default title color to be black OKStyle->SetTitleColor(kBlack); //set the margins OKStyle->SetPadBottomMargin(0.15); OKStyle->SetPadLeftMargin(0.1); OKStyle->SetPadTopMargin(0.075); OKStyle->SetPadRightMargin(0.1); //set axis label and title text sizes OKStyle->SetLabelSize(0.035, "xyz"); OKStyle->SetTitleSize(0.05, "xyz"); OKStyle->SetTitleOffset(0.9, "xyz"); OKStyle->SetStatFontSize(0.035); OKStyle->SetTextSize(0.05); OKStyle->SetTitleBorderSize(0); OKStyle->SetTitleStyle(0); OKStyle->SetLegendBorderSize(0); //set line widths OKStyle->SetHistLineWidth(1); OKStyle->SetFrameLineWidth(2); OKStyle->SetFuncWidth(2); // Misc //align the titles to be centered //OKStyle->SetTextAlign(22); //turn off xy grids OKStyle->SetPadGridX(1); OKStyle->SetPadGridY(1); //set the tick mark style OKStyle->SetPadTickX(1); OKStyle->SetPadTickY(1); //don't show the fit parameters in a box OKStyle->SetOptFit(0); //set the default stats shown OKStyle->SetOptStat(1); //marker settings // OKStyle->SetMarkerStyle(8); // OKStyle->SetMarkerSize(0.7); // Fonts OKStyle->SetStatFont(42); OKStyle->SetLabelFont(42, "xyz"); OKStyle->SetTitleFont(42, "xyz"); OKStyle->SetTextFont(42); // Set the paper size for output OKStyle->SetPaperSize(TStyle::kUSLetter); //done OKStyle->cd(); cout << "Using Jin's Style" << endl; }
void CMSStyle() { std::cout << "\nApplying CMS style settings...\n" << std::endl ; TStyle *cmsStyle = new TStyle("CMS","Cms style"); // ALBERTO: default palette is hideous, use xx.x format for text in TH2 cmsStyle->SetPalette(1); cmsStyle->SetPaintTextFormat(".1f"); // use plain black on white colors Int_t icol=0; // WHITE cmsStyle->SetFrameBorderMode(icol); cmsStyle->SetFrameFillColor(icol); cmsStyle->SetCanvasBorderMode(icol); cmsStyle->SetCanvasColor(icol); cmsStyle->SetPadBorderMode(icol); cmsStyle->SetPadColor(icol); cmsStyle->SetStatColor(icol); //cmsStyle->SetFillColor(icol); // don't use: white fill color floa *all* objects // set the paper & margin sizes cmsStyle->SetPaperSize(20,26); cmsStyle->SetPadTopMargin(0.05); cmsStyle->SetPadRightMargin(0.05); cmsStyle->SetPadBottomMargin(0.16); cmsStyle->SetPadLeftMargin(0.16); // use large fonts //Int_t font=72; // Helvetica italics Int_t font=42; // Helvetica Double_t tsize=0.05; cmsStyle->SetTextFont(font); cmsStyle->SetTextSize(tsize); cmsStyle->SetLabelFont(font,"x"); cmsStyle->SetTitleFont(font,"x"); cmsStyle->SetLabelFont(font,"y"); cmsStyle->SetTitleFont(font,"y"); cmsStyle->SetLabelFont(font,"z"); cmsStyle->SetTitleFont(font,"z"); cmsStyle->SetLabelSize(tsize,"x"); cmsStyle->SetTitleSize(tsize,"x"); cmsStyle->SetLabelSize(tsize,"y"); cmsStyle->SetTitleSize(tsize,"y"); cmsStyle->SetLabelSize(tsize,"z"); cmsStyle->SetTitleSize(tsize,"z"); // use bold lines and markers cmsStyle->SetMarkerStyle(20); cmsStyle->SetMarkerSize(1.2); cmsStyle->SetHistLineWidth(2.); cmsStyle->SetLineStyleString(2,"[12 12]"); // postscript dashes // get rid of X error bars and y error bar caps //cmsStyle->SetErrorX(0.001); // do not display any of the standard histogram decorations cmsStyle->SetOptTitle(0); //cmsStyle->SetOptStat(1111); cmsStyle->SetOptStat(0); //cmsStyle->SetOptFit(1111); cmsStyle->SetOptFit(0); // put tick marks on top and RHS of plots cmsStyle->SetPadTickX(1); cmsStyle->SetPadTickY(1); // reset plain style //gROOT->SetStyle("Plain"); gROOT->SetStyle("CMS"); gROOT->ForceStyle(); }
void FakeRate() { TStyle *tdrStyle = new TStyle("tdrStyle","Style for P-TDR"); // For the canvas: tdrStyle->SetCanvasBorderMode(0); tdrStyle->SetCanvasColor(kWhite); tdrStyle->SetCanvasDefH(600); //Height of canvas tdrStyle->SetCanvasDefW(600); //Width of canvas tdrStyle->SetCanvasDefX(0); //POsition on screen tdrStyle->SetCanvasDefY(0); // For the Pad: tdrStyle->SetPadBorderMode(0); tdrStyle->SetPadColor(kWhite); tdrStyle->SetPadGridX(true); tdrStyle->SetPadGridY(true); tdrStyle->SetGridColor(0); tdrStyle->SetGridStyle(3); tdrStyle->SetGridWidth(1); // For the frame: tdrStyle->SetFrameBorderMode(0); tdrStyle->SetFrameBorderSize(1); tdrStyle->SetFrameFillColor(0); tdrStyle->SetFrameFillStyle(0); tdrStyle->SetFrameLineColor(1); tdrStyle->SetFrameLineStyle(1); tdrStyle->SetFrameLineWidth(1); // For the histo: tdrStyle->SetHistLineColor(1); tdrStyle->SetHistLineStyle(0); tdrStyle->SetHistLineWidth(1); tdrStyle->SetEndErrorSize(2); tdrStyle->SetErrorX(0.); tdrStyle->SetMarkerStyle(20); //For the fit/function: tdrStyle->SetOptFit(1); tdrStyle->SetFitFormat("5.4g"); tdrStyle->SetFuncColor(2); tdrStyle->SetFuncStyle(1); tdrStyle->SetFuncWidth(1); //For the date: tdrStyle->SetOptDate(0); // For the statistics box: tdrStyle->SetOptFile(0); tdrStyle->SetOptStat("emr"); // To display the mean and RMS: SetOptStat("mr"); tdrStyle->SetStatColor(kWhite); tdrStyle->SetStatFont(42); tdrStyle->SetStatFontSize(0.025); tdrStyle->SetStatTextColor(1); tdrStyle->SetStatFormat("6.4g"); tdrStyle->SetStatBorderSize(1); tdrStyle->SetStatH(0.1); tdrStyle->SetStatW(0.15); // Margins: tdrStyle->SetPadTopMargin(0.07); tdrStyle->SetPadBottomMargin(0.13); tdrStyle->SetPadLeftMargin(0.13); tdrStyle->SetPadRightMargin(0.05); // For the Global title: tdrStyle->SetTitleFont(35); tdrStyle->SetTitleColor(1); tdrStyle->SetTitleTextColor(1); tdrStyle->SetTitleFillColor(10); tdrStyle->SetTitleFontSize(0.045); tdrStyle->SetTitleX(0.15); // Set the position of the title box tdrStyle->SetTitleBorderSize(0); // For the axis titles: tdrStyle->SetTitleColor(1, "XYZ"); tdrStyle->SetTitleFont(42, "XYZ"); tdrStyle->SetTitleSize(0.04, "XYZ"); tdrStyle->SetTitleXOffset(0.9); tdrStyle->SetTitleYOffset(1.5); // For the axis labels: tdrStyle->SetLabelColor(1, "XYZ"); tdrStyle->SetLabelFont(42, "XYZ"); tdrStyle->SetLabelOffset(0.007, "XYZ"); tdrStyle->SetLabelSize(0.03, "XYZ"); // For the axis: tdrStyle->SetAxisColor(1, "XYZ"); tdrStyle->SetStripDecimals(kTRUE); tdrStyle->SetTickLength(0.03, "XYZ"); tdrStyle->SetNdivisions(510, "XYZ"); tdrStyle->SetPadTickX(1); // To get tick marks on the opposite side of the frame tdrStyle->SetPadTickY(1); // Change for log plots: tdrStyle->SetOptLogx(0); tdrStyle->SetOptLogy(0); tdrStyle->SetOptLogz(0); // Postscript options: tdrStyle->SetPaperSize(20.,20.); tdrStyle->SetPalette(1); const Int_t NRGBs = 5; const Int_t NCont = 255; Double_t stops[NRGBs] = { 0.00, 0.34, 0.61, 0.84, 1.00 }; Double_t red[NRGBs] = { 0.00, 0.00, 0.87, 1.00, 0.51 }; Double_t green[NRGBs] = { 0.00, 0.81, 1.00, 0.20, 0.00 }; Double_t blue[NRGBs] = { 0.51, 1.00, 0.12, 0.00, 0.00 }; TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont); TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont); tdrStyle->SetNumberContours(NCont); gROOT -> ForceStyle(); tdrStyle->cd(); int binsize = 10; int binlow = 30; int binup = 130; TString cut_Iasonas_n = "pfmet_pt < 40. && ph_N_Pt > 0. && ph_N_sinin < 0.011"; TString cut_Iasonas_d = "pfmet_pt < 40. && ph_DLU_Pt > 0. "; TString cut_Zeynep_n = "Num_Pho_Pt > 0. && Num_Pho_SigmaIEtaIEta < 0.011"; TString cut_Zeynep_d = "Den_Pho_Pt > 0."; TString cut_Zeynep_n_new = "passedNum && Pho_Pt > 0. && Pho_SigmaIEtaIEta < 0.011 && muVeto0==0"; TString cut_Zeynep_d_new = "passedDen && Pho_Pt > 0. && muVeto0==0"; TFile *f_Iasonas = new TFile("old_results/dataAll.root","READ"); f_Iasonas->cd("Analyzer"); TH1F *h_num_I = new TH1F("h_num_I","h_num_I" ,binsize ,binlow ,binup); TH1F *h_den_I = new TH1F("h_den_I","h_den_I" ,binsize ,binlow ,binup); AnalyzerTree->Draw("ph_N_Pt>>h_num_I",cut_Iasonas_n,"goff"); AnalyzerTree->Draw("ph_DLU_Pt>>h_den_I",cut_Iasonas_d,"goff"); TH1F *h_raw_I = (TH1F*)h_num_I->Clone("h_raw_I"); h_raw_I->Divide(h_den_I); //TFile *f_Zeynep = new TFile("higgsHistograms_QCD.root","READ"); //TFile *f_Zeynep = new TFile("higgsHistograms_QCD_newHoE.root","READ"); TFile *f_Zeynep = new TFile("n_jetTest2.root","READ"); f_Zeynep->cd("Analyzer"); h_num_Z = new TH1F("h_num_Z","h_num_Z" ,binsize ,binlow ,binup); h_den_Z = new TH1F("h_den_Z","h_den_Z" ,binsize ,binlow ,binup); AnalyzerTree->Draw("Pho_Pt>>h_num_Z",cut_Zeynep_n_new,"goff"); AnalyzerTree->Draw("Pho_Pt>>h_den_Z",cut_Zeynep_d_new,"goff"); TH1F *h_raw_Z = (TH1F*)h_num_Z->Clone("h_raw_Z"); h_raw_Z->Divide(h_den_Z); TFile *f_Zeynep_o = new TFile("old_results/compareDen_Num/ifStatements/testing_simple_1fake.root","READ"); //TFile *f_Zeynep_o = new TFile("higgsHistograms_QCD_newHoE.root","READ"); f_Zeynep_o->cd("Analyzer"); h_num_Z_o = new TH1F("h_num_Z_o","h_num_Z_o" ,binsize ,binlow ,binup); h_den_Z_o = new TH1F("h_den_Z_o","h_den_Z_o" ,binsize ,binlow ,binup); AnalyzerTree->Draw("Num_Pho_Pt>>h_num_Z_o",cut_Zeynep_n,"goff"); AnalyzerTree->Draw("Den_Pho_Pt>>h_den_Z_o",cut_Zeynep_d,"goff"); TH1F *h_raw_Z_o = (TH1F*)h_num_Z_o->Clone("h_raw_Z_o"); h_raw_Z_o->Divide(h_den_Z_o); TCanvas* c1 = new TCanvas("c1","c1",700,600); c1->cd(); h_raw_I->SetTitle("Raw Fake Rate"); h_raw_I->GetYaxis()->SetTitle("Raw Fake Rate"); h_raw_I->GetXaxis()->SetTitle("Offline Photon Pt [GeV]"); h_raw_I->Draw(); h_raw_I->GetYaxis()->SetRangeUser(0.0,15); h_raw_Z->SetLineColor(2); h_raw_Z->Draw("same"); h_raw_Z_o->SetLineColor(4); h_raw_Z_o->Draw("same"); gStyle->SetOptStat(kFALSE); TLegend *leg = new TLegend(0.6879195,0.7482517,0.9496644,0.9300699,NULL,"brNDC"); leg->AddEntry(h_raw_I, "Iasonas Raw Fake Rate" ,"l"); leg->AddEntry(h_raw_Z, "Zeynep Raw Fake Rate" ,"l"); leg->AddEntry(h_raw_Z_o, "Zeynep old Raw Fake Rate" ,"l"); leg->SetFillColor(0); leg->SetShadowColor(0); leg->Draw(); }
void Style(){ TStyle *tdrStyle = new TStyle("tdrStyle","Style for P-TDR"); // For the canvas: tdrStyle->SetCanvasBorderMode(0); tdrStyle->SetCanvasColor(kWhite); tdrStyle->SetCanvasDefH(600); //Height of canvas tdrStyle->SetCanvasDefW(1100); //Width of canvas tdrStyle->SetCanvasDefX(0); //POsition on screen tdrStyle->SetCanvasDefY(0); // For the Pad: tdrStyle->SetPadBorderMode(0); tdrStyle->SetPadColor(kWhite); tdrStyle->SetPadGridX(false); tdrStyle->SetPadGridY(false); tdrStyle->SetGridColor(0); tdrStyle->SetGridStyle(3); tdrStyle->SetGridWidth(1); // For the frame: tdrStyle->SetFrameBorderMode(0); tdrStyle->SetFrameBorderSize(1); tdrStyle->SetFrameFillColor(0); tdrStyle->SetFrameFillStyle(0); tdrStyle->SetFrameLineColor(1); tdrStyle->SetFrameLineStyle(1); tdrStyle->SetFrameLineWidth(1); tdrStyle->SetHistLineWidth(1.5); //For the fit/function: tdrStyle->SetOptFit(1); tdrStyle->SetStatColor(kWhite); tdrStyle->SetStatFont(42); tdrStyle->SetStatFontSize(0.025); tdrStyle->SetOptStat(000000); tdrStyle->SetStatColor(kWhite); // Margins: tdrStyle->SetPadTopMargin(0.05); tdrStyle->SetPadBottomMargin(0.13); tdrStyle->SetPadLeftMargin(0.10); tdrStyle->SetPadRightMargin(0.02); // For the Global title: tdrStyle->SetOptTitle(0); tdrStyle->SetTitleFont(42); tdrStyle->SetTitleColor(1); tdrStyle->SetTitleTextColor(1); tdrStyle->SetTitleFillColor(10); tdrStyle->SetTitleFontSize(0.05); // For the axis titles: tdrStyle->SetTitleColor(1, "XYZ"); tdrStyle->SetTitleFont(42, "XYZ"); tdrStyle->SetTitleSize(0.04, "XYZ"); tdrStyle->SetTitleXOffset(1.1); tdrStyle->SetTitleYOffset(1.1); // For the axis labels: tdrStyle->SetLabelColor(1, "XYZ"); tdrStyle->SetLabelFont(42, "XYZ"); tdrStyle->SetLabelOffset(0.007, "XYZ"); tdrStyle->SetLabelSize(0.04, "XYZ"); // For the axis: tdrStyle->SetAxisColor(1, "XYZ"); tdrStyle->SetStripDecimals(kTRUE); tdrStyle->SetTickLength(0.03, "XYZ"); tdrStyle->SetNdivisions(510, "XYZ"); tdrStyle->SetPadTickX(1); // To get tick marks on the opposite side of the frame tdrStyle->SetPadTickY(1); // Change for log plots: tdrStyle->SetOptLogx(0); tdrStyle->SetOptLogy(0); tdrStyle->SetOptLogz(0); // Postscript options: tdrStyle->SetPaperSize(20.,20.); tdrStyle->cd(); gStyle->SetFillColor(-1); }
void teenyWeenyBtagEffCalculation(){ // TDR style crap - include from Utilities.cc TStyle *tdrStyle = new TStyle("tdrStyle","Style for P-TDR"); // For the canvas: tdrStyle->SetCanvasBorderMode(0); tdrStyle->SetCanvasColor(kWhite); tdrStyle->SetCanvasDefH(600); //Height of canvas tdrStyle->SetCanvasDefW(600); //Width of canvas tdrStyle->SetCanvasDefX(0); //Position on screen tdrStyle->SetCanvasDefY(0); // For the Pad: tdrStyle->SetPadBorderMode(0); // tdrStyle->SetPadBorderSize(Width_t size = 1); tdrStyle->SetPadColor(kWhite); tdrStyle->SetPadGridX(false); tdrStyle->SetPadGridY(false); tdrStyle->SetGridColor(0); tdrStyle->SetGridStyle(3); tdrStyle->SetGridWidth(1); // For the frame: tdrStyle->SetFrameBorderMode(0); tdrStyle->SetFrameBorderSize(1); tdrStyle->SetFrameFillColor(0); tdrStyle->SetFrameFillStyle(0); tdrStyle->SetFrameLineColor(1); tdrStyle->SetFrameLineStyle(1); tdrStyle->SetFrameLineWidth(1); // For the histo: // tdrStyle->SetHistFillColor(1); // tdrStyle->SetHistFillStyle(0); tdrStyle->SetHistLineColor(1); tdrStyle->SetHistLineStyle(0); tdrStyle->SetHistLineWidth(1); // tdrStyle->SetLegoInnerR(Float_t rad = 0.5); // tdrStyle->SetNumberContours(Int_t number = 20); tdrStyle->SetEndErrorSize(2); //tdrStyle->SetErrorMarker(20); tdrStyle->SetErrorX(0.); tdrStyle->SetMarkerStyle(20); //For the fit/function: tdrStyle->SetOptFit(1); tdrStyle->SetFitFormat("5.4g"); tdrStyle->SetFuncColor(2); tdrStyle->SetFuncStyle(1); tdrStyle->SetFuncWidth(1); //For the date: tdrStyle->SetOptDate(0); // tdrStyle->SetDateX(Float_t x = 0.01); // tdrStyle->SetDateY(Float_t y = 0.01); // For the statistics box: tdrStyle->SetOptFile(0); tdrStyle->SetOptStat(0); // To display the mean and RMS: SetOptStat("mr"); tdrStyle->SetStatColor(kWhite); tdrStyle->SetStatFont(42); tdrStyle->SetStatFontSize(0.025); tdrStyle->SetStatTextColor(1); tdrStyle->SetStatFormat("6.4g"); tdrStyle->SetStatBorderSize(1); tdrStyle->SetStatH(0.1); tdrStyle->SetStatW(0.15); // tdrStyle->SetStatStyle(Style_t style = 1001); // tdrStyle->SetStatX(Float_t x = 0); // tdrStyle->SetStatY(Float_t y = 0); // Margins: tdrStyle->SetPadTopMargin(0.05); tdrStyle->SetPadBottomMargin(0.13); tdrStyle->SetPadLeftMargin(0.16); tdrStyle->SetPadRightMargin(0.04); // For the Global title: tdrStyle->SetOptTitle(0); tdrStyle->SetTitleFont(42); tdrStyle->SetTitleColor(1); tdrStyle->SetTitleTextColor(1); tdrStyle->SetTitleFillColor(10); tdrStyle->SetTitleFontSize(0.05); // tdrStyle->SetTitleH(0); // Set the height of the title box // tdrStyle->SetTitleW(0); // Set the width of the title box // tdrStyle->SetTitleX(0); // Set the position of the title box // tdrStyle->SetTitleY(0.985); // Set the position of the title box // tdrStyle->SetTitleStyle(Style_t style = 1001); // tdrStyle->SetTitleBorderSize(2); // For the axis titles: tdrStyle->SetTitleColor(1, "XYZ"); tdrStyle->SetTitleFont(42, "XYZ"); tdrStyle->SetTitleSize(0.05, "XYZ"); // tdrStyle->SetTitleXSize(Float_t size = 0.02); // Another way to set the size? // tdrStyle->SetTitleYSize(Float_t size = 0.02); tdrStyle->SetTitleXOffset(0.9); tdrStyle->SetTitleYOffset(1.25); // tdrStyle->SetTitleOffset(1.1, "Y"); // Another way to set the Offset // tdrStyle->SetTitleOffset(.3, "X"); // Another way to set the Offset // tdrStyle->SetTitleOffset(1., "Y"); // Another way to set the Offset // // For the axis labels: tdrStyle->SetLabelColor(1, "XYZ"); tdrStyle->SetLabelFont(42, "XYZ"); tdrStyle->SetLabelOffset(0.007, "XYZ"); tdrStyle->SetLabelSize(0.05, "XYZ"); // For the axis: tdrStyle->SetAxisColor(1, "XYZ"); tdrStyle->SetStripDecimals(kTRUE); tdrStyle->SetTickLength(0.03, "XYZ"); tdrStyle->SetNdivisions(510, "XYZ"); tdrStyle->SetPadTickX(1); // To get tick marks on the opposite side of the frame tdrStyle->SetPadTickY(1); // Change for log plots: tdrStyle->SetOptLogx(0); tdrStyle->SetOptLogy(0); tdrStyle->SetOptLogz(0); // Postscript options: tdrStyle->SetPaperSize(20.,20.); // tdrStyle->SetLineScalePS(Float_t scale = 3); // tdrStyle->SetLineStyleString(Int_t i, const char* text); // tdrStyle->SetHeaderPS(const char* header); // tdrStyle->SetTitlePS(const char* pstitle); // tdrStyle->SetBarOffset(Float_t baroff = 0.5); // tdrStyle->SetBarWidth(Float_t barwidth = 0.5); // tdrStyle->SetPaintTextFormat(const char* format = "g"); // tdrStyle->SetPalette(Int_t ncolors = 0, Int_t* colors = 0); // tdrStyle->SetTimeOffset(Double_t toffset); // tdrStyle->SetHistMinimumZero(kTRUE); tdrStyle->cd(); // Meat of the stuff // // ned in current scope (tmpfile):1: // (const int)0 //*** Interpreter error recovered *** //root [4] .ls // TFile**/lustre/ncg.ingrid.pt/cmslocal/samples/CMSSW_5_3_7_patch4/chiggs/fakerate_fractionsEstimate/trees/TauFRWMuMCFailing_PFlow.root // TFile*/lustre/ncg.ingrid.pt/cmslocal/samples/CMSSW_5_3_7_patch4/chiggs/fakerate_fractionsEstimate/trees/TauFRWMuMCFailing_PFlow.root //root [5] .q //[vischia@ui-cms01 TopTaus]$ ls /lustre/ncg.ingrid.pt/ //cmslocal/ cmst3/ data1/ data2/ data3/ //[vischia@ui-cms01 TopTaus]$ ls /lustre/ncg.ingrid.pt/cmslocal/vischia/ //MyTMVA_temporaneo/ backupFirstFullRun2012/ myt // // // TFile* ttmutau = new TFile("/lustre/ncg.ingrid.pt/cmslocal/vischia/store/tau/Jan13ReReco/dataRedo/test_preapp2/nomt-2012-V1-mc-MU-20GeV/out-ttbar-mutau.root"); TH1F* btag_eff_fakebs_num = (TH1F*) ttmutau->Get("PFlow/RecoSteps/m_tau/MET/btag_eff_fakebs_num_27" ); TH1F* btag_eff_fakebs_den = (TH1F*) ttmutau->Get("PFlow/RecoSteps/m_tau/MET/btag_eff_fakebs_den_27" ); TH1F* btag_eff_nomatch_num = (TH1F*) ttmutau->Get("PFlow/RecoSteps/m_tau/MET/btag_eff_nomatch_num_27"); TH1F* btag_eff_nomatch_den = (TH1F*) ttmutau->Get("PFlow/RecoSteps/m_tau/MET/btag_eff_nomatch_den_27"); TH1F* btag_eff_fakebs2_num = (TH1F*) ttmutau->Get("PFlow/RecoSteps/m_tau/MET/btag_eff_fakebs2_num_27"); TH1F* btag_eff_fakebs2_den = (TH1F*) ttmutau->Get("PFlow/RecoSteps/m_tau/MET/btag_eff_fakebs2_den_27"); TH1F* btag_eff_realbs_num = (TH1F*) ttmutau->Get("PFlow/RecoSteps/m_tau/MET/btag_eff_realbs_num_27" ); TH1F* btag_eff_realbs_den = (TH1F*) ttmutau->Get("PFlow/RecoSteps/m_tau/MET/btag_eff_realbs_den_27" ); // num= passing // den = non passing double fakesWNonMatchedPassing_over_fakesWNonMatchedNonPassing = ( btag_eff_fakebs_num->Integral()+ btag_eff_nomatch_num->Integral() ) / ( btag_eff_fakebs_den->Integral() + btag_eff_nomatch_den->Integral() ); double fakesWoutNonMatchedPassing_over_fakesWoutNonMatchedNonPassing = btag_eff_fakebs_num->Integral() / btag_eff_fakebs_den->Integral(); double fakesAllNonBsPassing_over_fakesAllNonBsNonPassing = btag_eff_fakebs2_num->Integral() / btag_eff_fakebs2_den->Integral(); double realBsNonPassing_over_fakeAndRealbsNonPassing = btag_eff_realbs_den->Integral() / ( btag_eff_fakebs_den->Integral() +btag_eff_realbs_den->Integral()); double realBsPassing_over_realBsNonPassing = btag_eff_realbs_num->Integral() / btag_eff_realbs_den->Integral(); double realBsPassing_over_realBs = btag_eff_realbs_num->Integral() / ( btag_eff_realbs_num->Integral() + btag_eff_realbs_den->Integral() ); double fakeBsPassing_over_fakeBs = btag_eff_fakebs_num->Integral() / ( btag_eff_fakebs_num->Integral() + btag_eff_fakebs_den->Integral() ); double fakeBsPassing_over_fakeBs_includeNonMatched = btag_eff_fakebs2_num->Integral() / ( btag_eff_fakebs2_num->Integral() + btag_eff_fakebs2_den->Integral() ); cout << "fakesWNonMatchedPassing_over_fakesWNonMatchedNonPassing: " << fakesWNonMatchedPassing_over_fakesWNonMatchedNonPassing <<endl; cout << "fakesWoutNonMatchedPassing_over_fakesWoutNonMatchedNonPassing: " << fakesWoutNonMatchedPassing_over_fakesWoutNonMatchedNonPassing <<endl; cout << "fakesAllNonBsPassing_over_fakesAllNonBsNonPassing: " << fakesAllNonBsPassing_over_fakesAllNonBsNonPassing <<endl; cout << "realBsNonPassing_over_fakeAndRealbsNonPassing: " << realBsNonPassing_over_fakeAndRealbsNonPassing <<endl; cout << "realBsPassing_over_realBsNonPassing: " << realBsPassing_over_realBsNonPassing <<endl; cout << "realBsPassing_over_realBs: " << realBsPassing_over_realBs <<endl; cout << "fakeBsPassing_over_fakeBs: " << fakeBsPassing_over_fakeBs <<endl; cout << "fakeBsPassing_over_fakeBs_includeNonMatched: " << fakeBsPassing_over_fakeBs_includeNonMatched <<endl; // // httllq->Sumw2(); // httllg->Sumw2(); // // httllq->Add(hwjetq,1.); // httllg->Add(hwjetg,1.); // httlla->Add(hwjeta,1.); // // double fqf= httllq->Integral() / (httllq->Integral() + httllg->Integral()); // double fgf= httllg->Integral() / (httllq->Integral() + httllg->Integral()); // // // cout << "Fractions in ttll sample: quarks " << ttllfq << ", gluons " << ttllfg << endl; // cout << "Fractions in wjet sample: quarks " << wjetfq << ", gluons " << wjetfg << endl; // cout << "Combination: quarks " << 0.5*ttllfq + 0.5*wjetfq << ", gluons " << 0.5*ttllfg+0.5*wjetfg << endl; // cout << "Fractions in main anal. sample: quarks " << fqf << ", gluons " << fgf << endl; // cout << "-------------------------------" << endl; // // TFile* wmuP = new TFile("/lustre/ncg.ingrid.pt/cmslocal/samples/CMSSW_5_3_7_patch4/chiggs/fakerate_testPOG/trees/TauFRWMuMCPassing_PFlow.root"); // TFile* wmuF = new TFile("/lustre/ncg.ingrid.pt/cmslocal/samples/CMSSW_5_3_7_patch4/chiggs/fakerate_testPOG/trees/TauFRWMuMCFailing_PFlow.root"); // TFile* qcdP = new TFile("/lustre/ncg.ingrid.pt/cmslocal/samples/CMSSW_5_3_7_patch4/chiggs/fakerate_testPOG/trees/TauFRQCDMCPassing_PFlow.root"); // TFile* qcdF = new TFile("/lustre/ncg.ingrid.pt/cmslocal/samples/CMSSW_5_3_7_patch4/chiggs/fakerate_testPOG/trees/TauFRQCDMCFailing_PFlow.root"); // // std::vector<TH1F*> v_wplusjets_pt; // std::vector<TH1F*> v_wplusjets_pt_unknown; // std::vector<TH1F*> v_wplusjets_pt_quark; // std::vector<TH1F*> v_wplusjets_pt_bquark; // std::vector<TH1F*> v_wplusjets_pt_gluon; // std::vector<TH1F*> v_wplusjets_pt_allquark; // // std::vector<TH1F*> v_qf; // std::vector<TH1F*> v_gf; // // // v_wplusjets_pt .push_back( (TH1F*) ((TH1F*) wmuP->Get("wplusjets_pt") )->Clone("wmuP_wplusjets_pt") ); // v_wplusjets_pt_unknown .push_back( (TH1F*) ((TH1F*) wmuP->Get("wplusjets_pt_unknown") )->Clone("wmuP_wplusjets_pt_unknown") ); // v_wplusjets_pt_quark .push_back( (TH1F*) ((TH1F*) wmuP->Get("wplusjets_pt_quark") )->Clone("wmuP_wplusjets_pt_quark") ); // v_wplusjets_pt_bquark .push_back( (TH1F*) ((TH1F*) wmuP->Get("wplusjets_pt_bquark") )->Clone("wmuP_wplusjets_pt_bquark") ); // v_wplusjets_pt_gluon .push_back( (TH1F*) ((TH1F*) wmuP->Get("wplusjets_pt_gluon") )->Clone("wmuP_wplusjets_pt_gluon") ); // v_wplusjets_pt_allquark.push_back( (TH1F*) ((TH1F*) wmuP->Get("wplusjets_pt_allquark"))->Clone("wmuP_wplusjets_pt_allquark") ); // // v_wplusjets_pt .push_back( (TH1F*) ((TH1F*) wmuF->Get("wplusjets_pt") )->Clone("wmuF_wplusjets_pt") ); // v_wplusjets_pt_unknown .push_back( (TH1F*) ((TH1F*) wmuF->Get("wplusjets_pt_unknown") )->Clone("wmuF_wplusjets_pt_unknown") ); // v_wplusjets_pt_quark .push_back( (TH1F*) ((TH1F*) wmuF->Get("wplusjets_pt_quark") )->Clone("wmuF_wplusjets_pt_quark") ); // v_wplusjets_pt_bquark .push_back( (TH1F*) ((TH1F*) wmuF->Get("wplusjets_pt_bquark") )->Clone("wmuF_wplusjets_pt_bquark") ); // v_wplusjets_pt_gluon .push_back( (TH1F*) ((TH1F*) wmuF->Get("wplusjets_pt_gluon") )->Clone("wmuF_wplusjets_pt_gluon") ); // v_wplusjets_pt_allquark.push_back( (TH1F*) ((TH1F*) wmuF->Get("wplusjets_pt_allquark"))->Clone("wmuF_wplusjets_pt_allquark") ); // // v_wplusjets_pt .push_back( (TH1F*) ((TH1F*) qcdP->Get("wplusjets_pt") )->Clone("qcdP_wplusjets_pt") ); // v_wplusjets_pt_unknown .push_back( (TH1F*) ((TH1F*) qcdP->Get("wplusjets_pt_unknown") )->Clone("qcdP_wplusjets_pt_unknown") ); // v_wplusjets_pt_quark .push_back( (TH1F*) ((TH1F*) qcdP->Get("wplusjets_pt_quark") )->Clone("qcdP_wplusjets_pt_quark") ); // v_wplusjets_pt_bquark .push_back( (TH1F*) ((TH1F*) qcdP->Get("wplusjets_pt_bquark") )->Clone("qcdP_wplusjets_pt_bquark") ); // v_wplusjets_pt_gluon .push_back( (TH1F*) ((TH1F*) qcdP->Get("wplusjets_pt_gluon") )->Clone("qcdP_wplusjets_pt_gluon") ); // v_wplusjets_pt_allquark.push_back( (TH1F*) ((TH1F*) qcdP->Get("wplusjets_pt_allquark"))->Clone("qcdP_wplusjets_pt_allquark") ); // // v_wplusjets_pt .push_back( (TH1F*) ((TH1F*) qcdF->Get("wplusjets_pt") )->Clone("qcdF_wplusjets_pt") ); // v_wplusjets_pt_unknown .push_back( (TH1F*) ((TH1F*) qcdF->Get("wplusjets_pt_unknown") )->Clone("qcdF_wplusjets_pt_unknown") ); // v_wplusjets_pt_quark .push_back( (TH1F*) ((TH1F*) qcdF->Get("wplusjets_pt_quark") )->Clone("qcdF_wplusjets_pt_quark") ); // v_wplusjets_pt_bquark .push_back( (TH1F*) ((TH1F*) qcdF->Get("wplusjets_pt_bquark") )->Clone("qcdF_wplusjets_pt_bquark") ); // v_wplusjets_pt_gluon .push_back( (TH1F*) ((TH1F*) qcdF->Get("wplusjets_pt_gluon") )->Clone("qcdF_wplusjets_pt_gluon") ); // v_wplusjets_pt_allquark.push_back( (TH1F*) ((TH1F*) qcdF->Get("wplusjets_pt_allquark"))->Clone("qcdF_wplusjets_pt_allquark") ); // // std::vector<int> colours; // colours.push_back(1); // colours.push_back(2); // colours.push_back(4); // colours.push_back(5); // // std::vector<TString> labels; // labels.push_back("W+1jet "); // labels.push_back("W+1jet "); // labels.push_back("QCDmulti "); // labels.push_back("QCDmulti "); // // std::vector<TString> fBase; // fBase.push_back("WMu1"); // fBase.push_back("WMu2"); // fBase.push_back("QCD1"); // fBase.push_back("QCD2"); // // for(size_t i=0; i<v_wplusjets_pt.size(); ++i){ // v_wplusjets_pt [i]->SetLineColor(colours[i]); // v_wplusjets_pt_unknown [i]->SetLineColor(colours[i]); // v_wplusjets_pt_quark [i]->SetLineColor(colours[1]); // v_wplusjets_pt_bquark [i]->SetLineColor(colours[i]); // v_wplusjets_pt_gluon [i]->SetLineColor(colours[2]); // v_wplusjets_pt_allquark[i]->SetLineColor(colours[1]); // // v_wplusjets_pt [i]->SetLineWidth(3); // v_wplusjets_pt_unknown [i]->SetLineWidth(3); // v_wplusjets_pt_quark [i]->SetLineWidth(3); // v_wplusjets_pt_bquark [i]->SetLineWidth(3); // v_wplusjets_pt_gluon [i]->SetLineWidth(3); // v_wplusjets_pt_allquark[i]->SetLineWidth(3); // // // v_wplusjets_pt_gluon[i]->Add(v_wplusjets_pt_unknown[i],1.); // // TH1F* numQ = v_wplusjets_pt_allquark[i]->Clone(TString(v_wplusjets_pt_allquark[i]->GetName())+"numQ"); // TH1F* numG = v_wplusjets_pt_gluon[i]->Clone(TString(v_wplusjets_pt_gluon[i]->GetName())+"numG"); // TH1F* den = v_wplusjets_pt_allquark[i]->Clone(TString(v_wplusjets_pt_allquark[i]->GetName())+"den"); // // numQ->GetYaxis()->SetTitle("Jet content"); // numG->GetYaxis()->SetTitle("Jet content"); // // // cout << "Fractions for " << fBase[i] << ": quark " << v_wplusjets_pt_allquark[i]->Integral() / (v_wplusjets_pt_allquark[i]->Integral() + v_wplusjets_pt_gluon[i]->Integral() ) << ", gluon " << v_wplusjets_pt_gluon[i]->Integral() / (v_wplusjets_pt_allquark[i]->Integral() + v_wplusjets_pt_gluon[i]->Integral() ) << endl; // // numQ->Sumw2(); // numG->Sumw2(); // den->Sumw2(); // // den->Add(v_wplusjets_pt_gluon[i],1.); // // numQ->Divide(den); // numG->Divide(den); // cout << "I divided" << endl; // // v_qf.push_back(numQ); // v_gf.push_back(numG); // // // // TLegend* leg_ = new TLegend(0.15,0.65,0.62,0.80,NULL,"brNDC"); // TLegend* leg_ = new TLegend(0.40,0.50,0.80,0.70,NULL,"brNDC"); // leg_->SetTextFont(42); // leg_->SetBorderSize(0); // leg_->SetLineColor(1); // leg_->SetLineStyle(1); // leg_->SetLineWidth(1); // leg_->SetFillColor(0); // leg_->SetFillStyle(0); // leg_->AddEntry(numQ,/*labels[i]+*/"Quark jets fraction","lpf"); // leg_->AddEntry(numG,/*labels[i]+*/"Gluon jets fraction","lpf"); // // TPaveText *pt1 = new TPaveText(0.17,0.45,0.5,0.5, "brNDC"); // pt1->SetBorderSize(1); // pt1->SetFillColor(19); // pt1->SetFillStyle(0); // pt1->SetLineColor(0); // pt1->SetTextFont(132); // pt1->SetTextSize(0.033); // // TText *text = pt1->AddText("#splitline{m_{H^{#pm}} = 120 GeV/c^{2},}{BR(t #rightarrow H^{+}b) = 0.05}"); // TCanvas* myCanva = new TCanvas(labels[i],labels[i],2000,2000); // myCanva->cd(); // // if(i<2){ // numQ->Draw("hist"); // numG->Draw("histsame"); // } // else{ // numG->Draw("hist"); // numQ->Draw("histsame"); // } // leg_->Draw(); // // pt1->Draw("same"); // myCanva->SaveAs(fBase[i]+".pdf"); // myCanva->SaveAs(fBase[i]+".png"); // myCanva->Clear(); // delete myCanva; // delete pt1; // delete numQ; // delete numG; // delete den; // delete leg_; // } }
void setTDRStyle() { TStyle *tdrStyle = new TStyle("tdrStyle","Style for P-DR"); gROOT->SetStyle("Plain"); gROOT->ForceStyle(); tdrStyle->SetFrameBorderMode(0); tdrStyle->SetCanvasBorderMode(0); tdrStyle->SetPadBorderMode(0); tdrStyle->SetPadBorderMode(0); // tdrStyle->SetFrameColor(0); tdrStyle->SetPadColor(0); tdrStyle->SetCanvasColor(0); tdrStyle->SetStatColor(0); tdrStyle->SetFillColor(0); tdrStyle->SetPaperSize(20,26); // tdrStyle->SetPadTopMargin(0.08); // tdrStyle->SetPadBottomMargin(0.14); tdrStyle->SetPadRightMargin(0.04); tdrStyle->SetPadLeftMargin(0.05); // tdrStyle->SetCanvasDefH(800); // tdrStyle->SetCanvasDefW(800); // tdrStyle->SetPadGridX(1); // tdrStyle->SetPadGridY(1); tdrStyle->SetPadTickX(1); tdrStyle->SetPadTickY(1); tdrStyle->SetTextFont(42); //132 tdrStyle->SetTextSize(0.09); tdrStyle->SetLabelFont(42,"xyz"); tdrStyle->SetTitleFont(42,"xyz"); tdrStyle->SetLabelSize(0.045,"xyz"); //0.035 tdrStyle->SetTitleSize(0.045,"xyz"); tdrStyle->SetTitleOffset(1.5,"y"); tdrStyle->SetTitleX(0.16); tdrStyle->SetTitleY(0.93); tdrStyle->SetTitleColor(1); tdrStyle->SetTitleTextColor(1); tdrStyle->SetTitleFillColor(0); tdrStyle->SetTitleBorderSize(1); tdrStyle->SetTitleFontSize(0.04); // tdrStyle->SetPadTopMargin(0.05); // tdrStyle->SetPadBottomMargin(0.13); // tdrStyle->SetPadLeftMargin(0.14); // tdrStyle->SetPadRightMargin(0.02); // use bold lines and markers tdrStyle->SetMarkerSize(4); tdrStyle->SetHistLineWidth(4); tdrStyle->SetLineWidth(2); tdrStyle->SetOptTitle(kFALSE); tdrStyle->SetOptStat(0); tdrStyle->cd(); }
void ChargeRatioStyle() { TStyle* GloStyle; GloStyle = gStyle; TStyle* ChargeRatioStyle = new TStyle("ChargeRatioStyle", "ChargeRatioStyle"); gStyle = ChargeRatioStyle; //---------------------------------------------------------------------------- // Canvas //---------------------------------------------------------------------------- ChargeRatioStyle->SetCanvasBorderMode( 0); ChargeRatioStyle->SetCanvasBorderSize( 10); ChargeRatioStyle->SetCanvasColor ( 0); ChargeRatioStyle->SetCanvasDefH (600); ChargeRatioStyle->SetCanvasDefW (550); ChargeRatioStyle->SetCanvasDefX ( 10); ChargeRatioStyle->SetCanvasDefY ( 10); //---------------------------------------------------------------------------- // Pad //---------------------------------------------------------------------------- ChargeRatioStyle->SetPadBorderMode ( 0); ChargeRatioStyle->SetPadBorderSize ( 10); ChargeRatioStyle->SetPadColor ( 0); ChargeRatioStyle->SetPadBottomMargin(0.20); ChargeRatioStyle->SetPadTopMargin (0.08); ChargeRatioStyle->SetPadLeftMargin (0.18); ChargeRatioStyle->SetPadRightMargin (0.05); //---------------------------------------------------------------------------- // Frame //---------------------------------------------------------------------------- ChargeRatioStyle->SetFrameFillStyle ( 0); ChargeRatioStyle->SetFrameFillColor ( 0); ChargeRatioStyle->SetFrameLineColor ( 1); ChargeRatioStyle->SetFrameLineStyle ( 0); ChargeRatioStyle->SetFrameLineWidth ( 2); ChargeRatioStyle->SetFrameBorderMode( 0); ChargeRatioStyle->SetFrameBorderSize(10); //---------------------------------------------------------------------------- // Hist //---------------------------------------------------------------------------- ChargeRatioStyle->SetHistFillColor(0); ChargeRatioStyle->SetHistFillStyle(1); ChargeRatioStyle->SetHistLineColor(1); ChargeRatioStyle->SetHistLineStyle(0); ChargeRatioStyle->SetHistLineWidth(1); //---------------------------------------------------------------------------- // Axis //---------------------------------------------------------------------------- ChargeRatioStyle->SetLabelFont ( 42, "xyz"); ChargeRatioStyle->SetLabelOffset(0.015, "xyz"); ChargeRatioStyle->SetLabelSize (0.050, "xyz"); ChargeRatioStyle->SetNdivisions ( 505, "xyz"); ChargeRatioStyle->SetTitleFont ( 42, "xyz"); ChargeRatioStyle->SetTitleSize (0.050, "xyz"); // ChargeRatioStyle->SetNdivisions ( -503, "y"); ChargeRatioStyle->SetTitleOffset( 1.4, "x"); ChargeRatioStyle->SetTitleOffset( 1.2, "y"); ChargeRatioStyle->SetPadTickX ( 1); // Tick marks on the opposite side of the frame ChargeRatioStyle->SetPadTickY ( 1); // Tick marks on the opposite side of the frame //---------------------------------------------------------------------------- // Title //---------------------------------------------------------------------------- ChargeRatioStyle->SetTitleBorderSize( 0); ChargeRatioStyle->SetTitleFillColor (10); ChargeRatioStyle->SetTitleFont (42, ""); ChargeRatioStyle->SetTitleAlign ( 33); ChargeRatioStyle->SetTitleFontSize(0.045); ChargeRatioStyle->SetTitleX (0.560); ChargeRatioStyle->SetTitleY (0.890); // ChargeRatioStyle->SetTitleX (0.940); // ChargeRatioStyle->SetTitleY (0.990); //---------------------------------------------------------------------------- // Stat //---------------------------------------------------------------------------- ChargeRatioStyle->SetOptStat (1110); ChargeRatioStyle->SetStatBorderSize( 0); ChargeRatioStyle->SetStatColor ( 10); ChargeRatioStyle->SetStatFont ( 42); ChargeRatioStyle->SetStatX (0.94); ChargeRatioStyle->SetStatY (0.91); return(); }
void SetStyle() { TH1::SetDefaultSumw2(); gROOT->SetStyle("Plain"); TStyle *MITStyle = new TStyle("MIT-Style","The Perfect Style for Plots ;-)"); gStyle = MITStyle; gStyle->SetTitleSize(0.08,"t");// gStyle->SetTitleX(0.8); gStyle->SetTitleW(0.3); gStyle->SetFrameFillColor(2); gStyle->SetFrameLineColor(2); // Canvas MITStyle->SetCanvasColor (0); MITStyle->SetCanvasBorderSize(10); MITStyle->SetCanvasBorderMode(0); MITStyle->SetCanvasDefH (500); MITStyle->SetCanvasDefW (550); // MITStyle->SetCanvasDefX (100); // MITStyle->SetCanvasDefY (100); // Pads MITStyle->SetPadColor (0); // MITStyle->SetPadBorderSize (10); MITStyle->SetPadBorderMode (0); MITStyle->SetPadBottomMargin(0.18); MITStyle->SetPadTopMargin (0.06); MITStyle->SetPadLeftMargin (0.22); MITStyle->SetPadRightMargin (0.06); MITStyle->SetPadGridX (0); MITStyle->SetPadGridY (0); MITStyle->SetPadTickX (1); MITStyle->SetPadTickY (1); // Frames MITStyle->SetFrameFillStyle ( 0); MITStyle->SetFrameFillColor ( 0); MITStyle->SetFrameLineColor ( 1); MITStyle->SetFrameLineStyle ( 0); MITStyle->SetFrameLineWidth ( 1); // MITStyle->SetFrameBorderSize(10); MITStyle->SetFrameBorderMode( 0); // Histograms MITStyle->SetHistLineColor(1); MITStyle->SetHistLineStyle(0); MITStyle->SetHistLineWidth(3); MITStyle->SetNdivisions(505,"X"); MITStyle->SetNdivisions(505,"Y"); MITStyle->SetNdivisions(505,"Z"); // Functions MITStyle->SetFuncColor(1); MITStyle->SetFuncStyle(0); MITStyle->SetFuncWidth(2); // Various MITStyle->SetMarkerStyle(20); MITStyle->SetMarkerColor(kBlack); MITStyle->SetMarkerSize (1.2); // MITStyle->SetTitleSize (0.1,"t"); MITStyle->SetTitleSize (0.070,"X"); MITStyle->SetTitleOffset(1.0,"X"); MITStyle->SetTitleFont (42,"X"); MITStyle->SetLabelOffset(0.005,"X"); MITStyle->SetLabelSize (0.070,"X"); MITStyle->SetLabelFont (42 ,"X"); MITStyle->SetTitleSize (0.070,"Y"); MITStyle->SetTitleOffset(1.0,"Y"); MITStyle->SetTitleFont (42,"Y"); MITStyle->SetLabelOffset(0.005,"Y"); MITStyle->SetLabelSize (0.070,"Y"); MITStyle->SetLabelFont (42 ,"Y"); MITStyle->SetTitleSize (0.06,"Z"); MITStyle->SetTitleOffset(1.640,"Z"); MITStyle->SetTitleFont (42,"Z"); MITStyle->SetLabelOffset(0.005,"Z"); MITStyle->SetLabelSize (0.070,"Z"); MITStyle->SetLabelFont (42 ,"Z"); MITStyle->SetStripDecimals(kFALSE); MITStyle->SetTitleBorderSize(0); MITStyle->SetTitleFillColor(0); // MITStyle->SetTitleAlign(6); MITStyle->SetTextSize (20); MITStyle->SetTextFont (43); MITStyle->SetStatFont (42); MITStyle->SetOptStat (0); MITStyle->SetLegendBorderSize(0); MITStyle->SetEndErrorSize(0); MITStyle->SetErrorX(0); MITStyle->SetPalette (1,0); }
void setStyle(){ //Style// TStyle *tdrStyle = new TStyle("tdrStyle","Style for P-TDR"); // For the canvas: tdrStyle->SetCanvasBorderMode(0); tdrStyle->SetCanvasColor(kWhite); tdrStyle->SetCanvasDefH(600); //Height of canvas tdrStyle->SetCanvasDefW(600); //Width of canvas tdrStyle->SetCanvasDefX(0); //POsition on screen tdrStyle->SetCanvasDefY(0); // For the Pad: tdrStyle->SetPadBorderMode(0); tdrStyle->SetPadColor(kWhite); tdrStyle->SetPadGridX(false); tdrStyle->SetPadGridY(false); tdrStyle->SetGridColor(0); tdrStyle->SetGridStyle(3); tdrStyle->SetGridWidth(1); // For the frame: tdrStyle->SetFrameBorderMode(0); tdrStyle->SetFrameBorderSize(1); tdrStyle->SetFrameFillColor(0); tdrStyle->SetFrameFillStyle(0); tdrStyle->SetFrameLineColor(1); tdrStyle->SetFrameLineStyle(1); tdrStyle->SetFrameLineWidth(1); tdrStyle->SetPadTopMargin(0.05); tdrStyle->SetPadBottomMargin(0.13); tdrStyle->SetPadLeftMargin(0.16); tdrStyle->SetPadRightMargin(0.02); // For the Global title: tdrStyle->SetOptTitle(0); tdrStyle->SetTitleFont(42); tdrStyle->SetTitleColor(1); tdrStyle->SetTitleTextColor(1); tdrStyle->SetTitleFillColor(10); tdrStyle->SetTitleFontSize(0.05); // For the axis titles: tdrStyle->SetTitleColor(1, "XYZ"); tdrStyle->SetTitleFont(42, "XYZ"); tdrStyle->SetTitleSize(0.06, "XYZ"); tdrStyle->SetTitleXOffset(0.9); tdrStyle->SetTitleYOffset(0.9); // For the axis labels: tdrStyle->SetLabelColor(1, "XYZ"); tdrStyle->SetLabelFont(42, "XYZ"); tdrStyle->SetLabelOffset(0.007, "XYZ"); tdrStyle->SetLabelSize(0.05, "XYZ"); // For the axis: tdrStyle->SetAxisColor(1, "XYZ"); //tdrStyle->SetStripDecimals(kTRUE); tdrStyle->SetTickLength(0.03, "XYZ"); tdrStyle->SetNdivisions(510, "XYZ"); tdrStyle->SetPadTickX(1); // To get tick marks on the opposite side of the frame tdrStyle->SetPadTickY(1); tdrStyle->SetPaperSize(20.,20.); tdrStyle->SetHatchesLineWidth(5); tdrStyle->SetHatchesSpacing(0.05); tdrStyle->SetOptStat(0); tdrStyle->cd(); }
///// // Set setTDRStyle_modified (from link https://twiki.cern.ch/twiki/pub/CMS/TRK10001/setTDRStyle_modified.C) ///// void setTDRStyle(){ TStyle *tdrStyle = new TStyle("tdrStyle","Style for P-TDR"); // For the canvas: tdrStyle->SetCanvasBorderMode(0); tdrStyle->SetCanvasColor(kWhite); tdrStyle->SetCanvasDefH(600); //Height of canvas tdrStyle->SetCanvasDefW(600); //Width of canvas tdrStyle->SetCanvasDefX(0); //POsition on screen tdrStyle->SetCanvasDefY(0); // For the Pad: tdrStyle->SetPadBorderMode(0); tdrStyle->SetPadColor(kWhite); tdrStyle->SetPadGridX(false); tdrStyle->SetPadGridY(false); tdrStyle->SetGridColor(0); tdrStyle->SetGridStyle(3); tdrStyle->SetGridWidth(1); // For the frame: tdrStyle->SetFrameBorderMode(0); tdrStyle->SetFrameBorderSize(1); tdrStyle->SetFrameFillColor(0); tdrStyle->SetFrameFillStyle(0); tdrStyle->SetFrameLineColor(1); tdrStyle->SetFrameLineStyle(1); tdrStyle->SetFrameLineWidth(1); // For the histo: tdrStyle->SetHistFillColor(0); tdrStyle->SetHistLineColor(1); tdrStyle->SetHistLineStyle(0); tdrStyle->SetHistLineWidth(1); tdrStyle->SetErrorX(0.); tdrStyle->SetMarkerStyle(20); //For the fit/function: tdrStyle->SetOptFit(1); tdrStyle->SetFitFormat("5.4g"); tdrStyle->SetFuncStyle(1); tdrStyle->SetFuncWidth(1); //For the date: tdrStyle->SetOptDate(0); // For the statistics box: tdrStyle->SetOptFile(0); tdrStyle->SetOptStat("e"); tdrStyle->SetStatColor(kGray); tdrStyle->SetStatFont(42); tdrStyle->SetStatTextColor(1); tdrStyle->SetStatFormat("6.4g"); tdrStyle->SetStatBorderSize(0); tdrStyle->SetStatX(1.); //Starting position on X axis tdrStyle->SetStatY(1.); //Starting position on Y axis tdrStyle->SetStatFontSize(0.025); //Vertical Size tdrStyle->SetStatW(0.15); //Horizontal size // tdrStyle->SetStatStyle(Style_t style = 1001); // Margins: tdrStyle->SetPadTopMargin(0.05); tdrStyle->SetPadBottomMargin(0.125); tdrStyle->SetPadLeftMargin(0.105); tdrStyle->SetPadRightMargin(0.1); // For the Global title: // tdrStyle->SetOptTitle(0); tdrStyle->SetTitleFont(42); tdrStyle->SetTitleColor(1); tdrStyle->SetTitleTextColor(1); tdrStyle->SetTitleFillColor(10); tdrStyle->SetTitleFontSize(0.05); // For the axis titles: tdrStyle->SetTitleColor(1, "XYZ"); tdrStyle->SetTitleFont(42, "XYZ"); tdrStyle->SetTitleSize(0.05, "XYZ"); tdrStyle->SetTitleXOffset(0.9); tdrStyle->SetTitleYOffset(0.8); tdrStyle->SetTitleOffset(0.7, "Y"); // Another way to set the Offset // For the axis labels: tdrStyle->SetLabelColor(1, "XYZ"); tdrStyle->SetLabelFont(42, "XYZ"); tdrStyle->SetLabelOffset(0.007, "XYZ"); tdrStyle->SetLabelSize(0.045, "XYZ"); // For the axis: tdrStyle->SetAxisColor(1, "XYZ"); tdrStyle->SetStripDecimals(kTRUE); tdrStyle->SetTickLength(0.03, "XYZ"); tdrStyle->SetNdivisions(510, "XYZ"); tdrStyle->SetPadTickX(1); // To get tick marks on the opposite side of the frame tdrStyle->SetPadTickY(1); // Change for log plots: tdrStyle->SetOptLogx(0); tdrStyle->SetOptLogy(0); tdrStyle->SetOptLogz(0); tdrStyle->cd(); }
void setStyle() { // set the TStyle TStyle* style = new TStyle("DrawBaseStyle", ""); style->SetCanvasColor(0); style->SetPadColor(0); style->SetFrameFillColor(0); style->SetStatColor(0); style->SetOptStat(0); style->SetTitleFillColor(0); style->SetCanvasBorderMode(0); style->SetPadBorderMode(0); style->SetFrameBorderMode(0); style->SetPadBottomMargin(0.12); style->SetPadLeftMargin(0.12); style->cd(); // For the canvas: style->SetCanvasBorderMode(0); style->SetCanvasColor(kWhite); style->SetCanvasDefH(600); //Height of canvas style->SetCanvasDefW(600); //Width of canvas style->SetCanvasDefX(0); //POsition on screen style->SetCanvasDefY(0); // For the Pad: style->SetPadBorderMode(0); style->SetPadColor(kWhite); style->SetPadGridX(false); style->SetPadGridY(false); style->SetGridColor(0); style->SetGridStyle(3); style->SetGridWidth(1); // For the frame: style->SetFrameBorderMode(0); style->SetFrameBorderSize(1); style->SetFrameFillColor(0); style->SetFrameFillStyle(0); style->SetFrameLineColor(1); style->SetFrameLineStyle(1); style->SetFrameLineWidth(1); // Margins: style->SetPadTopMargin(0.05); style->SetPadBottomMargin(0.15);//0.13); style->SetPadLeftMargin(0.15);//0.16); style->SetPadRightMargin(0.05);//0.02); // For the Global title: style->SetOptTitle(0); style->SetTitleFont(42); style->SetTitleColor(1); style->SetTitleTextColor(1); style->SetTitleFillColor(10); style->SetTitleFontSize(0.05); // For the axis titles: style->SetTitleColor(1, "XYZ"); style->SetTitleFont(42, "XYZ"); style->SetTitleSize(0.05, "XYZ"); style->SetTitleXOffset(1.15);//0.9); style->SetTitleYOffset(1.3); // => 1.15 if exponents // For the axis labels: style->SetLabelColor(1, "XYZ"); style->SetLabelFont(42, "XYZ"); style->SetLabelOffset(0.007, "XYZ"); style->SetLabelSize(0.045, "XYZ"); // For the axis: style->SetAxisColor(1, "XYZ"); style->SetStripDecimals(kTRUE); style->SetTickLength(0.03, "XYZ"); style->SetNdivisions(510, "XYZ"); style->SetPadTickX(1); // To get tick marks on the opposite side of the frame style->SetPadTickY(1); // for histograms: style->SetHistLineColor(0); style->cd(); }
TStyle* sPhenixStyle() { TStyle *sphenixStyle = new TStyle("sPHENIX","sPHENIX style"); // use plain black on white colors Int_t icol=0; // WHITE sphenixStyle->SetFrameBorderMode(icol); sphenixStyle->SetFrameFillColor(icol); sphenixStyle->SetCanvasBorderMode(icol); sphenixStyle->SetCanvasColor(icol); sphenixStyle->SetPadBorderMode(icol); sphenixStyle->SetPadColor(icol); sphenixStyle->SetStatColor(icol); //sphenixStyle->SetFillColor(icol); // don't use: white fill color for *all* objects // set the paper & margin sizes sphenixStyle->SetPaperSize(20,26); // set margin sizes sphenixStyle->SetPadTopMargin(0.05); sphenixStyle->SetPadRightMargin(0.05); sphenixStyle->SetPadBottomMargin(0.16); sphenixStyle->SetPadLeftMargin(0.16); // set title offsets (for axis label) sphenixStyle->SetTitleXOffset(1.4); sphenixStyle->SetTitleYOffset(1.4); // use large fonts //Int_t font=72; // Helvetica italics Int_t font=42; // Helvetica Double_t tsize=0.05; sphenixStyle->SetTextFont(font); sphenixStyle->SetTextSize(tsize); sphenixStyle->SetLabelFont(font,"x"); sphenixStyle->SetTitleFont(font,"x"); sphenixStyle->SetLabelFont(font,"y"); sphenixStyle->SetTitleFont(font,"y"); sphenixStyle->SetLabelFont(font,"z"); sphenixStyle->SetTitleFont(font,"z"); sphenixStyle->SetLabelSize(tsize,"x"); sphenixStyle->SetTitleSize(tsize,"x"); sphenixStyle->SetLabelSize(tsize,"y"); sphenixStyle->SetTitleSize(tsize,"y"); sphenixStyle->SetLabelSize(tsize,"z"); sphenixStyle->SetTitleSize(tsize,"z"); // use bold lines and markers sphenixStyle->SetMarkerStyle(20); sphenixStyle->SetMarkerSize(1.2); sphenixStyle->SetHistLineWidth(2.); sphenixStyle->SetLineStyleString(2,"[12 12]"); // postscript dashes // get rid of X error bars //sphenixStyle->SetErrorX(0.001); // get rid of error bar caps sphenixStyle->SetEndErrorSize(0.); // do not display any of the standard histogram decorations sphenixStyle->SetOptTitle(0); //sphenixStyle->SetOptStat(1111); sphenixStyle->SetOptStat(0); //sphenixStyle->SetOptFit(1111); sphenixStyle->SetOptFit(0); // put tick marks on top and RHS of plots sphenixStyle->SetPadTickX(1); sphenixStyle->SetPadTickY(1); // legend modificatin sphenixStyle->SetLegendBorderSize(0); sphenixStyle->SetLegendFillColor(0); sphenixStyle->SetLegendFont(font); #if ROOT_VERSION_CODE >= ROOT_VERSION(6,00,0) std::cout << "sPhenixStyle: ROOT6 mode" << std::endl; sphenixStyle->SetLegendTextSize(tsize); sphenixStyle->SetPalette(kBird); #else std::cout << "sPhenixStyle: ROOT5 mode" << std::endl; // color palette - manually define 'kBird' palette only available in ROOT 6 Int_t alpha = 0; Double_t stops[9] = { 0.0000, 0.1250, 0.2500, 0.3750, 0.5000, 0.6250, 0.7500, 0.8750, 1.0000}; Double_t red[9] = { 0.2082, 0.0592, 0.0780, 0.0232, 0.1802, 0.5301, 0.8186, 0.9956, 0.9764}; Double_t green[9] = { 0.1664, 0.3599, 0.5041, 0.6419, 0.7178, 0.7492, 0.7328, 0.7862, 0.9832}; Double_t blue[9] = { 0.5293, 0.8684, 0.8385, 0.7914, 0.6425, 0.4662, 0.3499, 0.1968, 0.0539}; TColor::CreateGradientColorTable(9, stops, red, green, blue, 255, alpha); #endif sphenixStyle->SetNumberContours(80); return sphenixStyle; }
void setEgammaStyle() { TStyle *egammaStyle = new TStyle("egammaStyle","Style for P-TDR"); // For the palette: egammaStyle->SetPalette(1); // For the grid egammaStyle->SetPadGridX(1); egammaStyle->SetPadGridY(1); // For the canvas: egammaStyle->SetCanvasBorderMode(0); egammaStyle->SetCanvasBorderSize(2); egammaStyle->SetCanvasColor(0); //egammaStyle->SetCanvasDefH(600); //egammaStyle->SetCanvasDefW(600); egammaStyle->SetCanvasDefX(0); egammaStyle->SetCanvasDefY(0); // For the pad: egammaStyle->SetPadBorderMode(0); egammaStyle->SetPadColor(kWhite); egammaStyle->SetPadGridX(false); egammaStyle->SetPadGridY(false); egammaStyle->SetGridColor(0); egammaStyle->SetGridStyle(3); egammaStyle->SetGridWidth(1); // For the frame: egammaStyle->SetFrameBorderMode(0); egammaStyle->SetFrameBorderSize(1); egammaStyle->SetFrameFillColor(0); egammaStyle->SetFrameFillStyle(0); egammaStyle->SetFrameLineColor(1); egammaStyle->SetFrameLineStyle(1); egammaStyle->SetFrameLineWidth(1); // For the histos: egammaStyle->SetHistLineColor(1); egammaStyle->SetHistLineStyle(0); egammaStyle->SetHistLineWidth(2); // chiara: era 1 egammaStyle->SetEndErrorSize(2); egammaStyle->SetErrorX(0.); // for the graphs egammaStyle->SetMarkerColor(1); egammaStyle->SetMarkerStyle(20); egammaStyle->SetMarkerSize(1.1); // chiara: era 1.2 // For the fit/function: egammaStyle->SetOptFit(1); egammaStyle->SetFitFormat("5.4g"); egammaStyle->SetFuncColor(2); egammaStyle->SetFuncStyle(1); egammaStyle->SetFuncWidth(2); // chiara: era 1 //For the date: egammaStyle->SetOptDate(0); // For the statistics box: egammaStyle->SetOptFile(0); egammaStyle->SetOptStat(0); // To display the mean and RMS: SetOptStat("mr"); egammaStyle->SetStatColor(kWhite); egammaStyle->SetStatFont(42); egammaStyle->SetStatFontSize(0.025); egammaStyle->SetStatTextColor(1); egammaStyle->SetStatFormat("6.4g"); egammaStyle->SetStatBorderSize(1); egammaStyle->SetStatH(0.1); egammaStyle->SetStatW(0.15); // For the Global title: egammaStyle->SetOptTitle(1); // 0=No Title egammaStyle->SetTitleFont(42); egammaStyle->SetTitleColor(1); egammaStyle->SetTitleTextColor(1); egammaStyle->SetTitleFillColor(10); egammaStyle->SetTitleFontSize(0.05); // For the axis titles: egammaStyle->SetTitleColor(1, "XYZ"); egammaStyle->SetTitleFont(42, "XYZ"); egammaStyle->SetTitleSize(0.05, "XYZ"); // chiara: era 0.06 // egammaStyle->SetTitleXOffset(0.9); // chiara // egammaStyle->SetTitleYOffset(1.25); // chiara // For the axis labels: egammaStyle->SetLabelColor(1, "XYZ"); egammaStyle->SetLabelFont(42, "XYZ"); egammaStyle->SetLabelOffset(0.007, "XYZ"); // chiara egammaStyle->SetLabelSize(0.04, "XYZ"); // chiara: era 0.05 // For the axis: egammaStyle->SetAxisColor(1, "XYZ"); egammaStyle->SetStripDecimals(kTRUE); egammaStyle->SetTickLength(0.03, "XYZ"); egammaStyle->SetNdivisions(510, "XYZ"); egammaStyle->SetPadTickX(0); // 0=Text labels (and tics) only on bottom, 1=Text labels on top and bottom egammaStyle->SetPadTickY(1); // Change for log plots: egammaStyle->SetOptLogx(0); egammaStyle->SetOptLogy(0); egammaStyle->SetOptLogz(0); // Postscript options: egammaStyle->SetPaperSize(20.,20.); egammaStyle->cd(); }
// Create my custom FORMAL style // ***************************** void SemiFormalStyle(void) { std::cout << " *** void getSemiFormalStyle(void) *** Custom TStyle initialized!" << std::endl; TStyle *semiFStyle = new TStyle("semiFStyle","Style for AN09"); // For the canvas: semiFStyle->SetCanvasBorderMode(0); semiFStyle->SetCanvasColor(kWhite); semiFStyle->SetCanvasDefH(600); //Height of canvas semiFStyle->SetCanvasDefW(600); //Width of canvas semiFStyle->SetCanvasDefX(0); //POsition on screen semiFStyle->SetCanvasDefY(0); // For the Pad: semiFStyle->SetPadBorderMode(0); // semiFStyle->SetOptTitle(0); // delete histogram titles // semiFStyle->SetPadBorderSize(Width_t size = 1); semiFStyle->SetPadColor(kWhite); semiFStyle->SetPadGridX(true); semiFStyle->SetPadGridY(true); semiFStyle->SetGridColor(0); semiFStyle->SetGridStyle(3); semiFStyle->SetGridWidth(1); // For the frame: semiFStyle->SetFrameBorderMode(0); semiFStyle->SetFrameBorderSize(1); semiFStyle->SetFrameFillColor(0); semiFStyle->SetFrameFillStyle(0); semiFStyle->SetFrameLineColor(1); semiFStyle->SetFrameLineStyle(1); semiFStyle->SetFrameLineWidth(1); // For the histo: // semiFStyle->SetHistFillColor(1); // semiFStyle->SetHistFillStyle(0); semiFStyle->SetHistLineColor(1); semiFStyle->SetHistLineStyle(0); semiFStyle->SetHistLineWidth(1); // semiFStyle->SetLegoInnerR(Float_t rad = 0.5); // semiFStyle->SetNumberContours(Int_t number = 20); semiFStyle->SetEndErrorSize(2); //semiFStyle->SetErrorMarker(20); semiFStyle->SetErrorX(0.); semiFStyle->SetMarkerStyle(20); //For the fit/function: semiFStyle->SetOptFit(1); semiFStyle->SetFitFormat("5.4g"); semiFStyle->SetFuncColor(2); semiFStyle->SetFuncStyle(1); semiFStyle->SetFuncWidth(1); //For the date: semiFStyle->SetOptDate(1); // For the statistics box: semiFStyle->SetOptFile(0); semiFStyle->SetOptStat("mnre"); // stats box semiFStyle->SetOptFit(1111); // fit box semiFStyle->SetStatColor(kWhite); semiFStyle->SetStatFont(42); semiFStyle->SetStatFontSize(0.025); semiFStyle->SetStatTextColor(1); semiFStyle->SetStatFormat("6.4g"); semiFStyle->SetStatBorderSize(1); semiFStyle->SetStatH(0.1); semiFStyle->SetStatW(0.15); // Margins: semiFStyle->SetPadTopMargin(0.15); semiFStyle->SetPadBottomMargin(0.13); semiFStyle->SetPadLeftMargin(0.13); semiFStyle->SetPadRightMargin(0.15); // For the Global title: // semiFStyle->SetOptTitle(0); semiFStyle->SetTitleFont(42); semiFStyle->SetTitleColor(1); semiFStyle->SetTitleTextColor(1); semiFStyle->SetTitleFillColor(10); semiFStyle->SetTitleFontSize(0.05); // For the axis titles: semiFStyle->SetTitleColor(1, "XYZ"); semiFStyle->SetTitleFont(42, "XYZ"); semiFStyle->SetTitleSize(0.06, "XYZ"); semiFStyle->SetTitleXOffset(1.5); semiFStyle->SetTitleYOffset(1.5); semiFStyle->SetTitleOffset(1.5, "Y"); // Another way to set the Offset // For the axis labels: semiFStyle->SetLabelColor(1, "XYZ"); semiFStyle->SetLabelFont(42, "XYZ"); semiFStyle->SetLabelOffset(0.007, "XYZ"); semiFStyle->SetLabelSize(0.05, "XYZ"); // For the axis: semiFStyle->SetAxisColor(1, "XYZ"); semiFStyle->SetStripDecimals(kTRUE); semiFStyle->SetTickLength(0.03, "XYZ"); semiFStyle->SetNdivisions(510, "XYZ"); semiFStyle->SetPadTickX(0); // To get tick marks on the opposite side of the frame semiFStyle->SetPadTickY(0); // Change for log plots: semiFStyle->SetOptLogx(0); semiFStyle->SetOptLogy(0); semiFStyle->SetOptLogz(0); semiFStyle->SetPalette(1,0); semiFStyle->cd(); } //end of: void SemiFormalStyle(void){
void LatinoStyle2() { TStyle* GloStyle; GloStyle = gStyle; (void)GloStyle; TStyle* LatinosStyle = new TStyle("LatinosStyle", "LatinosStyle"); gStyle = LatinosStyle; //---------------------------------------------------------------------------- // Canvas //---------------------------------------------------------------------------- LatinosStyle->SetCanvasBorderMode( 0); LatinosStyle->SetCanvasBorderSize( 10); LatinosStyle->SetCanvasColor ( 0); LatinosStyle->SetCanvasDefH (794); LatinosStyle->SetCanvasDefW (550); LatinosStyle->SetCanvasDefX ( 10); LatinosStyle->SetCanvasDefY ( 10); //---------------------------------------------------------------------------- // Pad //---------------------------------------------------------------------------- LatinosStyle->SetPadBorderMode ( 0); LatinosStyle->SetPadBorderSize ( 10); LatinosStyle->SetPadColor ( 0); LatinosStyle->SetPadBottomMargin(0.20); LatinosStyle->SetPadTopMargin (0.08); LatinosStyle->SetPadLeftMargin (0.18); LatinosStyle->SetPadRightMargin (0.05); //---------------------------------------------------------------------------- // Frame //---------------------------------------------------------------------------- LatinosStyle->SetFrameFillStyle ( 0); LatinosStyle->SetFrameFillColor ( 0); LatinosStyle->SetFrameLineColor ( 1); LatinosStyle->SetFrameLineStyle ( 0); LatinosStyle->SetFrameLineWidth ( 2); LatinosStyle->SetFrameBorderMode( 0); LatinosStyle->SetFrameBorderSize(10); //---------------------------------------------------------------------------- // Hist //---------------------------------------------------------------------------- LatinosStyle->SetHistFillColor(0); LatinosStyle->SetHistFillStyle(1); LatinosStyle->SetHistLineColor(1); LatinosStyle->SetHistLineStyle(0); LatinosStyle->SetHistLineWidth(1); //---------------------------------------------------------------------------- // Axis //---------------------------------------------------------------------------- LatinosStyle->SetLabelFont ( 42, "xyz"); LatinosStyle->SetLabelOffset(0.015, "xyz"); LatinosStyle->SetLabelSize (0.050, "xyz"); LatinosStyle->SetNdivisions ( 505, "xyz"); LatinosStyle->SetTitleFont ( 42, "xyz"); LatinosStyle->SetTitleSize (0.050, "xyz"); // LatinosStyle->SetNdivisions ( -503, "y"); LatinosStyle->SetTitleOffset( 1.4, "x"); LatinosStyle->SetTitleOffset( 1.2, "y"); LatinosStyle->SetPadTickX ( 1); // Tick marks on the opposite side of the frame LatinosStyle->SetPadTickY ( 1); // Tick marks on the opposite side of the frame //---------------------------------------------------------------------------- // Title //---------------------------------------------------------------------------- LatinosStyle->SetTitleBorderSize( 0); LatinosStyle->SetTitleFillColor ( 10); LatinosStyle->SetTitleAlign ( 12); LatinosStyle->SetTitleFontSize (0.045); LatinosStyle->SetTitleX (0.590); LatinosStyle->SetTitleY (0.830); LatinosStyle->SetTitleFont(42, ""); //---------------------------------------------------------------------------- // Stat //---------------------------------------------------------------------------- LatinosStyle->SetOptStat (1110); LatinosStyle->SetStatBorderSize( 0); LatinosStyle->SetStatColor ( 10); LatinosStyle->SetStatFont ( 42); LatinosStyle->SetStatX (0.94); LatinosStyle->SetStatY (0.91); const Int_t NRGBs = 5; const Int_t NCont = 255; Double_t stops[NRGBs] = { 0.00, 0.34, 0.61, 0.84, 1.00 }; Double_t red[NRGBs] = { 0.00, 0.00, 0.87, 1.00, 0.51 }; Double_t green[NRGBs] = { 0.00, 0.81, 1.00, 0.20, 0.00 }; Double_t blue[NRGBs] = { 0.51, 1.00, 0.12, 0.00, 0.00 }; TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont); LatinosStyle->SetNumberContours(NCont); // return(); }
void TDRStyle() { TStyle *TDRStyle = new TStyle("TDRStyle", "TDR style"); /// helvetica, size absolute // TDRStyle->font = 43 // TDRStyle->titleSize = 33 // TDRStyle->labelSize = 27 // TDRStyle->statSize = 14 /// for the canvas TDRStyle->SetCanvasBorderMode(0); TDRStyle->SetCanvasColor(kWhite); TDRStyle->SetCanvasDefH(600); // Height of canvas TDRStyle->SetCanvasDefW(600); // Width of canvas TDRStyle->SetCanvasDefX(0); // POsition on screen TDRStyle->SetCanvasDefY(0); /// For the Pad: TDRStyle->SetPadBorderMode(0); TDRStyle->SetPadColor(kWhite); TDRStyle->SetPadGridX(false); TDRStyle->SetPadGridY(false); TDRStyle->SetGridColor(0); TDRStyle->SetGridStyle(3); TDRStyle->SetGridWidth(1); /// For the frame: TDRStyle->SetFrameBorderMode(0); TDRStyle->SetFrameBorderSize(1); TDRStyle->SetFrameFillColor(0); TDRStyle->SetFrameFillStyle(0); TDRStyle->SetFrameLineColor(1); TDRStyle->SetFrameLineStyle(1); TDRStyle->SetFrameLineWidth(1); /// For the histo: TDRStyle->SetHistLineColor(1); TDRStyle->SetHistLineStyle(0); TDRStyle->SetHistLineWidth(1); TDRStyle->SetEndErrorSize(2); TDRStyle->SetErrorX(0.5); // needed for uncertainty histograms TDRStyle->SetMarkerStyle(20); /// For the fit/function: TDRStyle->SetOptFit(1); TDRStyle->SetFitFormat("5.4g"); TDRStyle->SetFuncColor(2); TDRStyle->SetFuncStyle(1); TDRStyle->SetFuncWidth(1); /// For the date: TDRStyle->SetOptDate(0);; /// For the statistics box: TDRStyle->SetOptFile(0); TDRStyle->SetOptStat(0); // To display the mean and RMS: SetOptStat("mr");; TDRStyle->SetStatColor(kWhite); TDRStyle->SetStatFont(43); TDRStyle->SetStatFontSize(14); TDRStyle->SetStatTextColor(1); TDRStyle->SetStatFormat("6.4g"); TDRStyle->SetStatBorderSize(1); TDRStyle->SetStatH(0.1); TDRStyle->SetStatW(0.15); /// Margins: TDRStyle->SetPadTopMargin(0.05); // default TDRStyle->SetPadBottomMargin(0.13); TDRStyle->SetPadLeftMargin(0.16); TDRStyle->SetPadRightMargin(0.05); // default /// For the Global title: TDRStyle->SetOptTitle(0); TDRStyle->SetTitleFont(43); TDRStyle->SetTitleColor(1); TDRStyle->SetTitleTextColor(1); TDRStyle->SetTitleFillColor(10); TDRStyle->SetTitleFontSize(27); /// For the axis titles: TDRStyle->SetTitleColor(1, "XYZ"); TDRStyle->SetTitleFont(43, "XYZ"); TDRStyle->SetTitleSize(33, "XYZ"); TDRStyle->SetTitleXOffset(0.9); TDRStyle->SetTitleYOffset(1.25); /// For the axis labels: TDRStyle->SetLabelColor(1, "XYZ"); TDRStyle->SetLabelFont(43, "XYZ"); TDRStyle->SetLabelOffset(0.007, "XYZ"); TDRStyle->SetLabelSize(27, "XYZ"); /// For the axis: TDRStyle->SetAxisColor(1, "XYZ"); TDRStyle->SetStripDecimals(true); TDRStyle->SetTickLength(0.03, "XYZ"); TDRStyle->SetNdivisions(510, "XYZ"); TDRStyle->SetPadTickX(1); /// To get tick marks on the opposite side of the frame TDRStyle->SetPadTickY(1); /// For the text boxes TDRStyle->SetTextFont(43+20); // Bold TDRStyle->SetTextSize(27); /// Change for log plots: TDRStyle->SetOptLogx(0); TDRStyle->SetOptLogy(0); TDRStyle->SetOptLogz(0); /// Postscript options: TDRStyle->SetPaperSize(20,20); TDRStyle->cd(); }
void WZPaperStyle() { TStyle* WZPaperStyle = new TStyle("WZPaperStyle", "WZPaperStyle"); gStyle = WZPaperStyle; //---------------------------------------------------------------------------- // Canvas //---------------------------------------------------------------------------- WZPaperStyle->SetCanvasBorderMode( 0); WZPaperStyle->SetCanvasBorderSize( 10); WZPaperStyle->SetCanvasColor ( 0); WZPaperStyle->SetCanvasDefH (600); WZPaperStyle->SetCanvasDefW (550); WZPaperStyle->SetCanvasDefX ( 10); WZPaperStyle->SetCanvasDefY ( 10); //---------------------------------------------------------------------------- // Pad //---------------------------------------------------------------------------- WZPaperStyle->SetPadBorderMode ( 0); WZPaperStyle->SetPadBorderSize ( 10); WZPaperStyle->SetPadColor ( 0); WZPaperStyle->SetPadBottomMargin(0.20); WZPaperStyle->SetPadTopMargin (0.08); WZPaperStyle->SetPadLeftMargin (0.18); WZPaperStyle->SetPadRightMargin (0.05); //---------------------------------------------------------------------------- // Frame //---------------------------------------------------------------------------- WZPaperStyle->SetFrameBorderMode( 0); WZPaperStyle->SetFrameBorderSize(10); WZPaperStyle->SetFrameFillStyle ( 0); WZPaperStyle->SetFrameFillColor ( 0); WZPaperStyle->SetFrameLineColor ( 1); WZPaperStyle->SetFrameLineStyle ( 0); WZPaperStyle->SetFrameLineWidth ( 2); //---------------------------------------------------------------------------- // Hist //---------------------------------------------------------------------------- WZPaperStyle->SetHistFillColor(0); WZPaperStyle->SetHistFillStyle(1); WZPaperStyle->SetHistLineColor(1); WZPaperStyle->SetHistLineStyle(0); WZPaperStyle->SetHistLineWidth(1); //---------------------------------------------------------------------------- // Axis //---------------------------------------------------------------------------- WZPaperStyle->SetLabelFont ( 42, "xyz"); WZPaperStyle->SetLabelOffset(0.015, "xyz"); WZPaperStyle->SetLabelSize (0.040, "xyz"); WZPaperStyle->SetNdivisions ( 505, "xyz"); WZPaperStyle->SetTitleFont ( 42, "xyz"); WZPaperStyle->SetTitleSize (0.040, "xyz"); WZPaperStyle->SetTitleOffset( 1.15, "x"); WZPaperStyle->SetTitleOffset( 1.15, "y"); WZPaperStyle->SetPadTickX ( 1); WZPaperStyle->SetPadTickY ( 1); //---------------------------------------------------------------------------- // Title //---------------------------------------------------------------------------- WZPaperStyle->SetTitleAlign ( 33); WZPaperStyle->SetTitleBorderSize( 0); WZPaperStyle->SetTitleFillColor ( 10); WZPaperStyle->SetTitleFont ( 42); WZPaperStyle->SetTitleFontSize (0.045); WZPaperStyle->SetTitleX (0.960); WZPaperStyle->SetTitleY (0.990); //---------------------------------------------------------------------------- // Stat //---------------------------------------------------------------------------- WZPaperStyle->SetOptStat ( 0); WZPaperStyle->SetStatBorderSize( 0); WZPaperStyle->SetStatColor ( 10); WZPaperStyle->SetStatFont ( 42); WZPaperStyle->SetStatX (0.94); WZPaperStyle->SetStatY (0.91); }
void setTDRStyle() { TStyle *tdrStyle = new TStyle("tdrStyle","Style for P-TDR"); // For the canvas: tdrStyle->SetCanvasBorderMode(0); tdrStyle->SetCanvasColor(kWhite); tdrStyle->SetCanvasDefH(600); //Height of canvas tdrStyle->SetCanvasDefW(600); //Width of canvas tdrStyle->SetCanvasDefX(0); //POsition on screen tdrStyle->SetCanvasDefY(0); // For the Pad: tdrStyle->SetPadBorderMode(0); tdrStyle->SetPadColor(kWhite); tdrStyle->SetPadGridX(false); tdrStyle->SetPadGridY(false); tdrStyle->SetGridColor(0); tdrStyle->SetGridStyle(3); tdrStyle->SetGridWidth(1); // For the frame: tdrStyle->SetFrameBorderMode(0); tdrStyle->SetFrameBorderSize(1); tdrStyle->SetFrameFillColor(0); tdrStyle->SetFrameFillStyle(0); tdrStyle->SetFrameLineColor(1); tdrStyle->SetFrameLineStyle(1); tdrStyle->SetFrameLineWidth(1); // For the histo: tdrStyle->SetHistLineColor(1); tdrStyle->SetHistLineStyle(0); tdrStyle->SetHistLineWidth(1); tdrStyle->SetEndErrorSize(2); tdrStyle->SetErrorX(0.); tdrStyle->SetMarkerStyle(20); //For the fit/function: tdrStyle->SetOptFit(1); tdrStyle->SetFitFormat("5.4g"); tdrStyle->SetFuncColor(2); tdrStyle->SetFuncStyle(1); tdrStyle->SetFuncWidth(1); //For the date: tdrStyle->SetOptDate(0); // For the statistics box: tdrStyle->SetOptFile(0); tdrStyle->SetOptStat(0); // To display the mean and RMS: SetOptStat("mr"); tdrStyle->SetStatColor(kWhite); tdrStyle->SetStatFont(42); tdrStyle->SetStatFontSize(0.025); tdrStyle->SetStatTextColor(1); tdrStyle->SetStatFormat("6.4g"); tdrStyle->SetStatBorderSize(1); tdrStyle->SetStatH(0.1); tdrStyle->SetStatW(0.15); // Margins: tdrStyle->SetPadTopMargin(0.05); tdrStyle->SetPadBottomMargin(0.13); tdrStyle->SetPadLeftMargin(0.16); tdrStyle->SetPadRightMargin(0.02); // For the Global title: tdrStyle->SetOptTitle(0); tdrStyle->SetTitleFont(42); tdrStyle->SetTitleColor(1); tdrStyle->SetTitleTextColor(1); tdrStyle->SetTitleFillColor(10); tdrStyle->SetTitleFontSize(0.05); // For the axis titles: tdrStyle->SetTitleColor(1, "XYZ"); tdrStyle->SetTitleFont(42, "XYZ"); tdrStyle->SetTitleSize(0.06, "XYZ"); tdrStyle->SetTitleXOffset(0.9); tdrStyle->SetTitleYOffset(1.25); // For the axis labels: tdrStyle->SetLabelColor(1, "XYZ"); tdrStyle->SetLabelFont(42, "XYZ"); tdrStyle->SetLabelOffset(0.007, "XYZ"); tdrStyle->SetLabelSize(0.05, "XYZ"); // For the axis: tdrStyle->SetAxisColor(1, "XYZ"); tdrStyle->SetStripDecimals(kTRUE); tdrStyle->SetTickLength(0.03, "XYZ"); tdrStyle->SetNdivisions(510, "XYZ"); tdrStyle->SetPadTickX(1); // To get tick marks on the opposite side of the frame tdrStyle->SetPadTickY(1); // Change for log plots: tdrStyle->SetOptLogx(0); tdrStyle->SetOptLogy(0); tdrStyle->SetOptLogz(0); // Postscript options: tdrStyle->SetPaperSize(20.,20.); tdrStyle->cd(); }
TStyle* AtlasStyle() { TStyle *atlasStyle = new TStyle("ATLAS","Atlas style"); // use plain black on white colors Int_t icol=0; // WHITE atlasStyle->SetFrameBorderMode(icol); atlasStyle->SetFrameFillColor(icol); atlasStyle->SetCanvasBorderMode(icol); atlasStyle->SetCanvasColor(icol); atlasStyle->SetPadBorderMode(icol); atlasStyle->SetPadColor(icol); atlasStyle->SetStatColor(icol); //atlasStyle->SetFillColor(icol); // don't use: white fill color for *all* objects // set the paper & margin sizes atlasStyle->SetPaperSize(20,26); // set margin sizes atlasStyle->SetPadTopMargin(0.05); atlasStyle->SetPadRightMargin(0.05); atlasStyle->SetPadBottomMargin(0.16); atlasStyle->SetPadLeftMargin(0.16); // set title offsets (for axis label) atlasStyle->SetTitleXOffset(1.1); atlasStyle->SetTitleYOffset(1.3); // use large fonts //Int_t font=72; // Helvetica italics Int_t font=42; // Helvetica Double_t tsize=0.05; // originally 0.05 atlasStyle->SetTextFont(font); atlasStyle->SetTextSize(tsize); atlasStyle->SetLabelFont(font,"x"); atlasStyle->SetTitleFont(font,"x"); atlasStyle->SetLabelFont(font,"y"); atlasStyle->SetTitleFont(font,"y"); atlasStyle->SetLabelFont(font,"z"); atlasStyle->SetTitleFont(font,"z"); atlasStyle->SetLabelSize(tsize,"x"); atlasStyle->SetTitleSize(tsize,"x"); atlasStyle->SetLabelSize(tsize,"y"); atlasStyle->SetTitleSize(tsize,"y"); atlasStyle->SetLabelSize(tsize,"z"); atlasStyle->SetTitleSize(tsize,"z"); // use bold lines and markers atlasStyle->SetMarkerStyle(20); atlasStyle->SetMarkerSize(1.2); atlasStyle->SetHistLineWidth((Width_t)3.0); atlasStyle->SetLineStyleString(2,"[12 12]"); // postscript dashes // get rid of X error bars //atlasStyle->SetErrorX(0.001); // get rid of error bar caps atlasStyle->SetEndErrorSize(0.); // do not display any of the standard histogram decorations atlasStyle->SetOptTitle(0); //atlasStyle->SetOptStat(1111); atlasStyle->SetOptStat(0); //atlasStyle->SetOptFit(1111); atlasStyle->SetOptFit(0); // put tick marks on top and RHS of plots atlasStyle->SetPadTickX(1); atlasStyle->SetPadTickY(1); return atlasStyle; }
void setTDRStyle() { TStyle *tdrStyle = new TStyle("tdrStyle","Style for P-TDR"); // For the canvas: tdrStyle->SetCanvasBorderMode(0); tdrStyle->SetCanvasColor(kWhite); tdrStyle->SetCanvasDefH(600); //Height of canvas tdrStyle->SetCanvasDefW(600); //Width of canvas tdrStyle->SetCanvasDefX(0); //POsition on screen tdrStyle->SetCanvasDefY(0); // For the Pad: tdrStyle->SetPadBorderMode(0); // tdrStyle->SetPadBorderSize(Width_t size = 1); tdrStyle->SetPadColor(kWhite); tdrStyle->SetPadGridX(false); tdrStyle->SetPadGridY(false); tdrStyle->SetGridColor(0); tdrStyle->SetGridStyle(3); tdrStyle->SetGridWidth(1); // For the frame: tdrStyle->SetFrameBorderMode(0); tdrStyle->SetFrameBorderSize(1); tdrStyle->SetFrameFillColor(0); tdrStyle->SetFrameFillStyle(0); tdrStyle->SetFrameLineColor(1); tdrStyle->SetFrameLineStyle(1); tdrStyle->SetFrameLineWidth(1); // For the histo: tdrStyle->SetHistFillColor(63); // tdrStyle->SetHistFillStyle(0); tdrStyle->SetHistLineColor(1); tdrStyle->SetHistLineStyle(0); tdrStyle->SetHistLineWidth(1); // tdrStyle->SetLegoInnerR(Float_t rad = 0.5); // tdrStyle->SetNumberContours(Int_t number = 20); // tdrStyle->SetEndErrorSize(0); tdrStyle->SetErrorX(0.); // tdrStyle->SetErrorMarker(20); tdrStyle->SetMarkerStyle(20); //For the fit/function: tdrStyle->SetOptFit(1); tdrStyle->SetFitFormat("5.4g"); tdrStyle->SetFuncColor(2); tdrStyle->SetFuncStyle(1); tdrStyle->SetFuncWidth(1); //For the date: tdrStyle->SetOptDate(0); // tdrStyle->SetDateX(Float_t x = 0.01); // tdrStyle->SetDateY(Float_t y = 0.01); // For the statistics box: tdrStyle->SetOptFile(0); tdrStyle->SetOptStat(0); // To display the mean and RMS: SetOptStat("mr"); tdrStyle->SetStatColor(kWhite); tdrStyle->SetStatFont(42); tdrStyle->SetStatFontSize(0.025); tdrStyle->SetStatTextColor(1); tdrStyle->SetStatFormat("6.4g"); tdrStyle->SetStatBorderSize(1); tdrStyle->SetStatH(0.1); tdrStyle->SetStatW(0.15); // tdrStyle->SetStatStyle(Style_t style = 1001); // tdrStyle->SetStatX(Float_t x = 0); // tdrStyle->SetStatY(Float_t y = 0); // Margins: tdrStyle->SetPadTopMargin(0.05); tdrStyle->SetPadBottomMargin(0.13); tdrStyle->SetPadLeftMargin(0.13); tdrStyle->SetPadRightMargin(0.05); // For the Global title: // tdrStyle->SetOptTitle(0); tdrStyle->SetTitleFont(42); tdrStyle->SetTitleColor(1); tdrStyle->SetTitleTextColor(1); tdrStyle->SetTitleFillColor(10); tdrStyle->SetTitleFontSize(0.05); // tdrStyle->SetTitleH(0); // Set the height of the title box // tdrStyle->SetTitleW(0); // Set the width of the title box // tdrStyle->SetTitleX(0); // Set the position of the title box // tdrStyle->SetTitleY(0.985); // Set the position of the title box // tdrStyle->SetTitleStyle(Style_t style = 1001); // tdrStyle->SetTitleBorderSize(2); // For the axis titles: tdrStyle->SetTitleColor(1, "XYZ"); tdrStyle->SetTitleFont(42, "XYZ"); tdrStyle->SetTitleSize(0.06, "XYZ"); // tdrStyle->SetTitleXSize(Float_t size = 0.02); // Another way to set the size? // tdrStyle->SetTitleYSize(Float_t size = 0.02); tdrStyle->SetTitleXOffset(0.9); tdrStyle->SetTitleYOffset(1.05); // tdrStyle->SetTitleOffset(1.1, "Y"); // Another way to set the Offset // For the axis labels: tdrStyle->SetLabelColor(1, "XYZ"); tdrStyle->SetLabelFont(42, "XYZ"); tdrStyle->SetLabelOffset(0.007, "XYZ"); tdrStyle->SetLabelSize(0.05, "XYZ"); // For the axis: tdrStyle->SetAxisColor(1, "XYZ"); tdrStyle->SetStripDecimals(kTRUE); tdrStyle->SetTickLength(0.03, "XYZ"); //@@ was: tdrStyle->SetNdivisions(510, "XYZ"); tdrStyle->SetNdivisions(510, "YZ"); tdrStyle->SetNdivisions(1005, "X"); tdrStyle->SetPadTickX(1); // To get tick marks on the opposite side of the frame tdrStyle->SetPadTickY(1); // Change for log plots: tdrStyle->SetOptLogx(0); tdrStyle->SetOptLogy(0); tdrStyle->SetOptLogz(0); // Postscript options: // tdrStyle->SetPaperSize(15.,15.); // tdrStyle->SetLineScalePS(Float_t scale = 3); // tdrStyle->SetLineStyleString(Int_t i, const char* text); // tdrStyle->SetBarOffset(Float_t baroff = 0.5); // tdrStyle->SetBarWidth(Float_t barwidth = 0.5); // tdrStyle->SetPaintTextFormat(const char* format = "g"); // tdrStyle->SetPalette(Int_t ncolors = 0, Int_t* colors = 0); // tdrStyle->SetTimeOffset(Double_t toffset); // tdrStyle->SetHistMinimumZero(kTRUE); tdrStyle->cd(); }
void SetStyle() { TStyle *MITStyle = new TStyle("MIT-Style","The Perfect Style for Plots ;-)"); gStyle = MITStyle; // Canvas MITStyle->SetCanvasColor (0); MITStyle->SetCanvasBorderSize(10); MITStyle->SetCanvasBorderMode(0); MITStyle->SetCanvasDefH (700); MITStyle->SetCanvasDefW (700); MITStyle->SetCanvasDefX (100); MITStyle->SetCanvasDefY (100); // Pads MITStyle->SetPadColor (0); MITStyle->SetPadBorderSize (10); MITStyle->SetPadBorderMode (0); MITStyle->SetPadBottomMargin(0.13); MITStyle->SetPadTopMargin (0.08); MITStyle->SetPadLeftMargin (0.15); MITStyle->SetPadRightMargin (0.05); MITStyle->SetPadGridX (0); MITStyle->SetPadGridY (0); MITStyle->SetPadTickX (0); MITStyle->SetPadTickY (0); // Frames MITStyle->SetFrameFillStyle ( 0); MITStyle->SetFrameFillColor ( 0); MITStyle->SetFrameLineColor ( 1); MITStyle->SetFrameLineStyle ( 0); MITStyle->SetFrameLineWidth ( 1); MITStyle->SetFrameBorderSize(10); MITStyle->SetFrameBorderMode( 0); // Histograms MITStyle->SetHistFillColor(2); MITStyle->SetHistFillStyle(0); MITStyle->SetHistLineColor(1); MITStyle->SetHistLineStyle(0); MITStyle->SetHistLineWidth(2); MITStyle->SetNdivisions(505); // Functions MITStyle->SetFuncColor(1); MITStyle->SetFuncStyle(0); MITStyle->SetFuncWidth(2); // Various MITStyle->SetMarkerStyle(20); MITStyle->SetMarkerColor(kBlack); MITStyle->SetMarkerSize (1.2); MITStyle->SetTitleSize (0.055,"X"); MITStyle->SetTitleOffset(1.200,"X"); MITStyle->SetLabelOffset(0.005,"X"); MITStyle->SetLabelSize (0.050,"X"); MITStyle->SetLabelFont (42 ,"X"); MITStyle->SetStripDecimals(kFALSE); MITStyle->SetTitleSize (0.055,"Y"); MITStyle->SetTitleOffset(1.800,"Y"); MITStyle->SetLabelOffset(0.010,"Y"); MITStyle->SetLabelSize (0.050,"Y"); MITStyle->SetLabelFont (42 ,"Y"); MITStyle->SetTextSize (0.055); MITStyle->SetTextFont (42); MITStyle->SetStatFont (42); MITStyle->SetTitleFont (42); MITStyle->SetTitleFont (42,"X"); MITStyle->SetTitleFont (42,"Y"); MITStyle->SetOptStat (0); return; }