JG ROOT Tools libraries  version 5.0 - august 2014
RGHistoPlotModeSelect Class Reference

#include <RGHistoPlotModeSelect.hh>

Inheritance diagram for RGHistoPlotModeSelect:

Public Member Functions

 RGHistoPlotModeSelect (TGWindow *p=NULL, const Int_t mode=0, UInt_t opt=0)
 
virtual ~RGHistoPlotModeSelect ()
 
virtual void InitModes ()
 
virtual void ChangeDimension (const Int_t dim)
 
virtual Int_t GetDimension () const
 
virtual void SetState (const Bool_t b=kTRUE)
 
virtual Int_t GetPlotMode () const
 
virtual string GetPlotOption () const
 
virtual Int_t DrawHisto (TH1 *hptr, const string &add_opts, TPad *padptr, const Int_t copy, const Double_t norm=1.) const
 
virtual Int_t DrawHisto (TH1 *hptr, const string &add_opts="", TPad *padptr=NULL) const
 
virtual Int_t DrawHistoCopy (TH1 *hptr, const string &add_opts="", TPad *padptr=NULL) const
 
virtual Int_t DrawHistoNormalized (TH1 *hptr, const Double_t norm, const string &add_opts="", TPad *padptr=NULL) const
 
virtual void SelectMode (const Int_t mode, const Bool_t emit=kTRUE)
 
virtual void ModeSelected (Int_t m)
 
 ClassDef (RGHistoPlotModeSelect, 0)
 

Static Public Member Functions

static string GetPlotOption (const Int_t dim, const Int_t mode)
 
static Int_t DrawHisto (TH1 *hptr, const Int_t mode, const string &add_opts, TPad *padptr, const Int_t copy=1, const Double_t norm=1.)
 

Protected Member Functions

virtual void Construct ()
 

Protected Attributes

UInt_t options
 Options;.
 
Int_t histo_dim
 Histogram dimension.
 
Int_t mode_num
 Number of plot modes.
 
string * mode_list
 Array of plot mode names.
 
Int_t * mode_val
 Array of plot mode values.
 
Int_t plot_mode
 Initial plot mode.
 
TGComboBox * w_mode_select
 Selection widget.
 

Private Member Functions

 GObject (RGHistoPlotModeSelect)
 
 RGHistoPlotModeSelect (const RGHistoPlotModeSelect &original)
 

Detailed Description

class RGHistoPlotModeSelect

Widget for plot mode selection of an histogram (1D, 2D or 3D).

Options:

  • rgHPMSHisto1D: plot modes of a 1D histogram (défaut)
  • rgHPMSHisto2D: plot modes of a 2D histogram
  • rgHPMSHisto3D: plot modes of a 3D histogram

The following options can be used for 2D histograms (note that 1D histograms are plotted in 2D views, and 3D histograms in 3D views):

  • rgHPMSNo2DView: do not include 2D plot modes
  • rgHPMSNo3DView: do not include 3D plot modes

Constructor & Destructor Documentation

RGHistoPlotModeSelect::RGHistoPlotModeSelect ( TGWindow *  p = NULL,
const Int_t  mode = 0,
UInt_t  opt = 0 
)

Constructor.

Parameters
pparent widget
modeinitial mode
optoptions

References Construct(), histo_dim, mode_list, mode_num, mode_val, options, plot_mode, and w_mode_select.

RGHistoPlotModeSelect::RGHistoPlotModeSelect ( const RGHistoPlotModeSelect original)
private

Copy constructor, not implemented.

Parameters
originalobject to copy
RGHistoPlotModeSelect::~RGHistoPlotModeSelect ( )
virtual

Destructor.

References mode_list, and mode_val.

Member Function Documentation

RGHistoPlotModeSelect::GObject ( RGHistoPlotModeSelect  )
private

Macro from GCpp library that defines the following functions:

  • ClassName(): return the real class name of the object
  • StaticClassName(): return the used class name of the object (that may be a base class of the real object).
  • IsInstanceOf<T>(): return true if the current object is an instance of the template class name argument
  • Clone(): return an allocated copy of the object.
void RGHistoPlotModeSelect::Construct ( )
protectedvirtual

Construction of the widget and sub-widgets.

References ChangeDimension(), options, plot_mode, and w_mode_select.

Referenced by RGHistoPlotModeSelect().

void RGHistoPlotModeSelect::ChangeDimension ( const Int_t  dim)
virtual

Set the dimension of histogram whose attributes are being edited.

Parameters
dimdimension (1, 2 or 3)

References histo_dim, InitModes(), mode_list, mode_num, mode_val, plot_mode, and w_mode_select.

Referenced by RGHistoPlotAttrSelect::ChangeDimension(), and Construct().

Int_t RGHistoPlotModeSelect::GetDimension ( ) const
inlinevirtual

Get histogram dimension corresponding to selected modes.

References histo_dim.

Referenced by RGHistoPlotAttrSelect::MapSubwindows(), and RGHistoPlotAttrSelect::ModeSelectionUpdate().

void RGHistoPlotModeSelect::SetState ( const Bool_t  b = kTRUE)
virtual

Set the widget state (active/inactive)

Parameters
bstate

References w_mode_select.

Referenced by RGHistoPlotAttrSelect::SetState().

Int_t RGHistoPlotModeSelect::GetPlotMode ( ) const
inlinevirtual
string RGHistoPlotModeSelect::GetPlotOption ( ) const
inlinevirtual

Get ROOT option string for selected mode.

References histo_dim, and w_mode_select.

Referenced by DrawHisto(), and RGHistoPlotAttrSelect::GetPlotOption().

string RGHistoPlotModeSelect::GetPlotOption ( const Int_t  dim,
const Int_t  mode 
)
static

Get the ROOT plotting options corresponding to the argument plot mode number.

Parameters
dimhistogram dimension
modeplot mode
Int_t RGHistoPlotModeSelect::DrawHisto ( TH1 *  hptr,
const Int_t  mode,
const string &  add_opts,
TPad *  padptr,
const Int_t  copy = 1,
const Double_t  norm = 1. 
)
static

Draw an histogram with the argument plot mode. If histogram dimension does not fit with options, nothing is done. The additionnal options are added to the effective options (like "SAME" or "A", ...). If the pad is not specified, the histogram is plotted in the pad defined by gPad, if it is set.

Parameters
hptrhistogram pointer
modeplotting mode
add_optsadditional options
padptrpad pointer
copyflag defining if a copy of the histogram should be plotted (0: no copy, 1: copy, 2: copy and normalize)
normhistogram normalization

References GetPlotOption().

Referenced by RGHistoPlotAttrSelect::DrawHisto(), DrawHisto(), DrawHistoCopy(), and DrawHistoNormalized().

Int_t RGHistoPlotModeSelect::DrawHisto ( TH1 *  hptr,
const string &  add_opts,
TPad *  padptr,
const Int_t  copy,
const Double_t  norm = 1. 
) const
inlinevirtual

Draw an histogram with selected mode. If histogram dimension does not fit with options, nothing is done. The additionnal options are added to the effective options (like "SAME" or "A", ...). If the pad is not specified, the histogram is plotted in the pad defined by gPad, if it is set.

Parameters
hptrhistogram pointer
add_optsadditional options
padptrpad pointer
copyflag defining if a copy of the histogram should be plotted
normhistogram normalization

References DrawHisto(), and plot_mode.

Int_t RGHistoPlotModeSelect::DrawHisto ( TH1 *  hptr,
const string &  add_opts = "",
TPad *  padptr = NULL 
) const
inlinevirtual

Draw an histogram with selected mode. If histogram dimension does not fit with options, nothing is done. The additionnal options are added to the effective options (like "SAME" or "A", ...). If the pad is not specified, the histogram is plotted in the pad defined by gPad, if it is set.

Parameters
hptrhistogram pointer
add_optsadditional options
padptrpad pointer

References DrawHisto(), and plot_mode.

Int_t RGHistoPlotModeSelect::DrawHistoCopy ( TH1 *  hptr,
const string &  add_opts = "",
TPad *  padptr = NULL 
) const
inlinevirtual

Same as DrawHisto function, except that a copy of the histogram is plotted.

Parameters
hptrhistogram pointer
add_optsadditional options
padptrpad pointer

References DrawHisto(), and plot_mode.

Referenced by RGHistoPlotAttrSelect::DrawHistoCopy().

Int_t RGHistoPlotModeSelect::DrawHistoNormalized ( TH1 *  hptr,
const Double_t  norm,
const string &  add_opts = "",
TPad *  padptr = NULL 
) const
inlinevirtual

Same as DrawHisto function, except that a renormalised copy of the histogram is plotted.

Parameters
hptrhistogram pointer
normnormalization value
add_optsadditional options
padptrpad pointer

References DrawHisto(), and plot_mode.

Referenced by RGHistoPlotAttrSelect::DrawHistoNormalized().

void RGHistoPlotModeSelect::SelectMode ( const Int_t  mode,
const Bool_t  emit = kTRUE 
)
virtual

Set the plot mode.

Parameters
modeselected plot mode
emitflag if signal must be emitted

References mode_num, mode_val, ModeSelected(), and w_mode_select.

Referenced by RGHistoPlotAttrSelect::SetPlotMode().

void RGHistoPlotModeSelect::ModeSelected ( Int_t  m)
inlinevirtual

Signal sent when plot mode is changed.

References plot_mode.

Referenced by SelectMode().

RGHistoPlotModeSelect::ClassDef ( RGHistoPlotModeSelect  ,
 
)

For ROOT dictionary.


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