Example #1
0
void setTDRStyle() {
  TStyle *tdrStyle = new TStyle("tdrStyle","Style for P-TDR");

  tdrStyle->SetCanvasBorderMode(0);
  tdrStyle->SetCanvasColor(kWhite);
  tdrStyle->SetCanvasDefH(600);
  tdrStyle->SetCanvasDefW(600);
  tdrStyle->SetCanvasDefX(0);
  tdrStyle->SetCanvasDefY(0);

  tdrStyle->SetPadBorderMode(0);
  tdrStyle->SetPadColor(kWhite);

  tdrStyle->SetFrameBorderMode(0);
  tdrStyle->SetFrameBorderSize(1);
  tdrStyle->SetFrameFillColor(0);
  tdrStyle->SetFrameFillStyle(0);
  tdrStyle->SetFrameLineColor(1);
  tdrStyle->SetFrameLineStyle(1);
  tdrStyle->SetFrameLineWidth(1);

  tdrStyle->SetHistLineColor(kBlack);
  tdrStyle->SetHistLineStyle(0);
  tdrStyle->SetHistLineWidth(1);

  tdrStyle->SetEndErrorSize(2);
  tdrStyle->SetErrorX(0.);
  
  tdrStyle->SetMarkerStyle(20);
  tdrStyle->SetMarkerSize(2);

  tdrStyle->SetOptFit(1);
  tdrStyle->SetFitFormat("5.4g");
  tdrStyle->SetFuncColor(2);
  tdrStyle->SetFuncStyle(1);
  tdrStyle->SetFuncWidth(1);

  tdrStyle->SetOptDate(0);

  tdrStyle->SetOptFile(0);
  tdrStyle->SetOptStat(0); 
  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->SetPadTopMargin(0.05);
  tdrStyle->SetPadBottomMargin(0.13);
  tdrStyle->SetPadLeftMargin(0.10);
  tdrStyle->SetPadRightMargin(0.05);

  tdrStyle->SetOptTitle(0);
  tdrStyle->SetTitleFont(42);
  tdrStyle->SetTitleColor(1);
  tdrStyle->SetTitleTextColor(1);
  tdrStyle->SetTitleFillColor(10);
  tdrStyle->SetTitleFontSize(0.05);

 
  // For the axis labels:

  tdrStyle->SetLabelColor(1, "XYZ");
  tdrStyle->SetLabelOffset(0.007, "XYZ");
  tdrStyle->SetLabelSize(0.03, "XYZ");

  tdrStyle->SetAxisColor(1, "XYZ");
  tdrStyle->SetStripDecimals(kTRUE);
  tdrStyle->SetTickLength(0.03, "XYZ");
  tdrStyle->SetNdivisions(510, "XYZ");
  tdrStyle->SetPadTickX(1);  
  tdrStyle->SetPadTickY(1);


  tdrStyle->SetOptLogx(0);
  tdrStyle->SetOptLogy(0);
  tdrStyle->SetOptLogz(0);

  tdrStyle->SetPaperSize(20.,20.);

  tdrStyle->cd();
}
Example #2
0
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);
}
Example #3
0
// 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){
Example #4
0
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;
}
Example #5
0
int electronCompare()
 {
  TString CMP_DIR          = gSystem->Getenv( "CMP_DIR"          ) ;
  TString CMP_URL          = gSystem->Getenv( "CMP_URL"          ) ;
  TString CMP_TITLE        = gSystem->Getenv( "CMP_TITLE"        ) ;
  TString CMP_RED_FILE     = gSystem->Getenv( "CMP_RED_FILE"     ) ;
  TString CMP_BLUE_FILE    = gSystem->Getenv( "CMP_BLUE_FILE"    ) ;
  TString CMP_RED_NAME     = gSystem->Getenv( "CMP_RED_NAME"     ) ;
  TString CMP_BLUE_NAME    = gSystem->Getenv( "CMP_BLUE_NAME"    ) ;
  TString CMP_RED_COMMENT  = gSystem->Getenv( "CMP_RED_COMMENT"  ) ;
  TString CMP_BLUE_COMMENT = gSystem->Getenv( "CMP_BLUE_COMMENT" ) ;
  TString CMP_CONFIG       = gSystem->Getenv( "CMP_CONFIG"       ) ;
  TString CMP_RED_RELEASE  = gSystem->Getenv( "CMP_RED_RELEASE"  ) ;
  TString CMP_BLUE_RELEASE = gSystem->Getenv( "CMP_BLUE_RELEASE" ) ;

//-----
// AC
//  std::cout << "red_file : C : " << CMP_RED_FILE << std::endl;
//  std::cout << "blue_file : C : " << CMP_BLUE_FILE << std::endl;
  std::cout << "red_release : C : " << CMP_RED_RELEASE << std::endl;
  std::cout << "blue_release : C : " << CMP_BLUE_RELEASE << std::endl;
//-----
  
// style:
  TStyle *eleStyle = new TStyle("eleStyle","Style for electron validation");
  eleStyle->SetCanvasBorderMode(0);
  eleStyle->SetCanvasColor(kWhite);
  eleStyle->SetCanvasDefH(600);
  eleStyle->SetCanvasDefW(800);
  eleStyle->SetCanvasDefX(0);
  eleStyle->SetCanvasDefY(0);
  eleStyle->SetPadBorderMode(0);
  eleStyle->SetPadColor(kWhite);
  eleStyle->SetPadGridX(false);
  eleStyle->SetPadGridY(false);
  eleStyle->SetGridColor(0);
  eleStyle->SetGridStyle(3);
  eleStyle->SetGridWidth(1);
  eleStyle->SetOptStat(1);
  eleStyle->SetPadTickX(1);
  eleStyle->SetPadTickY(1);
  eleStyle->SetHistLineColor(1);
  eleStyle->SetHistLineStyle(0);
  eleStyle->SetHistLineWidth(2);
  eleStyle->SetEndErrorSize(2);
  eleStyle->SetErrorX(0.);
  eleStyle->SetOptStat(1);
  eleStyle->SetTitleColor(1, "XYZ");
  eleStyle->SetTitleFont(42, "XYZ");
  eleStyle->SetTitleXOffset(1.0);
  eleStyle->SetTitleYOffset(1.0);
  eleStyle->SetLabelOffset(0.005, "XYZ");
  eleStyle->SetTitleSize(0.05, "XYZ");
  eleStyle->SetTitleFont(22,"X");
  eleStyle->SetTitleFont(22,"Y");
  eleStyle->SetHistLineWidth(2);
  eleStyle->SetPadBottomMargin(0.13);
  eleStyle->SetPadLeftMargin(0.15);
  eleStyle->SetMarkerStyle(21);
  eleStyle->SetMarkerSize(0.8);
  //-- AC --
  eleStyle->SetPadRightMargin(0.2) ; 

  eleStyle->cd();

  gROOT->ForceStyle();

  TString internal_path("DQMData/Run 1/EgammaV/Run summary/") ;
  TString old_internal_path("DQMData/EgammaV/") ;

  TString file_ref_dir ;
  TFile * file_ref = 0 ;
  if ( CMP_BLUE_FILE != "" )
   {
    file_ref = TFile::Open(CMP_BLUE_FILE) ;
    if (file_ref!=0)
     {
      std::cout<<"open "<<CMP_BLUE_FILE<<std::endl ;
      if (file_ref->cd(internal_path)==kTRUE)
       {
        std::cerr<<"cd "<<internal_path<<std::endl ;
        file_ref_dir = internal_path ;
        file_ref->cd() ;
       }
      else if (file_ref->cd(old_internal_path)==kTRUE)
       {
        std::cerr<<"cd "<<old_internal_path<<std::endl ;
        file_ref_dir = old_internal_path ;
        file_ref->cd() ;
       }
      else
       {
        std::cerr<<"Failed move to: "<<internal_path<<" and "<<old_internal_path<<std::endl ;
        file_ref_dir = "" ;
       }
     }
    else
     { std::cerr<<"Failed to open: "<<CMP_BLUE_FILE<<std::endl ; }
   }

  TString file_new_dir = internal_path  ;
  TFile * file_new = 0 ;
  if ( CMP_RED_FILE != "" )
   {
    file_new = TFile::Open(CMP_RED_FILE) ;
    if (file_new!=0)
     {
      std::cout<<"open "<<CMP_RED_FILE<<std::endl ;
      if (file_new->cd(internal_path)==kTRUE)
       {
        std::cerr<<"cd "<<internal_path<<std::endl ;
        file_new_dir = internal_path ;
        file_new->cd() ;
       }
      else if (file_new->cd(old_internal_path)==kTRUE)
       {
        std::cerr<<"cd "<<old_internal_path<<std::endl ;
        file_new_dir = old_internal_path ;
        file_new->cd() ;
       }
      else
       {
        std::cerr<<"Failed move to: "<<internal_path<<" and "<<old_internal_path<<std::endl ;
        file_new_dir = "" ;
       }
     }
    else
     { std::cerr<<"Failed to open: "<<CMP_RED_FILE<<std::endl ; }
   }

  TCanvas * canvas ;
  TH1 * histo_ref, * histo_new ;
  TPaveStats * st_ref, * st_new ;

  std::ofstream web_page(CMP_DIR+"/index.html") ;

  web_page
    <<"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2 Final//EN\">\n"
    <<"<html>\n"
    <<"<head>\n"
    <<"<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\" />\n"
    <<"<title>"<<CMP_TITLE<<"</title>\n"
    <<"</head>\n"
    <<"<h1><a href=\"../\"><img border=0 width=\"22\" height=\"22\" src=\"../../../../img/up.gif\" alt=\"Up\"/></a>&nbsp;"<<CMP_TITLE<<"</h1>\n" ;

  if (file_ref==0)
   {
    web_page
     <<"<p>In all plots below"
     <<", there was no reference histograms to compare with"
     <<", and the "<<CMP_RED_NAME<<" histograms are in red." ;
   }
  else
   {
/*    web_page
     <<"<p>In all plots below"
     <<", the "<<CMP_RED_NAME<<" histograms are in red"
     <<", and the "<<CMP_BLUE_NAME<<" histograms are in blue." ;*/
    web_page
     <<"<p>In all plots below"
     <<", the "<<CMP_RED_RELEASE<<" histograms are in red"
     <<", and the "<<CMP_BLUE_RELEASE<<" histograms are in blue." ;
/*	std::cout <<"<p>In all plots below "
     <<", the "<<CMP_RED_RELEASE<<" histograms are in red"
     <<", and the "<<CMP_BLUE_RELEASE<<" histograms are in blue." << std::endl ;*/
   }

  std::ifstream red_comment_file(CMP_RED_COMMENT) ;
  std::string red_comment ;
  std::getline(red_comment_file,red_comment) ;
  red_comment_file.close() ;

  std::ifstream blue_comment_file(CMP_BLUE_COMMENT) ;
  std::string blue_comment ;
  std::getline(blue_comment_file,blue_comment) ;
  blue_comment_file.close() ;

  web_page<<" "<<red_comment<<" "<<blue_comment
    <<" Some more details"
    <<": <a href=\"electronCompare.C\">script</a> used to make the plots"
    <<", <a href=\""<<CMP_CONFIG<<"\">specification</a> of histograms"
    <<", <a href=\"gifs/\">images</a> of histograms"
    <<"." ;
  web_page<<"</p>\n" ;

  // canvas_name std::string => TString
  TString canvas_name, histo_name, histo_full_path, gif_name, gif_path ;
  TString short_histo_name ;
  TString first_short_histo_name, first_histo_name ;
  TString dl_short_histo_name, dl_histo_name ;
  TString num_ref, denom_ref, num_full, denom_full ;
  Int_t n_ele_charge ;
  int scaled, err ;
  int divide;
  std::string cat, line, histo_path, num, denom ;
  int eol ; // end of line
  int eoc ; // enf of category
  double rescale_factor = 0. ;

  std::ifstream histo_file1(CMP_CONFIG) ;

  web_page
    <<"<br><table border=\"1\" cellpadding=\"5\" width=\"100%\">"
    <<"<tr valign=\"top\"><td width=\"20%\">\n" ;
  int cat_num = 0 ;

  cat = "" ;
  do
   {
    std::getline(histo_file1,cat) ;
   } while (cat.find_first_not_of(" \t")==std::string::npos) ;

  web_page<<"<b>"<<cat<<"</b><br><br>" ;

  while (std::getline(histo_file1,line))
   {
    if (line.empty()) continue ;
    std::size_t first = line.find_first_not_of(" \t") ;
    if (first==std::string::npos) continue ;
    if (line[first]=='#') continue ;

    std::istringstream linestream(line) ;
    divide = 0 ; num = denom = "" ;
    linestream >> histo_path >> scaled >> err >> eol >> eoc >> divide >> num >> denom ;

    histo_name = histo_path ;
    Ssiz_t pos = histo_name.Last('/') ;
    if (pos!=kNPOS) histo_name.Remove(0,pos+1) ;
    short_histo_name = histo_name ;
    short_histo_name.Remove(0,2) ;
    if (short_histo_name.BeginsWith("ele_"))
     { short_histo_name.Remove(0,4) ; }

    if (first_histo_name.IsNull())
     {
      first_short_histo_name = short_histo_name ;
      first_histo_name = histo_name ;
      dl_short_histo_name = short_histo_name ;
      dl_histo_name = histo_name ;
     }
    else
     {
      TString common ;
      TString first_specific ;
      TString second_specific ;
      CompareHistoNames(first_short_histo_name,short_histo_name,common,first_specific,second_specific) ;
      if (!dl_histo_name.IsNull())
       {
        if (first_specific.IsNull())
         { web_page<<"<a href=\"#"<<first_histo_name<<"\">"<<first_short_histo_name<<"</a>" ; }
        else
         { web_page<<common<<"&nbsp;|&nbsp;<a href=\"#"<<first_histo_name<<"\">"<<first_specific<<"</a>" ; }
        dl_short_histo_name = dl_histo_name = "" ;
       }
      web_page<<"&nbsp;|&nbsp;<a href=\"#"<<histo_name<<"\">"<<second_specific<<"</a>" ;
     }

    if ((eol)||(eoc))
     {
      if (!dl_histo_name.IsNull())
       { web_page<<"<a href=\"#"<<dl_histo_name<<"\">"<<dl_short_histo_name<<"</a>" ; }
      web_page<<"<br>\n" ;
      first_histo_name = first_short_histo_name = "" ;
     }

    if (eoc)
     {
      cat_num++ ;
      if ((cat_num%5)==0)
       { web_page<<"<br></td></tr>\n<tr valign=\"top\"><td width=\"20%\">" ; }
      else
       { web_page<<"<br></td><td width=\"20%\">\n" ; }
      cat = "" ;
      do
       {
        std::getline(histo_file1,cat) ;
       } while (cat.find_first_not_of(" \t")==std::string::npos) ;
      web_page<<"<b>"<<cat<<"</b><br><br>" ;
     }
   }
  web_page<<"<br></td></tr></table>\n" ;
  histo_file1.close() ;

  web_page<<"<br><br><table cellpadding=\"5\"><tr valign=\"top\"><td><a href=\""<<CMP_URL<<"/\"><img width=\"18\" height=\"18\" border=\"0\" align=\"middle\" src=\"../../../../img/up.gif\" alt=\"Top\"/></a></td><td>\n" ;
  std::ifstream histo_file2(CMP_CONFIG) ;

  n_ele_charge = 0 ;
  cat = "" ;
  do
   {
    std::getline(histo_file2,cat) ;
   } while (cat.empty()) ;

  while (std::getline(histo_file2,line))
   {
    if (line.empty()) continue ;
    std::size_t first = line.find_first_not_of(" \t") ;
    if (first==std::string::npos) continue ;
    if (line[first]=='#') continue ;

    std::istrstream linestream(line) ;
    divide = 0 ; num = denom = "" ;
    linestream >> histo_path >> scaled >> err >> eol >> eoc >> divide >> num >> denom ;

    histo_name = histo_path.c_str() ;
    histo_ref = 0 ;
    histo_new = 0 ;
    st_ref = 0 ;
    st_new = 0 ;

    Ssiz_t pos = histo_name.Last('/') ;
    if (pos!=kNPOS) histo_name.Remove(0,pos+1) ;
    short_histo_name = histo_name ;
    short_histo_name.Remove(0,2) ;

    gif_name = "gifs/" ; gif_name += histo_name ; gif_name += ".gif" ;
    gif_path = CMP_DIR ; gif_path += "/" ; gif_path += gif_name ;
    canvas_name = "c" ; canvas_name += histo_name ;
    canvas = new TCanvas(canvas_name) ;
    canvas->SetFillColor(10) ;
	//std::cout << "canvas width " << canvas->GetWindowWidth() << std::endl; // 800 default
	//std::cout << "canvas height " << canvas->GetWindowHeight() << std::endl; // 600 default
	//std::cout << "canvas Y real " << canvas->GetYsizeReal() << std::endl;
	//std::cout << "canvas Y user " << canvas->GetYsizeUser() << std::endl;

    web_page<<"<a id=\""<<histo_name<<"\" name=\""<<short_histo_name<<"\"></a>" ;

    // search histo_ref
    if ( file_ref != 0 )
     {
      if (file_ref_dir.IsNull())
       { histo_full_path = histo_name ; }
      else
       { histo_full_path = file_ref_dir ; histo_full_path += histo_path.c_str() ; }
      histo_ref = (TH1 *)file_ref->Get(histo_full_path) ;
      if (histo_ref!=0)
       {
        // renaming those histograms avoid very strange bugs because they
        // have the same names as the ones loaded from the new file
        histo_ref->SetName(TString(histo_ref->GetName())+"_ref") ;
       }
      else
       {
        web_page<<"No <b>"<<histo_path<<"</b> for "<<CMP_BLUE_NAME<<".<br>" ;
       }
     }

    // search histo_new
    histo_full_path = file_new_dir ; histo_full_path += histo_path.c_str() ;
    histo_new = (TH1 *)file_new->Get(histo_full_path) ;
	//std::cout << "size " << histo_new->GetSize() << std::endl ;

    // special treatments
    if ((scaled==1)&&(histo_new!=0)&&(histo_ref!=0)&&(histo_ref->GetEntries()!=0))
     {
      Int_t new_entries = histo_new->GetEntries() ;
      if (new_entries==0) { new_entries = n_ele_charge ; }
      if (new_entries==0)
       { std::cerr<<"DO NOT KNOW HOW TO RESCALE "<<histo_name<<std::endl ; }
      else
       {
        // we want to reuse the rescale factor of the first histogram
        // for all the subsequent histograms.
        if (rescale_factor==0.) { rescale_factor = new_entries/histo_ref->GetEntries() ; }
        histo_ref->Scale(rescale_factor) ;
       }
     }
    if ((histo_new!=0)&&(histo_ref!=0)&&(histo_ref->GetMaximum()>histo_new->GetMaximum()))
     { histo_new->SetMaximum(histo_ref->GetMaximum()*1.1) ; }

    if (histo_new==0)
     {
      web_page<<"No <b>"<<histo_path<<"</b> for "<<CMP_RED_NAME<<".<br>" ;
     }
    else
     {
      // catch n_ele_charge
      if (histo_name=="h_ele_charge")
       { n_ele_charge = histo_new->GetEntries() ; }

      // draw histo_new
      TString newDrawOptions(err==1?"E1 P":"hist") ;
      gErrorIgnoreLevel = kWarning ;
      if (divide!=0)
       {
        num_full = file_new_dir ; num_full += num.c_str() ;
        denom_full = file_new_dir ; denom_full += denom.c_str() ;
        histo_new = DivideHistos(file_new,histo_new,num_full,denom_full) ;
       }
      histo_new->SetLineColor(kRed) ;
      histo_new->SetMarkerColor(2) ;
      histo_new->SetLineWidth(3) ;
      RenderHisto(histo_new,canvas) ;
      histo_new->Draw(newDrawOptions) ;
//	  std::cout << "SIZE : " << canvas->GetWw() << std::endl ; // 796 default
//	  std::cout << "SIZE : " << canvas->GetWh() << std::endl ; // 572 default
      //canvas->Update() ;
	  //canvas->SetWindowSize(440, 600);
	  canvas->SetCanvasSize(960, 600);
      canvas->Update() ;
      st_new = (TPaveStats*)histo_new->FindObject("stats");
      st_new->SetTextColor(kRed) ;

      // draw histo_ref
      if (histo_ref!=0)
       {
        if (divide!=0)
         {
          num_ref = num ;
          denom_ref = denom ;
          if (file_ref_dir.IsNull())
           {
            pos = num_ref.Last('/') ;
            if (pos!=kNPOS) num_ref.Remove(0,pos+1) ;
            pos = denom_ref.Last('/') ;
            if (pos!=kNPOS) denom_ref.Remove(0,pos+1) ;
           }
          histo_ref = DivideHistos(file_ref,histo_ref,file_ref_dir+num_ref,file_ref_dir+denom_ref) ;
         }
        RenderHisto(histo_ref,canvas) ;
        histo_ref->SetLineColor(kBlue) ;
        histo_ref->SetLineWidth(3) ;
        histo_ref->Draw("sames hist") ;
        canvas->Update() ;
        st_ref = (TPaveStats*)histo_ref->FindObject("stats");
        st_ref->SetTextColor(kBlue) ;
        Double_t y1 = st_ref->GetY1NDC() ;
        Double_t y2 = st_ref->GetY2NDC() ;
        st_ref->SetY1NDC(2*y1-y2) ;
        st_ref->SetY2NDC(y1) ;
        //Double_t x1 = st_ref->GetX1NDC() ;
        //Double_t x2 = st_ref->GetX2NDC() ;
		//std::cout << "position s x1 = " << x1 << std::endl ; // 0.78 par defaut
		//std::cout << "position s x2 = " << x2 << std::endl ; // 0.98 par defaut
		//std::cout << "position s y1 = " << y1 << std::endl ; // 0.755 ou 0.835 par defaut
		//std::cout << "position s y2 = " << y2 << std::endl ; // 0.995 par defaut
       }

      // Redraws
      newDrawOptions = "sames " ;
      newDrawOptions += (err==1?"E1 P":"hist") ;
      histo_new->Draw(newDrawOptions) ;
      if (st_ref!=0) st_ref->Draw() ;
      if (st_new!=0) st_new->Draw() ;

      // eventual log scale
      //if ( (log==1) && ( (histo_new->GetEntries()>0) || ( (histo_ref!=0) && (histo_ref->GetEntries()!=0) ) ) )
      // { canvas->SetLogy(1) ; }


// ne pas oublier de decommenter les 4 lignes suivantes
      std::cout<<histo_name
        <<" has "<<histo_new->GetEffectiveEntries()<<" entries"
        <<" of mean value "<<histo_new->GetMean()
        <<std::endl ;
      canvas->SaveAs(gif_path.Data()) ;
      web_page<<"<a href=\""<<gif_name<<"\"><img border=\"0\" class=\"image\" width=\"440\" src=\""<<gif_name<<"\"></a><br>" ;
     }

//    else if ((file_ref!=0)&&(histo_ref!=0))
//     {
//      std::cout<<histo_path<<" NOT FOUND"<<std::endl ;
//      web_page<<"<br>(no such histo)" ;
//      canvas->SaveAs(gif_path.Data()) ;
//      web_page<<"<a href=\""<<gif_name<<"\"><img border=\"0\" class=\"image\" width=\"440\" src=\""<<gif_name<<"\"></a><br>" ;
//     }

    if (eol)
     { web_page<<"</td></tr>\n<tr valign=\"top\"><td><a href=\""<<CMP_URL<<"/\"><img width=\"18\" height=\"18\" border=\"0\" align=\"middle\" src=\"../../../../img/up.gif\" alt=\"Top\"/></a></td><td>" ; }
    else
     { web_page<<"</td><td>" ; }
    if (eoc)
     {
      cat = "" ;
      do
       {
        std::getline(histo_file2,cat) ;
       } while (cat.empty()) ;
     }
   }
  histo_file2.close() ;
  web_page<<"</td></tr></table>\n" ;

  web_page<<"\n</html>"<<std::endl ;
  web_page.close() ;

 }
void setTDRStyle() {
  TStyle *tdrStyle = new TStyle("tdrStyle","Style for P-TDR");

// For the canvas:
  tdrStyle->SetCanvasBorderMode(0);
  tdrStyle->SetCanvasColor(kWhite);
  tdrStyle->SetCanvasDefH(750); //Height of canvas
  tdrStyle->SetCanvasDefW(1050); //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.010);
  tdrStyle->SetStatTextColor(1);
  tdrStyle->SetStatFormat("6.4g");
  tdrStyle->SetStatBorderSize(1);
  tdrStyle->SetStatH(0.25);
  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.14);
  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.005);
  // 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.25);
  // 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");
  //tdrStyle->SetNdivisions(505, "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);

  Int_t n=35;
  Int_t *colors = new Int_t[n];
  for (Int_t i =0; i < n; i++) {
    //colors[i] = i+61;
    //colors[i] = 70-i;
    colors[i] = i+63;
    }
  /*colors[0]=61
  colors[1]=62;
  colors[2]=63;
  colors[3]=;
  colors[4]=;
  colors[5]=;
  colors[6]=;
  colors[7]=;
  colors[8]=;
  colors[9]=;
  colors[10]=;*/
  gStyle->SetPalette(n, colors);
  
  //gStyle->SetPalette(1, 0);
  tdrStyle->cd();
}
Example #7
0
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();
  
  

}
Example #8
0
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();
}
Example #9
0
/*
 * Define different TStyles; use them with:
 * getStyle->cd();
 *
 * 2003 NCA
 */
TStyle * getStyle(TString name="myStyle")
{
    TStyle *theStyle;
    if ( name == "myStyle" ) {
        theStyle = new TStyle("myStyle", "myStyle");
        //    theStyle->SetOptStat(0);
        theStyle->SetPadBorderMode(0);
        theStyle->SetCanvasBorderMode(0);
        theStyle->SetPadColor(0);
        theStyle->SetCanvasColor(0);
        theStyle->SetMarkerStyle(8);
        theStyle->SetMarkerSize(0.7);
        theStyle->SetStatH(0.3);
        theStyle->SetStatW(0.15);
        //   theStyle->SetTextFont(132);
        //   theStyle->SetTitleFont(132);
        theStyle->SetTitleBorderSize(1);
        theStyle->SetPalette(1);

    } else if( name == "tdr" ) {
        theStyle = new TStyle("tdrStyle","Style for P-TDR");

        // For the canvas:
        theStyle->SetCanvasBorderMode(0);
        theStyle->SetCanvasColor(kWhite);
        theStyle->SetCanvasDefH(600); //Height of canvas
        theStyle->SetCanvasDefW(600); //Width of canvas
        theStyle->SetCanvasDefX(0);   //POsition on screen
        theStyle->SetCanvasDefY(0);

        // For the Pad:
        theStyle->SetPadBorderMode(0);
        // theStyle->SetPadBorderSize(Width_t size = 1);
        theStyle->SetPadColor(kWhite);
        theStyle->SetPadGridX(true);
        theStyle->SetPadGridY(true);
        theStyle->SetGridColor(0);
        theStyle->SetGridStyle(3);
        theStyle->SetGridWidth(1);

        // For the frame:
        theStyle->SetFrameBorderMode(0);
        theStyle->SetFrameBorderSize(1);
        theStyle->SetFrameFillColor(0);
        theStyle->SetFrameFillStyle(0);
        theStyle->SetFrameLineColor(1);
        theStyle->SetFrameLineStyle(1);
        theStyle->SetFrameLineWidth(1);

        // For the histo:
        // theStyle->SetHistFillColor(1);
        // theStyle->SetHistFillStyle(0);
        theStyle->SetHistLineColor(1);
        theStyle->SetHistLineStyle(0);
        theStyle->SetHistLineWidth(1);
        // theStyle->SetLegoInnerR(Float_t rad = 0.5);
        // theStyle->SetNumberContours(Int_t number = 20);

        theStyle->SetEndErrorSize(2);
//     theStyle->SetErrorMarker(20);
        theStyle->SetErrorX(0.);

        theStyle->SetMarkerStyle(20);

        //For the fit/function:
        theStyle->SetOptFit(1);
        theStyle->SetFitFormat("5.4g");
        theStyle->SetFuncColor(2);
        theStyle->SetFuncStyle(1);
        theStyle->SetFuncWidth(1);

        //For the date:
        theStyle->SetOptDate(0);
        // theStyle->SetDateX(Float_t x = 0.01);
        // theStyle->SetDateY(Float_t y = 0.01);

        // For the statistics box:
        theStyle->SetOptFile(0);
//     theStyle->SetOptStat(0); // To display the mean and RMS:   SetOptStat("mr");
        theStyle->SetOptStat(10);
        theStyle->SetStatColor(kWhite);
        theStyle->SetStatFont(42);
        theStyle->SetStatFontSize(0.07);
        theStyle->SetStatTextColor(1);
        theStyle->SetStatFormat("6.4g");
        theStyle->SetStatBorderSize(1);
        theStyle->SetStatH(0.3);
        theStyle->SetStatW(0.2);
        // theStyle->SetStatStyle(Style_t style = 1001);
        // theStyle->SetStatX(Float_t x = 0);
        // theStyle->SetStatY(Float_t y = 0);

        // Margins:
        theStyle->SetPadTopMargin(0.05);
        theStyle->SetPadBottomMargin(0.13);
        theStyle->SetPadLeftMargin(0.16);
        theStyle->SetPadRightMargin(0.02);

        // For the Global title:

        theStyle->SetOptTitle(0);
        theStyle->SetTitleFont(42);
        theStyle->SetTitleColor(1);
        theStyle->SetTitleTextColor(1);
        theStyle->SetTitleFillColor(10);
        theStyle->SetTitleFontSize(0.05);
        // theStyle->SetTitleH(0); // Set the height of the title box
        // theStyle->SetTitleW(0); // Set the width of the title box
        // theStyle->SetTitleX(0); // Set the position of the title box
        // theStyle->SetTitleY(0.985); // Set the position of the title box
        // theStyle->SetTitleStyle(Style_t style = 1001);
        // theStyle->SetTitleBorderSize(2);

        // For the axis titles:

        theStyle->SetTitleColor(1, "XYZ");
        theStyle->SetTitleFont(42, "XYZ");
        theStyle->SetTitleSize(0.06, "XYZ");
        // theStyle->SetTitleXSize(Float_t size = 0.02); // Another way to set the size?
        // theStyle->SetTitleYSize(Float_t size = 0.02);
        theStyle->SetTitleXOffset(0.9);
        theStyle->SetTitleYOffset(1.25);
        // theStyle->SetTitleOffset(1.1, "Y"); // Another way to set the Offset

        // For the axis labels:

        theStyle->SetLabelColor(1, "XYZ");
        theStyle->SetLabelFont(42, "XYZ");
        theStyle->SetLabelOffset(0.007, "XYZ");
        theStyle->SetLabelSize(0.045, "XYZ");

        // For the axis:

        theStyle->SetAxisColor(1, "XYZ");
        theStyle->SetStripDecimals(kTRUE);
        theStyle->SetTickLength(0.03, "XYZ");
        theStyle->SetNdivisions(510, "XYZ");
        theStyle->SetPadTickX(1);  // To get tick marks on the opposite side of the frame
        theStyle->SetPadTickY(1);

        // Change for log plots:
        theStyle->SetOptLogx(0);
        theStyle->SetOptLogy(0);
        theStyle->SetOptLogz(0);

        // Postscript options:
        theStyle->SetPaperSize(20.,20.);
        // theStyle->SetLineScalePS(Float_t scale = 3);
        // theStyle->SetLineStyleString(Int_t i, const char* text);
        // theStyle->SetHeaderPS(const char* header);
        // theStyle->SetTitlePS(const char* pstitle);

        // theStyle->SetBarOffset(Float_t baroff = 0.5);
        // theStyle->SetBarWidth(Float_t barwidth = 0.5);
        // theStyle->SetPaintTextFormat(const char* format = "g");
        // theStyle->SetPalette(Int_t ncolors = 0, Int_t* colors = 0);
        // theStyle->SetTimeOffset(Double_t toffset);
        // theStyle->SetHistMinimumZero(kTRUE);


        //   style->SetOptFit(101);
        //   style->SetOptStat(1111111);

    } else {
        // Avoid modifying the default style!
        theStyle = gStyle;
    }
    return theStyle;
}
Example #10
0
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_;
//  }
}
Example #12
0
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;
}
Example #13
0
void setNCUStyle(bool gridOn=false) {
  TStyle* ncuStyle = new TStyle("ncuStyle","Style for P-NCU");

// For the canvas:
  ncuStyle->SetCanvasBorderMode(0);
  ncuStyle->SetCanvasColor(kWhite);
  ncuStyle->SetCanvasDefH(600); //Height of canvas
  ncuStyle->SetCanvasDefW(600); //Width of canvas
  ncuStyle->SetCanvasDefX(0);   //POsition on screen
  ncuStyle->SetCanvasDefY(0);

// For the Pad:
  ncuStyle->SetPadBorderMode(0);
  // ncuStyle->SetPadBorderSize(Width_t size = 1);
  ncuStyle->SetPadColor(kWhite);
  ncuStyle->SetPadGridX(gridOn);
  ncuStyle->SetPadGridY(gridOn);
  ncuStyle->SetGridColor(0);
  ncuStyle->SetGridStyle(3);
  ncuStyle->SetGridWidth(1);

// For the frame:
  ncuStyle->SetFrameBorderMode(0);
  ncuStyle->SetFrameBorderSize(1);
  ncuStyle->SetFrameFillColor(0);
  ncuStyle->SetFrameFillStyle(0);
  ncuStyle->SetFrameLineColor(1);
  ncuStyle->SetFrameLineStyle(1);
  ncuStyle->SetFrameLineWidth(3);

// For the Legend:
  ncuStyle->SetLegendBorderSize(0);
  ncuStyle->SetLegendFillColor(0);
  ncuStyle->SetLegendFont(42);
  //ncuStyle->SetLegendFont(62);
  
// For the histo:
  // ncuStyle->SetHistFillColor(1);
  // ncuStyle->SetHistFillStyle(0);
  ncuStyle->SetHistLineColor(1);
  ncuStyle->SetHistLineStyle(0);
  ncuStyle->SetHistLineWidth(3);
  // ncuStyle->SetLegoInnerR(Float_t rad = 0.5);
  // ncuStyle->SetNumberContours(Int_t number = 20);

  ncuStyle->SetEndErrorSize(2);
  // ncuStyle->SetErrorMarker(20);
  //ncuStyle->SetErrorX(0.);
  
  ncuStyle->SetMarkerStyle(20);
  
//For the fit/function:
  ncuStyle->SetOptFit(1);
  ncuStyle->SetFitFormat("5.4g");
  ncuStyle->SetFuncColor(2);
  ncuStyle->SetFuncStyle(1);
  ncuStyle->SetFuncWidth(1);

//For the date:
  ncuStyle->SetOptDate(0);
  // ncuStyle->SetDateX(Float_t x = 0.01);
  // ncuStyle->SetDateY(Float_t y = 0.01);

// For the statistics box:
  ncuStyle->SetOptFile(0);
  ncuStyle->SetOptStat(0); // To display the mean and RMS:   SetOptStat("mr");
  ncuStyle->SetStatColor(kWhite);
  ncuStyle->SetStatFont(42);
  ncuStyle->SetStatFontSize(0.025);
  ncuStyle->SetStatTextColor(1);
  ncuStyle->SetStatFormat("6.4g");
  ncuStyle->SetStatBorderSize(1);
  ncuStyle->SetStatH(0.1);
  ncuStyle->SetStatW(0.15);
  // ncuStyle->SetStatStyle(Style_t style = 1001);
  // ncuStyle->SetStatX(Float_t x = 0);
  // ncuStyle->SetStatY(Float_t y = 0);

// Margins:
  ncuStyle->SetPadTopMargin(0.08);
  ncuStyle->SetPadBottomMargin(0.13);
  ncuStyle->SetPadLeftMargin(0.13);
  ncuStyle->SetPadRightMargin(0.04);

// For the Global title:

  ncuStyle->SetOptTitle(0);
  ncuStyle->SetTitleFont(62);
  ncuStyle->SetTitleColor(1);
  ncuStyle->SetTitleTextColor(1);
  ncuStyle->SetTitleFillColor(10);
  ncuStyle->SetTitleFontSize(0.05);
  // ncuStyle->SetTitleH(0); // Set the height of the title box
  // ncuStyle->SetTitleW(0); // Set the width of the title box
  // ncuStyle->SetTitleX(0); // Set the position of the title box
  // ncuStyle->SetTitleY(0.985); // Set the position of the title box
  // ncuStyle->SetTitleStyle(Style_t style = 1001);
  // ncuStyle->SetTitleBorderSize(2);

// For the axis titles:

  ncuStyle->SetTitleColor(1, "XYZ");
  ncuStyle->SetTitleSize(0.06, "XYZ");
  // ncuStyle->SetTitleXSize(Float_t size = 0.02); // Another way to set the size?
  // ncuStyle->SetTitleYSize(Float_t size = 0.02);
  // the following commands are not doing any thing
  // ncuStyle->SetTitleOffset(1.5, "X"); // Another way to set the Offset
  // ncuStyle->SetTitleOffset(1.5, "Y"); // Another way to set the Offset
  // ncuStyle->SetTitleFont(42, "XYZ");

// For the axis labels:
  ncuStyle->SetLabelColor(1, "XYZ");
  // the following command is not doing any thing
  // ncuStyle->SetLabelFont(42, "XYZ");
  ncuStyle->SetLabelOffset(0.007, "XYZ");
  ncuStyle->SetLabelSize(0.05, "XYZ");

// For the axis:

  ncuStyle->SetAxisColor(1, "XYZ");
  ncuStyle->SetStripDecimals(kFALSE);
  ncuStyle->SetTickLength(0.03, "XYZ");
  ncuStyle->SetNdivisions(510, "XYZ");
  ncuStyle->SetPadTickX(1);  // To get tick marks on the opposite side of the frame
  ncuStyle->SetPadTickY(1);

// Change for log plots:
  ncuStyle->SetOptLogx(0);
  ncuStyle->SetOptLogy(0);
  ncuStyle->SetOptLogz(0);

// Postscript options:
  ncuStyle->SetPaperSize(20.,20.);
  // ncuStyle->SetLineScalePS(Float_t scale = 3);
  // ncuStyle->SetLineStyleString(Int_t i, const char* text);
  // ncuStyle->SetHeaderPS(const char* header);
  // ncuStyle->SetTitlePS(const char* pstitle);

  // ncuStyle->SetBarOffset(Float_t baroff = 0.5);
  // ncuStyle->SetBarWidth(Float_t barwidth = 0.5);
  // ncuStyle->SetPaintTextFormat(const char* format = "g");
  // ncuStyle->SetPalette(Int_t ncolors = 0, Int_t* colors = 0);
  // ncuStyle->SetTimeOffset(Double_t toffset);
  // ncuStyle->SetHistMinimumZero(kTRUE);

  ncuStyle->SetHatchesLineWidth(5);
  ncuStyle->SetHatchesSpacing(0.05);

  ncuStyle->cd();

}
Example #14
0
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->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.1);
  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);

  // For the axis titles:

  tdrStyle->SetTitleColor(1, "XYZ");
  tdrStyle->SetTitleFont(42, "XYZ");
  tdrStyle->SetTitleSize(0.06, "XYZ");
  tdrStyle->SetTitleXOffset(0.9);
  tdrStyle->SetTitleYOffset(1.05);

  // 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);
  
  tdrStyle->cd();
}
Example #15
0
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();


}
Example #16
0
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 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();
}
Example #18
0
/////
//   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();
}
Example #19
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();
}
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);
}
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();

}
Example #22
0
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(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.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");
  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(15.,15.);
  // 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();

  // --- set nice colors in 2D

  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);
  gStyle->SetNumberContours(NCont);

  // --- set default Sumw2
  TH1::SetDefaultSumw2(true);
}
Example #23
0
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();
}
Example #24
0
// 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){
Example #25
0
//-------------------------------------------------------------------------------
void setIStyle() {
  
  TStyle* IStyle = new TStyle("IStyle","Ignazio Style");   
  
  gROOT->Reset();
  gROOT->SetStyle("Plain");

   // For the Global title:
  IStyle->SetOptTitle(1); // In general I want global title!
  IStyle->SetTitleFont(42);
  IStyle->SetTitleColor(1);
  IStyle->SetTitleTextColor(1);
  IStyle->SetTitleFillColor(10);
  IStyle->SetTitleFontSize(0.05);

  IStyle->SetCanvasBorderMode(0);
  IStyle->SetCanvasColor(kWhite);
  IStyle->SetCanvasDefH(400);     //Height of canvas
  IStyle->SetCanvasDefW(600);     //Width of canvas
  IStyle->SetPadBorderMode(0);
  IStyle->SetPadColor(kWhite);
  /*
  // Pad Margins:
  //-----------------------------
  IStyle->SetPadTopMargin(0.05);
  IStyle->SetPadBottomMargin(0.13);
  IStyle->SetPadLeftMargin(0.16);
  IStyle->SetPadRightMargin(0.02);
  */

  // For the frame:
  //-----------------------------
  IStyle->SetFrameBorderMode(0);
  IStyle->SetFrameBorderSize(1);
  IStyle->SetFrameFillColor(kWhite);
  IStyle->SetFrameFillStyle(0);
  IStyle->SetFrameLineColor(1);
  IStyle->SetFrameLineStyle(1);
  IStyle->SetFrameLineWidth(1);

  // For the histo:
  //-----------------------------
  IStyle->SetHistLineWidth(1);
  IStyle->SetHistLineColor(kBlack);
  IStyle->SetEndErrorSize(2);
  IStyle->SetErrorX(0.);
  // IStyle->SetMarkerStyle(kFullDotSmall); 
  // IStyle->SetMarkerStyle(kFullDotMedium); 
  IStyle->SetMarkerStyle(kFullDotLarge);
  // IStyle->SetMarkerStyle(kFullCircle);


  // For the statistics box:
  //-----------------------------
  /*
    gStyle->SetOptStat("option-string");

    Where option string can contain:-
    n ;  name of histogram is printed
    e ;  number of entries printed
    m ;  mean value printed
    r ;  rms printed
    u ;  number of underflows printed
    o ;  number of overflows printed
    i ;  integral of bins printed
    Example: gStyle->SetOptStat("ne");
    print only name of histogram and number of entries.

    To remove it altogther:-

  gStyle->SetOptStat("");
  */
  // IStyle->SetOptStat("emr");        
  /*
  The parameter mode can be = ksiourmen  (default = 000001111)
    k = 1;  kurtosis printed
    k = 2;  kurtosis and kurtosis error printed
    s = 1;  skewness printed
    s = 2;  skewness and skewness error printed
    i = 1;  integral of bins printed
    o = 1;  number of overflows printed
    u = 1;  number of underflows printed
    r = 1;  rms printed
    r = 2;  rms and rms error printed
    m = 1;  mean value printed
    m = 2;  mean and mean error values printed
    e = 1;  number of entries printed
    n = 1;  name of histogram is printed
  Example: gStyle->SetOptStat(11);
           print only name of histogram and number of entries.
           gStyle->SetOptStat(1101);  displays the name of histogram, mean value and RMS.
  WARNING: never call SetOptStat(000111); but SetOptStat(1111), 0001111 will
          be taken as an octal number !!
  WARNING: SetOptStat(1) is taken as SetOptStat(1111) (for back compatibility
           with older versions. If you want to print only the name of the histogram
           call SetOptStat(1000000001).
  NOTE that in case of 2-D histograms, when selecting just underflow (10000)
        or overflow (100000), the stats box will show all combinations
        of underflow/overflows and not just one single number!
  */

  //  IStyle->SetOptStat(1110);  
  IStyle->SetOptStat(0); 

  IStyle->SetStatColor(kWhite);
  IStyle->SetStatFont(42);
 
  // For fitting:
  //-----------------------------
  IStyle->SetFuncWidth(1);         // for the fit function 
  IStyle->SetFuncColor(kBlack);    // for the fit function 
  IStyle->SetOptFit(111);          // IStyle->SetOptFit(0) to get rid of
  IStyle->SetStatW(0.18);          // set width of stat box
  IStyle->SetStatFontSize(0.04);   // set the font size for stat box

  /*
  // Change for log plots:
  IStyle->SetOptLogx(0);
  IStyle->SetOptLogy(0);
  IStyle->SetOptLogz(0)
  */

  // IStyle->SetPalette(1);
  palette();
  IStyle->cd(); // this becomes now the current style gStyle

}