1 #ifndef DrawingToolsBase_h 2 #define DrawingToolsBase_h 23 #include <TDirectory.h> 25 #include <TPaveStats.h> 27 #include <TGraphAsymmErrors.h> 29 #include <TLegendEntry.h> 30 #include "HistoStack.hxx" 35 #include "CategoryManager.hxx" 36 #include "SelectionManager.hxx" 37 #include "CorrectionManager.hxx" 38 #include "ConfigurationManager.hxx" 39 #include "SystematicManager.hxx" 40 #include "DocStringManager.hxx" 41 #include "VersionManager.hxx" 43 #include "SystematicTools.hxx" 44 #include "ConfigTreeTools.hxx" 47 const int NAUTOCOLORS=10;
48 const int NMAXAUTOCOLORS=30;
49 const int NMAXTYPES = 30;
50 const int NMAXBINS = 5001;
70 TH1_h* AddErrorsInQuadrature(TH1_h* h1,TH1_h* h2,
const std::string& opt=
"");
82 double GetEntries(TTree* tree,
const std::string& cut);
85 double GetEntries(TTree* tree,
const std::string& cut,
const std::string& var,
const std::string& opt =
"",
int toy_ref = -1);
88 void ScaleHisto(TH1* h,
double scale,
bool scale_errors=
true);
104 void PrintEventNumbers(TTree* tree,
const std::string& cut,
const std::string& file=
"",
int toy_ref=-1);
107 std::string
FormatCut(
const std::string& cut);
110 std::string
AddRangeCut(
const std::string& var,
int nx,
double* xbins,
int ny,
double* ybins,
const std::string& cut,
const std::string& uopt);
123 TH1*
Draw(TTree* tree,
const std::string& var,
int nbins,
double* xbins,
const std::string& categ=
"all",
124 const std::string& cut=
"",
const std::string& root_opt=
"",
const std::string& opt=
"",
double norm=1,
bool scale_errors=
true);
125 TH1*
Draw(TTree* tree,
const std::string& var,
int nbins,
double xmin,
double xmax,
const std::string& categ=
"all",
126 const std::string& cut=
"",
const std::string& root_opt=
"",
const std::string& opt=
"",
double norm=1,
bool scale_errors=
true);
129 TH1*
Draw(TTree* tree,
const std::string& var,
int nx,
double* xbins,
int ny,
double* ybins,
130 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);
131 TH1*
Draw(TTree* tree,
const std::string& var,
int nx,
double xmin,
double xmax,
int ny,
double ymin,
double ymax,
132 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);
135 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);
138 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);
140 void Draw(TTree* tree,
const std::string& var,
int nx,
double* xbins,
int ny,
double* ybins,
141 const std::string& idvar, std::vector<int> idSel, std::vector<std::string> idName, std::vector<int> idColor,
142 const std::string& cut=
"",
const std::string& root_opt=
"",
const std::string& opt=
"",
double norm=1,
bool scale_errors=
true);
145 void Draw(TTree* tree_mc, TTree* tree_data,
const std::string& var,
int nx,
double* xbins,
int ny,
double* ybins,
146 const std::string& idvar, std::vector<int> idSel, std::vector<std::string> idName, std::vector<int> idColor,
147 const std::string& cut=
"",
const std::string& root_opt=
"",
const std::string& opt=
"",
double norm=1,
bool scale_errors=
true);
154 double GetEff(TTree* tree,
const std::string& var,
double xmin,
double xmax,
155 const std::string& cut1,
const std::string& cut2,
const std::string& root_opt =
"",
const std::string& opt =
"");
159 double GetEff(TTree* tree,
const std::string& var,
double xmin,
double xmax,
double& errlow,
double& errhigh,
160 const std::string& cut1,
const std::string& cut2,
const std::string& root_opt =
"",
const std::string& opt =
"");
165 void DrawRatio(TTree* tree,
const std::string& var,
int nbins,
double* xbins,
166 const std::string& cut1,
const std::string& cut2,
const std::string& root_opt=
"",
const std::string& opt=
"",
const std::string& leg=
"");
167 void DrawRatio(TTree* tree,
const std::string& var,
int nx,
double xmin,
double xmax,
168 const std::string& cut1,
const std::string& cut2,
const std::string& root_opt=
"",
const std::string& opt=
"",
const std::string& leg=
"");
175 void DrawEff(TTree* tree,
const std::string& var,
int nbins,
double* xbins,
const std::string& cut1,
const std::string& cut2,
176 const std::string& root_opt=
"",
const std::string& opt=
"",
const std::string& leg=
"");
177 void DrawEff(TTree* tree,
const std::string& var,
int nx,
double xmin,
double xmax,
const std::string& cut1,
const std::string& cut2,
178 const std::string& root_opt=
"",
const std::string& opt=
"",
const std::string& leg=
"");
182 void DrawDoubleEff(TTree* tree1, TTree* tree2,
const std::string& var,
int nx,
double* xbins,
183 const std::string& cut1,
const std::string& cut2,
const std::string& root_opt=
"",
const std::string& opt=
"",
const std::string& leg=
"");
185 void DrawDoubleEff(TTree* tree1, TTree* tree2,
const std::string& var,
int nx,
double xmin,
double xmax,
186 const std::string& cut1,
const std::string& cut2,
const std::string& root_opt=
"",
const std::string& opt=
"",
const std::string& leg=
"");
190 void DrawSignificance(TTree* tree,
const std::string& var,
int nbins,
double* xbins,
const std::string& cut1,
const std::string& cut2,
191 double norm=1,
double rel_syst=0,
const std::string& root_opt=
"",
const std::string& opt=
"",
const std::string& leg=
"");
192 void DrawSignificance(TTree* tree,
const std::string& var,
int nbins,
double xmin,
double xmax,
const std::string& cut1,
const std::string& cut2,
193 double norm=1,
double rel_syst=0,
const std::string& root_opt=
"",
const std::string& opt=
"",
const std::string& leg=
"");
197 void DrawGraph(TGraphAsymmErrors* eff,
int nbins,
double* xbins,
198 const std::string& uroot_opt,
const std::string& uopt,
const std::string& leg,
double ymax=1.05);
200 void DumpGraph(TGraphAsymmErrors* graph,
int nbins,
const std::string& uopt);
206 TH1_h*
GetEventsVSCut(TTree* tree,
const std::string& var,
const std::string& cut_norm,
int isel,
int branch,
int& first_cut,
int& last_cut,
207 const std::string& root_opt=
"",
const std::string& opt=
"");
211 void DrawEventsVSCut(TTree* tree,
const std::string& cut_norm=
"",
int first_cut=-1,
int last_cut=-1,
212 const std::string& root_opt=
"",
const std::string& opt=
"",
const std::string& leg=
"");
215 void DrawEventsVSCut(TTree* tree,
int branch,
const std::string& cut_norm=
"",
int first_cut=-1,
int last_cut=-1,
216 const std::string& root_opt=
"",
const std::string& opt=
"",
const std::string& leg=
"");
219 void DrawEventsVSCut(TTree* tree,
int isel,
int branch,
const std::string& cut_norm=
"",
int first_cut=-1,
int last_cut=-1,
220 const std::string& root_opt=
"",
const std::string& opt=
"",
const std::string& leg=
"");
224 void DrawRatioVSCut(TTree* tree1, TTree* tree2,
const std::string& precut=
"",
int first_cut=-1,
int last_cut=-1,
225 const std::string& root_opt=
"",
const std::string& opt=
"",
const std::string& leg=
"",
double norm=1.);
228 void DrawRatioVSCut(TTree* tree1, TTree* tree2,
int branch,
const std::string& precut=
"",
int first_cut=-1,
int last_cut=-1,
229 const std::string& root_opt=
"",
const std::string& opt=
"",
const std::string& leg=
"",
double norm=1.);
232 void DrawRatioVSCut(TTree* tree1, TTree* tree2,
int isel,
int branch,
const std::string& precut=
"",
int first_cut=-1,
int last_cut=-1,
233 const std::string& root_opt=
"",
const std::string& opt=
"",
const std::string& leg=
"",
double norm=1.);
237 void DrawEffVSCut(TTree* tree,
const std::string& signal=
"",
const std::string& precut=
"",
int first_cut=-1,
int last_cut=-1,
238 const std::string& root_opt=
"",
const std::string& opt=
"",
const std::string& leg=
"");
241 void DrawEffVSCut(TTree* tree,
int branch,
const std::string& signal=
"",
const std::string& precut=
"",
int first_cut=-1,
int last_cut=-1,
242 const std::string& root_opt=
"",
const std::string& opt=
"",
const std::string& leg=
"");
245 void DrawEffVSCut(TTree* tree,
int isel,
int branch,
const std::string& signal=
"",
const std::string& precut=
"",
int first_cut=-1,
int last_cut=-1,
246 const std::string& root_opt=
"",
const std::string& opt=
"",
const std::string& leg=
"");
250 void DrawPurVSCut(TTree* tree,
const std::string& signal=
"",
const std::string& precut=
"",
int first_cut=-1,
int last_cut=-1,
251 const std::string& root_opt=
"",
const std::string& opt=
"",
const std::string& leg=
"");
254 void DrawPurVSCut(TTree* tree,
int branch,
const std::string& signal=
"",
const std::string& precut=
"",
int first_cut=-1,
int last_cut=-1,
255 const std::string& root_opt=
"",
const std::string& opt=
"",
const std::string& leg=
"");
258 void DrawPurVSCut(TTree* tree,
int isel,
int branch,
const std::string& signal=
"",
const std::string& precut=
"",
int first_cut=-1,
int last_cut=-1,
259 const std::string& root_opt=
"",
const std::string& opt=
"",
const std::string& leg=
"");
263 void DrawRatioVSCut(TH1_h* h1, TH1_h* h2,
int isel,
int branch,
int first_cut,
264 const std::string& root_opt,
const std::string& opt,
const std::string& leg);
272 void DrawToys(TTree* tree,
const std::string& cut=
"",
const std::string& root_opt=
"",
const std::string& opt=
"",
const std::string& leg=
"");
276 void DrawToysRatio(TTree* tree1, TTree* tree2,
const std::string& cut=
"",
277 const std::string& root_opt=
"",
const std::string& opt=
"",
const std::string& leg=
"",
double norm=1);
281 void DrawToysRatioTwoCuts(TTree* tree1, TTree* tree2,
const std::string& cut1,
const std::string& cut2,
282 const std::string& root_opt=
"",
const std::string& opt=
"",
const std::string& leg=
"",
double norm=1);
287 void DrawToysBase(TH1_h& result, TH1_h& entries,
const std::string& root_opt=
"",
const std::string& opt=
"",
const std::string& leg=
"");
290 void DrawVariations(
const std::string& name, Int_t ipar=-1,
int nx=100,
double xmin=-5,
double xmax=5,
291 const std::string& root_opt=
"",
const std::string& opt=
"",
const std::string& leg=
"");
298 void Draw(TTree* tree1, TTree* tree2,
const std::string& var,
int nx,
double xmin,
double xmax,
299 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);
300 void Draw(TTree* tree1, TTree* tree2,
const std::string& var,
int nbins,
double* xbins,
301 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);
304 void Draw(TTree* tree1, TTree* tree2,
const std::string& var,
int nx,
double xmin,
double xmax,
int ny,
double ymin,
double ymax,
305 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);
306 void Draw(TTree* tree1, TTree* tree2,
const std::string& var,
int nx,
double* xbins,
int ny,
double* ybins,
307 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);
311 void DrawRatio(TTree* tree1, TTree* tree2,
const std::string& var,
int nx,
double xmin,
double xmax,
312 const std::string& cut=
"",
const std::string& root_opt=
"",
const std::string& opt=
"",
const std::string& leg=
"",
double norm=1);
313 void DrawRatio(TTree* tree1, TTree* tree2,
const std::string& var,
int nx,
double* xbins,
314 const std::string& cut=
"",
const std::string& root_opt=
"",
const std::string& opt=
"",
const std::string& leg=
"",
double norm=1);
316 void DrawRatioTwoCuts(TTree* tree1, TTree* tree2,
const std::string& var,
int nx,
double* xbins,
int ny,
double* ybins,
317 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);
321 void DrawRatioTwoCuts(TTree* tree1, TTree* tree2,
const std::string& var,
int nx,
double xmin,
double xmax,
322 const std::string& cut1,
const std::string& cut2,
const std::string& root_opt=
"",
const std::string& opt=
"",
const std::string& leg=
"",
double norm=1);
323 virtual void DrawRatioTwoCuts(TTree* tree1, TTree* tree2,
const std::string& var,
int nx,
double* xbins,
324 const std::string& cut1,
const std::string& cut2,
const std::string& root_opt=
"",
const std::string& opt=
"",
const std::string& leg=
"",
double norm=1);
327 void DrawRatio(TH1_h* ratio,
const std::string& root_opt,
const std::string& uopt,
const std::string& leg);
329 void Project(
HistoStack* hs1,
HistoStack* hs2, TTree* tree1, TTree* tree2,
const std::string& var,
int nx,
double* xbins,
int ny,
double* ybins,
330 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);
333 void ProjectNew(
HistoStack* hs1,
HistoStack* hs2, TTree* tree1, TTree* tree2,
const std::string& var,
int nx,
double* xbins,
int ny,
double* ybins,
334 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);
339 void DumpHisto(TH1* histo,
const std::string& uopt);
344 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);
345 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);
346 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);
347 void DrawHisto(TH3F* h,
int lc,
int lw,
int fc,
int fs,
const std::string& opt=
"");
349 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);
351 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);
354 const std::string& categ,
const std::string& root_opt,
const std::string& opt,
double norm);
357 const std::string& root_opt,
const std::string& opt,
double norm,
const std::string& leg=
"");
360 void Project(
HistoStack* hs,
const std::string& sample_name, TTree* tree,
const std::string& var,
int nx,
double* xbins,
int ny,
double* ybins,
361 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);
363 void Project(
HistoStack* hs, TTree* tree,
const std::string& var,
int nx,
double* xbins,
int ny,
double* ybins,
364 const std::string& idVar, std::vector<int> idSel, std::vector<std::string> idName, std::vector<int> idColor,
365 const std::string& cut=
"",
const std::string& root_opt=
"",
const std::string& opt=
"",
double norm=1,
bool scale_errors=
true);
369 TH1_h* GetHisto(TTree* tree,
const std::string& name,
const std::string& var,
int nx,
double* xbins,
370 const std::string& cut,
const std::string& root_opt,
const std::string& opt,
double scale,
bool scale_errors=
true,
int toy_ref=-1);
372 virtual TH2_h* GetHisto(TTree* tree,
const std::string& name,
const std::string& var,
int nx,
double* xbins,
int ny,
double* ybins,
373 const std::string& cut,
const std::string& root_opt,
const std::string& opt,
double scale,
bool scale_errors=
true,
int toy_ref=-1);
375 virtual TH1_h* GetHisto(
HistoStack* hs, TTree* tree,
const std::string& name,
const std::string& var,
int nx,
double* xbins,
376 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);
378 TH1_h* GetHisto(
HistoStack* hs, TTree* tree,
const std::string& name,
const std::string& var,
int nx,
double* xbins,
379 const std::string& cut,
const std::string& root_opt,
const std::string& opt,
double scale,
bool scale_errors=
true,
int toy_ref=-1);
384 virtual TH1_h* GetRatioHisto(TTree* tree1, TTree* tree2,
const std::string& name,
const std::string& var,
int nx,
double* xbins,
385 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 toy_ref=-1);
387 virtual void FillHistoErrors(
HistoStack* hs1,
HistoStack* hs2, TTree* tree1,TTree* tree2,
const std::string& name,
const std::string& var,
int nx,
double* xbins,
388 const std::string& cut1,
const std::string& cut2,
const std::string& opt,
double norm, TH1_h* hstat, TH1_h*& hsyst);
390 virtual void FillHistoErrors(
HistoStack* hs1,
HistoStack* hs2, TH1_h* histo,
const std::string uopt);
394 const std::string& cut1,
const std::string& cut2,
const std::string& opt,
double norm);
396 virtual void FillGraphErrors(
HistoStack* hs1,
HistoStack* hs2, TGraphAsymmErrors* graph,
const std::string uopt);
403 std::cout <<
"x = " << _legendPos[0]
404 <<
", y = " << _legendPos[1]
405 <<
", width = " << _legendSize[0]
406 <<
", height = " << _legendSize[1]
409 void DumpSmallLegendPos() {
410 std::cout <<
"x = " << _legendPos[0]
411 <<
", y = " << _legendPos[1]
412 <<
", width = " << _legendSmallSize[0]
413 <<
", height = " << _legendSmallSize[1]
432 void SetSmallLegendSize(
double w = -999,
double h = -999){
if (w != -999) _legendSmallSize[0] = w;
if (h != -999) _legendSmallSize[1] = h;}
436 double GetLegendY() {
return _legendPos[1]; }
437 double GetLegendW() {
return _legendSize[0]; }
438 double GetLegendH() {
return _legendSize[1]; }
439 double GetSmallLegendX() {
return _legendPos[0]+_legendSize[0]-_legendSmallSize[0]; }
440 double GetSmallLegendY() {
return _legendPos[1]+_legendSize[1]-_legendSmallSize[1]; }
441 double GetSmallLegendW() {
return _legendSmallSize[0]; }
442 double GetSmallLegendH() {
return _legendSmallSize[1]; }
450 double GetStatH() {
return gStyle->GetStatW(); }
451 void SetStatSize(
double w = -999,
double h = -999) {
if (w != -999) gStyle->SetStatW(w);
if (h != -999) gStyle->SetStatH(h);}
455 double GetStatY() {
return gStyle->GetStatY(); }
456 void SetStatPos(
double x = -999,
double y = -999);
478 void SetLineColor(EColor kColor) { _line_color = kColor; }
482 void SetFillColor(EColor kColor) { _fill_color = kColor; }
488 void SetMCStatErrorColor(EColor kColor) { _mcstaterror_color = kColor; }
489 void SetMCStatErrorColor(
int color) { _mcstaterror_color = color; }
499 void SetEffDivideParams(
const std::string& params);
505 void SetTitleX(
const std::string& titleX){_titleX=titleX;}
508 void SetTitleY(
const std::string& titleY){_titleY=titleY;}
511 void SetTitle(
const std::string& title){_title=title;}
515 void SetDataLabel(
const std::string& label, Color_t color = kBlack) {_data_label = label; _data_color = color;}
519 void SetAllMCLabel(
const std::string& label, Color_t color = kBlack) {_allmc_label = label; _allmc_color = color;}
542 void SetLogY(
bool logY =
true);
545 void SetLogZ(
bool logZ =
true);
569 void DrawCutLineVertical(
double xval,
bool addarrow =
false, std::string arrowdir =
"l",
double arrowpos = 0.5);
579 void DrawCutLineHorizontal(
double yval,
bool addarrow =
false, std::string arrowdir =
"u",
double arrowpos = 0.5);
584 void DrawCutLine(
double xmin,
double ymin,
double xmax,
double ymax);
595 void DrawCutRegion(
double xmin,
double ymin,
double xmax,
double ymax, std::string opt =
"tblr");
600 void DrawCutArrow(
double xmin,
double ymin,
double xmax,
double ymax);
630 Header& header(){
return _header;}
666 void ReadSystematics(
const std::string& file){
727 void ChangeCategory(
const std::string& categ_name,
int ntypes, std::string* names,
int* codes,
int* colors);
766 void DumpCuts(
const std::string& sel_name,
int branch=-1);
770 void DumpSteps(
const std::string& sel_name,
int branch=-1);
774 void DumpCuts(Int_t sel_index,
int branch);
778 void DumpSteps(Int_t sel_index,
int branch);
782 std::vector<std::string>
GetCutNames(
const std::string& sel_name,
int branch=0) {
784 return std::vector<std::string>();
788 std::vector<std::string>
GetStepNames(
const std::string& sel_name,
int branch=0) {
790 return std::vector<std::string>();
794 std::vector<std::string>
GetCutNames(Int_t sel_index,
int branch) {
796 return std::vector<std::string>();
802 return std::vector<std::string>();
837 void DumpPOT(
const std::string& file);
851 void PrintPurities(TTree* tree,
const std::string& categ,
const std::string& cut,
double events_ratio = 1);
854 std::vector< TGraph* >
GetGraphs() {
return _saved_graphs; }
862 std::vector< TH1* >
GetHistos() {
return _saved_histos; }
868 void ChangeLegendEntry(Int_t index,
const std::string& new_label=
"",
const std::string& new_opt=
"");
880 std::cout <<
"If it crashes you should maybe use GetLastStackTotal instead.\n";
881 if (_saved_histos.back())
return _saved_histos.back();
882 else std::cout <<
"No histos found. You can try GetLastStackTotal \n";
return NULL;
888 std::cout <<
"If it crashes you should maybe use GetLastHisto instead.\n";
889 if ( ! _saved_histoStacks.back()) {
890 std::cout <<
"No histoStacks found. You can try GetLastHisto\n";
return NULL; }
892 if ((
int)_saved_histoStacks.size() <= nexttolast) {
895 HistoStack* s = _saved_histoStacks[(int)_saved_histoStacks.size() - nexttolast - 1];
907 if ( ! _saved_histoStacks.back()) {
908 std::cout <<
"No histoStacks found. You can try GetLastHisto\n";
return NULL; }
910 if ((
int)_saved_histoStacks.size() <= nexttolast) {
913 return _saved_histoStacks[(int)_saved_histoStacks.size() - nexttolast - 1];
917 return _saved_histoStacks.back();
951 void StartDocument(
const std::string& title,
bool pdf =
true,
bool web =
false,
const std::string& pdffile =
"plots.pdf",
const std::string& webpath =
"plots");
969 std::string ConvertCutForTruthTree(
const std::string cut,
bool replace_selmu =
true);
973 double GetChi2(
const TH1* h1,
const TH1* h2);
974 int GetNDOF(
const TH1* h1,
const TH1* h2);
975 double GetPvalue(
double chi2,
int ndof) {
return TMath::Prob(chi2,ndof);}
976 double GetPvalue(
const TH1* h1,
const TH1* h2) {
978 int ndof = GetNDOF(h1, h2);
979 return TMath::Prob(chi2,ndof);
993 std::vector<TLegend*> _legends;
996 double _legendParam[4];
997 double _legendSize[2];
998 double _legendPos[2];
999 double _legendSmallSize[2];
1001 std::string _legendPosS;
1003 int _stack_fill_style;
1004 bool _different_fill_styles;
1011 int _mcstaterror_color;
1012 double _marker_size;
1014 int _cut_line_width;
1015 std::string _titleX;
1016 std::string _titleY;
1018 Color_t _data_color;
1019 Color_t _allmc_color;
1020 std::string _data_label;
1021 std::string _allmc_label;
1022 std::string _allmcstat_label;
1023 std::string _allmcsyst_label;
1026 double _relativeMaxY;
1040 int _same_level_tot;
1041 int _auto_colors[NMAXAUTOCOLORS];
1042 int _auto_markers[NMAXAUTOCOLORS];
1045 std::vector< TH1* > _saved_histos;
1046 std::vector< TH2* > _saved_histos2D;
1047 std::vector< HistoStack* > _saved_histoStacks;
1048 std::vector< TGraph* > _saved_graphs;
1049 std::vector< TLine* > _cut_lines;
1054 TCanvas* _pdfcanvas;
1057 std::string _pdfpath;
1058 std::string _webpath;
1059 std::string _webheader;
1060 std::string _webbody;
1062 std::string _config_file;
1074 Int_t _minAccumLevelToSave;
void DumpConfigurations(SystematicManager *syst=NULL)
Dump summary info about all configurations.
std::vector< std::string > GetStepNames(Int_t ibranch=0) const
Return all the names of the steps, in the order they were added.
void DumpVariationSystematics()
Dump all variationSystematics.
void ExplainVar(const std::string &name, const std::string &tree_name)
Print the details of the specified variable in the given tree.
void DumpSystematics()
Dump all systematics.
void DumpCategories()
Dump the map of track categories.
The maximum number of systematics that is supported.
void ReadSelections(const std::string &file)
void ListVars(const std::string &tree_name)
List all the variables that were stored in this tree.
void DumpWeightSystematics()
Dump all weightSystematics.
void ExplainOption(OptionEnum opt)
Explain a given option given as enum.
void ReadDocStrings(const std::string &file)
void DumpCorrections()
Dump all corrections.
void ListOptions()
List sll valid options and a description of each of them.
void ReadConfigurations(const std::string &file)
Read configurations from a file.
std::vector< std::string > GetCutNames(Int_t ibranch=0) const
Return all the names of the cuts, in the order they were added.
void DumpCategory(const std::string &categ)
Dump the options stored for the given category.
void ReadSystematics(const std::string &file)
Read the systematics from a file.
SelectionBase * GetSelection(const std::string &name, bool print_error=true)
Return the selection that was registered with the given name. NULL if it does not exist...
void EnableAllWeightSystematics()
Enable all systematic weightSystematics.
TH1_h * GetTotal1D()
Return the total 1D histo.
void ReadCategories(const std::string &file)
Build the categories from a root file.
void EnableAllVariationSystematics()
Enable all variationSystematics.
void ReadCorrections(const std::string &file, bool input=false)
Readthe corrections from a file.