Diana Software
Public Member Functions | Static Public Member Functions | Private Attributes | Static Private Attributes | List of all members
QGHistogram Class Reference

Class for GUI histograms. More...

Inheritance diagram for QGHistogram:
QGPlot

Public Member Functions

 QGHistogram ()
 Default constructor. More...
 
 QGHistogram (const QGHistogram &)
 Copy constructor. More...
 
virtual ~QGHistogram ()
 Destructor. More...
 
void AutoSetAxisParameters ()
 Automatically set axis parameters. More...
 
void AutoSetStyle ()
 Automatically set the histogram style. More...
 
void Display ()
 Display histogram. More...
 
void DisplayEditWindow ()
 Display edit window for the histogram. More...
 
void DrawStyleHistogram ()
 Draw a mini-histogram showing the style of this histogram. More...
 
void Duplicate ()
 Duplicate the histogram. More...
 
void Erase ()
 Erase histogram. More...
 
void Generate (QChain *chain=0)
 Generate histogram. More...
 
Double_t GetBinWidth (Int_t bin=0) const
 Get bin width. More...
 
const char * GetName () const
 Get name of histogram. More...
 
Int_t GetNumberOfBins () const
 Get number of bins. More...
 
void GetParametersFromEditWindow ()
 Get parameters from edit window. More...
 
TH1D * GetStyleHistogram ()
 Get style histogram. More...
 
Double_t GetXMin () const
 Get x-min. More...
 
Double_t GetXMax () const
 Get x-max. More...
 
bool IsBinWidthSet ()
 Return true if bin width is set. More...
 
bool IsXMaxSet ()
 Return true if x-axis maximum is set. More...
 
bool IsXMinSet ()
 Return true if x-axis minimum is set. More...
 
bool IsNumberOfBinsSet ()
 Return true if number of bins is set. More...
 
void MakeStylePlot ()
 Make style plot. More...
 
void SetBinWidth (Double_t binWidth)
 Set bin width. More...
 
void SetName (const char *name=0)
 Set name of histogram. More...
 
void SetNumberOfBins (Int_t numberOfBins)
 Set number of bins. More...
 
void SetProperty (const std::string &key, const std::string &value)
 Set property (used for opening a session) More...
 
void SetXMax (Double_t xMax)
 Set x-max. More...
 
void SetXMin (Double_t xMin)
 Set x-min. More...
 
- Public Member Functions inherited from QGPlot
 QGPlot ()
 Default constructor. More...
 
 QGPlot (const QGPlot &)
 Copy constructor. More...
 
virtual ~QGPlot ()
 Destructor. More...
 
virtual void AddCut (const std::string &cut)
 Add cut. More...
 
virtual std::string GeneratePlotName (const std::string &baseName) const
 Generate a name for the plot. More...
 
virtual TCanvas * GetCanvas ()
 Get pointer to the associated canvas. More...
 
virtual QGCanvasWindowGetCanvasWindow () const
 Get pointer to the canvas window to which the plot is associated. More...
 
virtual void GetCanvasWindowFromEditWindow ()
 Get canvas window from edit window. More...
 
virtual const std::vector< std::string > & GetCuts () const
 Get cuts applied to make the plot. More...
 
virtual void GetCutsFromEditWindow ()
 Get cuts from edit window. More...
 
virtual QGPlotEditWindowGetEditWindow ()
 Get pointer to edit window. More...
 
virtual const std::string & GetXUnits () const
 Get x-axis units. More...
 
virtual const std::string & GetXVariable () const
 Get x-axis variable. More...
 
virtual const std::string & GetYUnits () const
 Get y-axis units. More...
 
virtual const std::string & GetYVariable () const
 Get y-axis variable. More...
 
virtual bool IsNameInUse (const std::string &name) const
 Check whether string is the name of any plot. More...
 
virtual bool IsSuperimposeSet () const
 Return true if plot is set to be superimposed. More...
 
virtual void MakeCutsString ()
 Make cuts string. More...
 
virtual bool NeedsRegeneration () const
 Check whether plot needs to be regenerated. More...
 
virtual void Plot ()
 Plot this in the associated canvas window, generating it if necessary. More...
 
virtual void SetCanvasWindow (QGCanvasWindow *window)
 Set the canvas window to which the plot is associated. More...
 
virtual void SetCuts (const std::vector< std::string > &cuts)
 Set cuts to apply in generating the plot. More...
 
virtual void SetPlotEditWindow (QGPlotEditWindow *window)
 Set plot edit window. More...
 
virtual void SetRegenerate (bool flag=true)
 Set whether the plot needs to be regenerated. More...
 
virtual void SetSuperimpose (bool flag=false)
 Set whether the plot should be superimposed. More...
 
virtual void SetXVariable (const std::string &x)
 Set X-axis variable. More...
 
virtual void SetXUnits (const std::string &units)
 Set X-axis units. More...
 
virtual void SetYVariable (const std::string &y)
 Set Y-axis variable. More...
 
virtual void SetYUnits (const std::string &units)
 Set Y-axis units. More...
 

Static Public Member Functions

static const std::list< QGHistogram * > & GetHistograms ()
 Get collection of histograms. More...
 
- Static Public Member Functions inherited from QGPlot
static QGPlotGetPlotByName (const std::string &name)
 Get plot by name. More...
 
static const std::list< QGPlot * > & GetPlots ()
 Get collection of plots. More...
 
static void ShowPlotsList ()
 Show plots list. More...
 

Private Attributes

bool fAutoSetNumberOfBins
 Flag to automatically set the number of bins. More...
 
bool fAutoSetXMax
 Flag to automatically set the x-axis maximum. More...
 
bool fAutoSetXMin
 Flag to automatically set the x-axis minimum. More...
 
Double_t fBinWidth
 Bin width. More...
 
std::vector< Double_t > fDataPoints
 Collection of points underlying the histogram, useful for instant rebinning. More...
 
std::string fDrawOption
 Draw option. More...
 
bool fIsBinWidthSet
 Whether or not bin width is set. More...
 
Int_t fNumberOfUniqueDataPoints
 Number of unique values among the data points, up to max 100. More...
 
TH1D * fStyleHistogram
 Mini-histogram to show style of this histogram. More...
 

Static Private Attributes

static std::list< QGHistogram * > fHistograms
 Collection of pointers to all QGHistograms. More...
 

Additional Inherited Members

- Protected Attributes inherited from QGPlot
QGCanvasWindowfCanvasWindow
 Canvas window to which plot is associated. More...
 
std::vector< std::string > fCuts
 Cuts applied to make the plot. More...
 
std::string fCutsString
 Cuts in a single string. More...
 
bool fNeedsRegeneration
 Indicates whether plot needs to be regenerated because settings have changed. More...
 
QGPlotEditWindowfPlotEditWindow
 Pointer to plot edit window. More...
 
bool fSuperimpose
 Indicates whether plot should be superimposed on existing plot. More...
 
std::string fXVariable
 X-axis variable. More...
 
std::string fXUnits
 X-axis units. More...
 
std::string fYVariable
 Y-axis variable. More...
 
std::string fYUnits
 Y-axis units. More...
 
- Static Protected Attributes inherited from QGPlot
static std::list< QGPlot * > fPlots
 Collection of pointers to all QGPlots. More...
 

Detailed Description

Class for GUI histograms.

Author
Adam Bryant (adam_.nosp@m.brya.nosp@m.nt@be.nosp@m.rkel.nosp@m.ey.ed.nosp@m.u)

Definition at line 19 of file QGHistogram.hh.

Constructor & Destructor Documentation

◆ QGHistogram() [1/2]

QGHistogram::QGHistogram ( )

Default constructor.

Definition at line 43 of file QGHistogram.cc.

References fHistograms, MakeStylePlot(), SetLineColor(), and SetName().

Referenced by Duplicate().

◆ QGHistogram() [2/2]

QGHistogram::QGHistogram ( const QGHistogram histogram)

Copy constructor.

Definition at line 57 of file QGHistogram.cc.

References fHistograms, MakeStylePlot(), and SetName().

◆ ~QGHistogram()

QGHistogram::~QGHistogram ( )
virtual

Destructor.

Definition at line 70 of file QGHistogram.cc.

References fHistograms, QGPlot::fPlotEditWindow, and fStyleHistogram.

Member Function Documentation

◆ AutoSetAxisParameters()

void QGHistogram::AutoSetAxisParameters ( )

◆ AutoSetStyle()

void QGHistogram::AutoSetStyle ( )
virtual

Automatically set the histogram style.

Reimplemented from QGPlot.

Definition at line 136 of file QGHistogram.cc.

References fHistograms, MakeStylePlot(), and SetLineColor().

Referenced by Duplicate(), and QGPlotIconsFrame::HandleHistogramButton().

◆ Display()

void QGHistogram::Display ( )
virtual

◆ DisplayEditWindow()

void QGHistogram::DisplayEditWindow ( )
virtual

◆ DrawStyleHistogram()

void QGHistogram::DrawStyleHistogram ( )

Draw a mini-histogram showing the style of this histogram.

Definition at line 248 of file QGHistogram.cc.

References fDrawOption, fStyleHistogram, and MakeStylePlot().

Referenced by DisplayEditWindow().

◆ Duplicate()

void QGHistogram::Duplicate ( )
virtual

Duplicate the histogram.

Reimplemented from QGPlot.

Definition at line 264 of file QGHistogram.cc.

References AutoSetStyle(), DisplayEditWindow(), and QGHistogram().

◆ Erase()

void QGHistogram::Erase ( )
virtual

◆ Generate()

void QGHistogram::Generate ( QChain chain = 0)
virtual

◆ GetBinWidth()

Double_t QGHistogram::GetBinWidth ( Int_t  bin = 0) const
inline

Get bin width.

Definition at line 55 of file QGHistogram.hh.

References fBinWidth.

◆ GetHistograms()

static const std::list<QGHistogram*>& QGHistogram::GetHistograms ( )
inlinestatic

Get collection of histograms.

Definition at line 58 of file QGHistogram.hh.

References fHistograms.

Referenced by QGCalibrationWindow::SetUpHistograms().

◆ GetName()

const char * QGHistogram::GetName ( ) const
virtual

Get name of histogram.

Reimplemented from QGPlot.

Definition at line 321 of file QGHistogram.cc.

Referenced by SetName(), and QGHistogramEditWindow::SetPlot().

◆ GetNumberOfBins()

Int_t QGHistogram::GetNumberOfBins ( ) const

Get number of bins.

Definition at line 374 of file QGHistogram.cc.

Referenced by AutoSetAxisParameters(), Display(), SetXMax(), and SetXMin().

◆ GetParametersFromEditWindow()

void QGHistogram::GetParametersFromEditWindow ( )
virtual

◆ GetStyleHistogram()

TH1D* QGHistogram::GetStyleHistogram ( )
inline

Get style histogram.

Definition at line 70 of file QGHistogram.hh.

References fStyleHistogram.

◆ GetXMax()

Double_t QGHistogram::GetXMax ( ) const

Get x-max.

Definition at line 369 of file QGHistogram.cc.

Referenced by AutoSetAxisParameters(), Display(), SetNumberOfBins(), and SetXMin().

◆ GetXMin()

Double_t QGHistogram::GetXMin ( ) const

Get x-min.

Definition at line 364 of file QGHistogram.cc.

Referenced by AutoSetAxisParameters(), Display(), SetNumberOfBins(), and SetXMax().

◆ IsBinWidthSet()

bool QGHistogram::IsBinWidthSet ( )
inline

Return true if bin width is set.

Definition at line 79 of file QGHistogram.hh.

References fIsBinWidthSet.

◆ IsNumberOfBinsSet()

bool QGHistogram::IsNumberOfBinsSet ( )
inline

Return true if number of bins is set.

Definition at line 88 of file QGHistogram.hh.

References fAutoSetNumberOfBins.

◆ IsXMaxSet()

bool QGHistogram::IsXMaxSet ( )
inline

Return true if x-axis maximum is set.

Definition at line 82 of file QGHistogram.hh.

References fAutoSetXMax.

◆ IsXMinSet()

bool QGHistogram::IsXMinSet ( )
inline

Return true if x-axis minimum is set.

Definition at line 85 of file QGHistogram.hh.

References fAutoSetXMin.

◆ MakeStylePlot()

void QGHistogram::MakeStylePlot ( )

Make style plot.

Definition at line 379 of file QGHistogram.cc.

References fStyleHistogram.

Referenced by AutoSetStyle(), DrawStyleHistogram(), and QGHistogram().

◆ SetBinWidth()

void QGHistogram::SetBinWidth ( Double_t  binWidth)
inline

Set bin width.

Definition at line 94 of file QGHistogram.hh.

References fBinWidth, and fIsBinWidthSet.

Referenced by SetProperty().

◆ SetName()

void QGHistogram::SetName ( const char *  name = 0)
virtual

Set name of histogram.

Reimplemented from QGPlot.

Definition at line 395 of file QGHistogram.cc.

References fStyleHistogram, QGPlot::GeneratePlotName(), GetName(), and QGPlot::IsNameInUse().

Referenced by QGHistogram().

◆ SetNumberOfBins()

void QGHistogram::SetNumberOfBins ( Int_t  numberOfBins)

Set number of bins.

Definition at line 416 of file QGHistogram.cc.

References GetXMax(), and GetXMin().

Referenced by AutoSetAxisParameters(), GetParametersFromEditWindow(), and SetProperty().

◆ SetProperty()

void QGHistogram::SetProperty ( const std::string &  key,
const std::string &  value 
)
virtual

◆ SetXMax()

void QGHistogram::SetXMax ( Double_t  xMax)

Set x-max.

Definition at line 491 of file QGHistogram.cc.

References GetNumberOfBins(), and GetXMin().

Referenced by AutoSetAxisParameters(), GetParametersFromEditWindow(), and SetProperty().

◆ SetXMin()

void QGHistogram::SetXMin ( Double_t  xMin)

Set x-min.

Definition at line 496 of file QGHistogram.cc.

References GetNumberOfBins(), and GetXMax().

Referenced by AutoSetAxisParameters(), GetParametersFromEditWindow(), and SetProperty().

Member Data Documentation

◆ fAutoSetNumberOfBins

bool QGHistogram::fAutoSetNumberOfBins
private

Flag to automatically set the number of bins.

Definition at line 113 of file QGHistogram.hh.

Referenced by AutoSetAxisParameters(), GetParametersFromEditWindow(), IsNumberOfBinsSet(), and SetProperty().

◆ fAutoSetXMax

bool QGHistogram::fAutoSetXMax
private

Flag to automatically set the x-axis maximum.

Definition at line 116 of file QGHistogram.hh.

Referenced by AutoSetAxisParameters(), GetParametersFromEditWindow(), IsXMaxSet(), and SetProperty().

◆ fAutoSetXMin

bool QGHistogram::fAutoSetXMin
private

Flag to automatically set the x-axis minimum.

Definition at line 119 of file QGHistogram.hh.

Referenced by AutoSetAxisParameters(), GetParametersFromEditWindow(), IsXMinSet(), and SetProperty().

◆ fBinWidth

Double_t QGHistogram::fBinWidth
private

Bin width.

Definition at line 122 of file QGHistogram.hh.

Referenced by AutoSetAxisParameters(), GetBinWidth(), GetParametersFromEditWindow(), and SetBinWidth().

◆ fDataPoints

std::vector<Double_t> QGHistogram::fDataPoints
private

Collection of points underlying the histogram, useful for instant rebinning.

Definition at line 125 of file QGHistogram.hh.

Referenced by AutoSetAxisParameters(), Display(), and Generate().

◆ fDrawOption

std::string QGHistogram::fDrawOption
private

Draw option.

Definition at line 128 of file QGHistogram.hh.

Referenced by Display(), and DrawStyleHistogram().

◆ fHistograms

list< QGHistogram * > QGHistogram::fHistograms
staticprivate

Collection of pointers to all QGHistograms.

Definition at line 131 of file QGHistogram.hh.

Referenced by AutoSetStyle(), GetHistograms(), QGHistogram(), and ~QGHistogram().

◆ fIsBinWidthSet

bool QGHistogram::fIsBinWidthSet
private

Whether or not bin width is set.

Definition at line 134 of file QGHistogram.hh.

Referenced by AutoSetAxisParameters(), GetParametersFromEditWindow(), IsBinWidthSet(), and SetBinWidth().

◆ fNumberOfUniqueDataPoints

Int_t QGHistogram::fNumberOfUniqueDataPoints
private

Number of unique values among the data points, up to max 100.

Definition at line 137 of file QGHistogram.hh.

◆ fStyleHistogram

TH1D* QGHistogram::fStyleHistogram
private

Mini-histogram to show style of this histogram.

Definition at line 140 of file QGHistogram.hh.

Referenced by Display(), DrawStyleHistogram(), GetStyleHistogram(), MakeStylePlot(), SetName(), and ~QGHistogram().


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