Example #1
0
void CMSStyle() {

  std::cout << "\nApplying CMS style settings...\n" << std::endl ;
  
  TStyle *cmsStyle = new TStyle("CMS","Cms style");

  // ALBERTO: default palette is hideous, use xx.x format for text in TH2   
  cmsStyle->SetPalette(1);
  cmsStyle->SetPaintTextFormat(".1f");

  // use plain black on white colors
  Int_t icol=0; // WHITE
  cmsStyle->SetFrameBorderMode(icol);
  cmsStyle->SetFrameFillColor(icol);
  cmsStyle->SetCanvasBorderMode(icol);
  cmsStyle->SetCanvasColor(icol);
  cmsStyle->SetPadBorderMode(icol);
  cmsStyle->SetPadColor(icol);
  cmsStyle->SetStatColor(icol);
  //cmsStyle->SetFillColor(icol); // don't use: white fill color floa *all* objects

  // set the paper & margin sizes
  cmsStyle->SetPaperSize(20,26);
  cmsStyle->SetPadTopMargin(0.05);
  cmsStyle->SetPadRightMargin(0.05);
  cmsStyle->SetPadBottomMargin(0.16);
  cmsStyle->SetPadLeftMargin(0.16);

  // use large fonts
  //Int_t font=72; // Helvetica italics
  Int_t font=42; // Helvetica
  Double_t tsize=0.05;
  cmsStyle->SetTextFont(font);

  cmsStyle->SetTextSize(tsize);
  cmsStyle->SetLabelFont(font,"x");
  cmsStyle->SetTitleFont(font,"x");
  cmsStyle->SetLabelFont(font,"y");
  cmsStyle->SetTitleFont(font,"y");
  cmsStyle->SetLabelFont(font,"z");
  cmsStyle->SetTitleFont(font,"z");
  
  cmsStyle->SetLabelSize(tsize,"x");
  cmsStyle->SetTitleSize(tsize,"x");
  cmsStyle->SetLabelSize(tsize,"y");
  cmsStyle->SetTitleSize(tsize,"y");
  cmsStyle->SetLabelSize(tsize,"z");
  cmsStyle->SetTitleSize(tsize,"z");

  // use bold lines and markers
  cmsStyle->SetMarkerStyle(20);
  cmsStyle->SetMarkerSize(1.2);
  cmsStyle->SetHistLineWidth(2.);
  cmsStyle->SetLineStyleString(2,"[12 12]"); // postscript dashes

  // get rid of X error bars and y error bar caps
  //cmsStyle->SetErrorX(0.001);

  // do not display any of the standard histogram decorations
  cmsStyle->SetOptTitle(0);
  //cmsStyle->SetOptStat(1111);
  cmsStyle->SetOptStat(0);
  //cmsStyle->SetOptFit(1111);
  cmsStyle->SetOptFit(0);

  // put tick marks on top and RHS of plots
  cmsStyle->SetPadTickX(1);
  cmsStyle->SetPadTickY(1);

  // reset plain style
  //gROOT->SetStyle("Plain");

  gROOT->SetStyle("CMS");
  gROOT->ForceStyle();

}
Example #2
0
void
SetOKStyle()
{
  TStyle* OKStyle = new TStyle("OKStyle", "OK Default Style");

  // Colors

  //set the background color to white
  OKStyle->SetFillColor(10);
  OKStyle->SetFrameFillColor(kWhite);
  OKStyle->SetFrameFillStyle(0);
  OKStyle->SetFillStyle(0);
  OKStyle->SetCanvasColor(kWhite);
  OKStyle->SetPadColor(kWhite);
  OKStyle->SetTitleFillColor(0);
  OKStyle->SetStatColor(kWhite);

  // Get rid of drop shadow on legends
  // This doesn't seem to work.  Call SetBorderSize(1) directly on your TLegends
  OKStyle->SetLegendBorderSize(1);

  //don't put a colored frame around the plots
  OKStyle->SetFrameBorderMode(0);
  OKStyle->SetCanvasBorderMode(0);
  OKStyle->SetPadBorderMode(0);

  //use the primary color palette
  OKStyle->SetPalette(1, 0);

  //set the default line color for a histogram to be black
  OKStyle->SetHistLineColor(kBlack);

  //set the default line color for a fit function to be red
  OKStyle->SetFuncColor(kBlue);

  //make the axis labels black
  OKStyle->SetLabelColor(kBlack, "xyz");

  //set the default title color to be black
  OKStyle->SetTitleColor(kBlack);

  //set the margins
  OKStyle->SetPadBottomMargin(0.15);
  OKStyle->SetPadLeftMargin(0.1);
  OKStyle->SetPadTopMargin(0.075);
  OKStyle->SetPadRightMargin(0.1);

  //set axis label and title text sizes
  OKStyle->SetLabelSize(0.035, "xyz");
  OKStyle->SetTitleSize(0.05, "xyz");
  OKStyle->SetTitleOffset(0.9, "xyz");
  OKStyle->SetStatFontSize(0.035);
  OKStyle->SetTextSize(0.05);
  OKStyle->SetTitleBorderSize(0);
  OKStyle->SetTitleStyle(0);

  OKStyle->SetLegendBorderSize(0);

  //set line widths
  OKStyle->SetHistLineWidth(1);
  OKStyle->SetFrameLineWidth(2);
  OKStyle->SetFuncWidth(2);

  // Misc

  //align the titles to be centered
  //OKStyle->SetTextAlign(22);

  //turn off xy grids
  OKStyle->SetPadGridX(1);
  OKStyle->SetPadGridY(1);

  //set the tick mark style
  OKStyle->SetPadTickX(1);
  OKStyle->SetPadTickY(1);

  //don't show the fit parameters in a box
  OKStyle->SetOptFit(0);

  //set the default stats shown
  OKStyle->SetOptStat(1);

  //marker settings
// 	OKStyle->SetMarkerStyle(8);
// 	OKStyle->SetMarkerSize(0.7);

  // Fonts
  OKStyle->SetStatFont(42);
  OKStyle->SetLabelFont(42, "xyz");
  OKStyle->SetTitleFont(42, "xyz");
  OKStyle->SetTextFont(42);

  // Set the paper size for output
  OKStyle->SetPaperSize(TStyle::kUSLetter);

  //done
  OKStyle->cd();

  cout << "Using Jin's Style" << endl;
}
Example #3
0
File: fake.C Project: kskovpen/bTag
TStyle* Style() 
{
  TStyle *style = new TStyle("STYLE","User style");

  // use plain black on white colors
  Int_t icol=0; // WHITE
  style->SetFrameBorderMode(icol);
  style->SetFrameFillColor(icol);
  style->SetCanvasBorderMode(icol);
  style->SetCanvasColor(icol);
  style->SetPadBorderMode(icol);
  style->SetPadColor(icol);
  style->SetStatColor(icol);
  //style->SetFillColor(icol); // don't use: white fill color for *all* objects

  // set the paper & margin sizes
  style->SetPaperSize(20,26);

  // set margin sizes
  style->SetPadTopMargin(0.05);
  style->SetPadRightMargin(0.05);
  style->SetPadBottomMargin(0.16);
  style->SetPadLeftMargin(0.16);

  // set title offsets (for axis label)
  style->SetTitleXOffset(1.4);
  style->SetTitleYOffset(1.4);

  // use large fonts
  //Int_t font=72; // Helvetica italics
  Int_t font=42; // Helvetica
  Double_t tsize=0.05;
  style->SetTextFont(font);

  style->SetTextSize(tsize);
  style->SetLabelFont(font,"x");
  style->SetTitleFont(font,"x");
  style->SetLabelFont(font,"y");
  style->SetTitleFont(font,"y");
  style->SetLabelFont(font,"z");
  style->SetTitleFont(font,"z");
  
  style->SetLabelSize(tsize,"x");
  style->SetTitleSize(tsize,"x");
  style->SetLabelSize(tsize,"y");
  style->SetTitleSize(tsize,"y");
  style->SetLabelSize(tsize,"z");
  style->SetTitleSize(tsize,"z");

  // use bold lines and markers
  style->SetMarkerStyle(20);
  style->SetMarkerSize(1.2);
  style->SetHistLineWidth(2.);
  style->SetLineStyleString(2,"[12 12]"); // postscript dashes

  // get rid of X error bars 
  //style->SetErrorX(0.001);
  // get rid of error bar caps
  style->SetEndErrorSize(0.);

  // do not display any of the standard histogram decorations
  style->SetOptTitle(0);
  //style->SetOptStat(1111);
  style->SetOptStat(0);
  //style->SetOptFit(1111);
  style->SetOptFit(0);

  // put tick marks on top and RHS of plots
  style->SetPadTickX(1);
  style->SetPadTickY(1);

  return style;
}
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
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 #6
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->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(0); // To display the mean and RMS:   SetOptStat("mr");
  tdrStyle->SetStatColor(kWhite);
  tdrStyle->SetStatFont(42);
  tdrStyle->SetStatFontSize(0.025);
  tdrStyle->SetStatTextColor(1);
  tdrStyle->SetStatFormat("6.4g");
  tdrStyle->SetStatBorderSize(1);
  tdrStyle->SetStatH(0.1);
  tdrStyle->SetStatW(0.15);

// Margins:
  tdrStyle->SetPadTopMargin(0.05);
  tdrStyle->SetPadBottomMargin(0.13);
  tdrStyle->SetPadLeftMargin(0.16);
  tdrStyle->SetPadRightMargin(0.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.25);

// For the axis labels:

  tdrStyle->SetLabelColor(1, "XYZ");
  tdrStyle->SetLabelFont(42, "XYZ");
  tdrStyle->SetLabelOffset(0.007, "XYZ");
  tdrStyle->SetLabelSize(0.05, "XYZ");

// For the axis:

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

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

// Postscript options:
  tdrStyle->SetPaperSize(20.,20.);

// Turn off the grid line
  tdrStyle->SetPadGridX(false);
  tdrStyle->SetPadGridY(false);

  tdrStyle->cd();

}
Example #7
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();
}
Example #8
0
//set global style to PRD recommendation????
void SetStyle_PRD(){

  TStyle *RootStyle = new TStyle("Root-Style","Single Top Style for PRD");
  
#ifdef __CINT__
  TStyle *GloStyle;
  GloStyle = gStyle;                          // save the global style reference
  gStyle = RootStyle;
#endif


  // Canvas

  RootStyle->SetCanvasColor     (0);
  RootStyle->SetCanvasBorderMode(0);

  // Pads

  RootStyle->SetPadColor       (0);
  RootStyle->SetPadBorderMode  (0);
  RootStyle->SetPadBottomMargin(0.17);
  RootStyle->SetPadTopMargin   (0.07);
  RootStyle->SetPadLeftMargin  (0.18);
  RootStyle->SetPadRightMargin (0.08);
  RootStyle->SetPadTickX       (0);
  RootStyle->SetPadTickY       (0);

  // Frames

  RootStyle->SetFrameLineWidth (3);
  RootStyle->SetFrameFillColor (0);
  RootStyle->SetFrameBorderMode(0);
  RootStyle->SetFrameBorderSize(0);


  // Histograms

   RootStyle->SetHistFillColor(0);
   RootStyle->SetHistLineWidth(2);

  // Functions

  //RootStyle->SetFuncColor(1);
  //RootStyle->SetFuncStyle(0);
  //RootStyle->SetFuncWidth(2);

  //Legends 

  //RootStyle->SetLegendBorderSize(0);
  //RootStyle->SetFillStyle(0);
  //RootStyle->SetTextFont(62); 
  //RootStyle->SetTextSize(0.045);

  // Labels, Ticks, and Titles

  //RootStyle->SetTickLength ( 0.015,"X");
  RootStyle->SetTitleSize  ( 0.070,"X");
  RootStyle->SetTitleOffset( 1.100,"X");
  RootStyle->SetLabelSize  ( 0.070,"X");
  RootStyle->SetNdivisions ( 505  ,"X");

//RootStyle->SetTickLength ( 0.015,"Y");
  RootStyle->SetTitleSize  ( 0.070,"Y");
  RootStyle->SetTitleOffset( 1.300,"Y");
  RootStyle->SetLabelSize  ( 0.070,"Y");
  RootStyle->SetNdivisions ( 505  ,"Y");

//   RootStyle->SetTickLength ( 0.015,"Z");
//   RootStyle->SetTitleSize  ( 0.060,"Z");
//   RootStyle->SetTitleOffset( 1.100,"Z");
//   RootStyle->SetLabelOffset( 0.015,"Z");
//   RootStyle->SetLabelSize  ( 0.050,"Z");
//   RootStyle->SetLabelFont  ( 42   ,"Z");
//   RootStyle->SetTitleFont  ( 42   ,"Z");
//   RootStyle->SetNdivisions ( 707   ,"Z");


  RootStyle->SetTitleBorderSize  (0);
  RootStyle->SetTitleFillColor  (0);  
//RootStyle->SetTitleFont  (42);
//RootStyle->SetTitleColor  (1);

  RootStyle->SetLineWidth  (2);

  // Options

  RootStyle->SetOptFit        (0111);
  RootStyle->SetOptStat       (1);
  RootStyle->SetStatBorderSize(0);
  RootStyle->SetStatColor     (0);
  RootStyle->SetStatW(0.5);
//  RootStyle->SetMarkerStyle(20);
//RootStyle->SetMarkerSize(1.25);

//RootStyle->SetPalette(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 #10
0
void drawNmenoUno() {

  TStyle *simpleStyle = new TStyle("simpleStyle","");
  simpleStyle->SetCanvasColor(0);
  simpleStyle->SetFrameFillColor(0);
  simpleStyle->SetStatColor(0);
  simpleStyle->SetOptStat(0);
  simpleStyle->SetTitleFillColor(0);
  simpleStyle->SetCanvasBorderMode(0);
  simpleStyle->SetPadBorderMode(0);
  simpleStyle->SetFrameBorderMode(0);
  simpleStyle->cd();

  TChain* chain = new TChain("jetTree");

  //chain->Add("2ndLevelOutputFile_PhotonJet15.root");
  //chain->Add("2ndLevelOutputFile_PhotonJet30.root");
  //chain->Add("2ndLevelOutputFile_PhotonJet80.root");
  chain->Add("2ndLevelOutputFile_PhotonJet170.root");
  //chain->Add("2ndLevelOutputFile_PhotonJet300.root");
  //chain->Add("2ndLevelOutputFile_PhotonJet470.root");
  //chain->Add("2ndLevelOutputFile_PhotonJet800.root");

  Float_t eventWeight;
  chain->SetBranchAddress("eventWeight", &eventWeight);

  Float_t hcalIso;
  chain->SetBranchAddress("hcalIsoPhotReco", &hcalIso);

  Float_t ecalIso;
  chain->SetBranchAddress("ecalIsoPhotReco", &ecalIso);

  Int_t nTrkIso;
  chain->SetBranchAddress("nTrkIsoPhotReco", &nTrkIso);

  Float_t ptTrkIso;
  chain->SetBranchAddress("ptTrkIsoPhotReco", &ptTrkIso);

  Float_t clusterMaj;
  chain->SetBranchAddress("clusterMajPhotReco", &clusterMaj);

  Float_t clusterMin;
  chain->SetBranchAddress("clusterMinPhotReco", &clusterMin);

  Float_t ptPhot;
  chain->SetBranchAddress("ptPhotReco", &ptPhot);

  Float_t etaPhot;
  chain->SetBranchAddress("etaPhotReco", &etaPhot);

  Float_t phiPhot;
  chain->SetBranchAddress("phiPhotReco", &phiPhot);

  Float_t pt2ndJet;
  chain->SetBranchAddress("pt2ndJetReco", &pt2ndJet);

  Float_t phi2ndJet;
  chain->SetBranchAddress("phi2ndJetReco", &phi2ndJet);

  Float_t eta2ndJet;
  chain->SetBranchAddress("eta2ndJetReco", &eta2ndJet);

  Float_t phiJet;
  chain->SetBranchAddress("phiJetReco", &phiJet);


  TH1F* h1_hcalIso = new TH1F("hcalIso", "", 100, -0.2, 1.4 );
  TH1F* h1_ecalIso = new TH1F("ecalIso", "", 100, -0.2, 1.4 );
  TH1F* h1_nTrkIso = new TH1F("nTrkIso", "", 26, -0.5, 25.5 );
  TH1F* h1_ptTrkIso = new TH1F("ptTrkIso", "", 100, 0., 5. );
  TH1F* h1_clusterMaj = new TH1F("clusterMaj", "", 100, 0., 2. );
  TH1F* h1_clusterMin = new TH1F("clusterMin", "", 100, 0., 1.4 );
  //TH1F* h1_ptPhot = new TH1F("ptPhot", "", 100, 0., 70. );
  //TH1F* h1_etaPhot = new TH1F("etaPhot", "", 100, -3.5, 3.5 );
  TH1F* h1_pt2ndJet = new TH1F("pt2ndJet", "", 100, 0., 5.);
  TH1F* h1_deltaPhi = new TH1F("deltaPhi", "", 100, 0., 3.14159);

  TH1F* h1_deltaR = new TH1F("deltaR", "", 100, 0., 1.);


  //efficiency plots:
  Int_t nBins_pt = 15;
  Float_t ptMin = 0.;
  Float_t ptMax = 700.;
  TH1F* h1_ptPhot_denom = new TH1F("ptPhot_denom", "", nBins_pt, ptMin, ptMax);
  h1_ptPhot_denom->SetMarkerStyle(20);
  TH1F* h1_ptPhot_nTrkIso_abs = new TH1F("ptPhot_nTrkIso_abs", "", nBins_pt, ptMin, ptMax);
  h1_ptPhot_nTrkIso_abs->SetMarkerStyle(20);
  TH1F* h1_ptPhot_nTrkIso_cascade = new TH1F("ptPhot_nTrkIso_cascade", "", nBins_pt, ptMin, ptMax);
  TH1F* h1_ptPhot_ptTrkIso_abs = new TH1F("ptPhot_ptTrkIso_abs", "", nBins_pt, ptMin, ptMax);
  TH1F* h1_ptPhot_ptTrkIso_cascade = new TH1F("ptPhot_ptTrkIso_cascade", "", nBins_pt, ptMin, ptMax);
  TH1F* h1_ptPhot_hcalIso_abs = new TH1F("ptPhot_hcalIso_abs", "", nBins_pt, ptMin, ptMax);
  TH1F* h1_ptPhot_hcalIso_cascade = new TH1F("ptPhot_hcalIso_cascade", "", nBins_pt, ptMin, ptMax);
  TH1F* h1_ptPhot_clusterMaj_abs = new TH1F("ptPhot_clusterMaj_abs", "", nBins_pt, ptMin, ptMax);
  TH1F* h1_ptPhot_clusterMaj_cascade = new TH1F("ptPhot_clusterMaj_cascade", "", nBins_pt, ptMin, ptMax);
  TH1F* h1_ptPhot_clusterMin_abs = new TH1F("ptPhot_clusterMin_abs", "", nBins_pt, ptMin, ptMax);
  TH1F* h1_ptPhot_clusterMin_cascade = new TH1F("ptPhot_clusterMin_cascade", "", nBins_pt, ptMin, ptMax);
  TH1F* h1_ptPhot_ecalIso_abs = new TH1F("ptPhot_ecalIso_abs", "", nBins_pt, ptMin, ptMax);
  TH1F* h1_ptPhot_ecalIso_cascade = new TH1F("ptPhot_ecalIso_cascade", "", nBins_pt, ptMin, ptMax);
  
  TH1F* h1_eff_nTrkIso_abs = new TH1F("eff_nTrkIso_abs", "", nBins_pt, ptMin, ptMax);
  h1_eff_nTrkIso_abs->SetMarkerStyle(20);
  h1_eff_nTrkIso_abs->SetMarkerColor(kRed);
  TH1F* h1_eff_nTrkIso_cascade = new TH1F("eff_nTrkIso_cascade", "", nBins_pt, ptMin, ptMax);
  h1_eff_nTrkIso_cascade->SetMarkerStyle(20);
  h1_eff_nTrkIso_cascade->SetMarkerColor(kRed);
  TH1F* h1_eff_ptTrkIso_abs = new TH1F("eff_ptTrkIso_abs", "", nBins_pt, ptMin, ptMax);
  h1_eff_ptTrkIso_abs->SetMarkerStyle(21);
  h1_eff_ptTrkIso_abs->SetMarkerColor(kBlue);
  TH1F* h1_eff_ptTrkIso_cascade = new TH1F("eff_ptTrkIso_cascade", "", nBins_pt, ptMin, ptMax);
  h1_eff_ptTrkIso_cascade->SetMarkerStyle(21);
  h1_eff_ptTrkIso_cascade->SetMarkerColor(kBlue);
  TH1F* h1_eff_hcalIso_abs = new TH1F("eff_hcalIso_abs", "", nBins_pt, ptMin, ptMax);
  h1_eff_hcalIso_abs->SetMarkerStyle(22);
  h1_eff_hcalIso_abs->SetMarkerColor(kGreen);
  TH1F* h1_eff_hcalIso_cascade = new TH1F("eff_hcalIso_cascade", "", nBins_pt, ptMin, ptMax);
  h1_eff_hcalIso_cascade->SetMarkerStyle(22);
  h1_eff_hcalIso_cascade->SetMarkerColor(kGreen);
  TH1F* h1_eff_clusterMaj_abs = new TH1F("eff_clusterMaj_abs", "", nBins_pt, ptMin, ptMax);
  h1_eff_clusterMaj_abs->SetMarkerStyle(23);
  h1_eff_clusterMaj_abs->SetMarkerColor(kMagenta);
  TH1F* h1_eff_clusterMaj_cascade = new TH1F("eff_clusterMaj_cascade", "", nBins_pt, ptMin, ptMax);
  h1_eff_clusterMaj_cascade->SetMarkerStyle(23);
  h1_eff_clusterMaj_cascade->SetMarkerColor(kMagenta);
  TH1F* h1_eff_clusterMin_abs = new TH1F("eff_clusterMin_abs", "", nBins_pt, ptMin, ptMax);
  h1_eff_clusterMin_abs->SetMarkerStyle(24);
  h1_eff_clusterMin_abs->SetMarkerColor(kCyan);
  TH1F* h1_eff_clusterMin_cascade = new TH1F("eff_clusterMin_cascade", "", nBins_pt, ptMin, ptMax);
  h1_eff_clusterMin_cascade->SetMarkerStyle(24);
  h1_eff_clusterMin_cascade->SetMarkerColor(kCyan);
  TH1F* h1_eff_ecalIso_abs = new TH1F("eff_ecalIso_abs", "", nBins_pt, ptMin, ptMax);
  h1_eff_ecalIso_abs->SetMarkerStyle(25);
  h1_eff_ecalIso_abs->SetMarkerColor(kYellow);
  TH1F* h1_eff_ecalIso_cascade = new TH1F("eff_ecalIso_cascade", "", nBins_pt, ptMin, ptMax);
  h1_eff_ecalIso_cascade->SetMarkerStyle(25);
  h1_eff_ecalIso_cascade->SetMarkerColor(kYellow);
  


  Int_t nEntries = chain->GetEntries();

  for(int iEntry=0; iEntry<nEntries; ++iEntry) {

    chain->GetEntry(iEntry);

    if( (iEntry % 100000)==0 ) std::cout << "Entry: " << iEntry << "/" << nEntries << std::endl;

    if( ptPhot < 25. ) continue;
    if( fabs(etaPhot)>1.3 ) continue;


    bool b_hcalIso = true;
    bool b_ecalIso = true;
    bool b_nTrkIso = true;
    bool b_ptTrkIso = true;
    bool b_clusterMaj= true;
    bool b_clusterMin = true;
    bool b_pt2ndJet = true;
    bool b_deltaPhi = true;

    h1_ptPhot_denom->Fill(ptPhot, eventWeight);

    if( nTrkIso>= 3) {
      b_nTrkIso = false;
      h1_ptPhot_nTrkIso_abs->Fill(ptPhot, eventWeight);
    }
    if( ptTrkIso>= 0.1) {
      b_ptTrkIso = false;
      h1_ptPhot_ptTrkIso_abs->Fill(ptPhot, eventWeight);
    }
    if( hcalIso>= 0.053) {
      b_hcalIso = false;
      h1_ptPhot_hcalIso_abs->Fill(ptPhot, eventWeight);
    }
    if( clusterMaj>= 0.3) {
      b_clusterMaj = false;
      h1_ptPhot_clusterMaj_abs->Fill(ptPhot, eventWeight);
    }
    if( clusterMin>= 0.25) {
      b_clusterMin = false;
      h1_ptPhot_clusterMin_abs->Fill(ptPhot, eventWeight);
    }
    if( ecalIso>= 0.05) {
      b_ecalIso = false;
      h1_ptPhot_ecalIso_abs->Fill(ptPhot, eventWeight);
    }

    if( b_nTrkIso && b_ptTrkIso )
      h1_ptPhot_ptTrkIso_cascade->Fill(ptPhot, eventWeight);

    if( b_nTrkIso && b_ptTrkIso && b_hcalIso )
      h1_ptPhot_hcalIso_cascade->Fill(ptPhot, eventWeight);

    if( b_nTrkIso && b_ptTrkIso && b_hcalIso && b_clusterMaj)
      h1_ptPhot_clusterMaj_cascade->Fill(ptPhot, eventWeight);

    if( b_nTrkIso && b_ptTrkIso && b_hcalIso && b_clusterMaj && b_clusterMin )
      h1_ptPhot_clusterMin_cascade->Fill(ptPhot, eventWeight);

    if( b_nTrkIso && b_ptTrkIso && b_hcalIso && b_clusterMaj && b_clusterMin && b_ecalIso )
      h1_ptPhot_ecalIso_cascade->Fill(ptPhot, eventWeight);



    if( (pt2ndJet>0.1*ptPhot)&&(pt2ndJet>10.)) b_pt2ndJet = false;
    
    //leading jet and photon back2back in transverse plane
    Float_t deltaPhi_jet = phiPhot- phiJet;
    Float_t pi = 3.14159;
    if( fabs(deltaPhi_jet) < (pi - 0.2) ) b_deltaPhi = false;

    Float_t deltaEta = etaPhot - eta2ndJet;
    Float_t deltaPhi = phiPhot - phi2ndJet;
    Float_t deltaR = sqrt( deltaEta*deltaEta + deltaPhi*deltaPhi );

    if( b_ecalIso && b_nTrkIso && b_ptTrkIso && b_clusterMaj && b_clusterMin ) 
      h1_hcalIso->Fill(hcalIso);

    if( b_hcalIso && b_nTrkIso && b_ptTrkIso && b_clusterMaj && b_clusterMin ) 
      h1_ecalIso->Fill(ecalIso);

    if( b_hcalIso && b_ecalIso && b_ptTrkIso && b_clusterMaj && b_clusterMin ) 
      h1_nTrkIso->Fill(nTrkIso);

    if( b_hcalIso && b_ecalIso && nTrkIso && b_clusterMaj && b_clusterMin) 
      h1_ptTrkIso->Fill(ptTrkIso);

    if( b_hcalIso && b_ecalIso && nTrkIso && b_ptTrkIso && b_clusterMin) 
      h1_clusterMaj->Fill(clusterMaj);

    if( b_hcalIso && b_ecalIso && nTrkIso && b_ptTrkIso && b_clusterMaj) 
      h1_clusterMin->Fill(clusterMin);

    if( b_hcalIso && b_ecalIso && b_nTrkIso && b_ptTrkIso && b_clusterMaj && b_clusterMin && b_pt2ndJet) {
      h1_deltaPhi->Fill( deltaPhi_jet, eventWeight );
    }

  } //for entries


  fillEfficiencyPlot( h1_ptPhot_nTrkIso_abs, h1_ptPhot_denom, h1_eff_nTrkIso_abs );

  TCanvas* c1 = new TCanvas("c1", "c1", 800, 600);
  c1->cd();
  h1_deltaPhi->Draw();
  c1->SaveAs("deltaPhi.eps");

  h1_ptPhot_denom->Draw("P");
  c1->SaveAs("ptPhot_denom.eps");

  h1_ptPhot_nTrkIso_abs->Draw("P");
  c1->SaveAs("ptPhot_nTrkIso.eps");

  h1_eff_nTrkIso_abs->Draw("P");
  c1->SaveAs("eff_nTrkIso.eps");


  c1->SetLogy();

  h1_hcalIso->Draw();
  c1->SaveAs("hcalIso.eps");

  h1_ecalIso->Draw();
  c1->SaveAs("ecalIso.eps");

  h1_nTrkIso->Draw();
  c1->SaveAs("nTrkIso.eps");

  h1_ptTrkIso->Draw();
  c1->SaveAs("ptTrkIso.eps");

  h1_clusterMaj->Draw();
  c1->SaveAs("clusterMaj.eps");

  h1_clusterMin->Draw();
  c1->SaveAs("clusterMin.eps");

}
Example #11
0
void FitXS (int nminx = 0, int nmaxx = 1509, int nmintest = 0, int nmaxtest = 1509) {
    ////////////////////////////////////////////////////
    // ftp://root.cern.ch/root/doc/ROOTUsersGuideHTML/ch09s05.html
    TStyle *defaultStyle = new TStyle("defaultStyle","Default Style");
    //gStyle->SetOptStat(0);
    //  defaultStyle->SetOptStat(0000);
    //  defaultStyle->SetOptFit(000); 
    //  defaultStyle->SetPalette(1);
    ////////////////////////
    defaultStyle->SetOptStat(0); // remove info box
    /////// pad ////////////
    defaultStyle->SetPadBorderMode(0);
    defaultStyle->SetPadBorderSize(3);
    defaultStyle->SetPadColor(0);
    defaultStyle->SetPadTopMargin(0.1);
    defaultStyle->SetPadBottomMargin(0.16);
    defaultStyle->SetPadRightMargin(5.5);
    defaultStyle->SetPadLeftMargin(0.18);
    /////// canvas /////////
    defaultStyle->SetCanvasBorderMode(1);
    defaultStyle->SetCanvasColor(0);
    //  defaultStyle->SetCanvasDefH(600);
    //  defaultStyle->SetCanvasDefW(600);
    /////// frame //////////
    //defaultStyle->SetFrameBorderMode(1);
    //defaultStyle->SetFrameBorderSize(1);
    defaultStyle->SetFrameFillColor(0); 
    defaultStyle->SetFrameLineColor(1);
    /////// label //////////
    //  defaultStyle->SetLabelOffset(0.005,"XY");
    //  defaultStyle->SetLabelSize(0.05,"XY");
    //defaultStyle->SetLabelFont(46,"XY");
    /////// title //////////
    //defaultStyle->SetTitleW(0.6);
    defaultStyle->SetTitleSize(0.08, "XYZ");
    defaultStyle->SetTitleBorderSize(0);
    defaultStyle->SetTitleX(0.2);
    //  defaultStyle->SetTitleOffset(1.1,"X");
    //  defaultStyle->SetTitleSize(0.01,"X");
    //  defaultStyle->SetTitleOffset(1.25,"Y");
    //  defaultStyle->SetTitleSize(0.05,"Y");
    //defaultStyle->SetTitleFont(42, "XYZ");
    /////// various ////////
    defaultStyle->SetNdivisions(303,"Y");
    defaultStyle->SetTitleFillColor(0);//SetTitleFillStyle(0, "Z");
    //defaultStyle->SetTitleX(0.2);
    //defaultStyle->SetTitleY(0.1);
    //defaultStyle->SetTitleBorderSize(-0.1);  // For the axis titles:
    
    //    defaultStyle->SetTitleColor(1, "XYZ");
    //    defaultStyle->SetTitleFont(42, "XYZ");
    
    
    // defaultStyle->SetTitleYSize(0.08);
    //defaultStyle->SetTitleXOffset(0.9);
    //defaultStyle->SetTitleYOffset(1.05);
    defaultStyle->SetTitleOffset(1.3, "Y"); // Another way to set the Offset
    //defaultStyle->SetTitleOffset(1.0, "X"); // Another way to set the Offset    
    // For the axis labels:
    defaultStyle->SetLabelColor(1, "XYZ");
    //defaultStyle->SetLabelFont(46, "XYZ");
    defaultStyle->SetLabelOffset(0.03, "XYZ");
    defaultStyle->SetLabelSize(0.07, "XYZ");
    //defaultStyle->SetLabelY(0.06);    
    // For the axis:
    //    defaultStyle->SetAxisColor(1, "XYZ");
    defaultStyle->SetStripDecimals(kTRUE);
    defaultStyle->SetTickLength(0.03, "XYZ");
    defaultStyle->SetNdivisions(7, "XYZ");
    //    defaultStyle->SetPadTickX(1);   // To get tick marks on the opposite side of the frame
    //    defaultStyle->SetPadTickY(1);
    defaultStyle->cd();

    ///////////////////////////////////////////

  nmin=nminx;
  nmax=nmaxx;
  if (nmin<0) nmin=0;
  if (nmax>Npoints) nmax=Npoints;
  // Read in the cross section values and the parameters space points
  ifstream XSvals;
    XSvals.open("list_all_translation_CX.txt");//"14TeV_CX_5k_opositecgw.ascii");// "8TeV_CX_5k_opositecgw.ascii");//
  for (int i=nmin; i<nmax; i++)  {
    XSvals >> par0[i] >> par1[i] >> par2[i] >> par3[i] >> par4[i] >> cross_section[i] >> cross_sectionerr[i];
    cout << "For point i = " << i << "pars are " << par0[i] << " " << par1[i] << " " << par2[i] 
    	 << " " << par3[i] << " " << par4[i] << " and xs is " << cross_section[i] << endl;
  }
  
  cout << "**********************************************" << endl;
  
  // Likelihood maximization
  // -----------------------  
  // Minuit routine
  TMinuit rmin(2);
  rmin.SetFCN(Likelihood);
  // Main initialization member function for MINUIT
  rmin.mninit(5,6,7);
  // Parameters needed to be unambiguous with MINOS
  int iflag=0; // You can use this for selection
  double arglis[4];
  //arglis[0]=2;
  arglis[0]=1;
  // Sets the strategy to be used in calculating first and second derivatives 
  // and in certain minimization methods. 1 is default
  rmin.mnexcm("SET STR", arglis, 1, iflag);
  // Set fit parameters
  
  double Start[15];//  ={ 0.030642286182762914, 0.1502216514258229, 0.004287943879883482, 0.0016389029559123376, 0.01930407853512356, -0.12540818099961384, -0.02048425705808435,  0.04246248185144494, 0.02590360491719489,  -0.05255851386689693,  -0.010393610828707423,  0.02770339496466713,  0.005468667874225809,  -0.011297300064522649,  -0.02261561923548796}; // cx in pb
  //  double Start[15] = {2.2646, 1.102, 0.316898, 16, 192, -3, -1, 1, 7, 15, -8, -23, 4, 9, 200}; // normalized to SM
  double Step[15];// ={ 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01 }; //={0.01};
  double Min[15]; // ={-3.1415926};
  double Max[15]; // = {3.1415926}; 
  for (int i=0; i<15; i++) {
    Start[i]=1.;
    Step[i]=1;
    Min[i]=-100000;
    Max[i]=+100000;
  }
  TString parnamEj[15]={"A1","A2","A3","A4","A5","A6","A7","A8","A9","A10","A11","A12","A13","A14","A15"};
  for (int i=0; i<15; i++) {
    rmin.mnparm(i, parnamEj[i],  Start[i], Step[i], Min[i], Max[i], iflag);
  }
  // Instructs Minuit to call subroutine FCN with the value of IFLAG
  rmin.mnexcm("call fcn", arglis, 1, iflag); // command executed normally
  // Causes minimization of the function by the method of Migrad
  rmin.mnexcm("mini", arglis, 0, iflag);
  // Read results
  double a[15], err[15], pmin, pmax;
  int ivar;
  for (int i=0; i<15; i++) {
    rmin.mnpout (i, parnamEj[i], a[i], err[i], pmin, pmax, ivar);
  }

  // End of program
  // --------------
  gROOT->Time();
    cout<<endl<<" Making plots "<<endl;
    cout<<"$A_1$ = "<<a[0]<<" $\\pm$ "<<err[0]<<" & $A_4$ = "<<a[3]<<" $\\pm$ "<<err[3]<<" & $A_7$ = "<<a[6]<<" $\\pm$ "<<err[6]<<" & $A_{10}$ = "<<a[9]<<" $\\pm$ "<<err[9]<<" & $A_{13}$ = "<<a[12]<<" $\\pm$ "<<err[12]<< " \\\ "<<endl;
    cout<<"$A_2$ = "<<a[1]<<" $\\pm$ "<<err[1]<<" & $A_5$ = "<<a[4]<<" $\\pm$ "<<err[4]<<" & $A_8$ = "<<a[7]<<" $\\pm$ "<<err[7]<<" & $A_{11}$ = "<<a[10]<<" $\\pm$ "<<err[10]<<" & $A_{14}$ = "<<a[13]<<" $\\pm$ "<<err[13]<< " \\\ "<<endl;
    cout<<"$A_3$ = "<<a[2]<<" $\\pm$ "<<err[2]<<" & $A_6$ = "<<a[5]<<" $\\pm$ "<<err[5]<<" & $A_9$ = "<<a[8]<<" $\\pm$ "<<err[8]<<" & $A_{12}$ = "<<a[11]<<" $\\pm$ "<<err[11]<<" & $A_{15}$ = "<<a[14]<<" $\\pm$ "<<err[14]<< " \\\ "<<endl;
    cout<<endl<<" To mathematica: "<<endl;
    cout<<"{"<<a[0]<<","<<a[1]<<","<<a[2]<<","<<a[3]<<","<<a[4]<<","<<a[5]<<","<<a[6]<<","<<a[7]<<","<<a[8]<<","<<a[9]<<","<<a[10]<<","<<a[11]<<","<<a[12]<<","<<a[13]<<","<<a[14]<<"}"<<endl;
    cout<<endl<<" To mathematica (errors): "<<endl;
    cout<<"{"<<err[0]<<","<<err[1]<<","<<err[2]<<","<<err[3]<<","<<err[4]<<","<<err[5]<<","<<err[6]<<","<<err[7]<<","<<err[8]<<","<<err[9]<<","<<err[10]<<","<<err[11]<<","<<err[12]<<","<<err[13]<<","<<err[14]<<"}"<<endl;
    
    /////////////////
    // plot the CX 
    ////////////////
    // plane b
    double norm =  1; //0.013531;// 0.0041758;//1;//  8tev 13 tev  1;// 
    double kt5d=1.0;
    double kl5d=1.0;
    double c25d=0.0;
    double mincg = -2.99, maxcg=2.99;
    // cg ===> x 
    // c2g ===> y
    TF2 *fg2 = new TF2("fg2","(([0]*[15]**4 + [1]*[17]**2 + [2]*[15]**2*[16]**2 + [3]*x**2*[16]**2 +  [4]*y**2 + [5]*[17]*[15]**2 + [6]*[15]*[16]*[15]**2 + [7]*[15]*[16]*[17] + [8]*x*[16]*[17] + [9]*[17]*y + [10]*x*[16]*[15]**2 + [11]*y*[15]**2 + [12]*[16]*x*[15]*[16] + [13]*y*[15]*[16] + [14]*x*y*[16])/[18])",mincg,maxcg,mincg,maxcg);
    fg2->SetParameter(0,a[0]);
    fg2->SetParameter(1,a[1]);
    fg2->SetParameter(2,a[2]);    
    fg2->SetParameter(3,a[3]);
    fg2->SetParameter(4,a[4]);
    fg2->SetParameter(5,a[5]); 
    fg2->SetParameter(6,a[6]);
    fg2->SetParameter(7,a[7]);
    fg2->SetParameter(8,a[8]); 
    fg2->SetParameter(9,a[9]);
    fg2->SetParameter(10,a[10]);
    fg2->SetParameter(11,a[11]); 
    fg2->SetParameter(12,a[12]);    
    fg2->SetParameter(13,a[13]);
    fg2->SetParameter(14,a[14]);
    fg2->SetTitle("kt = #kappa_{#lambda} = 1 , c_{2} = 0 ; c_{g} ; c_{2g}");
    fg2->SetParameter(15,kt5d);    
    fg2->SetParameter(16,kl5d);
    fg2->SetParameter(17,c25d);
    fg2->SetParameter(18,norm); //0.013531
    //fg2->SetMinimum(0);
    fg2->SetContour(100);
    // 
    ////////////////////////////////
    kt5d=1.0;
    kl5d=10.0;
    c25d=0.0;
    // cg ===> x 
    // c2g ===> y
    TF2 *fg10 = new TF2("fg10","([0]*[15]**4 + [1]*[17]**2 + [2]*[15]**2*[16]**2 + [3]*x**2*[16]**2 +  [4]*y**2 + [5]*[17]*[15]**2 + [6]*[15]*[16]*[15]**2 + [7]*[15]*[16]*[17] + [8]*x*[16]*[17] + [9]*[17]*y + [10]*x*[16]*[15]**2 + [11]*y*[15]**2 + [12]*[16]*x*[15]*[16] + [13]*y*[15]*[16] + [14]*x*y*[16])/[18]",mincg,maxcg,mincg,maxcg);
    fg10->SetParameter(0,a[0]);
    fg10->SetParameter(1,a[1]);
    fg10->SetParameter(2,a[2]);    
    fg10->SetParameter(3,a[3]);
    fg10->SetParameter(4,a[4]);
    fg10->SetParameter(5,a[5]); 
    fg10->SetParameter(6,a[6]);
    fg10->SetParameter(7,a[7]);
    fg10->SetParameter(8,a[8]); 
    fg10->SetParameter(9,a[9]);
    fg10->SetParameter(10,a[10]);
    fg10->SetParameter(11,a[11]); 
    fg10->SetParameter(12,a[12]);    
    fg10->SetParameter(13,a[13]);
    fg10->SetParameter(14,a[14]);
    fg10->SetTitle("");
    fg10->SetParameter(15,kt5d);    
    fg10->SetParameter(16,kl5d);
    fg10->SetParameter(17,c25d);
    fg10->SetParameter(18,norm);// 0.013531
    fg10->SetMinimum(0);
    ////////////////////////////////
    kt5d=1.0;
    kl5d=-10.0;
    c25d=0.0;
    // cg ===> x 
    // c2g ===> y
    TF2 *fgm10 = new TF2("fgm10","([0]*[15]**4 + [1]*[17]**2 + [2]*[15]**2*[16]**2 + [3]*x**2*[16]**2 +  [4]*y**2 + [5]*[17]*[15]**2 + [6]*[15]*[16]*[15]**2 + [7]*[15]*[16]*[17] + [8]*x*[16]*[17] + [9]*[17]*y + [10]*x*[16]*[15]**2 + [11]*y*[15]**2 + [12]*[16]*x*[15]*[16] + [13]*y*[15]*[16] + [14]*x*y*[16])/[18]",mincg,maxcg,mincg,maxcg);
    fgm10->SetParameter(0,a[0]);
    fgm10->SetParameter(1,a[1]);
    fgm10->SetParameter(2,a[2]);    
    fgm10->SetParameter(3,a[3]);
    fgm10->SetParameter(4,a[4]);
    fgm10->SetParameter(5,a[5]); 
    fgm10->SetParameter(6,a[6]);
    fgm10->SetParameter(7,a[7]);
    fgm10->SetParameter(8,a[8]); 
    fgm10->SetParameter(9,a[9]);
    fgm10->SetParameter(10,a[10]);
    fgm10->SetParameter(11,a[11]); 
    fgm10->SetParameter(12,a[12]);    
    fgm10->SetParameter(13,a[13]);
    fgm10->SetParameter(14,a[14]);
    fgm10->SetTitle("");
    fgm10->SetParameter(15,kt5d);    
    fgm10->SetParameter(16,kl5d);
    fgm10->SetParameter(17,c25d);
    fgm10->SetParameter(18,norm);//0.013531
    fgm10->SetMinimum(0);
    //
    cout<<endl<<"Value of the formula in SM point: 0.013531 pb"<<a[0]<<endl;
    cout<<"teste funcao cg , c2g : 0,0 "<< fg2->Eval(0,0)<<endl;
    cout<<"teste funcao cg , c2g : -1,1  "<<  fg2->Eval(-1,1)<<endl;
    cout<<"teste funcao cg , c2g : 1,-1  "<<  fg2->Eval(-1,1)<<endl;
    cout<<" "<<endl;
    ////////////////////////////////////////////////////
    double cg=0.0;
    double c2g=0.0;
    c25d=0.0;
    // cg ===> x  ===> kl
    // c2g ===> y ===> kt
    TF2 *SM0 = new TF2("SM0","(([0]*y**4 + [1]*[17]**2 + [2]*y**2*x**2 + [3]*[15]**2*x**2 +  [4]*[15]**2 + [5]*[17]*y**2 + [6]*y*x*y**2 + [7]*[15]*x*[17] + [8]*[16]*x*[17] + [9]*[17]*y + [10]*[16]*x*[15]**2 + [11]*[16]*y**2 + [12]*x*[16]*[15]*x + [13]*[15]*[15]*x + [14]*[16]*[15])/[18])+[19]",-15,15,0.5,2.5);
    SM0->SetParameter(0,a[0]);
    SM0->SetParameter(1,a[1]);
    SM0->SetParameter(2,a[2]);    
    SM0->SetParameter(3,a[3]);
    SM0->SetParameter(4,a[4]);
    SM0->SetParameter(5,a[5]); 
    SM0->SetParameter(6,a[6]);
    SM0->SetParameter(7,a[7]);
    SM0->SetParameter(8,a[8]); 
    SM0->SetParameter(9,a[9]);
    SM0->SetParameter(10,a[10]);
    SM0->SetParameter(11,a[11]); 
    SM0->SetParameter(12,a[12]);    
    SM0->SetParameter(13,a[13]);
    SM0->SetParameter(14,a[14]);
    SM0->SetParameter(15,cg); //==>y     
    SM0->SetParameter(16,c2g);//==>x
    SM0->SetParameter(17,c25d);
    SM0->SetParameter(18,norm);// 0.013531
    SM0->SetParameter(19,0.0001);// 0.013531
    SM0->SetTitle("c_{2} = c_{2g} = c_{g} = 0 ; #kappa_{#lambda} ; #kappa_{t}");
    //SM0->SetMinimum(0);
    SM0->SetContour(200);
    //
    cout<<endl<<"Value of the formula in SM point: 0.013531 pb "<<endl;
    cout<<"teste funcao kl , kt : 1,1 "<< SM0->Eval(1,1)<<endl;
    cout<<"teste funcao kl , kt : -10, 1  "<<  SM0->Eval(-10,1)<<endl;
    cout<<"teste funcao kl , kt : 10, 1  "<<  SM0->Eval(10,1)<<endl;
    ////////////////////////////////
    kt5d=1.0;
    kl5d=1.0;
    c25d=0.0;
    // cg ===> x ==> c2
    // c2g ===> y ==> kt
    TF2 *l1 = new TF2("l1","([0]*y**4 + [1]*x**2 + [2]*y**2*[16]**2 + [3]*[17]**2*[16]**2 +  [4]*[15]**2 + [5]*x*y**2 + [6]*y*[16]*y**2 + [7]*y*[16]*x + [8]*[17]*[16]*x + [9]*x*[15] + [10]*[17]*[16]*y**2 + [11]*[15]*y**2 + [12]*[16]*[17]*y*[16] + [13]*[15]*y*[16] + [14]*[17]*[15]*[16])/[18]",-4,4,0.5,2.5);
    l1->SetParameter(0,a[0]);
    l1->SetParameter(1,a[1]);
    l1->SetParameter(2,a[2]);    
    l1->SetParameter(3,a[3]);
    l1->SetParameter(4,a[4]);
    l1->SetParameter(5,a[5]); 
    l1->SetParameter(6,a[6]);
    l1->SetParameter(7,a[7]);
    l1->SetParameter(8,a[8]); 
    l1->SetParameter(9,a[9]);
    l1->SetParameter(10,a[10]);
    l1->SetParameter(11,a[11]); 
    l1->SetParameter(12,a[12]);    
    l1->SetParameter(13,a[13]);
    l1->SetParameter(14,a[14]);
    l1->SetTitle("#kappa_{#lambda} =1 , c_{2g} = c_{g} = 0 ; c_{2} ; #kappa_{t}");
    l1->SetParameter(15,c2g); //==> c2g
    l1->SetParameter(16,kl5d);
    l1->SetParameter(17,cg); //==> cg
    l1->SetParameter(18,norm);//0.013531
    //l1->->SetRange(1e1,0.1,1e3,1);
    //l1->SetMaximum(4e2);
    //l1->SetMinimum(0);
    //
    cout<<endl<<"Value of the formula in SM point: 0.013531 pb"<<a[0]<<endl;
    cout<<"teste funcao cg , c2g : 0,0 "<< l1->Eval(0,1)<<endl;
    cout<<"teste funcao cg , c2g : -1,1  "<<  l1->Eval(-1,1)<<endl;
    cout<<"teste funcao cg , c2g : 1,-1  "<<  l1->Eval(-1,1)<<endl;
    cout<<" "<<endl;
    
    ////////////////////////////////
    kt5d=1.0;
    kl5d=0.0;
    c25d=0.0;
    // cg ===> x ==> c2
    // c2g ===> y ==> kt
    TF2 *l0 = new TF2("l0","([0]*y**4 + [1]*x**2 + [2]*y**2*[16]**2 + [3]*[17]**2*[16]**2 +  [4]*[15]**2 + [5]*x*y**2 + [6]*y*[16]*y**2 + [7]*y*[16]*x + [8]*[17]*[16]*x + [9]*x*[15] + [10]*[17]*[16]*y**2 + [11]*[15]*y**2 + [12]*[16]*[17]*y*[16] + [13]*[15]*y*[16] + [14]*[17]*[15]*[16])/[18]",-4,4,0.5,2.5);
    l0->SetParameter(0,a[0]);
    l0->SetParameter(1,a[1]);
    l0->SetParameter(2,a[2]);    
    l0->SetParameter(3,a[3]);
    l0->SetParameter(4,a[4]);
    l0->SetParameter(5,a[5]); 
    l0->SetParameter(6,a[6]);
    l0->SetParameter(7,a[7]);
    l0->SetParameter(8,a[8]); 
    l0->SetParameter(9,a[9]);
    l0->SetParameter(10,a[10]);
    l0->SetParameter(11,a[11]); 
    l0->SetParameter(12,a[12]);    
    l0->SetParameter(13,a[13]);
    l0->SetParameter(14,a[14]);
    l0->SetTitle("");
    l0->SetParameter(15,c2g); //==> c2g
    l0->SetParameter(16,kl5d);
    l0->SetParameter(17,cg); //==> cg
    l0->SetParameter(18,norm);//0.013531
    l0->SetMinimum(0);
    //
    cout<<endl<<"Value of the formula in SM point: 0.013531 pb"<<a[0]<<endl;
    cout<<"teste funcao cg , c2g : 0,0 "<< l0->Eval(0,1)<<endl;
    cout<<"teste funcao cg , c2g : -1,1  "<<  l0->Eval(-1,1)<<endl;
    cout<<"teste funcao cg , c2g : 1,-1  "<<  l0->Eval(-1,1)<<endl;
    cout<<" "<<endl;
    ////////////////////////////////
    kt5d=1.0;
    kl5d=2.4;
    c25d=0.0;
    // cg ===> x ==> c2
    // c2g ===> y ==> kt
    TF2 *l24 = new TF2("l24","([0]*y**4 + [1]*x**2 + [2]*y**2*[16]**2 + [3]*[17]**2*[16]**2 +  [4]*[15]**2 + [5]*x*y**2 + [6]*y*[16]*y**2 + [7]*y*[16]*x + [8]*[17]*[16]*x + [9]*x*[15] + [10]*[17]*[16]*y**2 + [11]*[15]*y**2 + [12]*[16]*[17]*y*[16] + [13]*[15]*y*[16] + [14]*[17]*[15]*[16])/[18]",-4,4,0.5,2.5);
    l24->SetParameter(0,a[0]);
    l24->SetParameter(1,a[1]);
    l24->SetParameter(2,a[2]);    
    l24->SetParameter(3,a[3]);
    l24->SetParameter(4,a[4]);
    l24->SetParameter(5,a[5]); 
    l24->SetParameter(6,a[6]);
    l24->SetParameter(7,a[7]);
    l24->SetParameter(8,a[8]); 
    l24->SetParameter(9,a[9]);
    l24->SetParameter(10,a[10]);
    l24->SetParameter(11,a[11]); 
    l24->SetParameter(12,a[12]);    
    l24->SetParameter(13,a[13]);
    l24->SetParameter(14,a[14]);
    l24->SetTitle("");
    l24->SetParameter(15,c2g); //==> c2g
    l24->SetParameter(16,kl5d);
    l24->SetParameter(17,cg); //==> cg
    l24->SetParameter(18,norm);//0.013531
    l24->SetMinimum(0);
    //
    cout<<endl<<"Value of the formula in SM point: 0.013531 pb"<<a[0]<<endl;
    cout<<"teste funcao cg , c2g : 0,0 "<< l24->Eval(0,1)<<endl;
    cout<<"teste funcao cg , c2g : -1,1  "<<  l24->Eval(-1,1)<<endl;
    cout<<"teste funcao cg , c2g : 1,-1  "<<  l24->Eval(-1,1)<<endl;
    cout<<" "<<endl;
    ////////////////////////////////
    kt5d=1.0;
    kl5d=5.0;
    c25d=0.0;
    // cg ===> x ==> c2
    // c2g ===> y ==> kt
    TF2 *l5 = new TF2("l5","([0]*y**4 + [1]*x**2 + [2]*y**2*[16]**2 + [3]*[17]**2*[16]**2 +  [4]*[15]**2 + [5]*x*y**2 + [6]*y*[16]*y**2 + [7]*y*[16]*x + [8]*[17]*[16]*x + [9]*x*[15] + [10]*[17]*[16]*y**2 + [11]*[15]*y**2 + [12]*[16]*[17]*y*[16] + [13]*[15]*y*[16] + [14]*[17]*[15]*[16])/[18]",-4,4,0.5,2.5);
    l5->SetParameter(0,a[0]);
    l5->SetParameter(1,a[1]);
    l5->SetParameter(2,a[2]);    
    l5->SetParameter(3,a[3]);
    l5->SetParameter(4,a[4]);
    l5->SetParameter(5,a[5]); 
    l5->SetParameter(6,a[6]);
    l5->SetParameter(7,a[7]);
    l5->SetParameter(8,a[8]); 
    l5->SetParameter(9,a[9]);
    l5->SetParameter(10,a[10]);
    l5->SetParameter(11,a[11]); 
    l5->SetParameter(12,a[12]);    
    l5->SetParameter(13,a[13]);
    l5->SetParameter(14,a[14]);
    l5->SetTitle("");
    l5->SetParameter(15,c2g); //==> c2g
    l5->SetParameter(16,kl5d);
    l5->SetParameter(17,cg); //==> cg
    l5->SetParameter(18,norm);//0.013531
    l5->SetMinimum(0);
    //
    cout<<endl<<"Value of the formula in SM point: 0.013531 pb"<<a[0]<<endl;
    cout<<"teste funcao cg , c2g : 0,0 "<< l5->Eval(0,1)<<endl;
    cout<<"teste funcao cg , c2g : -1,1  "<<  l5->Eval(-1,1)<<endl;
    cout<<"teste funcao cg , c2g : 1,-1  "<<  l5->Eval(-1,1)<<endl;
    cout<<" "<<endl;
    ////////////////////////////////
    kt5d=1.0;
    kl5d=10.0;
    c25d=0.0;
    // cg ===> x ==> c2
    // c2g ===> y ==> kt
    TF2 *l10 = new TF2("l10","([0]*y**4 + [1]*x**2 + [2]*y**2*[16]**2 + [3]*[17]**2*[16]**2 +  [4]*[15]**2 + [5]*x*y**2 + [6]*y*[16]*y**2 + [7]*y*[16]*x + [8]*[17]*[16]*x + [9]*x*[15] + [10]*[17]*[16]*y**2 + [11]*[15]*y**2 + [12]*[16]*[17]*y*[16] + [13]*[15]*y*[16] + [14]*[17]*[15]*[16])/[18]",-4,4,0.5,2.5);
    l10->SetParameter(0,a[0]);
    l10->SetParameter(1,a[1]);
    l10->SetParameter(2,a[2]);    
    l10->SetParameter(3,a[3]);
    l10->SetParameter(4,a[4]);
    l10->SetParameter(5,a[5]); 
    l10->SetParameter(6,a[6]);
    l10->SetParameter(7,a[7]);
    l10->SetParameter(8,a[8]); 
    l10->SetParameter(9,a[9]);
    l10->SetParameter(10,a[10]);
    l10->SetParameter(11,a[11]); 
    l10->SetParameter(12,a[12]);    
    l10->SetParameter(13,a[13]);
    l10->SetParameter(14,a[14]);
    l10->SetTitle("");
    l10->SetParameter(15,c2g); //==> c2g
    l10->SetParameter(16,kl5d);
    l10->SetParameter(17,cg); //==> cg
    l10->SetParameter(18,norm);//0.013531
    l10->SetMinimum(0);
    //
    cout<<endl<<"Value of the formula in SM point: 0.013531 pb"<<a[0]<<endl;
    cout<<"teste funcao cg , c2g : 0,0 "<< l10->Eval(0,1)<<endl;
    cout<<"teste funcao cg , c2g : -1,1  "<<  l10->Eval(-1,1)<<endl;
    cout<<"teste funcao cg , c2g : 1,-1  "<<  l10->Eval(-1,1)<<endl;
    cout<<" "<<endl;
    ////////////////////////////////
    kt5d=1.0;
    kl5d=-2.4;
    c25d=0.0;
    // cg ===> x ==> c2
    // c2g ===> y ==> kt
    TF2 *lm24 = new TF2("lm24","([0]*y**4 + [1]*x**2 + [2]*y**2*[16]**2 + [3]*[17]**2*[16]**2 +  [4]*[15]**2 + [5]*x*y**2 + [6]*y*[16]*y**2 + [7]*y*[16]*x + [8]*[17]*[16]*x + [9]*x*[15] + [10]*[17]*[16]*y**2 + [11]*[15]*y**2 + [12]*[16]*[17]*y*[16] + [13]*[15]*y*[16] + [14]*[17]*[15]*[16])/[18]",-17,17,0.5,2.5);
    lm24->SetParameter(0,a[0]);
    lm24->SetParameter(1,a[1]);
    lm24->SetParameter(2,a[2]);    
    lm24->SetParameter(3,a[3]);
    lm24->SetParameter(4,a[4]);
    lm24->SetParameter(5,a[5]); 
    lm24->SetParameter(6,a[6]);
    lm24->SetParameter(7,a[7]);
    lm24->SetParameter(8,a[8]); 
    lm24->SetParameter(9,a[9]);
    lm24->SetParameter(10,a[10]);
    lm24->SetParameter(11,a[11]); 
    lm24->SetParameter(12,a[12]);    
    lm24->SetParameter(13,a[13]);
    lm24->SetParameter(14,a[14]);
    lm24->SetTitle("");
    lm24->SetParameter(15,c2g); //==> c2g
    lm24->SetParameter(16,kl5d);
    lm24->SetParameter(17,cg); //==> cg
    lm24->SetParameter(18,norm);//0.013531
    lm24->SetMinimum(0);
    //
    cout<<endl<<"Value of the formula in SM point: 0.013531 pb"<<a[0]<<endl;
    cout<<"teste funcao cg , c2g : 0,0 "<< lm24->Eval(0,1)<<endl;
    cout<<"teste funcao cg , c2g : -1,1  "<<  lm24->Eval(-1,1)<<endl;
    cout<<"teste funcao cg , c2g : 1,-1  "<<  lm24->Eval(-1,1)<<endl;
    cout<<" "<<endl;
    ////////////////////////////////
    kt5d=1.0;
    kl5d=-5.0;
    c25d=0.0;
    // cg ===> x ==> c2
    // c2g ===> y ==> kt
    TF2 *lm5 = new TF2("lm5","([0]*y**4 + [1]*x**2 + [2]*y**2*[16]**2 + [3]*[17]**2*[16]**2 +  [4]*[15]**2 + [5]*x*y**2 + [6]*y*[16]*y**2 + [7]*y*[16]*x + [8]*[17]*[16]*x + [9]*x*[15] + [10]*[17]*[16]*y**2 + [11]*[15]*y**2 + [12]*[16]*[17]*y*[16] + [13]*[15]*y*[16] + [14]*[17]*[15]*[16])/[18]",-4,4,0.5,2.5);
    lm5->SetParameter(0,a[0]);
    lm5->SetParameter(1,a[1]);
    lm5->SetParameter(2,a[2]);    
    lm5->SetParameter(3,a[3]);
    lm5->SetParameter(4,a[4]);
    lm5->SetParameter(5,a[5]); 
    lm5->SetParameter(6,a[6]);
    lm5->SetParameter(7,a[7]);
    lm5->SetParameter(8,a[8]); 
    lm5->SetParameter(9,a[9]);
    lm5->SetParameter(10,a[10]);
    lm5->SetParameter(11,a[11]); 
    lm5->SetParameter(12,a[12]);    
    lm5->SetParameter(13,a[13]);
    lm5->SetParameter(14,a[14]);
    lm5->SetTitle("");
    lm5->SetParameter(15,c2g); //==> c2g
    lm5->SetParameter(16,kl5d);
    lm5->SetParameter(17,cg); //==> cg
    lm5->SetParameter(18,norm);//0.013531
    lm5->SetMinimum(0);
    //
    cout<<endl<<"Value of the formula in SM point: 0.013531 pb"<<a[0]<<endl;
    cout<<"teste funcao cg , c2g : 0,0 "<< lm5->Eval(0,1)<<endl;
    cout<<"teste funcao cg , c2g : -1,1  "<<  lm5->Eval(-1,1)<<endl;
    cout<<"teste funcao cg , c2g : 1,-1  "<<  lm5->Eval(-1,1)<<endl;
    cout<<" "<<endl;
    ////////////////////////////////
    kt5d=1.0;
    kl5d=-10.0;
    c25d=0.0;
    // cg ===> x ==> c2
    // c2g ===> y ==> kt
    TF2 *lm10 = new TF2("lm10","([0]*y**4 + [1]*x**2 + [2]*y**2*[16]**2 + [3]*[17]**2*[16]**2 +  [4]*[15]**2 + [5]*x*y**2 + [6]*y*[16]*y**2 + [7]*y*[16]*x + [8]*[17]*[16]*x + [9]*x*[15] + [10]*[17]*[16]*y**2 + [11]*[15]*y**2 + [12]*[16]*[17]*y*[16] + [13]*[15]*y*[16] + [14]*[17]*[15]*[16])/[18]",-4,4,0.5,2.5);
    lm10->SetParameter(0,a[0]);
    lm10->SetParameter(1,a[1]);
    lm10->SetParameter(2,a[2]);    
    lm10->SetParameter(3,a[3]);
    lm10->SetParameter(4,a[4]);
    lm10->SetParameter(5,a[5]); 
    lm10->SetParameter(6,a[6]);
    lm10->SetParameter(7,a[7]);
    lm10->SetParameter(8,a[8]); 
    lm10->SetParameter(9,a[9]);
    lm10->SetParameter(10,a[10]);
    lm10->SetParameter(11,a[11]); 
    lm10->SetParameter(12,a[12]);    
    lm10->SetParameter(13,a[13]);
    lm10->SetParameter(14,a[14]);
    lm10->SetTitle("");
    lm10->SetParameter(15,c2g); //==> c2g
    lm10->SetParameter(16,kl5d);
    lm10->SetParameter(17,cg); //==> cg
    lm10->SetParameter(18,norm);//0.013531
    lm10->SetMinimum(0);
    //
    cout<<endl<<"Value of the formula in SM point: 0.013531 pb"<<a[0]<<endl;
    cout<<"teste funcao cg , c2g : 0,0 "<< lm10->Eval(0,1)<<endl;
    cout<<"teste funcao cg , c2g : -1,1  "<<  lm10->Eval(-1,1)<<endl;
    cout<<"teste funcao cg , c2g : 1,-1  "<<  lm10->Eval(-1,1)<<endl;
    cout<<" "<<endl;
    ///////////////////////////////////////////////////////////////
    // Draw this function in pad1 with Gouraud shading option
    TCanvas *c1 = new TCanvas("c1","Surfaces Drawing Options",1500,2500);
    const int Number = 3;
    Double_t Red[Number]    = { 1.00, 0.00, 0.00};
    Double_t Green[Number]  = { 0.00, 1.00, 0.00};
    Double_t Blue[Number]   = { 1.00, 0.00, 1.00};
    Double_t Length[Number] = { 0.00, 0.50, 1.00 };
    Int_t nb=30;
    TColor::CreateGradientColorTable(Number,Length,Red,Green,Blue,nb);
    ////////////////////////////
    TLatex* text = new TLatex();
    text->SetTextSize(0.09);
    c1->SetLogz(0);
    //////////////////////////////////////
    /*
    c1->Divide(3,4);   
    c1->cd(1);
    //c1_1->SetLogz();
    //c1->SetTicks(0,0);
    //c1->SetRightMargin(0.15);
    //c1->SetLeftMargin(0.15);
    //c1->SetBottomMargin(0.02);
    fg2->Draw("colz1");
    text->DrawLatex(-0.85,-0.8,"#kappa_{#lambda} = 1, #kappa_{t} = 1,  c_{2} = 0");
    //-----------------
    c1->cd(2);
    //c1_1->SetLogz();
    //c1_2->SetTicks(0,0);
    //c1_2->SetRightMargin(0.15);
    //c1_2->SetLeftMargin(0.15);
    //c1_2->SetBottomMargin(0.02);
    fg10->Draw("colz1");
    text->DrawLatex(-0.85,-0.8,"#kappa_{#lambda} = 10, #kappa_{t} = 1,  c_{2} = 0");
    //-----------------
    c1->cd(3);
    //c1_1->SetLogz();
    //c1_2->SetTicks(0,0);
    //c1_2->SetRightMargin(0.15);
    //c1_2->SetLeftMargin(0.15);
    //c1_2->SetBottomMargin(0.02);
    fgm10->Draw("colz1");
    text->DrawLatex(-0.85,-0.8,"#kappa_{#lambda} = -10, #kappa_{t} = 1,  c_{2} = 0");
    //text->SetTextSize(0.08);
    //text->SetTextColor(0);
    //text->DrawLatex(-0.85.,-0.8,"#kappa_{#lambda} = 2.4, #kappa_{t} = 1,  c_{2} = 0");
    c1->cd(4);
    //c1_1->SetLogz();
    //c1_2->SetTicks(0,0);
    //c1_2->SetRightMargin(0.15);
    //c1_2->SetLeftMargin(0.15);
    //c1_2->SetBottomMargin(0.02);
    SM0->Draw("colz1");
    text->DrawLatex(-3.,0.7,"c_{2} = c_{g}  = c_{2} = 0");  
    //text->SetTextSize(0.08);
    //text->SetTextColor(0);
    //text->DrawLatex(-0.85.,-0.8,"#kappa_{#lambda} = 2.4, #kappa_{t} = 1,  c_{2} = 0");
    c1->cd(5);
    //c1_5->SetTicks(0,0);
    //c1_2->SetRightMargin(0.15);
    //c1_2->SetLeftMargin(0.15);
    //c1_2->SetBottomMargin(0.02);
    l1->Draw("colz1");
    text->DrawLatex(-3.,0.7,"#kappa_{#lambda} = 1, c_{g}  = c_{2} = 0");  
    c1->cd(6);
    //c1_5->SetTicks(0,0);
    //c1_2->SetRightMargin(0.15);
    //c1_2->SetLeftMargin(0.15);
    //c1_2->SetBottomMargin(0.02);
    l0->Draw("colz1");
    text->DrawLatex(-3.,0.7,"#kappa_{#lambda} = c_{g}  = c_{2} = 0");  
    //text->SetTextSize(0.08);
    //text->SetTextColor(0);
    //text->DrawLatex(-0.85.,-0.8,"#kappa_{#lambda} = 2.4, #kappa_{t} = 1,  c_{2} = 0");   
    c1->cd(7);
    //c1_5->SetTicks(0,0);
    //c1_2->SetRightMargin(0.15);
    //c1_2->SetLeftMargin(0.15);
    //c1_2->SetBottomMargin(0.02);
    l24->Draw("colz");
    text->DrawLatex(-3.,0.7,"#kappa_{#lambda} = 2.4, c_{g}  = c_{2} = 0");  
    //text->SetTextSize(0.08);
    //text->SetTextColor(0);
    //text->DrawLatex(-0.85.,-0.8,"#kappa_{#lambda} = 2.4, #kappa_{t} = 1,  c_{2} = 0");  
    c1->cd(8);
    //c1_5->SetTicks(0,0);
    //c1_2->SetRightMargin(0.15);
    //c1_2->SetLeftMargin(0.15);
    //c1_2->SetBottomMargin(0.02);
    l5->Draw("colz1");
    text->DrawLatex(-3.,0.7,"#kappa_{#lambda} = 5, c_{g}  = c_{2} = 0");  
    //text->SetTextSize(0.08);
    //text->SetTextColor(0);
    //text->DrawLatex(-0.85.,-0.8,"#kappa_{#lambda} = 2.4, #kappa_{t} = 1,  c_{2} = 0");  
    c1->cd(9);
    //c1_5->SetTicks(0,0);
    //c1_2->SetRightMargin(0.15);
    //c1_2->SetLeftMargin(0.15);
    //c1_2->SetBottomMargin(0.02);
    l10->Draw("colz1");
    text->DrawLatex(-3.,0.7,"#kappa_{#lambda} = 10, c_{g}  = c_{2} = 0");  
    //text->DrawLatex(-3,1,"SM plane in log scale");
    //text->SetTextSize(0.08);
    //text->SetTextColor(0);
    //text->DrawLatex(-0.85.,-0.8,"#kappa_{#lambda} = 2.4, #kappa_{t} = 1,  c_{2} = 0");  
    c1->cd(10);
    //c1_5->SetTicks(0,0);
    //c1_2->SetRightMargin(0.15);
    //c1_2->SetLeftMargin(0.15);
    //c1_2->SetBottomMargin(0.02);
    lm24->Draw("colz1");
    text->DrawLatex(-3.,0.7,"#kappa_{#lambda} = -2.4, c_{g}  = c_{2} = 0");  
    c1->cd(11);
    //c1_5->SetTicks(0,0);
    //c1_2->SetRightMargin(0.15);
    //c1_2->SetLeftMargin(0.15);
    //c1_2->SetBottomMargin(0.02);
    lm5->Draw("colz1");
    text->DrawLatex(-3.,0.7,"#kappa_{#lambda} = -5, c_{g}  = c_{2} = 0");  
    c1->cd(12);
    //c1_5->SetTicks(0,0);
    //c1_2->SetRightMargin(0.15);
    //c1_2->SetLeftMargin(0.15);
    //c1_2->SetBottomMargin(0.02);
    lm10->Draw("colz1");
    //text->DrawLatex(-3,1,"SM plane in log scale");
    //text->SetTextSize(0.08);
    //text->SetTextColor(0);
    text->DrawLatex(-3.,0.7,"#kappa_{#lambda} = -10, c_{g}  = c_{2} = 0");  
    c1->SaveAs("C2Fit.pdf");
    c1->Close();
     */
    //////////////////////////////////////////////////
    //
    // do histrograms with errors
    //
    // plot (point - fit)/fit between int nmintest, int nmaxtest
    // do by the planes
    //////////////////////////////////////////////////
    // take the fit
    // need to be done by planes
    //c1->Clear();
    // a
    double SMxs =  0.013531; // 1 0.017278;// 14 0.0041758;// 8tev 0.013531; // 13 tev 0.017278;// 0.0041758;
    TGraph2D *g2 = new TGraph2D(117);//(118);
    g2->SetMarkerStyle(20);
    g2->SetMarkerSize(2);
    g2->SetTitle("0");
    g2->SetTitle("#kappa_{t} = #kappa_{#lambda} = 1 , c_{2} = 0 ; c_{g} ; c_{2g}");
    int j=0;
    for (unsigned int ij = 0; ij < nmaxx ; ij++) if( par1[ij] ==1 && par0[ij] ==1 && par2[ij]==0 && cross_section[ij] >0.0001) if(ij!=301) {
        double fit = SMxs*(fg2->Eval(par3[ij], par4[ij]));
        cout<<j<<" "<< par3[ij]<<" "<< par4[ij]<<" "<<fit <<" "<< cross_section[ij]<<" diff: " <<(fit - cross_section[ij])/fit<< endl;
        g2->SetPoint(j, par3[ij], par4[ij], 100*(fit - cross_section[ij])/fit); 
        j++;
        //Differences2->Fill(par3[i], par4[i], (fit - cross_section[i])/fit); 
    }
    // b 
    ////////////////////////////////
    int ktb=1.0;
    int klb=1.0;
    // cg ===> x ==> c2
    // c2g ===> y ==> kt ==> cg = c2g
    TF2 *pb = new TF2("pb","([0]*[15]**4 + [1]*x**2 + [2]*[15]**2*[16]**2 + [3]*y**2*[16]**2 +  [4]*y**2 + [5]*x*[15]**2 + [6]*[15]*[16]*[15]**2 + [7]*[15]*[16]*x + [8]*y*[16]*x - [9]*x*y + [10]*y*[16]*[15]**2 - [11]*y*[15]**2 + [12]*[16]*y*[15]*[16] - [13]*y*[15]*[16] - [14]*y*y*[16])/[17]",-3,3,-1,1);
    pb->SetParameter(0,a[0]);
    pb->SetParameter(1,a[1]);
    pb->SetParameter(2,a[2]);    
    pb->SetParameter(3,a[3]);
    pb->SetParameter(4,a[4]);
    pb->SetParameter(5,a[5]); 
    pb->SetParameter(6,a[6]);
    pb->SetParameter(7,a[7]);
    pb->SetParameter(8,a[8]); 
    pb->SetParameter(9,a[9]);
    pb->SetParameter(10,a[10]);
    pb->SetParameter(11,a[11]); 
    pb->SetParameter(12,a[12]);    
    pb->SetParameter(13,a[13]);
    pb->SetParameter(14,a[14]);
    pb->SetTitle("#kappa_{t} = #kappa_{#lambda} = 1 , c_{2g} = - c_{g} ; c_{2} ; c_{g}");
    pb->SetParameter(15,ktb); //==> c2g ==>kt
    pb->SetParameter(16,klb);
    pb->SetContour(200);
    //l5->SetParameter(17,cg); //==> cg
    pb->SetParameter(17,norm);//0.013531
    //pb->SetMinimum(0);
    TGraph2D *gb = new TGraph2D(132);//(118);
    gb->SetMarkerStyle(20);
    gb->SetMarkerSize(2);
    //gb->SetTitle("0");
    gb->SetTitle("#kappa_{t} = #kappa_{#lambda} = 1 , c_{2g} = - c_{g} ; c_{2} ; c_{g}");
    int jb=0;
    for (unsigned int ijb = 0; ijb < nmaxx ; ijb++) if( par1[ijb] ==1 && par0[ijb] ==1 && par3[ijb] == -par4[ijb] && cross_section[ijb] >0.0001) {
        double fitb = SMxs*(pb->Eval(par2[ijb], par3[ijb]));
        cout<<jb<<" "<<ijb<<" "<< par2[ijb]<<" "<< par4[ijb]<<" "<<fitb <<" "<< cross_section[ijb]<<" diff: " <<(fitb - cross_section[ijb])/fitb<< endl;
        if (abs((fitb - cross_section[ijb])/fitb) > 0.1) cout<<"here"<<endl;
        gb->SetPoint(jb, par2[ijb], par4[ijb], 100*((fitb - cross_section[ijb])/fitb)); 
        jb++;
        //Differences2->Fill(par3[i], par4[i], (fit - cross_section[i])/fit); 
    }
    //////////////////////////////////////////////
    // c
    ////////////////////////////////
    int ktc=1.0;
    int c2c=0.0;//==>c2
    // cg ===> x ==> c2 =//=>kl
    // c2g ===> y ==> kt ==> c2g = -cg 
    TF2 *pc = new TF2("pb","([0]*[15]**4 + [1]*[16]**2 + [2]*[15]**2*x**2 + [3]*y**2*x**2 +  [4]*y**2 + [5]*[16]*[15]**2 + [6]*[15]*x*[15]**2 + [7]*[15]*x*[16] + [8]*y*x*[16] - [9]*[16]*y + [10]*y*x*[15]**2 - [11]*y*[15]**2 + [12]*x*y*[15]*x - [13]*y*[15]*x - [14]*y*y*x)/[17]",-17,17,-1,1);
    pc->SetParameter(0,a[0]);
    pc->SetParameter(1,a[1]);
    pc->SetParameter(2,a[2]);    
    pc->SetParameter(3,a[3]);
    pc->SetParameter(4,a[4]);
    pc->SetParameter(5,a[5]); 
    pc->SetParameter(6,a[6]);
    pc->SetParameter(7,a[7]);
    pc->SetParameter(8,a[8]); 
    pc->SetParameter(9,a[9]);
    pc->SetParameter(10,a[10]);
    pc->SetParameter(11,a[11]); 
    pc->SetParameter(12,a[12]);    
    pc->SetParameter(13,a[13]);
    pc->SetParameter(14,a[14]);
    pc->SetTitle("#kappa_{t} = 1 , c2 = 0 , c_{2g} = - c_{g} ; #kappa_{#lambda} ; c_{g}");
    pc->SetParameter(15,ktc); //==> c2g ==>kt
    pc->SetParameter(16,c2c);// ==>c2
    //l5->SetParameter(17,cg); //==> cg
    pc->SetParameter(17,norm);//0.013531
    //pc->SetMinimum(0);
    pc->SetContour(200);
    TGraph2D *gc = new TGraph2D(125);//(118);
    gc->SetMarkerStyle(20);
    gc->SetMarkerSize(2);
    gc->SetTitle("#kappa_{t} = 1 , c2 = 0 , c_{2g} = - c_{g} ; #kappa_{#lambda} ; c_{g}");
  //  gc->GetYaxis()->SetTitle("c_{g}");
  //  gc->GetXaxis()->SetTitle("#kappa_{#lambda}");
    int jc=0;
    for (unsigned int ijb = 0; ijb < nmaxx ; ijb++) if( par1[ijb] ==1 && par2[ijb] ==0 && par3[ijb] == -par4[ijb]  && cross_section[ijb] >0.0001 && par3[ijb] >-1.5) { //&& abs(par0[ijb]) <6
        double fitc = SMxs*(pc->Eval(par0[ijb], par3[ijb]));
        //cout<<jb<<" "<<ijb<<" "<< par0[ijb]<<" "<< par4[ijb]<<" "<<fitc <<" "<< cross_section[ijb]<<" diff: " <<(fitc - cross_section[ijb])/fitc<< endl;
        if (abs((fitc - cross_section[ijb])/fitc) > 0.1) cout<<"here"<<endl;
        gc->SetPoint(jc, par0[ijb], par3[ijb], 100*((fitc - cross_section[ijb])/fitc)); 
        jc++;
        //Differences2->Fill(par3[i], par4[i], (fit - cross_section[i])/fit); 
    }
    //////////////////////////////////
    // d -- SM plane
    //SM0->Eval(1,1)
    // cg ===> x  ===> kl
    // c2g ===> y ===> kt
    TGraph2D *gSM = new TGraph2D(112);//(118);
    gSM->SetMarkerStyle(20);
    gSM->SetMarkerSize(2);
    gSM->SetTitle("0");
    gSM->SetTitle("c_{2} = c_{2g} = c_{g} = 0 ; #kappa_{#lambda} ; #kappa_{t}");
    int jSM=0;
    for (unsigned int ii = 0; ii < nmaxx ; ii++) if( par2[ii] ==0 && par3[ii] ==0 && par4[ii]==0 && cross_section[ii] >0.00001 &&  cross_section[ii] <10000 && par1[ii] >0.3 && ii!=301) {
        double fitSM = SMxs*(SM0->Eval(par0[ii], par1[ii]));
        //{
        //cout<<" SM plane"<<jSM<<" "<<ii<<" " << par0[ii]<<" "<< par1[ii]<<" "<<fitSM <<" "<< cross_section[ii]<<" diff: " <<(fitSM - cross_section[ii])/fitSM<< endl;
        if (abs((fitSM - cross_section[ii])/fitSM) > 0.1) cout<<"here"<<endl;
        gSM->SetPoint(jSM, par0[ii], par1[ii], 100*(fitSM - cross_section[ii])/fitSM); 
        jSM++;
        //}
        //Differences2->Fill(par3[i], par4[i], (fit - cross_section[i])/fit); 
    }    
    //////////////////////////////////
    // e -- SM plane
    //SM0->Eval(1,1)
    // cg ===> x  ===> c2
    // c2g ===> y ===> kt
    TGraph2D *gSMc2 = new TGraph2D(62);//(118);//57 13 tev
    gSMc2->SetMarkerStyle(20);
    gSMc2->SetMarkerSize(2);
    //gSMc2->SetTitle("0");
    gSMc2->SetTitle("#kappa_{#lambda} =1 , c_{2g} = c_{g} = 0 ; c_{2} ; #kappa_{t}");
    int jSMc2=0;
    for (unsigned int ii = 0; ii < nmaxx ; ii++) if( par0[ii] ==1 && par3[ii] ==0 && par4[ii]==0 && cross_section[ii] >0.00001 &&  cross_section[ii] <10000 && par1[ii] >0.25 ) if(ii!=301){
        double fitSM = SMxs*(l1->Eval(par2[ii], par1[ii]));
        //{
        cout<<jSMc2<<" "<<ii<<" " << par2[ii]<<" "<< par1[ii]<<" "<<fitSM <<" "<< cross_section[ii]<<" diff: " <<(fitSM - cross_section[ii])/fitSM<< endl;
        if (abs((fitSM - cross_section[ii])/fitSM) > 0.1) cout<<"here"<<endl;
        gSMc2->SetPoint(jSMc2, par2[ii], par1[ii], 100*(fitSM - cross_section[ii])/fitSM); 
        jSMc2++;
        //}
        //Differences2->Fill(par3[i], par4[i], (fit - cross_section[i])/fit); 
    }   
    ////////////////////////////////
    // f = cg =0
    int ktf=1.0;
    int klf=1.0;
    // cg ===> x ==> c2
    // c2g ===> y ==> kt ==> cg = c2g
    TF2 *pf = new TF2("pf","([0]*[15]**4 + [1]*x**2 + [2]*[15]**2*[16]**2 +  [4]*y**2 + [5]*x*[15]**2 + [6]*[15]*[16]*[15]**2 + [7]*[15]*[16]*x + [9]*x*y + [11]*y*[15]**2  + [13]*y*[15]*[16])/[17]",-3,3,-1,1);
    pf->SetParameter(0,a[0]);
    pf->SetParameter(1,a[1]);
    pf->SetParameter(2,a[2]);    
    pf->SetParameter(3,a[3]);
    pf->SetParameter(4,a[4]);
    pf->SetParameter(5,a[5]); 
    pf->SetParameter(6,a[6]);
    pf->SetParameter(7,a[7]);
    pf->SetParameter(8,a[8]); 
    pf->SetParameter(9,a[9]);
    pf->SetParameter(10,a[10]);
    pf->SetParameter(11,a[11]); 
    pf->SetParameter(12,a[12]);    
    pf->SetParameter(13,a[13]);
    pf->SetParameter(14,a[14]);
    pf->SetTitle("#kappa_{t} = #kappa_{#lambda} = 1 , c_{g} = 0 ; c_{2} ; c_{2g}");
    //pf->SetTitleSize(0.3);
    pf->SetParameter(15,ktf); //==> c2g ==>kt
    pf->SetParameter(16,klf);
    pf->SetContour(200);
    //l5->SetParameter(17,cg); //==> cg
    pf->SetParameter(17,norm);//0.013531
    //pb->SetMinimum(0);
    TGraph2D *gf = new TGraph2D(132);//(118);
    gf->SetMarkerStyle(20);
    gf->SetMarkerSize(2);
    //gb->SetTitle("0");
    gf->SetTitle("#kappa_{t} = #kappa_{#lambda} = 1 , c_{g} = 0 ; c_{2} ; c_{2g}");
    int jf=0;
    for (unsigned int ijb = 0; ijb < nmaxx ; ijb++) if( par1[ijb] ==1 && par0[ijb] ==1 && par3[ijb] == 0 && cross_section[ijb] >0.0001) {
        double fitb = SMxs*(pf->Eval(par2[ijb], par4[ijb]));
        cout<<jf<<" "<<ijb<<" "<< par2[ijb]<<" "<< par4[ijb]<<" "<<fitb <<" "<< cross_section[ijb]<<" diff: " <<(fitb - cross_section[ijb])/fitb<< endl;
        if (abs((fitb - cross_section[ijb])/fitb) > 0.1) cout<<"here"<<endl;
        gf->SetPoint(jf, par2[ijb], par4[ijb], 100*((fitb - cross_section[ijb])/fitb)); 
        jf++;
        //Differences2->Fill(par3[i], par4[i], (fit - cross_section[i])/fit); 
    }
    //////////////////////////////////////////////
    // rest square
    TCanvas *c2 = new TCanvas("c2","Surfaces Drawing Options",700,2200);
    c2->Divide(2,3);   
    c2->cd(1);
    c2_1->SetRightMargin(0.17);
    c2_1->SetLeftMargin(0.21);
    //c2->cd();
    c2_1->SetTheta(90.0-0.001);
    c2_1->SetPhi(0.0+0.001);
    gSM->Draw("Pcolz");
    //fg2->Draw("cont3SAME");
    c2->cd(2);
    c2_2->SetRightMargin(0.2);
    c2_2->SetLeftMargin(0.21);
    c2_2->SetTheta(90.0-0.001);
    c2_2->SetPhi(0.0+0.001);
    gSMc2->Draw("Pcolz");
    //SM0->Draw("cont3SAME");
    c2->cd(3);
    c2_3->SetRightMargin(0.2);
    c2_3->SetLeftMargin(0.21);
    c2_3->SetTheta(90.0-0.001);
    c2_3->SetPhi(0.0+0.001);
    gb->Draw("Pcolz");
    //pb->Draw("cont3SAME");
    c2->cd(4);
    c2_4->SetRightMargin(0.2);
    c2_4->SetLeftMargin(0.21);
    c2_4->SetTheta(90.0-0.001);
    c2_4->SetPhi(0.0+0.001);
    gc->Draw("Pcolz");
    //pc->Draw("cont3SAME");
    c2->cd(5);
    c2_5->SetRightMargin(0.2);
    c2_5->SetLeftMargin(0.21);
    c2_5->SetTheta(90.0-0.001);
    c2_5->SetPhi(0.0+0.001);
    
    g2->Draw("Pcolz");
    //
    c2->cd(6);
    c2_6->SetRightMargin(0.2);
    c2_6->SetLeftMargin(0.21);
    c2_6->SetTheta(90.0-0.001);
    c2_6->SetPhi(0.0+0.001);
    gf->Draw("Pcolz");
    c2->SaveAs("DiffSMplane_all_orthogonal_13tev.pdf");
    //////////////////////////////////////////////
    // rest square
    TCanvas *c3 = new TCanvas("c3","Surfaces Drawing Options",2200,700);
    c3->Divide(3,2); 
    c3->cd(1);
    c3_1->SetLogz(1);
    c3_1->SetLeftMargin(0.19);
    c3_1->SetBottomMargin(0.19);
    c3_1->SetRightMargin(0.2);
    //c2->cd();
    //g2->Draw("Pcolz");
    SM0->Draw("colz");
    
    c3->cd(2);
    c3_2->SetLogz(1);
    c3_2->SetRightMargin(0.19);
    c3_2->SetBottomMargin(0.19);
    c3_2->SetLeftMargin(0.21);
    //gSM->Draw("Pcolz");
    l1->Draw("colz");
    //c3_2->SetRightMargin(0.2);
    c3->cd(3);
    c3_3->SetLogz(1);
    c3_3->SetRightMargin(0.17);
    c3_3->SetBottomMargin(0.19);
    c3_3->SetLeftMargin(0.21);
    //gb->Draw("Pcolz");
    pb->Draw("colz");
    c3->cd(4);
    c3_4->SetLogz(1);
    c3_4->SetRightMargin(0.16);
    c3_4->SetBottomMargin(0.19);
    c3_4->SetLeftMargin(0.21);
    //gc->Draw("Pcolz");
    pc->Draw("colz");
    c3->cd(5);
    c3_5->SetLogz(1);
    c3_5->SetRightMargin(0.19);
    c3_5->SetBottomMargin(0.19);
    c3_5->SetLeftMargin(0.21);
    //gSMc2->Draw("Pcolz");
    
    fg2->Draw("colz");
    c3->cd(6);
    c3_6->SetLogz(1);
    c3_6->SetRightMargin(0.19);
    c3_6->SetBottomMargin(0.19);
    c3_6->SetLeftMargin(0.21);
    //gSMc2->Draw("Pcolz");
    pf->Draw("colz");
    
    c3->SaveAs("CX_all_orthogonal_13tev.pdf");
    //////////////////////////////////////////////
    
    /*  TGraph *gall = new TGraph(nmaxx - nminx);
    gall->SetMarkerStyle(20);
    gall->SetMarkerSize(2);
    gall->SetTitle("0");
    for (unsigned int i = 0; i < nmaxx - nminx; i++) if( par1[i] ==1 && par0[i] ==1 && par2[i]==0 ) {
        double fit = fg2->Eval(par3[i], par4[i]);
        cout<< par3[i]<<" "<< par4[i]<<" "<< (fit - cross_section[i])/fit<< endl;
        g2->SetPoint(i, par3[i], par4[i], (fit - cross_section[i])/fit); 
        //Differences2->Fill(par3[i], par4[i], (fit - cross_section[i])/fit); 
    }*/
    



    
}
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 SetTMVAStyle() {
      
      TStyle *TMVAStyle = gROOT->GetStyle("TMVA");
      if(TMVAStyle!=0) {
         gROOT->SetStyle("TMVA");
         return;
      }
			
      TMVAStyle = new TStyle(*gROOT->GetStyle("Plain")); // our style is based on Plain
      TMVAStyle->SetName("TMVA");
      TMVAStyle->SetTitle("TMVA style based on \"Plain\" with modifications defined in tmvaglob.C");
      gROOT->GetListOfStyles()->Add(TMVAStyle);
      gROOT->SetStyle("TMVA");
			
      TMVAStyle->SetLineStyleString( 5, "[52 12]" );
      TMVAStyle->SetLineStyleString( 6, "[22 12]" );
      TMVAStyle->SetLineStyleString( 7, "[22 10 7 10]" );

      // the pretty color palette of old
      TMVAStyle->SetPalette((UsePaperStyle ? 18 : 1),0);

      // use plain black on white colors
      TMVAStyle->SetFrameBorderMode(0);
      TMVAStyle->SetCanvasBorderMode(0);
      TMVAStyle->SetPadBorderMode(0);
      TMVAStyle->SetPadColor(0);
      TMVAStyle->SetFillStyle(0);

      TMVAStyle->SetLegendBorderSize(0);

      // title properties
      // TMVAStyle->SetTitleW(.4);
      // TMVAStyle->SetTitleH(.10);
      // MVAStyle->SetTitleX(.5);
      // TMVAStyle->SetTitleY(.9);
      TMVAStyle->SetTitleFillColor( c_TitleBox );
      TMVAStyle->SetTitleTextColor( c_TitleText );
      TMVAStyle->SetTitleBorderSize( 1 );
      TMVAStyle->SetLineColor( c_TitleBorder );
      if (!UsePaperStyle) {
         TMVAStyle->SetFrameFillColor( c_FrameFill );
         TMVAStyle->SetCanvasColor( c_Canvas );
      }

      // set the paper & margin sizes
      TMVAStyle->SetPaperSize(20,26);
      TMVAStyle->SetPadTopMargin(0.10);
      TMVAStyle->SetPadRightMargin(0.05);
      TMVAStyle->SetPadBottomMargin(0.11);
      TMVAStyle->SetPadLeftMargin(0.12);

      // use bold lines and markers
      TMVAStyle->SetMarkerStyle(21);
      TMVAStyle->SetMarkerSize(0.3);
      TMVAStyle->SetHistLineWidth(2);
      TMVAStyle->SetLineStyleString(2,"[12 12]"); // postscript dashes

      // do not display any of the standard histogram decorations
      TMVAStyle->SetOptTitle(1);
      TMVAStyle->SetTitleH(0.052);

      TMVAStyle->SetOptStat(0);
      TMVAStyle->SetOptFit(0);

      // put tick marks on top and RHS of plots
      TMVAStyle->SetPadTickX(1);
      TMVAStyle->SetPadTickY(1);

   }
Example #14
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 #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
/*
 * 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 #17
0
void drawSecondJet(std::string dataset, std::string recoType, std::string jetAlgo, const std::string& fitrms="") {

  ALGOTYPE_ = (recoType=="pf") ? recoType+jetAlgo : jetAlgo;
  RECOTYPE_ = recoType;

  TStyle *simpleStyle = new TStyle("simpleStyle","");
  simpleStyle->SetCanvasColor(0);
  simpleStyle->SetFrameFillColor(0);
  simpleStyle->SetStatColor(0);
  simpleStyle->SetOptStat(0);
  simpleStyle->SetTitleFillColor(0);
  simpleStyle->SetCanvasBorderMode(0);
  simpleStyle->SetPadBorderMode(0);
  simpleStyle->SetFrameBorderMode(0);
  simpleStyle->cd();

  if( fitrms != "" ) FIT_RMS = fitrms;

  char suffix_char[200];
  sprintf(suffix_char, "%s_%s_%s_%d", dataset.c_str(), ALGOTYPE_.c_str(), FIT_RMS.c_str(), INT_PERC);
  std::string suffix(suffix_char);
  if( LUMI>0 ) {
    char lumi_char[20];
    sprintf( lumi_char, "_%dPB", LUMI);
    std::string lumi_str(lumi_char);
    suffix += lumi_str;
  }
  if( NOQ ) suffix += "_05Q";
  OUTPUTDIR_ = "SecondJetPlots_" + suffix;

  std::string fileName = "SecondJet_"+dataset + "_" + ALGOTYPE_ + ".root";
  TFile* file = TFile::Open(fileName.c_str());

  TH2D* h2_ptPhotReco_vs_pt = (TH2D*)file->Get("ptPhotMean_vs_pt");


  Float_t ptPhotReco[NBINS_PT-1];
  Float_t ptPhotReco_err[NBINS_PT-1];

  Float_t extrapReso_RecoRel[NBINS_PT-1];
  Float_t extrapReso_err_RecoRel[NBINS_PT-1];
  Float_t trueReso_RecoRel[NBINS_PT-1];
  Float_t trueReso_err_RecoRel[NBINS_PT-1];
  Float_t intrReso_RecoRel[NBINS_PT-1];
  Float_t intrReso_err_RecoRel[NBINS_PT-1];
  Float_t extrapResp_RecoRel[NBINS_PT-1];
  Float_t extrapResp_err_RecoRel[NBINS_PT-1];
  Float_t trueResp_RecoRel[NBINS_PT-1];
  Float_t trueResp_err_RecoRel[NBINS_PT-1];
  Float_t intrResp_RecoRel[NBINS_PT-1];
  Float_t intrResp_err_RecoRel[NBINS_PT-1];
  Float_t imbalanceResp_RecoRel[NBINS_PT-1];
  Float_t imbalanceResp_err_RecoRel[NBINS_PT-1];
  Float_t pullResp_RecoRel[NBINS_PT-1];
  Float_t pullResp_err_RecoRel[NBINS_PT-1];
  Float_t pullReso_RecoRel[NBINS_PT-1];
  Float_t pullReso_err_RecoRel[NBINS_PT-1];
   
   

  for( int i=0; i<(NBINS_PT-1); ++i) {
    char projName[50];
    sprintf(projName, "projection_%d",i);
    TH1D* h1_proj = h2_ptPhotReco_vs_pt->ProjectionY(projName, i+1, i+1);
    ptPhotReco[i] = h1_proj->GetMean();
    ptPhotReco_err[i] = (h1_proj->GetEntries()>1.) ? h1_proj->GetRMS()/sqrt(h1_proj->GetEntries()) : h1_proj->GetRMS();
    drawSinglePtBin(file, i, "RecoRel", extrapReso_RecoRel[i], extrapReso_err_RecoRel[i], trueReso_RecoRel[i], trueReso_err_RecoRel[i], intrReso_RecoRel[i], intrReso_err_RecoRel[i], 
                                        extrapResp_RecoRel[i], extrapResp_err_RecoRel[i], trueResp_RecoRel[i], trueResp_err_RecoRel[i], intrResp_RecoRel[i], intrResp_err_RecoRel[i], imbalanceResp_RecoRel[i], imbalanceResp_err_RecoRel[i]);

    pullResp_RecoRel[i] = 100.*(extrapResp_RecoRel[i] - intrResp_RecoRel[i])/intrResp_RecoRel[i];
    pullResp_err_RecoRel[i] = 100.*sqrt( extrapResp_err_RecoRel[i]*extrapResp_err_RecoRel[i] + intrResp_RecoRel[i]*intrResp_RecoRel[i] );

    pullReso_RecoRel[i] = 100.*(extrapReso_RecoRel[i] - intrReso_RecoRel[i])/intrReso_RecoRel[i];
    pullReso_err_RecoRel[i] = 100.*sqrt( extrapReso_err_RecoRel[i]*extrapReso_err_RecoRel[i] + intrReso_RecoRel[i]*intrReso_RecoRel[i] );

    imbalanceResp_RecoRel[i] *= 100.; //in percent
    imbalanceResp_err_RecoRel[i] *= 100.;

  }

  TGraphErrors* gr_extrapRespRecoRel_vs_pt = new TGraphErrors(NBINS_PT-1, ptPhotReco, extrapResp_RecoRel, ptPhotReco_err, extrapResp_err_RecoRel); 
  gr_extrapRespRecoRel_vs_pt->SetName("gr_extrapRespRecoRel_vs_pt");
  gr_extrapRespRecoRel_vs_pt->SetMarkerStyle(25);
  gr_extrapRespRecoRel_vs_pt->SetMarkerColor(kBlack);
  gr_extrapRespRecoRel_vs_pt->SetMarkerSize(1.5);

  TGraphErrors* gr_intrRespRecoRel_vs_pt = new TGraphErrors(NBINS_PT-1, ptPhotReco, intrResp_RecoRel, ptPhotReco_err, intrResp_err_RecoRel); 
  gr_intrRespRecoRel_vs_pt->SetName("gr_intrRespRecoRel_vs_pt");
  gr_intrRespRecoRel_vs_pt->SetMarkerStyle(29);
  gr_intrRespRecoRel_vs_pt->SetMarkerColor(kBlue);
  gr_intrRespRecoRel_vs_pt->SetMarkerSize(1.5);

  TGraphErrors* gr_trueRespRecoRel_vs_pt = new TGraphErrors(NBINS_PT-1, ptPhotReco, trueResp_RecoRel, ptPhotReco_err, trueResp_err_RecoRel); 
  gr_trueRespRecoRel_vs_pt->SetName("gr_trueRespRecoRel_vs_pt");
  gr_trueRespRecoRel_vs_pt->SetMarkerStyle(23);
  gr_trueRespRecoRel_vs_pt->SetMarkerColor(kGray+2);
  gr_trueRespRecoRel_vs_pt->SetMarkerSize(1.5);

  TGraphErrors* gr_extrapResoRecoRel_vs_pt = new TGraphErrors(NBINS_PT-1, ptPhotReco, extrapReso_RecoRel, ptPhotReco_err, extrapReso_err_RecoRel); 
  gr_extrapResoRecoRel_vs_pt->SetName("gr_extrapResoRecoRel_vs_pt");
  gr_extrapResoRecoRel_vs_pt->SetMarkerStyle(25);
  gr_extrapResoRecoRel_vs_pt->SetMarkerColor(kBlack);
  gr_extrapResoRecoRel_vs_pt->SetMarkerSize(1.5);

  TGraphErrors* gr_intrResoRecoRel_vs_pt = new TGraphErrors(NBINS_PT-1, ptPhotReco, intrReso_RecoRel, ptPhotReco_err, intrReso_err_RecoRel); 
  gr_intrResoRecoRel_vs_pt->SetName("gr_intrResoRecoRel_vs_pt");
  gr_intrResoRecoRel_vs_pt->SetMarkerStyle(29);
  gr_intrResoRecoRel_vs_pt->SetMarkerColor(kBlue);
  gr_intrResoRecoRel_vs_pt->SetMarkerSize(1.5);

  TGraphErrors* gr_trueResoRecoRel_vs_pt = new TGraphErrors(NBINS_PT-1, ptPhotReco, trueReso_RecoRel, ptPhotReco_err, trueReso_err_RecoRel); 
  gr_trueResoRecoRel_vs_pt->SetName("gr_trueResoRecoRel_vs_pt");
  gr_trueResoRecoRel_vs_pt->SetMarkerStyle(23);
  gr_trueResoRecoRel_vs_pt->SetMarkerColor(kGray+2);
  gr_trueResoRecoRel_vs_pt->SetMarkerSize(1.5);

  TGraphErrors* gr_imbalanceRecoRel_vs_pt = new TGraphErrors(NBINS_PT-1, ptPhotReco, imbalanceResp_RecoRel, ptPhotReco_err, imbalanceResp_err_RecoRel); 
  gr_imbalanceRecoRel_vs_pt->SetName("gr_imbalanceRecoRel_vs_pt");
  gr_imbalanceRecoRel_vs_pt->SetMarkerStyle(20);
  gr_imbalanceRecoRel_vs_pt->SetMarkerColor(kBlack);
  gr_imbalanceRecoRel_vs_pt->SetMarkerSize(1.5);

  drawPullHistogram("pullResp", pullResp_RecoRel, pullResp_err_RecoRel);
  drawPullHistogram("pullReso", pullReso_RecoRel, pullReso_err_RecoRel);

  std::string graphFileName= "SecondJet_GraphFile_" + suffix + ".root";
  TFile* graphFile = TFile::Open(graphFileName.c_str(), "RECREATE");
  graphFile->cd();
  gr_extrapRespRecoRel_vs_pt->Write();
  gr_trueRespRecoRel_vs_pt->Write();
  gr_intrRespRecoRel_vs_pt->Write();
  gr_extrapResoRecoRel_vs_pt->Write();
  gr_trueResoRecoRel_vs_pt->Write();
  gr_intrResoRecoRel_vs_pt->Write();
  graphFile->Close();

  std::string graphName;
  std::string canvasName;

  //response:
  graphName = "gr_response_vs_pt_MEAN_barrel_" + ALGOTYPE_;
  TGraphErrors* gr_respReco_cutOn2ndJet = (TGraphErrors*)file->Get(graphName.c_str());
  gr_respReco_cutOn2ndJet->SetMarkerStyle(20);
  gr_respReco_cutOn2ndJet->SetMarkerColor(kRed);
  gr_respReco_cutOn2ndJet->SetMarkerSize(1.5);

  canvasName = OUTPUTDIR_ + "/response_vs_pt_noextrap."+PICTURE_FORMAT;
  drawGraphs_vs_pt( "Response", canvasName, gr_respReco_cutOn2ndJet, gr_intrRespRecoRel_vs_pt );
  
  canvasName = OUTPUTDIR_ + "/response_vs_pt_RECO."+PICTURE_FORMAT;
  drawGraphs_vs_pt( "Response", canvasName, gr_respReco_cutOn2ndJet, gr_intrRespRecoRel_vs_pt, gr_extrapRespRecoRel_vs_pt);


  // resolution:
  std::string resoType = (FIT_RMS=="RMS") ? "RMS" : "FIT";
  graphName = "gr_responseRes_vs_pt_"+resoType+"_barrel_" + ALGOTYPE_;
  TGraphErrors* gr_resoReco_cutOn2ndJet = (TGraphErrors*)file->Get(graphName.c_str());
  gr_resoReco_cutOn2ndJet->SetMarkerStyle(20);
  gr_resoReco_cutOn2ndJet->SetMarkerColor(kRed);
  gr_resoReco_cutOn2ndJet->SetMarkerSize(1.5);

  canvasName = OUTPUTDIR_ + "/resolution_vs_pt_noextrap."+PICTURE_FORMAT;
  drawGraphs_vs_pt( "Resolution", canvasName, gr_resoReco_cutOn2ndJet, gr_intrResoRecoRel_vs_pt );
  
  canvasName = OUTPUTDIR_ + "/resolution_vs_pt_RECO."+PICTURE_FORMAT;
  drawGraphs_vs_pt( "Resolution", canvasName, gr_resoReco_cutOn2ndJet, gr_intrResoRecoRel_vs_pt, gr_extrapResoRecoRel_vs_pt);


  TH2D* h2_axes = new TH2D("axes", "", 10, 20., 2200., 10, -10., 5.);
  h2_axes->GetXaxis()->SetTitleOffset(1.1);
  h2_axes->GetYaxis()->SetTitleOffset(1.2);
  h2_axes->SetYTitle("Residual Imbalance [%]");
  h2_axes->SetXTitle("p_{T}^{#gamma} [GeV/c]");
  h2_axes->GetXaxis()->SetMoreLogLabels();
  h2_axes->GetXaxis()->SetNoExponent();

  canvasName = OUTPUTDIR_ + "/imbalance." + PICTURE_FORMAT;
  TCanvas* c1 = new TCanvas("c1", "c1", 800, 600);
  c1->cd();
  c1->SetLogx();
  c1->SetGridx();
  c1->SetGridy();
  h2_axes->Draw();
  gr_imbalanceRecoRel_vs_pt->Draw("Psame");
  c1->SaveAs(canvasName.c_str());
  


  delete h2_axes;
  delete gr_extrapRespRecoRel_vs_pt;
  delete gr_extrapResoRecoRel_vs_pt;

}
Example #18
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 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 #20
0
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.04, "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.04);
            
    // =====================
    //  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);
}
Example #21
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(0);

    // 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.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.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(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);

    // Legend options
    //tdrStyle->SetLegendBorderMode(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->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);
    tdrStyle->SetNumberContours(NCont);

    tdrStyle->cd();

}
Example #22
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

}