ROOTANA
Loading...
Searching...
No Matches
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"
8
9const 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
27public:
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.
61 void UpdateCanvasHistograms(TDataContainer& dataContainer){;};
62
63
64private:
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.
TGraph * fSummaryGraphSingle[gMaxSubCanvasesMuCa]
bool fHasGraphSingle[gMaxSubCanvasesMuCa]
TH2 * fSummaryHisto2D[gMaxSubCanvasesMuCa]
void ResetCanvasHistograms()
Reset the histograms for this canvas.
void AddHistoSingle(TH1 *histo, int index)
void AddHisto2D(TH2 *histo, int index)
TH1 * fSummaryHistoSingle[gMaxSubCanvasesMuCa]
bool fHasHisto2D[gMaxSubCanvasesMuCa]
bool fHasHistoSingle[gMaxSubCanvasesMuCa]
void AddGraphSingle(TGraph *graph, int index)