Angular analysis of B+->K*+(K+pi0)mumu
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

239 lines
9.5 KiB

#ifndef DESIGN_HPP
#define DESIGN_HPP
//===========================================================================
//
// Functions for creating pretty figures
//
// 2016: Renata Kopecna
//===========================================================================
//--- c++ libs ---//
#include <string.h>
#include <iostream>
#include <sstream>
//--- ROOT libs ---//
#include <TROOT.h>
#include <TSystem.h>
#include <TH1F.h>
#include <TH1D.h>
#include <TColor.h>
#include <TAxis.h>
#include <TCanvas.h>
#include <TH2F.h>
#include <TF1.h>
#include <TStyle.h>
#include <TPaveText.h>
#include <TLine.h>
#include <TEfficiency.h>
#include <TLegend.h>
#include <TGraphErrors.h>
#include "Paths.hpp"
using namespace std;
///////////////////////////////////////////////////////////////////////////////////
///
///
/// ##### Basic rules for plotting various histograms
///
/// ### design_markers
/// # Designs histogram's markers, sets titles and color
///
/// ### design_lines
/// # Designs histogram's lines, sets titles and color
///
/// ### design_filled_plot
/// # Designs filled histograms, including titles, color and fill style
/// # two options: with or without lines
///
/// ### design_canvas, design canvas TH2F, design_canvas_ridge_fancy
/// # initializes canvases basic, TH2F and fancy canvases
///
/// ### design_2D_legend, design_2D_legend_integrated
/// # designes box with legend with given pT and multiplicity
///
/// ### design_TH2F
/// # Sets axis names and palette for 2D histograms
///
/// ### design_TH2F_ratio
/// # Sets axis names and palette for 2D histograms for ratios
///
/// ### design_function
/// # Sets width and color of a TF1
///
/// ### design_cut_line
/// # Designes the line used for cuts in distribution plots
///
/// ### design_ratio_line
/// # Designes the line for True/MC ratios
///
///
////////////////////////////////////////////////////////////////////////////////////
///
const string recoMassKplus = (UseDTF ? "m(K^{+}#pi^{0}#mu^{+}#mu^{-})" : "m(K^{+}#gamma#gamma#mu^{+}#mu^{-})");
void design_markers(TH1F *histogram, string xaxis_name, string yaxis_name, Color_t color);
void design_markers(TH1D *histogram, string xaxis_name, string yaxis_name, Color_t color);
void design_markers(TEfficiency *histogram, string xaxis_name, string yaxis_name, Color_t color);
void design_lines(TH1F *histogram, string xaxis_name, string yaxis_name, Color_t color);
void design_lines(TH1D *histogram, string xaxis_name, string yaxis_name, Color_t color);
void design_lines(TH1 *histogram, string xaxis_name, string yaxis_name, Color_t color);
void design_filled_plot(TH1F *histogram, string xaxis_name, string yaxis_name, Color_t fill_color, int fill_style);
void design_filled_plot(TH1D *histogram, string xaxis_name, string yaxis_name, Color_t fill_color, int fill_style);
void design_filled_plot(TH1F *histogram, string xaxis_name, string yaxis_name, Color_t fill_color, int fill_style, Color_t line_color);
void design_filled_plot(TH1D *histogram, string xaxis_name, string yaxis_name, Color_t fill_color, int fill_style , Color_t line_color);
void design_canvas(TCanvas *canvas);
void design_canvas(TCanvas *canvas, string title);
void design_canvas_Bmass(TCanvas *canvas);
void design_canvas_Bmass(TCanvas *canvas, string title);
TCanvas *c_TH2F(string c_name);
void design_canvas_TH2F(TCanvas *canvas);
void design_canvas_fancy(TCanvas *canvas);
TCanvas *c_canvas(string name);
void design_TH2F(TH2F *histogram, string xaxis_name, string yaxis_name, string zaxis_name);
void design_TH2F(TH2D *histogram, string xaxis_name, string yaxis_name, string zaxis_name);
void design_TH2F(TH2F *histogram, string xaxis_name, string yaxis_name, string zaxis_name, int palette);
void design_TH2F(TH2D *histogram, string xaxis_name, string yaxis_name, string zaxis_name, int palette);
void design_TH2F_ratio(TH2F *histogram, string xaxis_name, string yaxis_name, string zaxis_name, int palette);
void design_TH2F_ratio(TH2D *histogram, string xaxis_name, string yaxis_name, string zaxis_name, int palette);
TH1D *generalHistogram(string hist_name, string title, int nBins, double low_edge, double high_edge, string xaxis_name, string yaxis_name, Color_t color);
void design_function(TF1 *graph, Color_t color);
void design_function(TF1 *graph, Color_t color, int style);
void design_TH1F(TH1F *histogram, string xaxis_name, string yaxis_name, Color_t color);
void design_TH1D(TH1D *histogram, string xaxis_name, string yaxis_name, Color_t color);
void design_TH1F(TH1F *histogram, string xaxis_name, string yaxis_name, Color_t color, int marker_style);
void design_TH1D(TH1D *histogram, string xaxis_name, string yaxis_name, Color_t color, int marker_style);
void design_TH1F(TH1F *histogram, string xaxis_name, string yaxis_name, Color_t color, int marker_style, double x_low, double x_up, double y_low, double y_up);
void design_TH1D(TH1D *histogram, string xaxis_name, string yaxis_name, Color_t color, int marker_style, double x_low, double x_up, double y_low, double y_up);
TLine *design_cut_line(float x1, float y1, float x2, float y2, Color_t color);
TLine *design_veto_line(float x1, float y1, float x2, float y2, Color_t color);
TLine *design_ratio_line(float x1, float x2, Color_t color);
void designTGraph(TGraphErrors *graph, string title, string xAxisName, string yAxisName, Color_t color, Int_t markerStyle);
////////////////////////////////////
///
///
/// TMVA plots
///
///
////////////////////////////////////
bool DesignCorrelationPlots(TH2F *h_corr);
TCanvas *c_forCOLZ(string name);
TCanvas *c_Correlation(string type);
bool designVariablesSignalVsBackground(TH1F *h_variableS, TH1F *h_variableB);
bool designResponseSignalVsBackground(TH1F *h_responseS, TH1F *h_responseB, string method);
bool designOvertraining(TH1F *h_responseS, TH1F *h_responseB);
TCanvas *c_VariablesSignalVsBackground(string variable);
TCanvas *c_Efficiency(string c_name);
bool designEfficiency(TH1F *h_efficiencySignal,TH1F *h_efficiencyBackground,TH1F *h_purity,TH1F *h_significance, string method);
TPaveText *significanceText(double xmin, int nSig, int nBkg, double maxSignificance, double maxSignificanceMLPcut);
TCanvas *c_ROCplot(string c_name);
void designROC(TH1F* h_ROC, int index);
////////////////////////////////////
///
///
/// Efficiencies
///
///
////////////////////////////////////
TPaveText *text_effFromPi0(double yieldSig, double yieldBkg, double ymax);
TCanvas *c_L0MuonEff(string c_name);
void designL0MuonEffHistos(TH1D *L0MuonEffData,TH1D *L0MuonEffMC, TH1D *L0MuonEffRatio);
TCanvas * designL0MuonEfficiencies(string year, string magnet,TH1D *L0MuonEffData,TH1D *L0MuonEffMC, TH1D *L0MuonEffRatio, string extraString);
void designBasicEfficiency(TGraphErrors *graph, string title, string xAxisName, string effName, double lowRange, double highRange);
void designBasicEfficiency(TGraphErrors *graph, string title, string xAxisName, string effName, double lowRange, double highRange, Color_t color);
void designMultiGraphEfficiency(TMultiGraph *graph, string title, string xAxisName, string effName, double lowRange, double highRange);
////////////////////////////////////
///
///
/// Other plots
///
///
////////////////////////////////////
TH1D *BmassHistogram(string hist_name, string title, string xaxis_name,Color_t color);
void TM_canvas(string name, TH1D *all, TH1D *TMed, TH1D *notTMed, string year, bool ReferenceChannel, bool PHSP, bool B0, bool K1, bool Inc);
void designMultiGraph(TMultiGraph *multGraph, string name, string xaxis_name, string yaxis_name, double lowx, double highx, double lowy, double highy);
void designMultiGraph(TMultiGraph *multGraph, string name, string xaxis_name, string yaxis_name);
void addYearTag(Float_t x, Float_t y, string year, int Run, Int_t color, Float_t Scaling);
void addAnyTag(Float_t x, Float_t y, string text, Int_t color, Float_t Scaling);
////////////////////////////////////
///
///
/// Truth-matching stuff
///
///
////////////////////////////////////
TCanvas *c_for_TH2D(string name);
TH1D *hist_cosThetaK(string hist_name, string title, Color_t color, bool cos);
TH1D *hist_cosAngle(string angle, string hist_name, string title, Color_t color, bool cos, bool norm);
////////////////////////////////////
///
///
/// Mass fit stuff
///
///
////////////////////////////////////
void designMassFitFrame(RooPlot* frame, float pullHeight);
void designPullFrame(RooPlot *pullFrame, RooPlot *frame_m, float pullHeight);
TLine *threeSigmaLine (bool plus);
////////////////////////////////////
///
///
/// reweighting control plots
///
///
////////////////////////////////////
void drawKolmogorovTest(TH1D *hist_nTracks, TH1D * hist_nTracks_MC, string canvasPath, string TMtype);
void drawWeightRatio(TH1D *hist_w, string canvasPath, bool is2D, string TMtype);
void drawWeightCorrelation(TH2D *hCorrelationCheck, double CorrelationCoefficent, string canvasPath);
////////////////////////////////////
///
///
/// BDT scan
///
///
////////////////////////////////////
void designYieldGraph(TGraphErrors *graph, int Run, string year, string tag, string basicPath, TFile *TGraphOutput, bool fineScan);
////////////////////////////////////
///
///
/// Yiled plots
///
///
////////////////////////////////////
void design_YieldInQ2(int Run, TGraphErrors *graphSig, TGraphErrors *graphBkg, TGraphErrors *graphSignificance, TGraphErrors *CMS, bool fixRange);
void design_SignificanceInQ2(int Run, TGraphErrors *graphSignificance, TGraphErrors *CMS, bool fixRange);
#endif // DESIGN_HPP