QGUIHistogramHandler Class Reference
[ApolloApollo Gui]

List of all members.


Detailed Description

read and manipulate histograms displayed in QGUIHistogramDisplay

Author:
sergio.didomizio@ge.infn.it Reads root files created by diana module MApolloHistoMaker.

Public Member Functions

 QGUIHistogramHandler ()
 ctor
virtual ~QGUIHistogramHandler ()
 dtor
void SetChannel (unsigned int channel)
 set logical channel to be displayed in channel based histograms
unsigned int GetChannel () const
 get current channel
void SetRateCanvas (TCanvas *ptr)
 set pointer to canvas used to draw counting rate histogram
void SetSpectrumCanvas (TCanvas *ptr)
 set pointer to canvas used to draw amplitude spectrum
void SetPulseCanvas (TCanvas *ptr)
 set pointer to canvas used to draw last pulse
void DrawHistograms ()
 perform graphical manipulation and draw histograms
bool CheckUpdate ()
 check whether new histograms are available
void ForceUpdate () const
 force update even if there is no new event for current channel
void Inhibit () const
 inhibit communication with MApolloHistoMaker by deleting config file and lock file
void SetHistogramColor (QApolloMonitorDefs::QMonitorEventType_t type, Int_t color)
 set histogram color for events of a given type
void SetSpectrumActive (QApolloMonitorDefs::QMonitorEventType_t type, bool active)
 toggle whether events of a given type will be shown in the amplitude spectrum
void SetRateActive (QApolloMonitorDefs::QMonitorEventType_t type, bool active)
 toggle whether events of a given type will be shown in the counting rate histogram
void SetRateStacked (bool stacked)
 select between stacked and side by side mode for counting rate histogram display
void SetSpectrumLogScale (bool logScale)
 toggle between linear and log scale in spectrum y axis
void SetAutoRangeSpectrum (bool lowerBound, bool upperBound)
 toggle between automatic and user defined range in amplitude spectrum
void SetSpectrumMin (Int_t min)
 set user defined lower bound for amplitude spectrum
void SetSpectrumMax (Int_t max)
 set user defined upper bound for amplitude spectrum

Private Member Functions

bool UpdateHistograms ()
 read root file and update histograms
void ResetHistograms ()
 reset all histograms
void EvalSpectrumRange ()
 evaluate x axis range for current spectrum histo
std::string GetTimeString (const time_t &time, const std::string &format)
 utility function to convert from time_t to string
void DrawStackedHistograms (bool type, bool stacked)
 draw multiple histograms on the same canvas, one for each active event type

Private Attributes

unsigned int fChannel
std::string fRootFile
std::map
< QApolloMonitorDefs::QMonitorEventType_t,
TH1F > 
fRateHisto
std::map
< QApolloMonitorDefs::QMonitorEventType_t,
TH1F > 
fSpectrumHisto
TH1F fPulseHisto
std::map< UInt_t, std::map
< QApolloMonitorDefs::QMonitorEventType_t,
int > > 
fLastSpectrumBin
std::map< UInt_t, std::map
< QApolloMonitorDefs::QMonitorEventType_t,
int > > 
fFirstSpectrumBin
Double_t fTimeFromStart
time_t fEventTime
unsigned int fSamplingRate
QApolloMonitorDefs::QMonitorEventType_t fEventType
QMonitorHistogramReaderfReader
QMonitorConfigHandlerfConfigHandler
TCanvas * fRateCanvas
TCanvas * fSpectrumCanvas
TCanvas * fPulseCanvas
bool fRateStacked
bool fSpectrumLogScale
bool fAutoRangeSpectrumMin
bool fAutoRangeSpectrumMax
Int_t fSpectrumMin
Int_t fSpectrumMax
std::map
< QApolloMonitorDefs::QMonitorEventType_t,
Int_t > 
fColors
std::map
< QApolloMonitorDefs::QMonitorEventType_t,
bool > 
fSpectrumActive
std::map
< QApolloMonitorDefs::QMonitorEventType_t,
bool > 
fRateActive

Member Function Documentation

bool QGUIHistogramHandler::CheckUpdate (  ) 

check whether new histograms are available

Returns:
true if new histograms are available
New histograms are available when lock file does not exist. If this condition is verified, histograms are updated and a new lock file is dumped

References QMonitorConfigHandler::CheckLockFile(), QMonitorConfigHandler::DumpLockFile(), fConfigHandler, fReader, QMonitorHistogramReader::GetError(), ResetHistograms(), and UpdateHistograms().

Referenced by QGUIHistogramDisplay::UpdateDisplay().

void QGUIHistogramHandler::SetRateStacked ( bool  stacked  )  [inline]

select between stacked and side by side mode for counting rate histogram display

Parameters:
stacked true for stacked, false for side by side

References fRateStacked.

Referenced by QGUIHistogramDisplay::UpdateDisplay().

void QGUIHistogramHandler::SetAutoRangeSpectrum ( bool  lowerBound,
bool  upperBound 
) [inline]

toggle between automatic and user defined range in amplitude spectrum

Parameters:
lowerBound whehter lower bound should be determined automatically
upperBound whether upper bound should be determined automatically
User defined range has effect only if the values set via SetSpectrumMin() and SetSpectrumMax() are valid (-1 < min < max < 10000)

References fAutoRangeSpectrumMax, and fAutoRangeSpectrumMin.

Referenced by QGUIHistogramDisplay::UpdateDisplay().

void QGUIHistogramHandler::SetSpectrumMin ( Int_t  min  )  [inline]

set user defined lower bound for amplitude spectrum

Parameters:
min lower bound in mV
  • In order to use the range set in this function for the amplitude spectrum, the SetAutoRangeSpectrum() method must be called too
  • If provided parameter is not valid, user defined range has no effect
  • Due to histogram binning, it is not always possible to set the values requested by the user. The approach used is to set the actual spectrum bound to the allowed value that is the closest to the requested one.

References fSpectrumMin.

Referenced by QGUIHistogramDisplay::UpdateDisplay().

void QGUIHistogramHandler::SetSpectrumMax ( Int_t  max  )  [inline]

set user defined upper bound for amplitude spectrum

Parameters:
max upper bound in mV
  • In order to use the range set in this function for the amplitude spectrum, the SetAutoRangeSpectrum() method must be called too
  • If provided parameter is not valid, user defined range has no effect
  • Due to histogram binning, it is not always possible to set the values requested by the user. The approach used is to set the actual spectrum bound to the allowed value that is the closest to the requested one.

References fSpectrumMax.

Referenced by QGUIHistogramDisplay::UpdateDisplay().

bool QGUIHistogramHandler::UpdateHistograms (  )  [private]

std::string QGUIHistogramHandler::GetTimeString ( const time_t &  time,
const std::string &  format 
) [private]

utility function to convert from time_t to string

Parameters:
time value to be converted
format date format as specified in strftime()
Returns:
string filled with formatted date or "NOT_DETECTED" if time is 0

Referenced by DrawHistograms().

void QGUIHistogramHandler::DrawStackedHistograms ( bool  type,
bool  stacked 
) [private]

draw multiple histograms on the same canvas, one for each active event type

Parameters:
type true for counting rate histo, false for amplitude spectrum
stacked whether to use stacked mode

References fAutoRangeSpectrumMax, fAutoRangeSpectrumMin, fColors, fEventType, fFirstSpectrumBin, fLastSpectrumBin, fRateActive, fRateCanvas, fRateHisto, fSpectrumActive, fSpectrumCanvas, fSpectrumHisto, fSpectrumLogScale, QApolloMonitorDefs::QBolometer_t, QApolloMonitorDefs::QHeater_t, and QApolloMonitorDefs::QNoise_t.

Referenced by DrawHistograms().


Member Data Documentation

unsigned int QGUIHistogramHandler::fChannel [private]

current logical channel

Referenced by GetChannel().

std::string QGUIHistogramHandler::fRootFile [private]

name of the root file containing histograms

Referenced by UpdateHistograms().

key: event type, value: counting rate histogram

Referenced by DrawStackedHistograms(), ResetHistograms(), and UpdateHistograms().

key: event type, value: amplitude spectrum histogram

Referenced by DrawStackedHistograms(), EvalSpectrumRange(), ResetHistograms(), and UpdateHistograms().

last pulse from channel fChannel

Referenced by DrawHistograms(), ResetHistograms(), and UpdateHistograms().

  • key: logical channel
  • value: another map, with
    • key: event type
    • value: index of the highest non empty bin in amplitude spectrum histo

Referenced by DrawStackedHistograms(), and EvalSpectrumRange().

  • key: logical channel
  • value: another map, with
    • key: event type
    • value: index of the lowest non empty bin in amplitude spectrum histo

Referenced by DrawStackedHistograms(), and EvalSpectrumRange().

time from run start in s

unix time of the last event

unsigned int QGUIHistogramHandler::fSamplingRate [private]

sampling rate used for pulse digitization

event type of the last pulse

Referenced by DrawHistograms(), DrawStackedHistograms(), ResetHistograms(), and UpdateHistograms().

root file handler

Referenced by CheckUpdate(), UpdateHistograms(), and ~QGUIHistogramHandler().

config file handler

Referenced by CheckUpdate(), ForceUpdate(), Inhibit(), SetChannel(), and ~QGUIHistogramHandler().

canvas used to draw counting rate

Referenced by DrawStackedHistograms(), and SetRateCanvas().

canvas used to draw amplitude spectrum

Referenced by DrawStackedHistograms(), and SetSpectrumCanvas().

canvas used to draw last pulse

Referenced by DrawHistograms(), and SetPulseCanvas().

whether to use stacked mode in rate histo

Referenced by DrawHistograms(), and SetRateStacked().

whether to use log scale in spectrum

Referenced by DrawStackedHistograms(), and SetSpectrumLogScale().

whether to use automatic lower bound evaluation in amplitude spectrum

Referenced by DrawStackedHistograms(), and SetAutoRangeSpectrum().

whether to use automatic upper bound evaluation in amplitude spectrum

Referenced by DrawStackedHistograms(), and SetAutoRangeSpectrum().

amplitude spectrum lower bound in mV

Referenced by SetSpectrumMin().

amplitude spectrum upper bound in mV

Referenced by SetSpectrumMax().

key: event type, value: histogram color

Referenced by DrawHistograms(), DrawStackedHistograms(), and SetHistogramColor().

key: event type, value, whether corresponding spectrum is active

Referenced by DrawStackedHistograms(), EvalSpectrumRange(), and SetSpectrumActive().

key: event type, value, whether corresponding rate histo is active

Referenced by DrawStackedHistograms(), and SetRateActive().


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

Generated on Tue Nov 16 10:50:06 2010 for CUORE Software by  doxygen 1.5.6