#include <TSimpleExampleCanvas.hxx>
Public Member Functions | |
TSimpleExampleCanvas () | |
void | ResetCanvasHistograms () |
Reset the histograms for this canvas. | |
void | UpdateCanvasHistograms (TDataContainer &dataContainer) |
Update the histograms for this canvas. | |
void | PlotCanvas (TDataContainer &dataContainer, TRootEmbeddedCanvas *embedCanvas) |
Plot the histograms for this canvas. | |
virtual void | BeginRun (int transition, int run, int time) |
Take actions at begin run. | |
virtual void | EndRun (int transition, int run, int time) |
Take actions at end run. | |
std::string | GetTabName () |
TRootEmbeddedCanvas * | GetEmbeddedCanvas () |
This method is only. | |
virtual void | SetUpCompositeFrame (TGCompositeFrame *, TRootanaDisplay *display) |
Private Attributes | |
TH1F * | tdcHistogram |
A simple example, using V1190 data
Definition at line 15 of file TSimpleExampleCanvas.hxx.
TSimpleExampleCanvas::TSimpleExampleCanvas | ( | ) |
Definition at line 6 of file TSimpleExampleCanvas.cxx.
References tdcHistogram.
00006 : TCanvasHandleBase("V1190 TDC Values"){ 00007 00008 tdcHistogram = new TH1F("tdcHistogram","Histogram of all V1190 TDC value",2000,0,100000); 00009 00010 }
virtual void TCanvasHandleBase::BeginRun | ( | int | transition, | |
int | run, | |||
int | time | |||
) | [inline, virtual, inherited] |
Take actions at begin run.
Reimplemented in TComplicatedExampleCanvas, and TFancyHistogramCanvas.
Definition at line 33 of file TCanvasHandleBase.hxx.
virtual void TCanvasHandleBase::EndRun | ( | int | transition, | |
int | run, | |||
int | time | |||
) | [inline, virtual, inherited] |
Take actions at end run.
Reimplemented in TFancyHistogramCanvas.
Definition at line 36 of file TCanvasHandleBase.hxx.
TRootEmbeddedCanvas* TCanvasHandleBase::GetEmbeddedCanvas | ( | ) | [inline, inherited] |
This method is only.
Definition at line 41 of file TCanvasHandleBase.hxx.
std::string TCanvasHandleBase::GetTabName | ( | ) | [inline, inherited] |
Definition at line 38 of file TCanvasHandleBase.hxx.
References TCanvasHandleBase::fTabName.
Referenced by TRootanaDisplay::AddSingleCanvas().
00038 {return fTabName;}
void TSimpleExampleCanvas::PlotCanvas | ( | TDataContainer & | dataContainer, | |
TRootEmbeddedCanvas * | embedCanvas | |||
) | [virtual] |
Plot the histograms for this canvas.
Implements TCanvasHandleBase.
Definition at line 38 of file TSimpleExampleCanvas.cxx.
References tdcHistogram.
00038 { 00039 00040 TCanvas* c1 = embedCanvas->GetCanvas(); 00041 c1->Clear(); 00042 tdcHistogram->Draw(); 00043 c1->Modified(); 00044 c1->Update(); 00045 }
void TSimpleExampleCanvas::ResetCanvasHistograms | ( | ) | [virtual] |
Reset the histograms for this canvas.
Implements TCanvasHandleBase.
Definition at line 15 of file TSimpleExampleCanvas.cxx.
References tdcHistogram.
00015 { 00016 00017 tdcHistogram->Reset(); 00018 }
virtual void TCanvasHandleBase::SetUpCompositeFrame | ( | TGCompositeFrame * | , | |
TRootanaDisplay * | display | |||
) | [inline, virtual, inherited] |
Reimplemented in TComplicatedExampleCanvas, and TFancyHistogramCanvas.
Definition at line 48 of file TCanvasHandleBase.hxx.
Referenced by TRootanaDisplay::AddSingleCanvas().
void TSimpleExampleCanvas::UpdateCanvasHistograms | ( | TDataContainer & | dataContainer | ) | [virtual] |
Update the histograms for this canvas.
Implements TCanvasHandleBase.
Definition at line 21 of file TSimpleExampleCanvas.cxx.
References TDataContainer::GetEventData(), TDCMeasurement::GetMeasurement(), TV1190Data::GetMeasurements(), and tdcHistogram.
00021 { 00022 00023 TV1190Data *v1190 = dataContainer.GetEventData<TV1190Data>("TDC0"); 00024 if(v1190){ 00025 00026 std::vector<TDCMeasurement>& measurements = v1190->GetMeasurements(); 00027 for(unsigned int i = 0; i < measurements.size(); i++){ 00028 TDCMeasurement tdcmeas = measurements[i]; 00029 tdcHistogram->Fill(tdcmeas.GetMeasurement()); 00030 } 00031 00032 } 00033 00034 00035 }
TH1F* TSimpleExampleCanvas::tdcHistogram [private] |
Definition at line 30 of file TSimpleExampleCanvas.hxx.
Referenced by PlotCanvas(), ResetCanvasHistograms(), TSimpleExampleCanvas(), and UpdateCanvasHistograms().