ROOTANA
TSimpleExampleCanvas.cxx
Go to the documentation of this file.
2 
3 #include "TV1190Data.hxx"
4 
5 
7 
8  tdcHistogram = new TH1F("tdcHistogram","Histogram of all V1190 TDC value",2000,0,100000);
9 
10 }
11 
12 
13 
14 /// Reset the histograms for this canvas
16 
17  tdcHistogram->Reset();
18 }
19 
20 /// Update the histograms for this canvas.
22 
23  TV1190Data *v1190 = dataContainer.GetEventData<TV1190Data>("TDC0");
24  if(v1190){
25 
26  std::vector<TDCMeasurement>& measurements = v1190->GetMeasurements();
27  for(unsigned int i = 0; i < measurements.size(); i++){
28  TDCMeasurement tdcmeas = measurements[i];
29  tdcHistogram->Fill(tdcmeas.GetMeasurement());
30  }
31 
32  }
33 
34 
35 }
36 
37 /// Plot the histograms for this canvas
38 void TSimpleExampleCanvas::PlotCanvas(TDataContainer& dataContainer,TRootEmbeddedCanvas *embedCanvas){
39 
40  TCanvas* c1 = embedCanvas->GetCanvas();
41  c1->Clear();
42  tdcHistogram->Draw();
43  c1->Modified();
44  c1->Update();
45 }
uint32_t GetMeasurement() const
Get the TDC measurement.
Definition: TV1190Data.hxx:21
T * GetEventData(const char *name)
Add a templated function that returns event data in the format that we want.
void ResetCanvasHistograms()
Reset the histograms for this canvas.
void PlotCanvas(TDataContainer &dataContainer, TRootEmbeddedCanvas *embedCanvas)
Plot the histograms for this canvas.
void UpdateCanvasHistograms(TDataContainer &dataContainer)
Update the histograms for this canvas.
std::vector< TDCMeasurement > & GetMeasurements()
Get the Vector of TDC Measurements.
Definition: TV1190Data.hxx:124