ROOTANA
Loading...
Searching...
No Matches
TMulticanvas.cxx
Go to the documentation of this file.
1#include "TMulticanvas.h"
2
3
4TMulticanvas::TMulticanvas(std::string CanvasName): TCanvasHandleBase(CanvasName.c_str()){
5
6 for(int i = 0; i < gMaxSubCanvasesMuCa; i++){
7 fHasHistoSingle[i] = false;
8 fHasHisto2D[i] = false;
9 fHasGraphSingle[i] = false;
11 fSummaryHisto2D[i] = 0;
12 fSummaryGraphSingle[i] = 0;
13 }
14
15};
16
17
18/// Plot the histograms for this canvas for a particular index;
19/// this is the function that user must provide.
20void TMulticanvas::PlotCanvas(TDataContainer& dataContainer, TRootEmbeddedCanvas *embedCanvas){
21
22 TCanvas* c1 = embedCanvas->GetCanvas();
23 c1->Clear();
24 c1->Divide(2,2);
25 for(int i = 0; i < gMaxSubCanvasesMuCa; i++){
26
27 c1->cd(i+1);
28
29 // Try plotting the histogram, then the graph.
30
31 if(fHasHistoSingle[i]){
32 fSummaryHistoSingle[i]->Draw();
33 }else if(fHasHisto2D[i]){
34 fSummaryHisto2D[i]->Draw("COLZ");
35 }else if(fHasGraphSingle[i]){
36 fSummaryGraphSingle[i]->Draw("AP*");
37 fSummaryGraphSingle[i]->SetMarkerStyle(20);
38 }
39
40 }
41
42 //fSumm[index]->Draw();
43
44
45 c1->Modified();
46 c1->Update();
47
48}
49
50
51// Reset
53
54 for(int i = 0; i < gMaxSubCanvasesMuCa; i++){
55 if(fHasHistoSingle[i]){
56 fSummaryHistoSingle[i]->Reset();
57 }else if(fHasHisto2D[i]){
58 fSummaryHisto2D[i]->Reset();
59
60 }
61 }
62
63}
const int gMaxSubCanvasesMuCa
Definition TMulticanvas.h:9
void PlotCanvas(TDataContainer &dataContainer, TRootEmbeddedCanvas *embedCanvas)
Plot the histograms for this canvas for a particular index;.
TGraph * fSummaryGraphSingle[gMaxSubCanvasesMuCa]
bool fHasGraphSingle[gMaxSubCanvasesMuCa]
TH2 * fSummaryHisto2D[gMaxSubCanvasesMuCa]
void ResetCanvasHistograms()
Reset the histograms for this canvas.
TH1 * fSummaryHistoSingle[gMaxSubCanvasesMuCa]
TMulticanvas(std::string CanvasName="Multi Canvas")
bool fHasHisto2D[gMaxSubCanvasesMuCa]
bool fHasHistoSingle[gMaxSubCanvasesMuCa]