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 |
QMonitorHistogramReader * | fReader |
QMonitorConfigHandler * | fConfigHandler |
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 |
bool QGUIHistogramHandler::CheckUpdate | ( | ) |
check whether new histograms are available
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
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
lowerBound | whehter lower bound should be determined automatically | |
upperBound | whether upper bound should be determined automatically |
References fAutoRangeSpectrumMax, and fAutoRangeSpectrumMin.
Referenced by QGUIHistogramDisplay::UpdateDisplay().
void QGUIHistogramHandler::SetSpectrumMin | ( | Int_t | min | ) | [inline] |
set user defined lower bound for amplitude spectrum
min | lower bound in mV |
References fSpectrumMin.
Referenced by QGUIHistogramDisplay::UpdateDisplay().
void QGUIHistogramHandler::SetSpectrumMax | ( | Int_t | max | ) | [inline] |
set user defined upper bound for amplitude spectrum
max | upper bound in mV |
References fSpectrumMax.
Referenced by QGUIHistogramDisplay::UpdateDisplay().
bool QGUIHistogramHandler::UpdateHistograms | ( | ) | [private] |
read root file and update histograms
References fEventType, fPulseHisto, fRateHisto, fReader, fRootFile, fSpectrumHisto, QMonitorHistogramReader::GetEventType(), QMonitorHistogramReader::GetLgChannel(), QMonitorHistogramReader::GetPulse(), QMonitorHistogramReader::GetRateHistogram(), QMonitorHistogramReader::GetSamplingRate(), QMonitorHistogramReader::GetSpectrum(), QMonitorHistogramReader::GetTimeSec(), QMonitorHistogramReader::GetTimeUnix(), QApolloMonitorDefs::QBolometer_t, QApolloMonitorDefs::QHeater_t, QApolloMonitorDefs::QNoise_t, and QMonitorHistogramReader::Read().
Referenced by CheckUpdate().
std::string QGUIHistogramHandler::GetTimeString | ( | const time_t & | time, | |
const std::string & | format | |||
) | [private] |
utility function to convert from time_t to string
time | value to be converted | |
format | date format as specified in strftime() |
Referenced by DrawHistograms().
void QGUIHistogramHandler::DrawStackedHistograms | ( | bool | type, | |
bool | stacked | |||
) | [private] |
draw multiple histograms on the same canvas, one for each active event type
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().
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().
std::map<QApolloMonitorDefs::QMonitorEventType_t, TH1F> QGUIHistogramHandler::fRateHisto [private] |
key: event type, value: counting rate histogram
Referenced by DrawStackedHistograms(), ResetHistograms(), and UpdateHistograms().
std::map<QApolloMonitorDefs::QMonitorEventType_t, TH1F> QGUIHistogramHandler::fSpectrumHisto [private] |
key: event type, value: amplitude spectrum histogram
Referenced by DrawStackedHistograms(), EvalSpectrumRange(), ResetHistograms(), and UpdateHistograms().
TH1F QGUIHistogramHandler::fPulseHisto [private] |
last pulse from channel fChannel
Referenced by DrawHistograms(), ResetHistograms(), and UpdateHistograms().
std::map<UInt_t, std::map<QApolloMonitorDefs::QMonitorEventType_t, int> > QGUIHistogramHandler::fLastSpectrumBin [private] |
Referenced by DrawStackedHistograms(), and EvalSpectrumRange().
std::map<UInt_t, std::map<QApolloMonitorDefs::QMonitorEventType_t, int> > QGUIHistogramHandler::fFirstSpectrumBin [private] |
Referenced by DrawStackedHistograms(), and EvalSpectrumRange().
Double_t QGUIHistogramHandler::fTimeFromStart [private] |
time from run start in s
time_t QGUIHistogramHandler::fEventTime [private] |
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().
TCanvas* QGUIHistogramHandler::fRateCanvas [private] |
canvas used to draw counting rate
Referenced by DrawStackedHistograms(), and SetRateCanvas().
TCanvas* QGUIHistogramHandler::fSpectrumCanvas [private] |
canvas used to draw amplitude spectrum
Referenced by DrawStackedHistograms(), and SetSpectrumCanvas().
TCanvas* QGUIHistogramHandler::fPulseCanvas [private] |
canvas used to draw last pulse
Referenced by DrawHistograms(), and SetPulseCanvas().
bool QGUIHistogramHandler::fRateStacked [private] |
whether to use stacked mode in rate histo
Referenced by DrawHistograms(), and SetRateStacked().
bool QGUIHistogramHandler::fSpectrumLogScale [private] |
whether to use log scale in spectrum
Referenced by DrawStackedHistograms(), and SetSpectrumLogScale().
bool QGUIHistogramHandler::fAutoRangeSpectrumMin [private] |
whether to use automatic lower bound evaluation in amplitude spectrum
Referenced by DrawStackedHistograms(), and SetAutoRangeSpectrum().
bool QGUIHistogramHandler::fAutoRangeSpectrumMax [private] |
whether to use automatic upper bound evaluation in amplitude spectrum
Referenced by DrawStackedHistograms(), and SetAutoRangeSpectrum().
Int_t QGUIHistogramHandler::fSpectrumMin [private] |
amplitude spectrum lower bound in mV
Referenced by SetSpectrumMin().
Int_t QGUIHistogramHandler::fSpectrumMax [private] |
amplitude spectrum upper bound in mV
Referenced by SetSpectrumMax().
std::map<QApolloMonitorDefs::QMonitorEventType_t, Int_t> QGUIHistogramHandler::fColors [private] |
key: event type, value: histogram color
Referenced by DrawHistograms(), DrawStackedHistograms(), and SetHistogramColor().
std::map<QApolloMonitorDefs::QMonitorEventType_t, bool> QGUIHistogramHandler::fSpectrumActive [private] |
key: event type, value, whether corresponding spectrum is active
Referenced by DrawStackedHistograms(), EvalSpectrumRange(), and SetSpectrumActive().
std::map<QApolloMonitorDefs::QMonitorEventType_t, bool> QGUIHistogramHandler::fRateActive [private] |
key: event type, value, whether corresponding rate histo is active
Referenced by DrawStackedHistograms(), and SetRateActive().