HighLAND
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
DrawingTools Class Reference

#include <DrawingTools.hxx>

Inheritance diagram for DrawingTools:
DrawingToolsBase DrawingToolsNueCC

Public Member Functions

 DrawingTools (const std::string &file="", Int_t T2KstyleIndex=0)
 
 DrawingTools (Experiment &exp, Int_t T2KstyleIndex=0)
 
void DrawToys (DataSample &data, const std::string &cut="", const std::string &root_opt="", const std::string &opt="", const std::string &leg_name="")
 
void DrawToysRatio (DataSample &sample1, DataSample &sample2, const std::string &cut="", const std::string &root_opt="", const std::string &opt="", const std::string &leg_name="", double norm=-1, bool pot_norm=true)
 
void DrawToysRatioTwoCuts (DataSample &sample1, DataSample &sample2, const std::string &cut1, const std::string &cut2, const std::string &root_opt="", const std::string &opt="", const std::string &leg_name="", double norm=-1, bool pot_norm=true)
 
TH1_h * GetHisto (DataSample &data, const std::string &name, const std::string &var, int nx, double *xbins, const std::string &cut, const std::string &root_opt, const std::string &opt, double scale, bool scale_errors=true)
 
TH1_h * GetHisto (HistoStack *hs, TTree *tree, const std::string &name, const std::string &var, int nx, double *xbins, const std::string &cut, const std::string &root_opt, const std::string &opt, double scale, bool scale_errors=true, int refana=-1)
 
TH1_h * GetRatioHisto (TTree *tree1, TTree *tree2, const std::string &name, const std::string &var, int nx, double *xbins, const std::string &cut1, const std::string &cut2, const std::string &root_opt, const std::string &opt, double norm, double scale, bool scale_errors=true, int refana=-1)
 
void FillHistoErrors (HistoStack *hs1, HistoStack *hs2, TH1_h *histo, const std::string uopt)
 
void FillHistoErrors (HistoStack *hs1, HistoStack *hs2, TTree *tree1, TTree *tree2, const std::string &name, const std::string &var, int nx, double *xbins, const std::string &cut1, const std::string &cut2, const std::string &opt, double norm, TH1_h *hstat, TH1_h *&hsyst)
 
void UpdateSystInfo (HistoStack *hs1, HistoStack *hs2, TTree *tree1, TTree *tree2, const std::string &var, int nx, double *xbins, const std::string &cut1, const std::string &cut2, const std::string &opt, double norm)
 fill/update systematics information (fill appopriate histograms) for the stacks
 
void FillGraphErrors (HistoStack *hs1, HistoStack *hs2, TGraphAsymmErrors *graph, const std::string uopt)
 
TH1_h * GetHistoWithSystErrors (HistoStack *hs1, HistoStack *hs2, TTree *tree1, TTree *tree2, const std::string &name, const std::string &var, int nx, double *xbins, const std::string &cut1, const std::string &cut2, const std::string &opt, double norm)
 
void PrintEventNumbers (DataSample &data, const std::string &cut, const std::string &file="", int refana=-1)
 
void Project (HistoStack *hs, const std::string &sample_name, DataSample &sample, const std::string &var, int nx, double *xbins, int ny, double *ybins, const std::string &categ, const std::string &cut, const std::string &root_opt, const std::string &opt, double norm, bool scale_errors)
 
void Project (HistoStack *hs1, HistoStack *hs2, DataSample *sample1, DataSample *sample2, const std::string &var, int nx, double *xbins, int ny, double *ybins, const std::string &categ, const std::string &cut, const std::string &root_opt, const std::string &opt, bool scale_errors, double norm=-1, bool pot_norm=true)
 
void Project (HistoStack *hs1, HistoStack *hs2, SampleGroup &sampleGroup, const std::string &mcSampleName, const std::string &var, int nx, double *xbins, int ny, double *ybins, const std::string &categ, const std::string &cut, const std::string &root_opt, const std::string &opt, double norm, bool scale_errors)
 
void Project (HistoStack *hs1, HistoStack *hs2, Experiment &exp, const std::string &groupName, const std::string &mcSampleName, const std::string &var, int nx, double *xbins, int ny, double *ybins, const std::string &categ, const std::string &cut, const std::string &root_opt, const std::string &opt, double norm, bool scale_errors)
 
std::string GetCombinedCut (DataSample &sample, const std::string &cut)
 
void PrintPurities (DataSample &data, const std::string &categ, const std::string &cut, double events_ratio=1)
 
void PrintPurities (Experiment &exp, const std::string &categ, const std::string &cut, const std::string &opt="")
 
void Draw (DataSample &data, const std::string &name, int nbins, double *xbins, const std::string &categ="all", const std::string &cut="", const std::string &root_opt="", const std::string &opt="", double norm=-1, bool scale_errors=true)
 
void Draw (DataSample &data, const std::string &name, int nbins, double xmin, double xmax, const std::string &categ="all", const std::string &cut="", const std::string &root_opt="", const std::string &opt="", double norm=-1, bool scale_errors=true)
 
void Draw (DataSample &data, const std::string &name, int nx, double *xbins, int ny, double *ybins, const std::string &categ="all", const std::string &cut="", const std::string &root_opt="", const std::string &opt="", double norm=-1)
 
void Draw (DataSample &data, const std::string &name, int nx, double xmin, double xmax, int ny, double ymin, double ymax, const std::string &categ="all", const std::string &cut="", const std::string &root_opt="", const std::string &opt="", double norm=-1)
 
void DrawRatio (DataSample &data, const std::string &name, int nbins, double *xbins, const std::string &cut1, const std::string &cut2, const std::string &root_opt="", const std::string &opt="", const std::string &leg_name="")
 
void DrawRatio (DataSample &data, const std::string &name, int nx, double xmin, double xmax, const std::string &cut1, const std::string &cut2, const std::string &root_opt="", const std::string &opt="", const std::string &leg_name="")
 
void DrawEff (DataSample &data, const std::string &name, int nbins, double *xbins, const std::string &cut1, const std::string &cut2, const std::string &root_opt="", const std::string &opt="", const std::string &leg_name="")
 
void DrawEff (DataSample &data, const std::string &name, int nx, double xmin, double xmax, const std::string &cut1, const std::string &cut2, const std::string &root_opt="", const std::string &opt="", const std::string &leg_name="")
 
void DrawDoubleEff (DataSample &sample1, DataSample &sample2, const std::string &var, int nx, double *xbins, const std::string &cut1, const std::string &cut2, const std::string &root_opt="", const std::string &opt="", const std::string &leg="")
 
void DrawDoubleEff (DataSample &sample1, DataSample &sample2, const std::string &var, int nx, double xmin, double xmax, const std::string &cut1, const std::string &cut2, const std::string &root_opt="", const std::string &opt="", const std::string &leg="")
 
void DrawSignificance (DataSample &data, const std::string &name, int nbins, double *xbins, const std::string &cut1, const std::string &cut2, double norm=1, double rel_syst=0, const std::string &root_opt="", const std::string &opt="", const std::string &leg_name="")
 
void DrawSignificance (DataSample &data, const std::string &name, int nbins, double xmin, double xmax, const std::string &cut1, const std::string &cut2, double norm=1, double rel_syst=0, const std::string &root_opt="", const std::string &opt="", const std::string &leg_name="")
 
void Draw (DataSample &sample1, DataSample &sample2, const std::string &var, int nx, double xmin, double xmax, const std::string &categ="all", const std::string &cut="", const std::string &root_opt="", const std::string &opt="", double norm=-1, bool scale_errors=true, bool pot_norm=true)
 
void Draw (DataSample &sample1, DataSample &sample2, const std::string &var, int nbins, double *xbins, const std::string &categ="all", const std::string &cut="", const std::string &root_opt="", const std::string &opt="", double norm=-1, bool scale_errors=true, bool pot_norm=true)
 
void Draw (DataSample &sample1, DataSample &sample2, const std::string &var, int nx, double xmin, double xmax, int ny, double ymin, double ymax, const std::string &categ="all", const std::string &cut="", const std::string &root_opt="", const std::string &opt="", double norm=-1, bool scale_errors=true, bool pot_norm=true)
 
void Draw (DataSample &sample1, DataSample &sample2, const std::string &var, int nx, double *xbins, int ny, double *ybins, const std::string &categ="all", const std::string &cut="", const std::string &root_opt="", const std::string &opt="", double norm=-1, bool scale_errors=true, bool pot_norm=true)
 
void DrawRatio (DataSample &sample1, DataSample &sample2, const std::string &var, int nx, double xmin, double xmax, const std::string &cut1, const std::string &cut2, double norm=-1, const std::string &root_opt="", const std::string &opt="", const std::string &leg_name="", bool pot_norm=true)
 
void DrawRatio (DataSample &sample1, DataSample &sample2, const std::string &var, int nx, double *xbins, const std::string &cut1, const std::string &cut2, double norm=-1, const std::string &root_opt="", const std::string &opt="", const std::string &leg_name="", bool pot_norm=true)
 
void DrawRatio (DataSample &sample1, DataSample &sample2, const std::string &var, int nx, double xmin, double xmax, const std::string &cut="", double norm=-1, const std::string &root_opt="", const std::string &opt="", const std::string &leg_name="", bool pot_norm=true)
 
void DrawRatio (DataSample &sample1, DataSample &sample2, const std::string &var, int nx, double *xbins, const std::string &cut="", double norm=-1, const std::string &root_opt="", const std::string &opt="", const std::string &leg_name="", bool pot_norm=true)
 
void DrawEventsVSCut (DataSample &sample, const std::string &cut_norm="", int first_cut=-1, int last_cut=-1, const std::string &root_opt="", const std::string &opt="", const std::string &leg="")
 
void DrawEventsVSCut (DataSample &sample, int branch, const std::string &cut_norm="", int first_cut=-1, int last_cut=-1, const std::string &root_opt="", const std::string &opt="", const std::string &leg="")
 
void DrawEventsVSCut (DataSample &sample, int isel, int branch, const std::string &cut_norm="", int first_cut=-1, int last_cut=-1, const std::string &root_opt="", const std::string &opt="", const std::string &leg="")
 
void DrawEffVSCut (DataSample &sample, const std::string &signal="", const std::string &precut="", int first_cut=-1, int last_cut=-1, const std::string &root_opt="", const std::string &opt="", const std::string &leg="")
 
void DrawEffVSCut (DataSample &sample, int branch, const std::string &signal="", const std::string &precut="", int first_cut=-1, int last_cut=-1, const std::string &root_opt="", const std::string &opt="", const std::string &leg="")
 
void DrawEffVSCut (DataSample &sample, int isel, int branch, const std::string &signal="", const std::string &precut="", int first_cut=-1, int last_cut=-1, const std::string &root_opt="", const std::string &opt="", const std::string &leg="")
 
void DrawPurVSCut (DataSample &sample, const std::string &signal="", const std::string &precut="", int first_cut=-1, int last_cut=-1, const std::string &root_opt="", const std::string &opt="", const std::string &leg="")
 
void DrawPurVSCut (DataSample &sample, int branch, const std::string &signal="", const std::string &precut="", int first_cut=-1, int last_cut=-1, const std::string &root_opt="", const std::string &opt="", const std::string &leg="")
 
void DrawPurVSCut (DataSample &sample, int isel, int branch, const std::string &signal="", const std::string &precut="", int first_cut=-1, int last_cut=-1, const std::string &root_opt="", const std::string &opt="", const std::string &leg="")
 
void DrawRatioVSCut (DataSample &sample1, DataSample &sample2, const std::string &precut="", int first_cut=-1, int last_cut=-1, const std::string &root_opt="", const std::string &opt="", const std::string &leg="", double norm=-1., bool pot_norm=true)
 
void DrawRatioVSCut (DataSample &sample1, DataSample &sample2, int branch, const std::string &precut="", int first_cut=-1, int last_cut=-1, const std::string &root_opt="", const std::string &opt="", const std::string &leg="", double norm=-1., bool pot_norm=true)
 
void DrawRatioVSCut (DataSample &sample1, DataSample &sample2, int isel, int branch, const std::string &precut="", int first_cut=-1, int last_cut=-1, const std::string &root_opt="", const std::string &opt="", const std::string &leg="", double norm=-1., bool pot_norm=true)
 
void DrawEffPurVSCut (DataSample &sample, const std::string &signal, const std::string &precut="", int first_cut=-1, int last_cut=-1, const std::string &root_opt="", const std::string &opt="", const std::string &leg="")
 
void DrawEffPurVSCut (DataSample &sample, int branch, const std::string &signal, const std::string &precut="", int first_cut=-1, int last_cut=-1, const std::string &root_opt="", const std::string &opt="", const std::string &leg="")
 
void DrawEffPurVSCut (DataSample &sample, int isel, int branch, const std::string &signal, const std::string &precut="", int first_cut=-1, int last_cut=-1, const std::string &root_opt="", const std::string &opt="", const std::string &leg="")
 
void DrawEffPurVSCut (DataSample &sample, int isel, int branch, const std::string &signal, const std::string &precut, int first_cut_pur, int last_cut_pur, int first_cut_eff, int last_cut_eff, const std::string &root_opt="", const std::string &opt="", const std::string &leg="")
 
void DumpPOT (DataSample &data)
 [DrawingToolsVsCutsMethods] More...
 
void DumpPOT (Experiment &exp, const std::string &samplegroup_name)
 Dump the POT information for this sample, provided an Experiment and a sample group name (run1, run2a, run2w, ...)
 
double GetGoodPOT (DataSample &data)
 return the Good POT used to create this DataSample object.
 
int GetGoodSpills (DataSample &data)
 return the number of Good spills used to create this DataSample object.
 
double GetPOTRatio (DataSample &sample1, DataSample &sample2, double POTsample1_byhand=-1)
 
double GetPOTRatio (Experiment &exp)
 
double GetNormalisationFactor (DataSample *sample1, DataSample *sample2, double norm=-1., bool pot_norm=true, const std::string &opt="")
 
void DrawToys (Experiment &exp, const std::string &cut="", const std::string &root_opt="", const std::string &opt="", const std::string &leg="")
 [DrawingTools_POT] More...
 
void Draw (Experiment &exp, const std::string &var, int nx, double xmin, double xmax, const std::string &categ="all", const std::string &cut="", const std::string &root_opt="", const std::string &opt="", double norm=-1., bool scale_errors=true)
 Data-MC comparison plots using a vector of pairs of data and MC samples (Experiment), properly normalised to each other.
 
void Draw (Experiment &exp, const std::string &var, int nbins, double *xbins, const std::string &categ="all", const std::string &cut="", const std::string &root_opt="", const std::string &opt="", double norm=-1., bool scale_errors=true)
 
void Draw (Experiment &exp, const std::string &var, int nx, double xmin, double xmax, int ny, double ymin, double ymax, const std::string &categ="all", const std::string &cut="", const std::string &root_opt="", const std::string &opt="", double norm=-1., bool scale_errors=true)
 
void Draw (Experiment &exp, const std::string &var, int nx, double *xbins, int ny, double *ybins, const std::string &categ="all", const std::string &cut="", const std::string &root_opt="", const std::string &opt="", double norm=-1., bool scale_errors=true)
 
void Draw (Experiment &exp, const std::string &groupName, const std::string &var, int nx, double xmin, double xmax, const std::string &categ="all", const std::string &cut="", const std::string &root_opt="", const std::string &opt="", double norm=-1., bool scale_errors=true)
 Data-MC comparison plots using a single pair of data and MC samples properly normalised to each other.
 
void Draw (Experiment &exp, const std::string &groupName, const std::string &var, int nbins, double *xbins, const std::string &categ="all", const std::string &cut="", const std::string &root_opt="", const std::string &opt="", double norm=-1., bool scale_errors=true)
 
void Draw (Experiment &exp, const std::string &groupName, const std::string &var, int nx, double xmin, double xmax, int ny, double ymin, double ymax, const std::string &categ="all", const std::string &cut="", const std::string &root_opt="", const std::string &opt="", double norm=-1., bool scale_errors=true)
 
void Draw (Experiment &exp, const std::string &groupName, const std::string &var, int nx, double *xbins, int ny, double *ybins, const std::string &categ="all", const std::string &cut="", const std::string &root_opt="", const std::string &opt="", double norm=-1., bool scale_errors=true)
 
void Draw (Experiment &exp, const std::string &groupName, const std::string &mcSampleName, const std::string &var, int nx, double xmin, double xmax, const std::string &categ="all", const std::string &cut="", const std::string &root_opt="", const std::string &opt="", double norm=-1., bool scale_errors=true)
 Data-MC comparison plots using a single pair of data and MC samples properly normalised to each other.
 
void Draw (Experiment &exp, const std::string &groupName, const std::string &mcSampleName, const std::string &var, int nbins, double *xbins, const std::string &categ="all", const std::string &cut="", const std::string &root_opt="", const std::string &opt="", double norm=-1., bool scale_errors=true)
 
void Draw (Experiment &exp, const std::string &groupName, const std::string &mcSampleName, const std::string &var, int nx, double xmin, double xmax, int ny, double ymin, double ymax, const std::string &categ="all", const std::string &cut="", const std::string &root_opt="", const std::string &opt="", double norm=-1., bool scale_errors=true)
 
void Draw (Experiment &exp, const std::string &groupName, const std::string &mcSampleName, const std::string &var, int nx, double *xbins, int ny, double *ybins, const std::string &categ="all", const std::string &cut="", const std::string &root_opt="", const std::string &opt="", double norm=-1., bool scale_errors=true)
 
void CompareSampleGroups (Experiment &exp, const std::string &mcSampleName, const std::string &var, int nx, double xmin, double xmax, const std::string &cut="", const std::string &root_opt="", const std::string &opt="", bool scale_errors=true, const std::string &normtype="POT")
 
void CompareSampleGroups (Experiment &exp, const std::string &mcSampleName, const std::string &var, int nx, double *xbins, const std::string &cut="", const std::string &root_opt="", const std::string &opt="", bool scale_errors=true, const std::string &normtype="POT")
 
void GetEventsVSCut (Experiment &exp, const std::string &name, const std::string &cut_norm, int isel, int ibranch, int &first_cut, int &last_cut, const std::string &root_opt, const std::string &opt, TH1_h *&data, TH1_h *&mc)
 data and mc will be FILLED here
 
void DrawEventsVSCut (Experiment &exp, const std::string &cut_norm="", int first_cut=-1, int last_cut=-1, const std::string &root_opt="", const std::string &opt="", const std::string &leg="")
 
void DrawEventsVSCut (Experiment &exp, int branch, const std::string &cut_norm="", int first_cut=-1, int last_cut=-1, const std::string &root_opt="", const std::string &opt="", const std::string &leg="")
 
void DrawEventsVSCut (Experiment &exp, int isel, int branch, const std::string &cut_norm="", int first_cut=-1, int last_cut=-1, const std::string &root_opt="", const std::string &opt="", const std::string &leg="")
 
void DrawPurVSCut (Experiment &exp, const std::string &signal="", const std::string &precut="", int first_cut=-1, int last_cut=-1, const std::string &root_opt="", const std::string &opt="", const std::string &leg="")
 
void DrawPurVSCut (Experiment &exp, int branch, const std::string &signal="", const std::string &precut="", int first_cut=-1, int last_cut=-1, const std::string &root_opt="", const std::string &opt="", const std::string &leg="")
 
void DrawPurVSCut (Experiment &exp, int isel, int branch, const std::string &signal="", const std::string &precut="", int first_cut=-1, int last_cut=-1, const std::string &root_opt="", const std::string &opt="", const std::string &leg="")
 
void DrawEffVSCut (Experiment &exp, const std::string &signal="", const std::string &precut="", int first_cut=-1, int last_cut=-1, const std::string &root_opt="", const std::string &opt="", const std::string &leg="")
 
void DrawEffVSCut (Experiment &exp, int branch, const std::string &signal="", const std::string &precut="", int first_cut=-1, int last_cut=-1, const std::string &root_opt="", const std::string &opt="", const std::string &leg="")
 
void DrawEffVSCut (Experiment &exp, int isel, int branch, const std::string &signal="", const std::string &precut="", int first_cut=-1, int last_cut=-1, const std::string &root_opt="", const std::string &opt="", const std::string &leg="")
 
void DrawEffPurVSCut (Experiment &exp, const std::string &signal, const std::string &precut, int first_cut, int last_cut, const std::string &root_opt, const std::string &opt="", const std::string &leg="")
 
void DrawEffPurVSCut (Experiment &exp, int branch, const std::string &signal, const std::string &precut, int first_cut, int last_cut, const std::string &root_opt, const std::string &opt="", const std::string &leg="")
 
void DrawEffPurVSCut (Experiment &exp, int isel, int branch, const std::string &signal, const std::string &precut, int first_cut, int last_cut, const std::string &root_opt, const std::string &opt="", const std::string &leg="")
 
void DrawEffPurVSCut (Experiment &exp, int isel, int branch, const std::string &signal="", const std::string &precut="", int first_cut_pur=-1, int last_cut_pur=-1, int first_cut_eff=-1, int last_cut_eff=-1, const std::string &root_opt="", const std::string &opt="", const std::string &leg="")
 
void DrawRatioVSCut (Experiment &exp, const std::string &precut="", int first_cut=-1, int last_cut=-1, const std::string &root_opt="", const std::string &opt="", const std::string &leg="")
 
void DrawRatioVSCut (Experiment &exp, int branch, const std::string &precut="", int first_cut=-1, int last_cut=-1, const std::string &root_opt="", const std::string &opt="", const std::string &leg="")
 
void DrawRatioVSCut (Experiment &exp, int isel, int branch, const std::string &precut="", int first_cut=-1, int last_cut=-1, const std::string &root_opt="", const std::string &opt="", const std::string &leg="")
 
void DrawEff (Experiment &exp, bool usedata, const std::string &var, int nx, double xmin, double xmax, const std::string &cut1, const std::string &cut2, const std::string &root_opt="", const std::string &opt="", const std::string &leg_name="")
 
void DrawEff (Experiment &exp, bool usedata, const std::string &var, int nx, double *xbins, const std::string &cut1, const std::string &cut2, const std::string &root_opt="", const std::string &opt="", const std::string &leg_name="")
 
void DrawEffNew (Experiment &exp, bool usedata, const std::string &var, int nx, double xmin, double xmax, const std::string &cut1, const std::string &cut2, const std::string &root_opt="", const std::string &opt1="", const std::string &opt2="", const std::string &leg_name="")
 
void DrawEffNew (Experiment &exp, bool usedata, const std::string &var, int nx, double *xbins, const std::string &cut1, const std::string &cut2, const std::string &root_opt="", const std::string &opt1="", const std::string &opt2="", const std::string &leg_name="")
 
void DrawRatioNew (Experiment &exp, bool usedata, const std::string &var, int nx, double xmin, double xmax, const std::string &cut1, const std::string &cut2, const std::string &root_opt="", const std::string &opt1="", const std::string &opt2="")
 
void DrawRatioNew (Experiment &exp, bool usedata, const std::string &var, int nx, double *xbins, const std::string &cut1, const std::string &cut2, const std::string &root_opt="", const std::string &opt1="", const std::string &opt2="")
 
void DrawPur (Experiment &exp, const std::string &var, int nx, double xmin, double xmax, const std::string &cut1, const std::string &cut2, const std::string &root_opt="", const std::string &opt="", const std::string &leg_name="")
 
void DrawPur (Experiment &exp, const std::string &var, int nx, double *xbins, const std::string &cut1, const std::string &cut2, const std::string &root_opt="", const std::string &opt="", const std::string &leg_name="")
 
double GetEff (Experiment &exp, bool usedata, const std::string &cut1, const std::string &cut2, const std::string &root_opt="", const std::string &opt="")
 
double GetEff (Experiment &exp, bool usedata, double &errlow, double &errhigh, double &nev1, double &nev2, const std::string &cut1, const std::string &cut2, const std::string &root_opt="", const std::string &opt="")
 
TGraphAsymmErrors * GetEff (Experiment &exp, bool usedata, const std::string &var, int nx, double *xbins, double &nev1, double &nev2, const std::string &cut1, const std::string &cut2, const std::string &root_opt="", const std::string &opt="", bool scale_errors=true)
 
TGraphAsymmErrors * GetEffNew (Experiment &exp, bool usedata, const std::string &var, int nx, double *xbins, double &nev1, double &nev2, const std::string &cut1, const std::string &cut2, const std::string &root_opt="", const std::string &opt1="", const std::string &opt2="", bool scale_errors=true)
 
void DrawRatioNew (Experiment &exp, bool usedata, const std::string &var, int nx, double *xbins, double &nev1, double &nev2, const std::string &cut1, const std::string &cut2, const std::string &root_opt="", const std::string &opt1="", const std::string &opt2="", bool scale_errors=true)
 
void DrawRatio (Experiment &exp, const std::string &groupName, const std::string &mcSampleName, const std::string &var, int nx, double *xbins, int ny, double *ybins, const std::string &cut, const std::string &root_opt="", const std::string &opt="", const std::string &leg="")
 
void DrawRatio (Experiment &exp, const std::string &groupName, const std::string &mcSampleName, const std::string &var, int nx, double *xbins, const std::string &cut, const std::string &root_opt="", const std::string &opt="", const std::string &leg="")
 
void DrawRatio (Experiment &exp, const std::string &groupName, const std::string &mcSampleName, const std::string &var, int nx, double xmin, double xmax, const std::string &cut, const std::string &root_opt="", const std::string &opt="", const std::string &leg="")
 
void DrawRatio (Experiment &exp, const std::string &var, int nx, double *xbins, const std::string &cut, const std::string &root_opt="", const std::string &opt="", const std::string &leg="")
 
void DrawRatio (Experiment &exp, const std::string &var, int nx, double xmin, double xmax, const std::string &cut, const std::string &root_opt="", const std::string &opt="", const std::string &leg="")
 
void AnalysisResults (Experiment &exp, const std::string &groupName, const std::string &mcSampleName, const std::string &cut, const std::string &opt, const std::string &categ="all")
 
void AnalysisResults (Experiment &exp, const std::string &cut, const std::string &opt="", const std::string &categ="all")
 
Double_t DrawErrorsBase (Experiment &exp, const std::string &groupName, const std::string &mcSampleName, const std::string &var, int nx, double *xbins, const std::string &cut="", bool relative=false, const std::string &root_opt="", const std::string &opt="", const std::string &leg="", bool scale_errors=false)
 
Double_t DrawErrorsBase (HistoStack *hs, bool relative, const std::string &root_opt, const std::string &opt, const std::string &leg)
 
Double_t DrawErrors (TTree *tree, const std::string &var, int nx, double xmin, double xmax, const std::string &cut="", const std::string &root_opt="", const std::string &opt="", const std::string &leg="", double norm=1, bool scale_errors=false)
 [DrawingToolsDrawErrors]
 
Double_t DrawRelativeErrors (TTree *tree, const std::string &var, int nx, double xmin, double xmax, const std::string &cut="", const std::string &root_opt="", const std::string &opt="", const std::string &leg="", double norm=1, bool scale_errors=false)
 
Double_t DrawErrors (TTree *tree, const std::string &var, int nx, double *xbins, const std::string &cut="", const std::string &root_opt="", const std::string &opt="", const std::string &leg="", double norm=1, bool scale_errors=false)
 
Double_t DrawRelativeErrors (TTree *tree, const std::string &var, int nx, double *xbins, const std::string &cut="", const std::string &root_opt="", const std::string &opt="", const std::string &leg="", double norm=1, bool scale_errors=false)
 
Double_t DrawRelativeErrors (TTree *tree1, TTree *tree2, const std::string &var, int nx, double xmin, double xmax, const std::string &cut="", const std::string &root_opt="", const std::string &opt="", const std::string &leg="", double norm=1, bool scale_errors=false)
 
Double_t DrawRelativeErrors (TTree *tree1, TTree *tree2, const std::string &var, int nx, double *xbins, const std::string &cut="", const std::string &root_opt="", const std::string &opt="", const std::string &leg="", double norm=1, bool scale_errors=false)
 
Double_t DrawErrors (Experiment &exp, const std::string &groupName, const std::string &mcSampleName, const std::string &var, int nx, double xmin, double xmax, const std::string &cut="", const std::string &root_opt="", const std::string &opt="", const std::string &leg="", bool scale_errors=false)
 
Double_t DrawRelativeErrors (Experiment &exp, const std::string &groupName, const std::string &mcSampleName, const std::string &var, int nx, double xmin, double xmax, const std::string &cut="", const std::string &root_opt="", const std::string &opt="", const std::string &leg="", bool scale_errors=false)
 
Double_t DrawErrors (Experiment &exp, const std::string &groupName, const std::string &mcSampleName, const std::string &var, int nx, double *xbins, const std::string &cut="", const std::string &root_opt="", const std::string &opt="", const std::string &leg="", bool scale_errors=false)
 
Double_t DrawRelativeErrors (Experiment &exp, const std::string &groupName, const std::string &mcSampleName, const std::string &var, int nx, double *xbins, const std::string &cut="", const std::string &root_opt="", const std::string &opt="", const std::string &leg="", bool scale_errors=false)
 
Double_t DrawErrors (Experiment &exp, const std::string &var, int nx, double xmin, double xmax, const std::string &cut="", const std::string &root_opt="", const std::string &opt="", const std::string &leg="", bool scale_errors=false)
 
Double_t DrawRelativeErrors (Experiment &exp, const std::string &var, int nx, double xmin, double xmax, const std::string &cut="", const std::string &root_opt="", const std::string &opt="", const std::string &leg="", bool scale_errors=false)
 
Double_t DrawErrors (Experiment &exp, const std::string &var, int nx, double *xbins, const std::string &cut="", const std::string &root_opt="", const std::string &opt="", const std::string &leg="", bool scale_errors=false)
 
Double_t DrawRelativeErrors (Experiment &exp, const std::string &var, int nx, double *xbins, const std::string &cut="", const std::string &root_opt="", const std::string &opt="", const std::string &leg="", bool scale_errors=false)
 
void DrawCovMatrix (TTree *tree, const std::string &var, int nx, double xmin, double xmax, const std::string &cut="", const std::string &root_opt="", const std::string &uopt="")
 [DrawingToolsDrawErrors] More...
 
void DrawCovMatrix (TTree *tree, const std::string &var, int nx, double *xbins, const std::string &cut="", const std::string &root_opt="", const std::string &uopt="")
 
void DrawCovMatrix (Experiment &exp, const std::string &groupName, const std::string &mcSampleName, const std::string &var, int nx, double *xbins, const std::string &cut="", const std::string &root_opt="", const std::string &uopt="")
 Draw covariance matrix given an experiment; and for a given MC sample ("magnet", "sand") in a sample group (i.e. "run3"). MC information will be used.
 
void DrawCovMatrix (Experiment &exp, const std::string &groupName, const std::string &mcSampleName, const std::string &var, int nx, double xmin, double xmax, const std::string &cut="", const std::string &root_opt="", const std::string &uopt="")
 
void DrawCovMatrix (Experiment &exp, const std::string &var, int nx, double *xbins, const std::string &cut="", const std::string &root_opt="", const std::string &uopt="")
 Draw covariance matrix given an experiment; MC information will be used.
 
void DrawCovMatrix (Experiment &exp, const std::string &var, int nx, double xmin, double xmax, const std::string &cut="", const std::string &root_opt="", const std::string &uopt="")
 
const TMatrixD & GetCovMatrix (TTree *tree, const std::string &var, int nx, double *xbins, const std::string &cut="", const std::string &uopt="")
 Returns covariance matrix given a tree.
 
const TMatrixD & GetCovMatrix (TTree *tree, const std::string &var, int nx, double xmin, double xmax, const std::string &cut="", const std::string &uopt="")
 
const TMatrixD & GetCovMatrix (Experiment &exp, const std::string &groupName, const std::string &mcSampleName, const std::string &var, int nx, double xmin, double xmax, const std::string &cut="", const std::string &root_opt="", const std::string &uopt="")
 Returns covariance matrix given an experiment; and for a given MC sample ("magnet", "sand") in a sample group (i.e. "run3"). MC information will be used.
 
const TMatrixD & GetCovMatrix (Experiment &exp, const std::string &groupName, const std::string &mcSampleName, const std::string &var, int nx, double *xbins, const std::string &cut="", const std::string &root_opt="", const std::string &uopt="")
 
const TMatrixD & GetCovMatrix (Experiment &exp, const std::string &var, int nx, double xmin, double xmax, const std::string &cut="", const std::string &root_opt="", const std::string &uopt="")
 Returns covariance matrix given an experiment; MC information will be used.
 
const TMatrixD & GetCovMatrix (Experiment &exp, const std::string &var, int nx, double *xbins, const std::string &cut="", const std::string &root_opt="", const std::string &uopt="")
 
void DrawMatrix (const TMatrixD &m, int lc, int lw, int fc, int fs, const std::string &root_opt="", const std::string &opt="")
 [DrawingToolsDrawCovMatrix] More...
 
void SetTreeForSystErrors (TTree *tree)
 
- Public Member Functions inherited from DrawingToolsBase
 DrawingToolsBase (const std::string &file="", Int_t T2KstyleIndex=1)
 
TH1_h * AddErrorsInQuadrature (TH1_h *h1, TH1_h *h2, const std::string &opt="")
 
std::string GetSameRootOption (const std::string &root_opt)
 extract the same or sames option from the full root option
 
std::string GetNoSameRootOption (const std::string &root_opt)
 remove same and sames options from the root option
 
void Reset ()
 reset all saved histograms
 
double GetEntries (TTree *tree, const std::string &cut)
 Get number (sum of weights) of events (i.e. bunches) passing "cut".
 
double GetEntries (TTree *tree, const std::string &cut, const std::string &var, const std::string &opt="", int toy_ref=-1)
 Get number (sum of weights) for variable var pasing "cut" (useful for vector variables, which number can be different than number of events/bunches)
 
void ScaleHisto (TH1 *h, double scale, bool scale_errors=true)
 Scale an histogram and its errors(when requested)
 
double * GetVariableBins (int nx, double xmin, double xmax, double *)
 Get a vector with variable binning.
 
std::string GetSameLevel (const std::string &root_opt)
 Get the superposition level.
 
std::string GetUniqueName (const std::string &name)
 
void CreateLegend (const std::string &uopt="")
 create the legend
 
void PrintEventNumbers (TTree *tree, const std::string &cut, const std::string &file="", int toy_ref=-1)
 Print the event number of a specific selection.
 
std::string FormatCut (const std::string &cut)
 Give the appropriate format to any cut.
 
std::string AddRangeCut (const std::string &var, int nx, double *xbins, int ny, double *ybins, const std::string &cut, const std::string &uopt)
 Add cut on range shown on plot.
 
TH1 * Draw (TTree *tree, const std::string &var, int nbins, double *xbins, const std::string &categ="all", const std::string &cut="", const std::string &root_opt="", const std::string &opt="", double norm=1, bool scale_errors=true)
 1D histos
 
TH1 * Draw (TTree *tree, const std::string &var, int nbins, double xmin, double xmax, const std::string &categ="all", const std::string &cut="", const std::string &root_opt="", const std::string &opt="", double norm=1, bool scale_errors=true)
 
TH1 * Draw (TTree *tree, const std::string &var, int nx, double *xbins, int ny, double *ybins, const std::string &categ="all", const std::string &cut="", const std::string &root_opt="", const std::string &opt="", double norm=1, bool scale_errors=true)
 2D histos
 
TH1 * Draw (TTree *tree, const std::string &var, int nx, double xmin, double xmax, int ny, double ymin, double ymax, const std::string &categ="all", const std::string &cut="", const std::string &root_opt="", const std::string &opt="", double norm=1, bool scale_errors=true)
 
void Draw (TTree *tree, const std::string &var, int nx, double xmin, double xmax, int ny, double ymin, double ymax, const std::string &idVar, std::vector< int > idSel, std::vector< std::string > idName, std::vector< int > idColor, const std::string &cut="", const std::string &root_opt="", const std::string &opt="", double norm=1., bool scale_errors=true)
 
void Draw (TTree *tree_mc, TTree *tree_data, const std::string &var, int nx, double xmin, double xmax, int ny, double ymin, double ymax, const std::string &idVar, std::vector< int > idSel, std::vector< std::string > idName, std::vector< int > idColor, const std::string &cut="", const std::string &root_opt="", const std::string &opt="", double norm=1., bool scale_errors=true)
 
void Draw (TTree *tree, const std::string &var, int nx, double *xbins, int ny, double *ybins, const std::string &idvar, std::vector< int > idSel, std::vector< std::string > idName, std::vector< int > idColor, const std::string &cut="", const std::string &root_opt="", const std::string &opt="", double norm=1, bool scale_errors=true)
 
void Draw (TTree *tree_mc, TTree *tree_data, const std::string &var, int nx, double *xbins, int ny, double *ybins, const std::string &idvar, std::vector< int > idSel, std::vector< std::string > idName, std::vector< int > idColor, const std::string &cut="", const std::string &root_opt="", const std::string &opt="", double norm=1, bool scale_errors=true)
 
double GetEff (TTree *tree, const std::string &var, double xmin, double xmax, const std::string &cut1, const std::string &cut2, const std::string &root_opt="", const std::string &opt="")
 
double GetEff (TTree *tree, const std::string &var, double xmin, double xmax, double &errlow, double &errhigh, const std::string &cut1, const std::string &cut2, const std::string &root_opt="", const std::string &opt="")
 
void DrawRatio (TTree *tree, const std::string &var, int nbins, double *xbins, const std::string &cut1, const std::string &cut2, const std::string &root_opt="", const std::string &opt="", const std::string &leg="")
 
void DrawRatio (TTree *tree, const std::string &var, int nx, double xmin, double xmax, const std::string &cut1, const std::string &cut2, const std::string &root_opt="", const std::string &opt="", const std::string &leg="")
 
void DrawEff (TTree *tree, const std::string &var, int nbins, double *xbins, const std::string &cut1, const std::string &cut2, const std::string &root_opt="", const std::string &opt="", const std::string &leg="")
 
void DrawEff (TTree *tree, const std::string &var, int nx, double xmin, double xmax, const std::string &cut1, const std::string &cut2, const std::string &root_opt="", const std::string &opt="", const std::string &leg="")
 
void DrawDoubleEff (TTree *tree1, TTree *tree2, const std::string &var, int nx, double *xbins, const std::string &cut1, const std::string &cut2, const std::string &root_opt="", const std::string &opt="", const std::string &leg="")
 ratio between two Efficiencies
 
void DrawDoubleEff (TTree *tree1, TTree *tree2, const std::string &var, int nx, double xmin, double xmax, const std::string &cut1, const std::string &cut2, const std::string &root_opt="", const std::string &opt="", const std::string &leg="")
 
void DrawSignificance (TTree *tree, const std::string &var, int nbins, double *xbins, const std::string &cut1, const std::string &cut2, double norm=1, double rel_syst=0, const std::string &root_opt="", const std::string &opt="", const std::string &leg="")
 1D significance
 
void DrawSignificance (TTree *tree, const std::string &var, int nbins, double xmin, double xmax, const std::string &cut1, const std::string &cut2, double norm=1, double rel_syst=0, const std::string &root_opt="", const std::string &opt="", const std::string &leg="")
 
void DrawGraph (TGraphAsymmErrors *eff, int nbins, double *xbins, const std::string &uroot_opt, const std::string &uopt, const std::string &leg, double ymax=1.05)
 [DrawingToolsBase_eff_ratio]
 
void DumpGraph (TGraphAsymmErrors *graph, int nbins, const std::string &uopt)
 
TH1_h * GetEventsVSCut (TTree *tree, const std::string &var, const std::string &cut_norm, int isel, int branch, int &first_cut, int &last_cut, const std::string &root_opt="", const std::string &opt="")
 Get a TH1 containing the number of events passing the selection as a function of the cut.
 
void DrawEventsVSCut (TTree *tree, const std::string &cut_norm="", int first_cut=-1, int last_cut=-1, const std::string &root_opt="", const std::string &opt="", const std::string &leg="")
 
void DrawEventsVSCut (TTree *tree, int branch, const std::string &cut_norm="", int first_cut=-1, int last_cut=-1, const std::string &root_opt="", const std::string &opt="", const std::string &leg="")
 Draw the number of events passing the selection as a function of the cut, for a given branch.
 
void DrawEventsVSCut (TTree *tree, int isel, int branch, const std::string &cut_norm="", int first_cut=-1, int last_cut=-1, const std::string &root_opt="", const std::string &opt="", const std::string &leg="")
 Draw the number of events passing the selection as a function of the cut, for a given selection and branch.
 
void DrawRatioVSCut (TTree *tree1, TTree *tree2, const std::string &precut="", int first_cut=-1, int last_cut=-1, const std::string &root_opt="", const std::string &opt="", const std::string &leg="", double norm=1.)
 Draw the ratio between two trees as a function of the cut.
 
void DrawRatioVSCut (TTree *tree1, TTree *tree2, int branch, const std::string &precut="", int first_cut=-1, int last_cut=-1, const std::string &root_opt="", const std::string &opt="", const std::string &leg="", double norm=1.)
 Draw the ratio between two trees as a function of the cut for a given branch.
 
void DrawRatioVSCut (TTree *tree1, TTree *tree2, int isel, int branch, const std::string &precut="", int first_cut=-1, int last_cut=-1, const std::string &root_opt="", const std::string &opt="", const std::string &leg="", double norm=1.)
 Draw the ratio between two trees as a function of the cut for a given selection and branch.
 
void DrawEffVSCut (TTree *tree, const std::string &signal="", const std::string &precut="", int first_cut=-1, int last_cut=-1, const std::string &root_opt="", const std::string &opt="", const std::string &leg="")
 Draw the selection efficiency as a function of the cut. Must use the truth tree as input.
 
void DrawEffVSCut (TTree *tree, int branch, const std::string &signal="", const std::string &precut="", int first_cut=-1, int last_cut=-1, const std::string &root_opt="", const std::string &opt="", const std::string &leg="")
 Draw the selection efficiency as a function of the cut for a given branch. Must use the truth tree as input.
 
void DrawEffVSCut (TTree *tree, int isel, int branch, const std::string &signal="", const std::string &precut="", int first_cut=-1, int last_cut=-1, const std::string &root_opt="", const std::string &opt="", const std::string &leg="")
 Draw the selection efficiency as a function of the cut for a given selection and branch. Must use the truth tree as input.
 
void DrawPurVSCut (TTree *tree, const std::string &signal="", const std::string &precut="", int first_cut=-1, int last_cut=-1, const std::string &root_opt="", const std::string &opt="", const std::string &leg="")
 Draw the selection purity as a function of the cut. Must use the default tree as input.
 
void DrawPurVSCut (TTree *tree, int branch, const std::string &signal="", const std::string &precut="", int first_cut=-1, int last_cut=-1, const std::string &root_opt="", const std::string &opt="", const std::string &leg="")
 Draw the selection purity as a function of the cut for a given branch. Must use the default tree as input.
 
void DrawPurVSCut (TTree *tree, int isel, int branch, const std::string &signal="", const std::string &precut="", int first_cut=-1, int last_cut=-1, const std::string &root_opt="", const std::string &opt="", const std::string &leg="")
 Draw the selection purity as a function of the cut for a given selection and branch. Must use the default tree as input.
 
void DrawRatioVSCut (TH1_h *h1, TH1_h *h2, int isel, int branch, int first_cut, const std::string &root_opt, const std::string &opt, const std::string &leg)
 [DrawingToolsBaseVsCutsMethods] More...
 
void DrawToys (TTree *tree, const std::string &cut="", const std::string &root_opt="", const std::string &opt="", const std::string &leg="")
 
void DrawToysRatio (TTree *tree1, TTree *tree2, const std::string &cut="", const std::string &root_opt="", const std::string &opt="", const std::string &leg="", double norm=1)
 
void DrawToysRatioTwoCuts (TTree *tree1, TTree *tree2, const std::string &cut1, const std::string &cut2, const std::string &root_opt="", const std::string &opt="", const std::string &leg="", double norm=1)
 
void DrawToysBase (TH1_h &result, TH1_h &entries, const std::string &root_opt="", const std::string &opt="", const std::string &leg="")
 [DrawingToolsBaseDrawToyMethods] More...
 
void DrawVariations (const std::string &name, Int_t ipar=-1, int nx=100, double xmin=-5, double xmax=5, const std::string &root_opt="", const std::string &opt="", const std::string &leg="")
 Draw the variations for systematic parameter ipar.
 
void Draw (TTree *tree1, TTree *tree2, const std::string &var, int nx, double xmin, double xmax, const std::string &categ="all", const std::string &cut="", const std::string &root_opt="", const std::string &opt="", double norm=1, bool scale_errors=false)
 1D comparison More...
 
void Draw (TTree *tree1, TTree *tree2, const std::string &var, int nbins, double *xbins, const std::string &categ="all", const std::string &cut="", const std::string &root_opt="", const std::string &opt="", double norm=1, bool scale_errors=false)
 
void Draw (TTree *tree1, TTree *tree2, const std::string &var, int nx, double xmin, double xmax, int ny, double ymin, double ymax, const std::string &categ="all", const std::string &cut="", const std::string &root_opt="", const std::string &opt="", double norm=1, bool scale_errors=false)
 2D comparison
 
void Draw (TTree *tree1, TTree *tree2, const std::string &var, int nx, double *xbins, int ny, double *ybins, const std::string &categ="all", const std::string &cut="", const std::string &root_opt="", const std::string &opt="", double norm=1, bool scale_errors=false)
 
void DrawRatio (TTree *tree1, TTree *tree2, const std::string &var, int nx, double xmin, double xmax, const std::string &cut="", const std::string &root_opt="", const std::string &opt="", const std::string &leg="", double norm=1)
 Ratio between the two data samples with the same cut.
 
void DrawRatio (TTree *tree1, TTree *tree2, const std::string &var, int nx, double *xbins, const std::string &cut="", const std::string &root_opt="", const std::string &opt="", const std::string &leg="", double norm=1)
 
void DrawRatioTwoCuts (TTree *tree1, TTree *tree2, const std::string &var, int nx, double *xbins, int ny, double *ybins, const std::string &cut1="", const std::string &cut2="", const std::string &root_opt="", const std::string &opt="", const std::string &leg="", double norm=1, bool scale_errors=false)
 
void DrawRatioTwoCuts (TTree *tree1, TTree *tree2, const std::string &var, int nx, double xmin, double xmax, const std::string &cut1, const std::string &cut2, const std::string &root_opt="", const std::string &opt="", const std::string &leg="", double norm=1)
 Ratio between the two data samples with different cuts.
 
virtual void DrawRatioTwoCuts (TTree *tree1, TTree *tree2, const std::string &var, int nx, double *xbins, const std::string &cut1, const std::string &cut2, const std::string &root_opt="", const std::string &opt="", const std::string &leg="", double norm=1)
 
void DrawRatio (TH1_h *ratio, const std::string &root_opt, const std::string &uopt, const std::string &leg)
 just Draw the ratio histogram
 
void Project (HistoStack *hs1, HistoStack *hs2, TTree *tree1, TTree *tree2, const std::string &var, int nx, double *xbins, int ny, double *ybins, const std::string &categ="all", const std::string &cut="", const std::string &root_opt="", const std::string &opt="", double norm2=1, bool scale_errors=true)
 
void ProjectNew (HistoStack *hs1, HistoStack *hs2, TTree *tree1, TTree *tree2, const std::string &var, int nx, double *xbins, int ny, double *ybins, const std::string &categ="all", const std::string &cut1="", const std::string &cut2="", const std::string &root_opt="", const std::string &opt="", double norm2=1, bool scale_errors=true)
 
void DumpHisto (TH1 *histo, const std::string &uopt)
 dump histo contents
 
void DumpHistoInfo (TH1 *histo, const std::string &uopt)
 Dump integral, underflow and overflow.
 
void DrawHisto (TH1 *h, int lc, int lw, int fc, int fs, const std::string &root_opt="", const std::string &opt="", const std::string &leg_opt="", int mode=0)
 
void DrawHisto (TH1 *h, int lw, int fc, int fs, const std::string &root_opt="", const std::string &opt="", const std::string &leg_opt="", int mode=0)
 
void DrawHisto (TH2 *h, int lc, int lw, int fc, int fs, const std::string &root_opt="", const std::string &opt="", const std::string &leg_opt="", int mode=0)
 
void DrawHisto (TH3F *h, int lc, int lw, int fc, int fs, const std::string &opt="")
 
void DrawHistoStack (HistoStack *hs, const std::string &categ, const std::string &root_opt, const std::string &opt, const std::string &leg_opt="", int mode=2)
 
void DrawHistoStack (HistoStack *hs, const std::string &categ, const std::string &root_opt, const std::string &opt, int lc, int lw, int fc, int fs, const std::string &leg_opt="", int mode=2)
 
void DrawHistoStacks (HistoStack *hs1, HistoStack *hs2, const std::string &categ, const std::string &root_opt, const std::string &opt, double norm)
 
void DrawRatioHistoStacks (HistoStack *hs1, HistoStack *hs2, const std::string &root_opt, const std::string &opt, double norm, const std::string &leg="")
 
void Project (HistoStack *hs, const std::string &sample_name, TTree *tree, const std::string &var, int nx, double *xbins, int ny, double *ybins, const std::string &categ="all", const std::string &cut="", const std::string &root_opt="", const std::string &opt="", double norm=1, bool scale_errors=true)
 
void Project (HistoStack *hs, TTree *tree, const std::string &var, int nx, double *xbins, int ny, double *ybins, const std::string &idVar, std::vector< int > idSel, std::vector< std::string > idName, std::vector< int > idColor, const std::string &cut="", const std::string &root_opt="", const std::string &opt="", double norm=1, bool scale_errors=true)
 
TH1_h * GetHisto (TTree *tree, const std::string &name, const std::string &var, int nx, double *xbins, const std::string &cut, const std::string &root_opt, const std::string &opt, double scale, bool scale_errors=true, int toy_ref=-1)
 
virtual TH2_h * GetHisto (TTree *tree, const std::string &name, const std::string &var, int nx, double *xbins, int ny, double *ybins, const std::string &cut, const std::string &root_opt, const std::string &opt, double scale, bool scale_errors=true, int toy_ref=-1)
 
virtual TH1_h * GetHisto (HistoStack *hs, TTree *tree, const std::string &name, const std::string &var, int nx, double *xbins, const std::string &cut, const std::string &root_opt, const std::string &opt, TH1_h *&hsyst, double scale, bool scale_errors=true, int toy_ref=-1)
 
TH1_h * GetHisto (HistoStack *hs, TTree *tree, const std::string &name, const std::string &var, int nx, double *xbins, const std::string &cut, const std::string &root_opt, const std::string &opt, double scale, bool scale_errors=true, int toy_ref=-1)
 
TH1_h * GetRatioHisto (HistoStack *hs1, HistoStack *hs2, const std::string &opt)
 
void DumpLegendPos ()
 Dump position and size of the legend/small legend.
 
void DumpSmallLegendPos ()
 
void SetLegendEntryHeight (double h)
 [DrawingToolsCommandLineOptions] More...
 
void SetLegendParam (double a, double b, double c, double d)
 Set position and size of the legend.
 
void SetLegendPos (double x=-999, double y=-999)
 
void SetLegendPos (std::string pos)
 
void SetLegendSize (double w=-999, double h=-999)
 Set legend/small legend size, width and height (if -999 keep same value)
 
void SetSmallLegendSize (double w=-999, double h=-999)
 
double GetLegendX ()
 Get position/size of the legend/small legend.
 
double GetLegendY ()
 
double GetLegendW ()
 
double GetLegendH ()
 
double GetSmallLegendX ()
 
double GetSmallLegendY ()
 
double GetSmallLegendW ()
 
double GetSmallLegendH ()
 
void SetOptStat (int opt)
 Set the stat option (by int or string)
 
void SetOptStat (Option_t *stat)
 
double GetStatW ()
 Set/Get the stat box size.
 
double GetStatH ()
 
void SetStatSize (double w=-999, double h=-999)
 
double GetStatX ()
 Set/Get the stat box position (if -999 keep same value)
 
double GetStatY ()
 
void SetStatPos (double x=-999, double y=-999)
 
void SetStackFillStyle (int FillStyle)
 Change the fill style.
 
void SetDifferentStackFillStyles (bool diff=true)
 Make each histogram in the stack have a different fill style.
 
void SetMarkerStyle (int style)
 change the marker style
 
void SetMarkerSize (double size)
 change the marker size
 
void SetFillStyle (int style)
 Set the fill style of the current histogram..
 
void SetLineWidth (int width)
 Set the line width of the current histogram..
 
void SetLineColor (int color)
 Set the line color of the current histogram..
 
void SetLineColor (EColor kColor)
 
void SetFillColor (int color)
 Set the line color of the current histogram..
 
void SetFillColor (EColor kColor)
 
void SetMCErrorColor (EColor kColor)
 Set the color for the MC error bars.
 
void SetMCErrorColor (int color)
 
void SetMCStatErrorColor (EColor kColor)
 
void SetMCStatErrorColor (int color)
 
void SetAutoColors (int colors[], int ncolors)
 Set the auto colors when superimposing histograms.
 
void SetAutoMarkers (int markers[], int nmarkers)
 Set the auto Markers when superimposing histograms.
 
const std::string & GetEffDivideParams ()
 Setter and Getter for params controlling the efficiency calculation.
 
void SetEffDivideParams (const std::string &params)
 
void SetDefaultEffDivideParams ()
 Setter of default params.
 
void SetTitleX (const std::string &titleX)
 Set the title in X.
 
void SetTitleY (const std::string &titleY)
 Set the title in Y.
 
void SetTitle (const std::string &title)
 Set the title that appears at the top of the plot.
 
void SetDataLabel (const std::string &label, Color_t color=kBlack)
 
void SetAllMCLabel (const std::string &label, Color_t color=kBlack)
 
void SetAllMCStatLabel (const std::string &label)
 
void SetAllMCSystLabel (const std::string &label)
 
void SetMinY (double minY=0)
 
void SetMaxY (double maxY=0)
 
void SetRangeY (double minY=0, double maxY=0)
 
void SetLogY (bool logY=true)
 Set the current histogram to be drawn with a logarithmic Y axis.
 
void SetLogZ (bool logZ=true)
 Set the current 2D histogram to be drawn with a logarithmic Z axis (works only for category "all").
 
void SetRelativeMaxY (double maxY)
 Set the maximum value in Y relative to the bin with maximum content.
 
std::string GetErrorStyle (const std::string &opt)
 Gets the root error style from the user option.
 
void SetDraw2p2h (bool draw=true)
 switch on/off 2p2h type for reaction histos
 
void DrawCutLineVertical (double xval, bool addarrow=false, std::string arrowdir="l", double arrowpos=0.5)
 [DrawingToolsCommandLineOptions] More...
 
void DrawCutLineHorizontal (double yval, bool addarrow=false, std::string arrowdir="u", double arrowpos=0.5)
 
void DrawCutLine (double xmin, double ymin, double xmax, double ymax)
 
void DrawCutRegion (double xmin, double ymin, double xmax, double ymax, std::string opt="tblr")
 
void DrawCutArrow (double xmin, double ymin, double xmax, double ymax)
 
void SetCutLineColor (int col)
 Set the color of lines drawn with the DrawCut* functions.
 
void SetCutLineColor (EColor kCol)
 
void SetCutLineWidth (int width)
 Set the width of lines drawn with the DrawCut* functions.
 
CorrectionManagercorr ()
 [DrawingToolsBaseDrawCutLineMethods] More...
 
SystematicManagersyst ()
 
SelectionManagersel ()
 
ConfigurationManagerconf ()
 
CategoryManagercat ()
 
DocStringManagerdoc ()
 
Headerheader ()
 
SystematicsToolssyst_tools ()
 an access to tools instance
 
ConfigTreeToolsconfig_tools ()
 
void DumpVariationSystematics ()
 Print out the Standard Systematics for a given configuration.
 
void DumpWeightSystematics ()
 Print out the Weight Systematics for a given configuration.
 
void DumpSystematics ()
 Print out all Systematics for a given configuration.
 
void DumpCorrections (const std::string &file="")
 Print out the Corrections.
 
void ReadCorrections (const std::string &file)
 Read the list of Corrections.
 
void ReadSystematics (const std::string &file)
 
void DumpConfigurations (const std::string &file="")
 Print out the Configurations.
 
void DumpConfiguration (const std::string &name)
 Print out the Configuration.
 
void ReadConfigurations (const std::string &file)
 Read the list of Configurations.
 
void DumpSoftwareVersions (const std::string &file="")
 —— Package versions -------—— More...
 
void DumpOriginalSoftwareVersion (const std::string &file="", bool all=true)
 Dumps on the screen the software version of the original file (i.e. output of recon)
 
void DumpFileInfo (const std::string &file="")
 ---— Package versions ----------—
 
void ReadCategories (const std::string &file)
 
void DumpCategories ()
 
void DumpCategories (const std::string &file)
 
void DumpCategory (std::string category)
 
void ChangeCategory (const std::string &categ_name, int ntypes, std::string *names, int *codes, int *colors)
 [DrawingToolsBase_categ] More...
 
bool HasCategory (const std::string &categ_name)
 Check whether a category has been defined.
 
void ReadSelections (const std::string &file)
 Read the list of Selections.
 
void DumpSelections (const std::string &file="")
 
void DumpBranches (Int_t sel_index=0)
 Dump the list of branches in the selection provided selection index.
 
void DumpBranches (const std::string &sel_name)
 Dump the list of branches in the selection provided selection name.
 
void DumpCuts (int branch=-1)
 [DrawingToolsBase_DumpSelections] More...
 
void DumpSteps (int branch=-1)
 
void DumpCuts (const std::string &sel_name, int branch=-1)
 
void DumpSteps (const std::string &sel_name, int branch=-1)
 
void DumpCuts (Int_t sel_index, int branch)
 
void DumpSteps (Int_t sel_index, int branch)
 
std::vector< std::string > GetCutNames (const std::string &sel_name, int branch=0)
 [DrawingToolsBase_DumpSteps] More...
 
std::vector< std::string > GetStepNames (const std::string &sel_name, int branch=0)
 Get a vector of steps names for a given branch (in order) in a selection with a given name.
 
std::vector< std::string > GetCutNames (Int_t sel_index, int branch)
 Get a vector of cut names for a given branch (in order) in a selection with a given index.
 
std::vector< std::string > GetStepNames (Int_t sel_index, int branch)
 Get a vector of steps names for a given branch (in order) in a selection with a given index.
 
void ExplainOption (std::string name)
 
void ListOptions ()
 List all drawing options.
 
void ExplainVar (std::string name, std::string tree_name="default")
 [DrawingToolsBase_ops] More...
 
void ListVars (std::string tree_name="default")
 List all the variables stored in a tree. If no tree name is provided the "default" tree is used.
 
void ReadDocStrings (const std::string &file)
 [DrawingToolsBase_vars] More...
 
void DumpPOT (TTree *tree)
 
void DumpPOT (const std::string &file)
 Dump the POT information for this sample, provided an input file name.
 
void ReadConfig (const std::string &file)
 [DrawingToolsBase_POT] More...
 
void ReadOther (const std::string &file)
 Read any other variables in the config tree.
 
void ReadOther (TTree *chain)
 
void PrintPurities (TTree *tree, const std::string &categ, const std::string &cut, double events_ratio=1)
 
std::vector< TGraph *> GetGraphs ()
 Get all the graphs that have been drawn. Useful if you want to save them to file.
 
TGraph * GetLastGraph ()
 Get the last graph that was drawn. Useful if you want to modify its appearance.
 
std::vector< TH1 *> GetHistos ()
 
TLegend * GetLastLegend ()
 Get the last legend that was drawn. Useful if you want to modify its appearance.
 
void ChangeLegendEntry (Int_t index, const std::string &new_label="", const std::string &new_opt="")
 Change the label or drawing style of a entry in the legend provided the entry number.
 
void DeleteLegendEntry (Int_t index)
 Delete a given Legent entry provided its index.
 
std::vector< TH1 *> Get2DHistos ()
 
TH1 * GetLastHisto ()
 Get all the last Histo that was drawn. Useful if you want to modify its appearance.
 
TH1 * GetLastStackTotal (int nexttolast=0)
 
HistoStackGetLastStack (int nexttolast=0)
 Get the most recently-drawn stacked histogram. Useful to access its histograms.
 
void StartDocument (const std::string &title, bool pdf=true, bool web=false, const std::string &pdffile="plots.pdf", const std::string &webpath="plots")
 
void AddDocumentPage (const std::string &name)
 
void FinishDocument ()
 
int MakeDirectory (const std::string &path, mode_t mode)
 Make a directory on the filesystem.
 
std::string ConvertCutForTruthTree (const std::string cut, bool replace_selmu=true)
 
double GetChi2 (const TH1 *h1, const TH1 *h2)
 
int GetNDOF (const TH1 *h1, const TH1 *h2)
 
double GetPvalue (double chi2, int ndof)
 
double GetPvalue (const TH1 *h1, const TH1 *h2)
 

Protected Member Functions

Double_t DrawErrorsBase (TTree *tree, const std::string &var, int nx, double *xbins, const std::string &cut="", bool relative=false, const std::string &root_opt="", const std::string &opt="", const std::string &leg="", double norm=1, bool scale_errors=false)
 
- Protected Member Functions inherited from DrawingToolsBase
int GetFillStyle (int i)
 

Protected Attributes

TTree * _treeForSystErrors
 
- Protected Attributes inherited from DrawingToolsBase
int _unique
 Counter for ensuring all histograms get a unique name.
 
bool _drawleg
 
std::vector< TLegend * > _legends
 
double _legendParam [4]
 
double _legendSize [2]
 
double _legendPos [2]
 
double _legendSmallSize [2]
 
double _statPos [2]
 
std::string _legendPosS
 
int _stat_option
 
int _stack_fill_style
 
bool _different_fill_styles
 
int _marker_style
 
int _fill_style
 
int _fill_color
 
int _line_width
 
int _line_color
 
int _mcerror_color
 
int _mcstaterror_color
 
double _marker_size
 
int _cut_line_col
 
int _cut_line_width
 
std::string _titleX
 
std::string _titleY
 
std::string _title
 
Color_t _data_color
 
Color_t _allmc_color
 
std::string _data_label
 
std::string _allmc_label
 
std::string _allmcstat_label
 
std::string _allmcsyst_label
 
double _minY
 
double _maxY
 
double _relativeMaxY
 
bool _logY
 
bool _logZ
 
std::string _eff_params
 parameter to control options for TGraphAsymmErrors::Divide() method, the one used to get the efficiencies
 
bool _draw_2p2h
 
TFile * _file
 
int _same_level
 
int _same_level_tot
 
int _auto_colors [NMAXAUTOCOLORS]
 
int _auto_markers [NMAXAUTOCOLORS]
 
std::vector< TH1 *> _saved_histos
 
std::vector< TH2 *> _saved_histos2D
 
std::vector< HistoStack *> _saved_histoStacks
 
std::vector< TGraph *> _saved_graphs
 
std::vector< TLine *> _cut_lines
 
TPad * _MainPad
 
TPad * _RatioPad
 
TCanvas * _pdfcanvas
 
TPad * _bodypad
 
TPad * _headpad
 
std::string _pdfpath
 
std::string _webpath
 
std::string _webheader
 
std::string _webbody
 
std::string _config_file
 
DocStringManager _docStrings
 
CategoryManager _categories
 
ConfigurationManager _configurations
 
CorrectionManager _corrections
 
SystematicManager _systematics
 
SelectionManager _selections
 
SystematicsTools _syst_tools
 
ConfigTreeTools _configTree_tools
 
Header _header
 
Int_t _minAccumLevelToSave
 

Detailed Description

The DrawingTools class provides functions for plotting information in the micro-tree file. The DrawingTools can be used in interactive ROOT sessions and simple ROOT macros.

There is a distinction between the code for drawing plots (this class, DrawingTools) and the code for selecting the right data to plot (DataSample).

A file must be specified when instantiating the DrawingTools class, as the file contains important information in the "config" tree, that is used by the DrawingTools (including the cuts that an analysis performed, and the categories used when drawing stacked histograms.

More documentation on how to use the DrawingTools, including example macros, can be found in the highLevelAnalysis package documentation (follow the links from the main page).

TODO: This class must be properly documented.

Definition at line 26 of file DrawingTools.hxx.

Member Function Documentation

§ CompareSampleGroups()

void DrawingTools::CompareSampleGroups ( Experiment exp,
const std::string &  mcSampleName,
const std::string &  var,
int  nx,
double  xmin,
double  xmax,
const std::string &  cut = "",
const std::string &  root_opt = "",
const std::string &  opt = "",
bool  scale_errors = true,
const std::string &  normtype = "POT" 
)

Compare Data and MC for each sample properly normalised to each other. All samples are drawn using the "all" category (i.e. as 'data points' in different colours), with a legend created based on the names given when generating the SampleGroup. normtype can be POT or ONE

Definition at line 2170 of file DrawingTools.cxx.

2171  {
2172 //*********************************************************
2173 
2174  double xbins[NMAXBINS];
2175  CompareSampleGroups(exp,mcSampleName,var,nx,GetVariableBins(nx,xmin,xmax,xbins),cut,root_opt,opt,scale_errors,normtype);
2176 }
double * GetVariableBins(int nx, double xmin, double xmax, double *)
Get a vector with variable binning.
void CompareSampleGroups(Experiment &exp, const std::string &mcSampleName, const std::string &var, int nx, double xmin, double xmax, const std::string &cut="", const std::string &root_opt="", const std::string &opt="", bool scale_errors=true, const std::string &normtype="POT")

§ DrawCovMatrix()

void DrawingTools::DrawCovMatrix ( TTree *  tree,
const std::string &  var,
int  nx,
double  xmin,
double  xmax,
const std::string &  cut = "",
const std::string &  root_opt = "",
const std::string &  uopt = "" 
)

[DrawingToolsDrawErrors]

[DrawingToolsDrawCovMatrix] Draw covariance matrix given a tree

Definition at line 2625 of file DrawingTools.cxx.

2626  {
2627 //*********************************************************
2628  double xbins[NMAXBINS];
2629 
2630  DrawCovMatrix(tree, var, nx, GetVariableBins(nx, xmin, xmax, xbins), cut, root_opt, uopt);
2631 
2632 }
void DrawCovMatrix(TTree *tree, const std::string &var, int nx, double xmin, double xmax, const std::string &cut="", const std::string &root_opt="", const std::string &uopt="")
[DrawingToolsDrawErrors]
double * GetVariableBins(int nx, double xmin, double xmax, double *)
Get a vector with variable binning.

§ DrawMatrix()

void DrawingTools::DrawMatrix ( const TMatrixD &  m,
int  lc,
int  lw,
int  fc,
int  fs,
const std::string &  root_opt = "",
const std::string &  opt = "" 
)

[DrawingToolsDrawCovMatrix]

Draw a (covariance) matrix

Definition at line 2770 of file DrawingTools.cxx.

2771  {
2772 //*********************************************************
2773 
2774  // Histogram corresponding to the matrix
2775  TH2D* h = new TH2D(m);
2776 
2777  //set unique name
2778  std::string name = h->GetName();
2779  h->SetName(GetUniqueName(name).c_str());
2780 
2781  _saved_histos.push_back(h);
2782 
2783  // Draw the histo
2784  DrawHisto(h, lc, lw, fc, fs, root_opt, uopt+ " NOSTAT NOMIN","");
2785 
2786  std::string ropt = drawUtils::ToUpper(root_opt);
2787  if (ropt.find("COLZ"))
2788  gPad->SetRightMargin(0.15); //to be able to see the palette labels
2789 
2790  h->GetXaxis()->SetTitle("Bins");
2791  h->GetYaxis()->SetTitle("Bins");
2792  gPad->Modified();
2793  gPad->Update();
2794 
2795 }
std::string GetUniqueName(const std::string &name)
std::string ToUpper(const std::string &str)
Definition: DrawingUtils.cxx:9

§ DrawRatioVSCut()

void DrawingTools::DrawRatioVSCut ( DataSample sample1,
DataSample sample2,
const std::string &  precut = "",
int  first_cut = -1,
int  last_cut = -1,
const std::string &  root_opt = "",
const std::string &  opt = "",
const std::string &  leg = "",
double  norm = -1.,
bool  pot_norm = true 
)

[DrawingToolsVsCutsMethods] Draw the ratio between two trees as a function of the cut

Definition at line 579 of file DrawingTools.cxx.

580  {
581 //**************************************************
582 
583  DrawRatioVSCut(sample1,sample2,0,precut,first_cut,last_cut,root_opt,opt,leg,norm,pot_norm);
584 }
void DrawRatioVSCut(DataSample &sample1, DataSample &sample2, const std::string &precut="", int first_cut=-1, int last_cut=-1, const std::string &root_opt="", const std::string &opt="", const std::string &leg="", double norm=-1., bool pot_norm=true)

§ DrawToys()

void DrawingTools::DrawToys ( Experiment exp,
const std::string &  cut = "",
const std::string &  root_opt = "",
const std::string &  opt = "",
const std::string &  leg = "" 
)

[DrawingTools_POT]

This method draws the distribution of the number of selected events for all toys (one entry per toy in the histogram), provided a cut This is useful to check that the systematic error bars correspond to the RMS of this distribution

Definition at line 1018 of file DrawingTools.cxx.

1018  {
1019 //*********************************************************
1020 
1021  // Draw the distribution of entries for all toy experiments
1022  // The rms of this distribution is the systematic error
1023 
1024  std::string uopt = drawUtils::ToUpper(opt);
1025 
1026 
1027  // Check that all user options are valid
1028  if (!drawUtils::ContainValidOptions(uopt)) return;
1029 
1030  int ntoys = drawUtils::GetVarFromExperiment("NTOYS",exp);
1031  if (ntoys<=0) return;
1032 
1033  // Create temporary empty Histo Stacks
1034  HistoStack* hs2 = new HistoStack("dummy","","");
1035  HistoStack* hsw2 = new HistoStack("dummy","","");
1036 
1037  double xbins[NMAXBINS];
1038 
1039  // Project the Experiment into the HistoStack. Using 0 norm means that POT normalization is used when both samples are available
1040  // Project with no toy experiment weights
1041  Project(NULL, hs2, exp, "all","all", "toy_index",ntoys,GetVariableBins(ntoys,0,ntoys,xbins),0,NULL,"all",cut,root_opt,uopt+ " NOTOYW",0.,true);
1042 
1043  // Get the total histogram from the HistoStack
1044  TH1_h* h1 = hs2->GetTotal1D();
1045  TH1_h* hw = NULL;
1046 
1047  std::string cut2=cut;
1048  if (cut2=="") cut2="1==1";
1049 
1050  // Project the toy experiment PDF weights
1051  if (true){//(drawUtils::TreeHasVar(tree,"toy_weight")){
1052  Project(NULL, hsw2, exp, "all","all", "toy_index",ntoys,GetVariableBins(ntoys,0,ntoys,xbins),0,NULL,"all",cut,root_opt,uopt,0.,true);
1053  hw = hsw2->GetTotal1D();
1054  }
1055  else
1056  hw = h1;
1057 
1058  // compute the average toy exp weight
1059  TH1_h hwa(*hw);
1060  hwa.Divide(hw,h1);
1061 
1062  DrawToysBase(*h1,hwa,root_opt,uopt,leg);
1063 
1064  // delete the temporary HistoStacks
1065  delete hs2;
1066  delete hsw2;
1067 }
double * GetVariableBins(int nx, double xmin, double xmax, double *)
Get a vector with variable binning.
bool ContainValidOptions(const std::string &uopt)
Check if the input string contails only valid options.
int GetVarFromExperiment(const std::string &var, Experiment &exp, const std::string &groupName="all", const std::string &mcSampleName="all")
Get the Value of an integer variable from the experiment.
void DrawToysBase(TH1_h &result, TH1_h &entries, const std::string &root_opt="", const std::string &opt="", const std::string &leg="")
[DrawingToolsBaseDrawToyMethods]
std::string ToUpper(const std::string &str)
Definition: DrawingUtils.cxx:9
TH1_h * GetTotal1D()
Return the total 1D histo.
Definition: HistoStack.hxx:67

§ DumpPOT()

void DrawingTools::DumpPOT ( DataSample data)

[DrawingToolsVsCutsMethods]

[DrawingTools_POT] Dump the POT information for this sample, provided the sample it self

Definition at line 906 of file DrawingTools.cxx.

906  {
907 //*********************************************************
908 
909  sample.DumpPOT();
910 }

§ GetNormalisationFactor()

double DrawingTools::GetNormalisationFactor ( DataSample sample1,
DataSample sample2,
double  norm = -1.,
bool  pot_norm = true,
const std::string &  opt = "" 
)

Get the normalisation factor to apply when comparing sample1/sample2. If "pot_norm" is true, then the POT ratio is returned. If not, the value specified by "norm" is returned.

Definition at line 988 of file DrawingTools.cxx.

988  {
989 //*********************************************************
990 
991  (void) pot_norm;
992 
993  std::string uopt = drawUtils::ToUpper(opt);
994 
995  // The option NOPOTNORM disables POT normalization
996  if (drawUtils::CheckOption(uopt,"NOPOTNORM")){
997  norm=1;
998  }
999  // By default POT normalization is used unless a valid normalization factor is given
1000  else if (norm<=0 && sample1 && sample2){
1001  norm = GetPOTRatio(*sample1, *sample2);
1002  }
1003  // When norm>0 and the POTNORM option is given, the second sample is normalized to the POT indicated by norm, regardless of the POT of sample 1
1004  else if (norm>0 && sample2 && drawUtils::CheckOption(uopt,"POTNORM")){
1005  norm = GetPOTRatio(*sample2, *sample2, norm); // sample1 may not exist, thus we give sample2 as dummy first argument
1006  }
1007  // otherwise, if the factor is still negative don't normalize
1008  else if (norm<=0)
1009  norm=1;
1010 
1011 
1012  // Otherwise the normalization factor is used to directly scale sample2 regardless of its POT
1013  return norm;
1014 }
double GetPOTRatio(DataSample &sample1, DataSample &sample2, double POTsample1_byhand=-1)
std::string ToUpper(const std::string &str)
Definition: DrawingUtils.cxx:9
bool CheckOption(const std::string &uopt, const std::string &this_opt)
Check if specific option exists, and if so if it appears in option field.

§ GetPOTRatio() [1/2]

double DrawingTools::GetPOTRatio ( DataSample sample1,
DataSample sample2,
double  POTsample1_byhand = -1 
)

Print out the ratio of POTs used to create these DataSample objects. Ratio is set to 1 if either the numerator or denominator are 0.

Definition at line 934 of file DrawingTools.cxx.

934  {
935 //*********************************************************
936 
937  // so we must update it's values for the sample1 and sample2.
938 
939 
940  // Three options
941  // 1. sample1 and sample2 have standard POT values from the original files
942  // 2. either sample1 or sample2 have POT set by hand when creating the samples
943  // 3. there is no sample1 and sample2 is normalised to a POT value pass by argument to the drawing method (POTsample1p)
944 
945  double POTsample1 = POTsample1_byhand;
946  if (POTsample1<0){
947  POTsample1 = sample1.GetNorm();
948  if (POTsample1==0){
949  POTsample1 = sample1.GetPOT();
950  }
951  }
952 
953  double POTsample2 = sample2.GetNorm();
954  if (POTsample2==0 || POTsample2==1){
955 
956  // TODO: The sand muon factor. To be moved somewhere else
957  double sandFactor = 1;
958 #if !VERSION_HAS_OFFICIAL_POT
959  if (POTsample2==1)
960  sandFactor = 2.5e17;
961 #endif
962 
963  POTsample2 = sandFactor*sample2.GetPOT();
964  }
965 
966  double ratio;
967 
968  if (POTsample2 == 0) {
969  std::cout << "Warning: denominator in POT ratio is zero! Setting ratio to 1." << std::endl;
970  ratio = 1.;
971  } else if (POTsample1 == 0) {
972  std::cout << "Warning: numerator in POT ratio is zero! Setting ratio to 1." << std::endl;
973  ratio = 1.;
974  } else {
975  ratio = POTsample1 / POTsample2;
976  }
977 
978  return ratio;
979 }
Double_t GetPOT()
This is the method used externaly. It corresponds to POT that passed beam and ND280 quality cuts...
Definition: Header.hxx:36

§ GetPOTRatio() [2/2]

double DrawingTools::GetPOTRatio ( Experiment exp)

Print out the ratio of POTs between data and MC in this Experiment Ratio is set to 1 if either the numerator or denominator are 0.

Definition at line 982 of file DrawingTools.cxx.

982  {
983 //*********************************************************
984  return exp.GetOverallPOTRatio();
985 }
Float_t GetOverallPOTRatio()
Get the overall POT ratio.
Definition: Experiment.cxx:346

§ PrintPurities() [1/2]

void DrawingTools::PrintPurities ( DataSample data,
const std::string &  categ,
const std::string &  cut,
double  events_ratio = 1 
)

Print on the screen the purities for the different categories defined by "categ" and with cuts "cut". The expected number of events are also printed, after scaling by events_ratio.

Definition at line 185 of file DrawingTools.cxx.

185  {
186 //*********************************************************
187 
188  DrawingToolsBase::PrintPurities(sample.GetTree(), categ, GetCombinedCut(sample,cut), events_ratio);
189 }
void PrintPurities(TTree *tree, const std::string &categ, const std::string &cut, double events_ratio=1)

§ PrintPurities() [2/2]

void DrawingTools::PrintPurities ( Experiment exp,
const std::string &  categ,
const std::string &  cut,
const std::string &  opt = "" 
)

Print on the screen the purities for the different categories defined by "categ" and with cuts "cut". The expected number of events are also printed, after scaling by the data POT in the Experiment.

Definition at line 192 of file DrawingTools.cxx.

192  {
193 //*********************************************************
194 
195  // Read the categories from the config tree
196  ReadCategories(_config_file);
197 
198  if (!cat().HasCategory(categ) || categ =="all" ) {
199  std::cout << " ------------------------------------------ " << std::endl;
200  std::cout << " Invalid category " << categ << std::endl;
201  std::cout << " ------------------------------------------ " << std::endl;
202  return;
203  }
204 
205  std::string uopt = drawUtils::ToUpper(opt);
206 
207  int i=0;
208 
209  std::vector<TrackTypeDefinition>::iterator it;
210 
211  double dummy1, dummy2, nev1, nev2;
212  // Just to get the total number of events
213  dummy1 = GetEff(exp, false, dummy1, dummy2, nev1, nev2, cut, cut,"",uopt+" PUR");
214 
215  std::cout << " --------------------------------------------------------" << std::endl;
216  std::cout << " Experiment Purities (not POT normalized): " << std::endl;
217  std::cout << " Category: " << categ << std::endl;
218  std::cout << " Cut: " << cut << std::endl;
219  std::cout << " Events: " << nev1 << std::endl;
220  std::cout << " --------------------------------------------------------" << std::endl;
221 
222  // define stuff to print % on the legend
223  std::ostringstream percstr, str_tmp;
224  const int ntypes = (const int)cat().GetCategoryTypes(categ).size();
225  std::string* cattypes = new std::string[ntypes]; // to initialize with const dimension
226  int* catcodes = new int[ntypes]; // to initialize with const dimension
227  int* catcolors = new int[ntypes]; // to initialize with const dimension
228  int itype=0;
229 
230  for (it=cat().GetCategoryTypes(categ).begin();it!=cat().GetCategoryTypes(categ).end();it++, i++){
231  std::string type = it->_name;
232  std::string code = drawUtils::GetString(it->_code);
233 
234  std::string cut2 = categ+"=="+code;
235 
236  double frac = GetEff(exp, false, dummy1, dummy2, nev1, nev2, cut2, cut,"",uopt+" PUR");
237 
238  std::cout << std::setprecision(8) << std::setw(25) << type << std::setw(12) << frac*100. << " % (" << nev1 << " events)" << std::endl;
239 
240  // create categ_temp to print % on the legend
241  percstr.str(std::string()); // to clear it
242  percstr << std::setprecision(2) << std::fixed << frac*100.; // round to 2 decimal
243  str_tmp.str(std::string()); // to clear it
244  str_tmp << it->_name << std::setw(8) << percstr.str() << " %"; // tab
245  cattypes[itype] = str_tmp.str();
246  catcodes[itype] = it->_code;
247  catcolors[itype] = it->_color;
248  itype++;
249  }
250 
251  // create categories with % in the name
252  bool multi = cat().GetCategory(categ).IsMultiType();
253  bool noWarning = true, addNOTRUTH = false, addSAND = false;
254  cat().AddCategory(categ+"_withPurities",itype,cattypes,catcodes,catcolors,multi,noWarning,addNOTRUTH,addSAND);
255 
256  std::cout << " --------------------------------------------------------" << std::endl;
257  std::cout << std::endl;
258 
259  return;
260 }
bool IsMultiType()
Is this a multi-type category ? (Can several types coexist?)
void AddCategory(const std::string &name, int ntypes, std::string *names, int *codes, int *colors, bool multi=false, bool noWarning=false, bool addNOTRUTH=true, bool addSAND=true)
TrackCategoryDefinition & GetCategory(const std::string &categ)
Get a specific category.
std::string GetString(int code)
convert integer to string
std::vector< TrackTypeDefinition > & GetCategoryTypes(const std::string &categ)
Get the vector of track types in a given category.
std::string ToUpper(const std::string &str)
Definition: DrawingUtils.cxx:9
void ReadCategories(const std::string &file)
bool HasCategory(const std::string &categ_name)
Check whether a category has been defined.

The documentation for this class was generated from the following files: