#ifndef HEP_HepDataMCPlotter
#define HEP_HepDataMCPlotter
#ifndef HEP_HepDataMCPlot
#include <HepDataMCPlot.h>
#endif
#ifndef HEP_HepDataMCFolder
#include <HepDataMCFolder.h>
#endif
#ifndef HEP_HepNtuplePlotCmd
#include <HepNtuplePlotCmd.h>
#endif
#ifndef ROOT_TTask
#include <TTask.h>
#endif
#ifndef ROOT_TList
#include <TList.h>
#endif
#ifndef ROOT_TDirectory
#include <TDirectory.h>
#endif
#ifndef ROOT_TH1F
#include <TH1F.h>
#endif
#ifndef TROOT
#include <TROOT.h>
#endif
#ifndef TStyle
#include <TStyle.h>
#endif
class TFile;
class TKey;
class TSystem;
class HepDataMCSample;
class TObjString;
class TCanvas;
class TROOT;
class TObjArray;
class HepDataMCPlotter : public TTask {
private:
TFile *fOutputRootFile;
TList *fListOfDataFileNames;
TList *fListOfDataFiles;
TList *fListOfPlots;
TList *fListOfInFiles;
TList *fNtuplePlotCmds;
TList *fMCSamples;
TList *fMCSingleSamples;
TList *fMCFolders;
Float_t fLumiDATA;
TString *fExportDir;
TString fAtlasLabelStatus;
TString fCenterOfMassEnergyLabel;
TString fLuminosityLabel;
Bool_t fExportROOT;
Bool_t fExportEPS;
Bool_t fExportPS;
Bool_t fExportPDF;
Bool_t fExportPNG;
Bool_t fExportC;
Bool_t fDrawLegend;
Bool_t fGroupHistograms;
Bool_t fUnifyMCStack;
Bool_t fDrawMCError;
Bool_t fDrawDataZeroEntryErrors;
Bool_t fLogyaxis;
Bool_t fDrawCMSLumiAtlasLabel;
Bool_t fUseAtlasStyle;
Bool_t fUseOverflowUnderflow;
Bool_t fDrawSignalOverlay;
Float_t fScaleOverlay;
public:
HepDataMCPlotter(const char* name, const char* title);
virtual ~HepDataMCPlotter();
void InitInput();
virtual void Exec(Option_t *option = "");
HepDataMCPlot* BuildNtuplePlot(HepNtuplePlotCmd *cmd) const;
void AddDataFile(const char* path, const char* label);
HepDataMCSample* AddMCSample(const char* path, const char* label, Color_t color,
Style_t line_style, Width_t line_width,
Style_t fill_style);
HepDataMCSample* AddMCSample(const char* path, const char* label, Color_t color);
HepDataMCSample* AddMCSample(const char* path, const char* label, Float_t xsec,
Color_t color);
HepDataMCSample* AddMCSample(const char* folder_name, const char* path, const char* label,
Float_t xsec, Color_t color);
HepDataMCSample* AddMCSample(HepDataMCFolder *folder, const char* path, const char* label,
Float_t xsec, Color_t color);
void AddMCFolder(const char* name, const char* title, Color_t color);
void AddNtuplePlotCmd(const char* TreeName, const char* VarExp,
const char* Selection, const char* PlotName,
const char* PlotTitle, Int_t Nbins,
Double_t Xlow, Double_t Xup,
const char* XTitle, const char* YTitle);
void Export(HepDataMCPlot *Plot, TNamed *PlotName);
inline TList* GetListOfPlots() { return fListOfPlots; }
inline void SetLumiDATA(Float_t lumi)
{ fLumiDATA = lumi; }
inline void SetWorkingDir(const char* dir)
{ SetExportDir(dir); }
inline void SetExportDir(const char* dir) {
fExportDir->Remove(0);
fExportDir->Append(dir);
}
Bool_t GetExportROOT() { return fExportROOT; }
Bool_t GetExportEPS() { return fExportEPS; }
Bool_t GetExportPS() { return fExportPS; }
Bool_t GetExportPDF() { return fExportPDF; }
Bool_t GetExportPNG() { return fExportPNG; }
Bool_t GetExportC() { return fExportC; }
Bool_t GetDrawLegend() { return fDrawLegend; }
Bool_t GetGroupHistograms() { return fGroupHistograms; }
Bool_t GetUnifyMCStack() { return fUnifyMCStack; }
Bool_t GetDrawMCError() { return fDrawMCError; }
Bool_t GetDrawDataZeroEntryErrors() { return fDrawDataZeroEntryErrors; }
Bool_t GetLogyaxis() { return fLogyaxis; }
void SetExportROOT(Bool_t ExportROOT) {
fExportROOT = ExportROOT;
}
void SetExportEPS(Bool_t ExportEPS) {
fExportEPS = ExportEPS;
}
void SetExportPS(Bool_t ExportPS) {
fExportPS = ExportPS;
}
void SetExportPDF(Bool_t ExportPDF) {
fExportPDF = ExportPDF;
}
void SetExportPNG(Bool_t ExportPNG) {
fExportPNG = ExportPNG;
}
void SetExportC(Bool_t ExportC) {
fExportC = ExportC;
}
void SetDrawLegend(Bool_t DrawLegend) {
fDrawLegend = DrawLegend;
}
void SetGroupHistograms(Bool_t GroupHistograms);
void SetUnifyMCStack(Bool_t UnifyMCStack);
void SetDrawMCError(Bool_t DrawMCError);
void SetDrawDataZeroEntryErrors(Bool_t DrawDataZeroEntryErrors = kTRUE);
void SetLogyaxis(Bool_t Logyaxis);
void SetUseOverflowUnderflow(Bool_t status);
void SetDrawSignalOverlay(Bool_t status);
void SetScaleOverlay(Float_t scale);
void SetUseAtlasStyle(Bool_t UseAtlasStyle = kTRUE) {
fUseAtlasStyle = UseAtlasStyle;
}
Bool_t GetUseAtlasStyle(){ return fUseAtlasStyle;}
inline void SetDrawCMSLumiAtlasLabel(Bool_t DrawCMSLumiAtlasLabel = kTRUE){
fDrawCMSLumiAtlasLabel = DrawCMSLumiAtlasLabel;
}
inline Bool_t GetDrawCMSLumiAtlasLabel(){return fDrawCMSLumiAtlasLabel;}
inline void SetAtlasLabelStatus(TString AtlasLabelStatus){
fAtlasLabelStatus = AtlasLabelStatus;
}
inline TString GetAtlasLabelStatus(){ return fAtlasLabelStatus;}
inline void SetCenterOfMassEnergyLabel(TString CenterOfMassEnergy){
fCenterOfMassEnergyLabel = CenterOfMassEnergy;
}
inline TString GetCenterOfMassEnergyLabel(){ return fCenterOfMassEnergyLabel;}
inline void SetLuminosityLabel(TString Luminosity){
fLuminosityLabel = Luminosity;
}
inline TString GetLuminosityLabel(){ return fLuminosityLabel;}
private:
void ReadHistogramsFromDir(TDirectory *dir);
void BuildListOfPlots();
HepDataMCPlot* BuildPlot(TNamed *PlotName);
TDirectory* MkDirWithParents(TFile *f, const char* dir);
void Normalize(TH1F &h, HepDataMCSample *sample, Float_t LumiScale = 1.) const;
TH1F* GetHistFromFile(TFile *f, TNamed *PlotName);
HepDataMCPlot* CreatePlotFromHist(TH1F* h) const;
void AddHistMC(HepDataMCPlot *plot, TH1F *h,
HepDataMCSample *mc_sample,
HepDataMCFolder *folder = 0,
Float_t LumiScale = 1.) const;
ClassDef(HepDataMCPlotter,3)
};
#endif