ROOTANA
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes
TFancyHistogramCanvas Class Reference

#include <TFancyHistogramCanvas.hxx>

Inheritance diagram for TFancyHistogramCanvas:
Inheritance graph
[legend]
Collaboration diagram for TFancyHistogramCanvas:
Collaboration graph
[legend]

Public Member Functions

 TFancyHistogramCanvas (THistogramArrayBase *histoArray, std::string name, int numberChannelsInGroups=-1, bool disableAutoUpdate=false)
 
 ~TFancyHistogramCanvas ()
 
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.
 
void BeginRun (int transition, int run, int time)
 Take actions at begin run.
 
void EndRun (int transition, int run, int time)
 Take actions at end run

 
void SetUpCompositeFrame (TGCompositeFrame *compFrame, TRootanaDisplay *display)
 This is the complicated part, where we create a bunch of buttons and widgets.
 
void ActivateMultiCanvasButton ()
 
void ActivateOverlayButton ()
 
void SetGroupName (std::string groupName)
 Allow the user to set explicitly the group name.
 
void SetChannelName (std::string channelName)
 Allow the user to set explicitly the channel name.
 
- Public Member Functions inherited from TCanvasHandleBase
 TCanvasHandleBase (std::string tabName)
 
virtual ~TCanvasHandleBase ()
 
std::string GetTabName ()
 
TRootEmbeddedCanvas * GetEmbeddedCanvas ()
 This method is only.
 

Private Member Functions

void CheckExtraButtons ()
 Helper function to remove extra buttons if not needed anymore.
 
 TFancyHistogramCanvas ()
 

Private Attributes

THistogramArrayBasefHistoArray
 Pointer to the THistogramArrayBase class; memory is not owned by TFancyHistogramCanvas.
 
bool fDisableAutoUpdate
 
int fNumberChannelsInGroups
 
TGHorizontalFrame * fLabelframe
 Overall frame in which we will add buttons and widgets.
 
TGNumberEntry * fChannelCounterButton
 Button for the histogram number.
 
TGLabel * fLabelChannels
 A label for the histogram number button.
 
std::string fChannelName
 Name for the channel button.
 
TGNumberEntry * fGroupCounterButton
 Button for the group number.
 
TGLabel * fLabelGroup
 A label for the group button.
 
std::string fGroupName
 Name for the group button.
 
TGCheckButton * fMultiCanvasButton
 This button controls whether to display mutliple sub-canvases.
 
TGHButtonGroup * fNCanvasButtonGroup
 Button group to select how many canvases to show.
 
TGRadioButton * fNCanvasButtons [4]
 
TGCheckButton * fOverlayHistoButton
 This button controls whether to display overlaid histograms.
 
TGNumberEntry * fNHistoButton
 Button group to select how many histograms to show.
 
TGLabel * labelNHisto
 
TLegend * fNHistoLegend
 
TRootanaDisplayfDisplay
 

Detailed Description

A canvas that plots THistogramArrayBase type histograms in a nice way. The basic idea is to allow the user to easily plot an array of histograms in three different ways: 1) They can scroll through the histograms one by one, using the "Histogram Number" button. 2) They can have a set of NNN different canvases, each with a different histogram, where NNN can be 2, 4, 8 or 16. 3) They can have multiple histograms overlaid on the same canvas; the user can choose how many histograms to overlay.

Definition at line 28 of file TFancyHistogramCanvas.hxx.

Constructor & Destructor Documentation

◆ TFancyHistogramCanvas() [1/2]

TFancyHistogramCanvas::TFancyHistogramCanvas ( THistogramArrayBase histoArray,
std::string  name,
int  numberChannelsInGroups = -1,
bool  disableAutoUpdate = false 
)

Pass the THistogramArrayBase pointer during constructor; does not pass ownership (TFancyHistogramCanvas will not delete histoArray); parameters: 'histoArray': this is the pointer to the class derived from THistogramArrayBase base;

  • does not assume ownership of pointer memory. 'name' is the name that the histogram will have. 'numberChannelsInGroups': if this value is greater than 1, then the fancy canvas will have an additional button allowing the user to specify particular groups; the histograms will be organized into size/fNumberChannelsInGroups of groups, with each group having fNumberChannelsInGroups entries. will have an additional button allowing the user to specify particular groups. 'disableAutoUpdate' will tell fancy histogram to not call histoArray->UpdateHistograms() -> the assumption is that the user will take care of calling this function.

◆ ~TFancyHistogramCanvas()

TFancyHistogramCanvas::~TFancyHistogramCanvas ( )

Definition at line 54 of file TFancyHistogramCanvas.cxx.

◆ TFancyHistogramCanvas() [2/2]

TFancyHistogramCanvas::TFancyHistogramCanvas ( )
private

Member Function Documentation

◆ ActivateMultiCanvasButton()

void TFancyHistogramCanvas::ActivateMultiCanvasButton ( )

These methods are callbacks to ensure that multi-canvas and overlay-histo modes are used exclusively.

Definition at line 318 of file TFancyHistogramCanvas.cxx.

◆ ActivateOverlayButton()

void TFancyHistogramCanvas::ActivateOverlayButton ( )

Definition at line 328 of file TFancyHistogramCanvas.cxx.

◆ BeginRun()

void TFancyHistogramCanvas::BeginRun ( int  transition,
int  run,
int  time 
)
virtual

Take actions at begin run.

Reimplemented from TCanvasHandleBase.

Definition at line 308 of file TFancyHistogramCanvas.cxx.

Here is the call graph for this function:

◆ CheckExtraButtons()

void TFancyHistogramCanvas::CheckExtraButtons ( )
private

Helper function to remove extra buttons if not needed anymore.

◆ EndRun()

void TFancyHistogramCanvas::EndRun ( int  transition,
int  run,
int  time 
)
virtual

Take actions at end run

Reimplemented from TCanvasHandleBase.

Definition at line 313 of file TFancyHistogramCanvas.cxx.

Here is the call graph for this function:

◆ PlotCanvas()

void TFancyHistogramCanvas::PlotCanvas ( TDataContainer dataContainer,
TRootEmbeddedCanvas *  embedCanvas 
)
virtual

Plot the histograms for this canvas.

Implements TCanvasHandleBase.

Definition at line 207 of file TFancyHistogramCanvas.cxx.

Here is the call graph for this function:

◆ ResetCanvasHistograms()

void TFancyHistogramCanvas::ResetCanvasHistograms ( )
virtual

Reset the histograms for this canvas.

Reset the histograms in fHistoArray.

Implements TCanvasHandleBase.

Definition at line 178 of file TFancyHistogramCanvas.cxx.

◆ SetChannelName()

void TFancyHistogramCanvas::SetChannelName ( std::string  channelName)

Allow the user to set explicitly the channel name.

Definition at line 354 of file TFancyHistogramCanvas.cxx.

Here is the caller graph for this function:

◆ SetGroupName()

void TFancyHistogramCanvas::SetGroupName ( std::string  groupName)

Allow the user to set explicitly the group name.

Definition at line 342 of file TFancyHistogramCanvas.cxx.

Here is the caller graph for this function:

◆ SetUpCompositeFrame()

void TFancyHistogramCanvas::SetUpCompositeFrame ( TGCompositeFrame *  compFrame,
TRootanaDisplay display 
)
virtual

This is the complicated part, where we create a bunch of buttons and widgets.

Cached pointer to rootana display; needed so that we can create new buttons with correct callbacks.

Add the button group to control how many sub-canvases to plot.

Add the button to control how many histograns to plot to plot.

Reimplemented from TCanvasHandleBase.

Definition at line 59 of file TFancyHistogramCanvas.cxx.

Here is the call graph for this function:

◆ UpdateCanvasHistograms()

void TFancyHistogramCanvas::UpdateCanvasHistograms ( TDataContainer dataContainer)
virtual

Update the histograms for this canvas.

Implements TCanvasHandleBase.

Definition at line 184 of file TFancyHistogramCanvas.cxx.

Here is the call graph for this function:

Field Documentation

◆ fChannelCounterButton

TGNumberEntry* TFancyHistogramCanvas::fChannelCounterButton
private

Button for the histogram number.

Definition at line 99 of file TFancyHistogramCanvas.hxx.

◆ fChannelName

std::string TFancyHistogramCanvas::fChannelName
private

Name for the channel button.

Definition at line 105 of file TFancyHistogramCanvas.hxx.

◆ fDisableAutoUpdate

bool TFancyHistogramCanvas::fDisableAutoUpdate
private

'disableAutoUpdate' will tell fancy histogram to not call histoArray->UpdateHistograms() -> the assumption is that the user will take care of calling this function.

Definition at line 87 of file TFancyHistogramCanvas.hxx.

◆ fDisplay

TRootanaDisplay* TFancyHistogramCanvas::fDisplay
private

Cached pointer to rootana display; needed so that we can create new buttons with correct callbacks.

Definition at line 136 of file TFancyHistogramCanvas.hxx.

◆ fGroupCounterButton

TGNumberEntry* TFancyHistogramCanvas::fGroupCounterButton
private

Button for the group number.

Definition at line 108 of file TFancyHistogramCanvas.hxx.

◆ fGroupName

std::string TFancyHistogramCanvas::fGroupName
private

Name for the group button.

Definition at line 114 of file TFancyHistogramCanvas.hxx.

◆ fHistoArray

THistogramArrayBase* TFancyHistogramCanvas::fHistoArray
private

Pointer to the THistogramArrayBase class; memory is not owned by TFancyHistogramCanvas.

Definition at line 83 of file TFancyHistogramCanvas.hxx.

◆ fLabelChannels

TGLabel* TFancyHistogramCanvas::fLabelChannels
private

A label for the histogram number button.

Definition at line 102 of file TFancyHistogramCanvas.hxx.

◆ fLabelframe

TGHorizontalFrame* TFancyHistogramCanvas::fLabelframe
private

Overall frame in which we will add buttons and widgets.

Definition at line 96 of file TFancyHistogramCanvas.hxx.

◆ fLabelGroup

TGLabel* TFancyHistogramCanvas::fLabelGroup
private

A label for the group button.

Definition at line 111 of file TFancyHistogramCanvas.hxx.

◆ fMultiCanvasButton

TGCheckButton* TFancyHistogramCanvas::fMultiCanvasButton
private

This button controls whether to display mutliple sub-canvases.

Definition at line 117 of file TFancyHistogramCanvas.hxx.

◆ fNCanvasButtonGroup

TGHButtonGroup* TFancyHistogramCanvas::fNCanvasButtonGroup
private

Button group to select how many canvases to show.

Definition at line 120 of file TFancyHistogramCanvas.hxx.

◆ fNCanvasButtons

TGRadioButton* TFancyHistogramCanvas::fNCanvasButtons[4]
private

Definition at line 121 of file TFancyHistogramCanvas.hxx.

◆ fNHistoButton

TGNumberEntry* TFancyHistogramCanvas::fNHistoButton
private

Button group to select how many histograms to show.

Definition at line 127 of file TFancyHistogramCanvas.hxx.

◆ fNHistoLegend

TLegend* TFancyHistogramCanvas::fNHistoLegend
private

Definition at line 129 of file TFancyHistogramCanvas.hxx.

◆ fNumberChannelsInGroups

int TFancyHistogramCanvas::fNumberChannelsInGroups
private

'fNumberChannelsInGroups': if this value is greater than 1, then the fancy canvas will have an additional button allowing the user to specify particular groups; the histograms will be organized into size/fNumberChannelsInGroups of groups, with each group having fNumberChannelsInGroups entries.

Definition at line 93 of file TFancyHistogramCanvas.hxx.

◆ fOverlayHistoButton

TGCheckButton* TFancyHistogramCanvas::fOverlayHistoButton
private

This button controls whether to display overlaid histograms.

Definition at line 124 of file TFancyHistogramCanvas.hxx.

◆ labelNHisto

TGLabel* TFancyHistogramCanvas::labelNHisto
private

Definition at line 128 of file TFancyHistogramCanvas.hxx.


The documentation for this class was generated from the following files: