12 #include "DrawingUtils.hxx" 31 HistoStack(
const std::string& title,
const std::string& titleX,
const std::string& titleY);
45 void Add(TH1_h* h1,
int lc,
int lw,
int fc,
int fs,
const std::string& leg);
48 void Add(TH2_h* h2,
int fc,
int lc,
const std::string& leg=
"");
53 void Draw(
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);
56 void Draw(
const std::string& root_opt =
"",
const std::string& opt =
"");
79 void AddTotal(TH1_h* h1, TH1_h* hsyst=NULL);
85 void GetSystHistos(
const std::string& group, TH2_h*& h1, TH2_h*& h2, TH2_h*& h1w);
94 const std::string& GetCurrentSystGroup(){
return _currentSystGroup;}
187 std::string _currentSystGroup;
189 std::map<std::string,TH2_h*> _h1;
190 std::map<std::string,TH2_h*> _h1w;
191 std::map<std::string,TH2_h*> _h2;
void Draw(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)
TH2_h * GetHisto2D(const std::string &title)
Returns one of the histos in the 2D stack. The title is used for comparison.
void ResetDrawHistos()
delete all temporary histos used for drawing the stak (with variable binning normalization) ...
void AddTotal(TH1_h *h1, TH1_h *hsyst=NULL)
Sets the total 1D histo if it does not exists or adds to the previous one when it exists...
TH1_h * GetHisto1D(const std::string &title)
Returns one of the histos in the 1D stack. The title is used for comparison.
THStack * _stack
The root stack.
TH1_h * _hall1D_stat
The "total" 1D histogram with only stat errors.
void FillLegend(TLegend *leg)
Fill the legend with info in the HistoStack.
void AddSystHistosGroup(const std::string &group)
Add a new group of systemtic histos.
TH1_h * GetTotalStat1D()
Return the total 1D histo with only stat errors.
std::string _title
The title of the plot.
double GetMaximum(const std::string &opt="")
Get the maximum for the HistoStack.
TH1_h * GetTotalSyst1D()
Return the total 1D histo with only systematic errors.
void SetMinimum(double min)
Set the minimum for the HistoStack.
void SetCurrentSystGroup(const std::string &group)
Set the current Systematics group.
void NormalizeByArea(const std::string &uopt, double area=1)
normalize all histos in the stack by area
std::vector< std::string > _systHistosGroups
Histos for updating systematics when using several files.
HistoStack(const std::string &title, const std::string &titleX, const std::string &titleY)
std::vector< TH1_h * > _histos1D_draw
The TH1_hs that were added to the stack. Temporary histos used for drawing the stack (with variable b...
void SetMaximum(double max)
Set the maximum for the HistoStack.
TH1_h * _hall1D_syst
The "total" 1D histogram with only systematic errors.
void Add(TH1_h *h1, int lc, int lw, int fc, int fs, const std::string &leg)
Add a new 1D histogram to the stack, with fill colour "fc", line colour "lc".
bool Is1D()
Tells whether this is a 1D histo.
void Print() const
Dump the stack contents.
std::vector< std::string > GetSystHistosGroups() const
get the vector of groups of systemtic histos
TH1_h * _hall1D_draw
temporary histo used for drawing the total (with variable binning normalization)
std::vector< TH2_h * > _histos2D
The TH2_hs that were added to the stack.
void AddSystHistos(TH2_h *h1, TH2_h *h2, TH2_h *h1w)
Add histos for updating systematics when using several files.
double GetMaximumWithError(const std::string &opt="")
Get the maximum for the HistoStack taking into account the upper error.
void GetSystHistos(const std::string &group, TH2_h *&h1, TH2_h *&h2, TH2_h *&h1w)
Get Histos for updating systematics when using several files.
TH2_h * GetTotal2D()
Return the total 2D histo.
std::string _titleY
The title of the Y axis.
std::string _titleX
The title of the X axis.
std::vector< TH1_h * > _histos1D
The TH1_hs that were added to the stack.
TH1_h * GetTotal1D()
Return the total 1D histo.
bool Is2D()
Tells whether this is a 2D histo.