#include <THistogramArrayBase.h>
Public Member Functions | |
THistogramArrayBase () | |
virtual | ~THistogramArrayBase () |
virtual void | UpdateHistograms (TDataContainer &dataContainer)=0 |
Update the histograms for this canvas. | |
TH1 * | GetHistogram (unsigned int i) |
A helper method for accessing each histogram. Does bounds checking. | |
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. | |
void | SetNumberChannelsInGroup (int numberChannelsInGroups) |
const int | GetNumberChannelsInGroup () |
void | SetGroupName (std::string name) |
Set name for the 'group'. | |
const std::string | GetGroupName () |
void | SetChannelName (std::string name) |
Set name for the 'channel'. | |
const std::string | GetChannelName () |
void | DisableAutoUpdate (bool DisableautoUpdate=true) |
const bool | GetDisableAutoUpdate () |
const bool | HasAutoUpdate () |
Private Attributes | |
int | fNumberChannelsInGroups |
std::string | fGroupName |
The name for the 'group'. | |
std::string | fChannelName |
The name for the 'channel'. | |
bool | fDisableAutoUpdate |
bool | fHasAutoUpdate |
Base class for user to create an array of histograms. Features of the histogram array i) Histograms are all defined together. ii) Histograms are updated together
Users of this abstract base class should implement a class derived from must THistogramArrayBase that 1) define the histograms that you want in the constructor. 2) implement the UpdateHistograms(TDataContainer&) method.
The logic of this histogram array is based on it being a set of similar histograms; if you use this class for a set of dissimilar histograms (different binning, different quantities) the results will probably be unsatisfactory. The array'ness is actually implemented as a vector of TH1s.
The default representation is to have a 1D array of histograms. But the user can also use the class a 2D array of histograms by specifying the functions
Definition at line 33 of file THistogramArrayBase.h.
THistogramArrayBase::THistogramArrayBase | ( | ) | [inline] |
Definition at line 35 of file THistogramArrayBase.h.
00035 :fNumberChannelsInGroups(-1),fGroupName(""),fChannelName(""), 00036 fDisableAutoUpdate(false),fHasAutoUpdate(false){}
virtual THistogramArrayBase::~THistogramArrayBase | ( | ) | [inline, virtual] |
Definition at line 38 of file THistogramArrayBase.h.
virtual void THistogramArrayBase::BeginRun | ( | int | transition, | |
int | run, | |||
int | time | |||
) | [inline, virtual] |
Take actions at begin run.
Reimplemented in TAgilentHistograms, TDT724Waveform, TL2249Histograms, TV1190Histograms, TV1720Waveform, TV1730DppWaveform, TV1730RawWaveform, and TV792Histograms.
Definition at line 54 of file THistogramArrayBase.h.
Referenced by TFancyHistogramCanvas::BeginRun().
void THistogramArrayBase::DisableAutoUpdate | ( | bool | DisableautoUpdate = true |
) | [inline] |
Define whether the histogram gets automatically updated by rootana display. 'True' means that rootana display will NOT call UpdateHistograms automatically.
Definition at line 74 of file THistogramArrayBase.h.
References fDisableAutoUpdate, and fHasAutoUpdate.
Referenced by TAnaManager::TAnaManager().
00074 { fDisableAutoUpdate = DisableautoUpdate; fHasAutoUpdate = true;}
virtual void THistogramArrayBase::EndRun | ( | int | transition, | |
int | run, | |||
int | time | |||
) | [inline, virtual] |
Take actions at end run.
Reimplemented in TAgilentHistograms, TL2249Histograms, TV1190Histograms, TV1730DppWaveform, TV1730RawWaveform, and TV792Histograms.
Definition at line 57 of file THistogramArrayBase.h.
Referenced by TFancyHistogramCanvas::EndRun().
const std::string THistogramArrayBase::GetChannelName | ( | ) | [inline] |
Definition at line 70 of file THistogramArrayBase.h.
References fChannelName.
00070 { return fChannelName; }
const bool THistogramArrayBase::GetDisableAutoUpdate | ( | ) | [inline] |
Definition at line 75 of file THistogramArrayBase.h.
References fDisableAutoUpdate.
00075 { return fDisableAutoUpdate; }
const std::string THistogramArrayBase::GetGroupName | ( | ) | [inline] |
Definition at line 66 of file THistogramArrayBase.h.
References fGroupName.
00066 { return fGroupName; }
TH1* THistogramArrayBase::GetHistogram | ( | unsigned int | i | ) | [inline] |
A helper method for accessing each histogram. Does bounds checking.
Definition at line 44 of file THistogramArrayBase.h.
Referenced by TV1730RawWaveform::Reset(), TV1730DppWaveform::Reset(), TV1720Waveform::Reset(), TDT724Waveform::Reset(), TV792Histograms::UpdateHistograms(), TV1730RawWaveform::UpdateHistograms(), TV1730DppWaveform::UpdateHistograms(), TV1720Waveform::UpdateHistograms(), TV1190Histograms::UpdateHistograms(), TL2249Histograms::UpdateHistograms(), TDT724Waveform::UpdateHistograms(), and TAgilentHistograms::UpdateHistograms().
00044 { 00045 if(i < 0 || i >= size()){ 00046 std::cerr << "Invalid index (=" << i 00047 << ") requested in THistogramArrayBase::GetHistogram(int i) " << std::endl; 00048 return 0; 00049 } 00050 return (*this)[i]; 00051 }
const int THistogramArrayBase::GetNumberChannelsInGroup | ( | ) | [inline] |
Definition at line 62 of file THistogramArrayBase.h.
References fNumberChannelsInGroups.
00062 { return fNumberChannelsInGroups; }
const bool THistogramArrayBase::HasAutoUpdate | ( | ) | [inline] |
Definition at line 76 of file THistogramArrayBase.h.
References fHasAutoUpdate.
00076 { return fHasAutoUpdate; }
void THistogramArrayBase::SetChannelName | ( | std::string | name | ) | [inline] |
Set name for the 'channel'.
Definition at line 69 of file THistogramArrayBase.h.
References fChannelName.
00069 { fChannelName = name; }
void THistogramArrayBase::SetGroupName | ( | std::string | name | ) | [inline] |
Set name for the 'group'.
Definition at line 65 of file THistogramArrayBase.h.
References fGroupName.
00065 { fGroupName = name; }
void THistogramArrayBase::SetNumberChannelsInGroup | ( | int | numberChannelsInGroups | ) | [inline] |
Function to define the number of channels in group and allow user to treat the array as 2D array.
Definition at line 61 of file THistogramArrayBase.h.
References fNumberChannelsInGroups.
00061 { fNumberChannelsInGroups = numberChannelsInGroups; }
virtual void THistogramArrayBase::UpdateHistograms | ( | TDataContainer & | dataContainer | ) | [pure virtual] |
Update the histograms for this canvas.
Implemented in TAgilentHistograms, TDT724Waveform, TL2249Histograms, TV1190Histograms, TV1720Waveform, TV1730DppWaveform, TV1730RawWaveform, and TV792Histograms.
Referenced by TFancyHistogramCanvas::UpdateCanvasHistograms().
std::string THistogramArrayBase::fChannelName [private] |
The name for the 'channel'.
Definition at line 89 of file THistogramArrayBase.h.
Referenced by GetChannelName(), and SetChannelName().
bool THistogramArrayBase::fDisableAutoUpdate [private] |
Defines whether the histogram should be automatically updated by TRootanaDisplay.
Definition at line 93 of file THistogramArrayBase.h.
Referenced by DisableAutoUpdate(), and GetDisableAutoUpdate().
std::string THistogramArrayBase::fGroupName [private] |
The name for the 'group'.
Definition at line 86 of file THistogramArrayBase.h.
Referenced by GetGroupName(), and SetGroupName().
bool THistogramArrayBase::fHasAutoUpdate [private] |
Definition at line 94 of file THistogramArrayBase.h.
Referenced by DisableAutoUpdate(), and HasAutoUpdate().
int THistogramArrayBase::fNumberChannelsInGroups [private] |
This is the number of channels in a given group. This is mostly used by rootana display, but could also be used to specify histograms as a 2D array of [group][channel.
Definition at line 83 of file THistogramArrayBase.h.
Referenced by GetNumberChannelsInGroup(), and SetNumberChannelsInGroup().