QGUIHistogramHandler Class Reference

List of all members.

Detailed Description

non graphical class used to read histograms to be displayed by QGUIHistogramDisplay class

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


Public Member Functions

 QGUIHistogramHandler ()
 ctor
virtual ~QGUIHistogramHandler ()
 dtor
void SetChannel (unsigned int channel)
 set channel to be displayed
unsigned int GetChannel () const
 get current channel
TH1F & GetRateHistogram ()
 histogram content makes sense only if this method is called after a successful call to CheckUpdate()
TH1F & GetPulseHistogram ()
 histogram content makes sense only if this method is called after a successful call to CheckUpdate()
TH1F & GetSpectrumHistogram ()
 histogram content makes sense only if this method is called after a successful call to CheckUpdate()
bool CheckUpdate ()
 check whether new histograms are available
void ForceUpdate () const
 force histograms 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 UpdateSpectrumRange ()
 scedule spectrum range update next time histogram is update

Private Member Functions

bool UpdateConfigFile (bool force=false) const
 write current channel to config file
bool UpdateHistograms ()
 read root file and update histograms
void ResetHistograms ()
 reset all histograms
void DressHistograms ()
 perform graphical manipulation on histograms
void EvalSpectrumRange ()
 evaluate x axis range for current spectrum histo
bool DumpLockFile () const
 dump empty "lock" file used to tell MApolloHistoMaker that we are waiting for new data
std::string GetTimeString (const time_t &time, const std::string &format)
 utility function to convert from time_t to string

Private Attributes

unsigned int fChannel
std::string fFilesPath
std::string fLockFile
std::string fConfigFile
std::string fRootFile
TH1F fRateHisto
TH1F fPulseHisto
TH1F fSpectrumHisto
bool fUpdateSpectrumRange
int fLastSpectrumBin
time_t fTimeFromStart
time_t fEventTime
unsigned int fSamplingRate


Member Function Documentation

void QGUIHistogramHandler::SetChannel ( unsigned int  channel  ) 

set channel to be displayed

Parameters:
channel daq logical channel
This method returns immediately if channel equals current channel.

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

bool QGUIHistogramHandler::UpdateConfigFile ( bool  force = false  )  const [private]

write current channel to config file

Parameters:
force if true, -1*fChannel (instead of bare fChannel) is dumped into config file
Returns:
true if file can be written, false otherwise
Config file contains just the channel to be dumped by MApolloHistoMaker. Lockfile is removed to avoid concurrent access to config file with MApolloHistoMaker (see source code for further details)

bool QGUIHistogramHandler::UpdateHistograms (  )  [private]

read root file and update histograms

Returns:
true on success, false if file cannot be open in read mode or one of the histograms cannot be read. In this case histograms are reset by mean of ResetHistograms().

bool QGUIHistogramHandler::DumpLockFile (  )  const [private]

dump empty "lock" file used to tell MApolloHistoMaker that we are waiting for new data

Returns:
true on success, false if lock file cannot be dumped

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


The documentation for this class was generated from the following files:
Generated on Fri Mar 6 13:40:43 2009 for CUORE Software by  doxygen 1.5.1