00001 #ifndef TMultiCanvas_h 00002 #define TMultiCanvas_h 00003 00004 #include "TGraph.h" 00005 #include "TH1.h" 00006 #include "TH2.h" 00007 #include "TCanvasHandleBase.hxx" 00008 00009 const int gMaxSubCanvasesMuCa = 4; 00010 00011 /// This is a canvas to display a set of four histograms. 00012 /// 00013 /// The class also supports adding single histograms or graphs, if you want a 00014 /// canvas that mixes plots for a part of detector with overall summary plots. 00015 class TMulticanvas : public TCanvasHandleBase { 00016 00017 private: 00018 00019 TH1 *fSummaryHistoSingle[gMaxSubCanvasesMuCa]; 00020 TH2 *fSummaryHisto2D[gMaxSubCanvasesMuCa]; 00021 TGraph *fSummaryGraphSingle[gMaxSubCanvasesMuCa]; 00022 00023 bool fHasHisto2D[gMaxSubCanvasesMuCa]; 00024 bool fHasHistoSingle[gMaxSubCanvasesMuCa]; 00025 bool fHasGraphSingle[gMaxSubCanvasesMuCa]; 00026 00027 public: 00028 00029 TMulticanvas(std::string CanvasName = "Multi Canvas"); 00030 00031 00032 00033 00034 void AddHisto2D(TH2 *histo, int index){ 00035 if(index >= 0 && index < gMaxSubCanvasesMuCa){ 00036 fSummaryHisto2D[index] = histo; 00037 fHasHisto2D[index] = true; 00038 } 00039 } 00040 00041 void AddHistoSingle(TH1 *histo, int index){ 00042 if(index >= 0 && index < gMaxSubCanvasesMuCa){ 00043 fSummaryHistoSingle[index] = histo; 00044 fHasHistoSingle[index] = true; 00045 } 00046 } 00047 00048 void AddGraphSingle(TGraph *graph, int index){ 00049 if(index >= 0 && index < gMaxSubCanvasesMuCa){ 00050 fSummaryGraphSingle[index] = graph; 00051 fHasGraphSingle[index] = true; 00052 } 00053 } 00054 00055 00056 /// Plot the histograms for this canvas for a particular index; 00057 void PlotCanvas(TDataContainer& dataContainer, TRootEmbeddedCanvas *embedCanvas); 00058 00059 // Don't do anything here; let deap ana manager handle updating/resetting. 00060 void ResetCanvasHistograms(){;}; 00061 void UpdateCanvasHistograms(TDataContainer& dataContainer){;}; 00062 00063 00064 private: 00065 00066 00067 }; 00068 00069 00070 00071 #endif 00072