ROOTANA
TMulticanvas.h
Go to the documentation of this file.
1 #ifndef TMultiCanvas_h
2 #define TMultiCanvas_h
3 
4 #include "TGraph.h"
5 #include "TH1.h"
6 #include "TH2.h"
7 #include "TCanvasHandleBase.hxx"
8 
9 const int gMaxSubCanvasesMuCa = 4;
10 
11 /// This is a canvas to display a set of four histograms.
12 ///
13 /// The class also supports adding single histograms or graphs, if you want a
14 /// canvas that mixes plots for a part of detector with overall summary plots.
16 
17  private:
18 
22 
26 
27 public:
28 
29  TMulticanvas(std::string CanvasName = "Multi Canvas");
30 
31 
32 
33 
34  void AddHisto2D(TH2 *histo, int index){
35  if(index >= 0 && index < gMaxSubCanvasesMuCa){
36  fSummaryHisto2D[index] = histo;
37  fHasHisto2D[index] = true;
38  }
39  }
40 
41  void AddHistoSingle(TH1 *histo, int index){
42  if(index >= 0 && index < gMaxSubCanvasesMuCa){
43  fSummaryHistoSingle[index] = histo;
44  fHasHistoSingle[index] = true;
45  }
46  }
47 
48  void AddGraphSingle(TGraph *graph, int index){
49  if(index >= 0 && index < gMaxSubCanvasesMuCa){
50  fSummaryGraphSingle[index] = graph;
51  fHasGraphSingle[index] = true;
52  }
53  }
54 
55 
56  /// Plot the histograms for this canvas for a particular index;
57  void PlotCanvas(TDataContainer& dataContainer, TRootEmbeddedCanvas *embedCanvas);
58 
59  // Don't do anything here; let deap ana manager handle updating/resetting.
60  void ResetCanvasHistograms();
61  void UpdateCanvasHistograms(TDataContainer& dataContainer){;};
62 
63 
64 private:
65 
66 
67 };
68 
69 
70 
71 #endif
72 
const int gMaxSubCanvasesMuCa
Definition: TMulticanvas.h:9
void PlotCanvas(TDataContainer &dataContainer, TRootEmbeddedCanvas *embedCanvas)
Plot the histograms for this canvas for a particular index;.
void UpdateCanvasHistograms(TDataContainer &dataContainer)
Update the histograms for this canvas.
Definition: TMulticanvas.h:61
TGraph * fSummaryGraphSingle[gMaxSubCanvasesMuCa]
Definition: TMulticanvas.h:21
bool fHasGraphSingle[gMaxSubCanvasesMuCa]
Definition: TMulticanvas.h:25
TH2 * fSummaryHisto2D[gMaxSubCanvasesMuCa]
Definition: TMulticanvas.h:20
void ResetCanvasHistograms()
Reset the histograms for this canvas.
void AddHistoSingle(TH1 *histo, int index)
Definition: TMulticanvas.h:41
void AddHisto2D(TH2 *histo, int index)
Definition: TMulticanvas.h:34
TH1 * fSummaryHistoSingle[gMaxSubCanvasesMuCa]
Definition: TMulticanvas.h:19
TMulticanvas(std::string CanvasName="Multi Canvas")
Definition: TMulticanvas.cxx:4
bool fHasHisto2D[gMaxSubCanvasesMuCa]
Definition: TMulticanvas.h:23
bool fHasHistoSingle[gMaxSubCanvasesMuCa]
Definition: TMulticanvas.h:24
void AddGraphSingle(TGraph *graph, int index)
Definition: TMulticanvas.h:48