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

Class to generate session files for the GUI from a Diana module. More...

Inheritance diagram for QGuiSession:

Public Member Functions

 QGuiSession (const std::string &name="GUI Session")
 Default constructor. More...
 
virtual ~QGuiSession ()
 Default destructor. More...
 
void Clear ()
 
QGuiCalibrationWindowCalibrationWindow (std::string name)
 Access calibration window. More...
 
void Dump (std::ostream &o) const
 Dump session to string to be written to file. More...
 
bool GetUseReaderFileList () const
 Get name MV FIXME (commented out) More...
 
QGuiHistogramHistogram (std::string name)
 Access histogram. More...
 
QGuiScatterPlotScatterPlot (std::string name)
 Access scatter plot. More...
 
void SetName (const std::string &name)
 Set name of session, becomes canvas window name. More...
 
void SetUseReaderFileList (const bool flag=true)
 Set a flag to use file list from the reader. More...
 

Private Member Functions

 QObjectDef (QGuiSession, 1)
 

Private Attributes

std::map< std::string, QGuiCalibrationWindowfCalibrationWindow
 Calibration windows. More...
 
std::map< std::string, QGuiHistogramfHistogram
 Histograms. More...
 
std::string fName
 Name. More...
 
std::map< std::string, QGuiScatterPlotfScatterPlot
 Scatter plots. More...
 
bool fUseReaderFileList
 Flag to use file list from the reader (default is to use file list from the writer) More...
 

Detailed Description

Class to generate session files for the GUI from a Diana module.

-------—Usage in module-------— QGuiSession session("MyGuiSessionName");

session.Histogram("EnergySpectrum_Channel1"); session.Histogram("EnergySpectrum_Channel1").SetXVariable("event_branch.fCalib.fEnergy"); session.Histogram("EnergySpectrum_Channel1").SetXMin(300); session.Histogram("EnergySpectrum_Channel1").SetXMax(3000); session.Histogram("EnergySpectrum_Channel1").SetNumberOfBins(2700); session.Histogram("EnergySpectrum_Channel1").SetCut("Channel == 1"); session.Histogram("EnergySpectrum_Channel1").SetCut("TriggerWord == 1");

session.ScatterPlot("AmplitudeVsBaseline_Channel1"); session.ScatterPlot("AmplitudeVsBaseline_Channel1").SetXVariable("event_branch.fPreProcess.fBaseline"); session.ScatterPlot("AmplitudeVsBaseline_Channel1").SetYVariable("event_branch.fOB.fAmplitude"); session.ScatterPlot("AmplitudeVsBaseline_Channel1").SetCut("HeaterFlag == 1"); session.ScatterPlot("AmplitudeVsBaseline_Channel1").SetCut("event_branch.fCountPulses.fNumberOfPulses == 1");

session.ScatterPlot("BaselineVsTime_Channel2"); session.ScatterPlot("BaselineVsTime_Channel2").SetXVariable("NsTime"); session.ScatterPlot("BaselineVsTime_Channel2").SetYVariable("event_branch.fPreProcess.fBaseline");

session.CalibrationWindow("FailedChannels"); session.CalibrationWindow("FailedChannels").AddPeak(511.0); session.CalibrationWindow("FailedChannels").AddPeak(583.0); session.CalibrationWindow("FailedChannels").AddPeak(2614.5); session.CalibrationWindow("FailedChannels").SetOutputFilename("filename");

// session.SetUseReaderFileList(true); // If this method is called, the GUI session file will contain the list of // files used by the current Reader. By default, the GUI session file // contains the list of files used by the current Writer;

SeqAuxData().SetQObject("UnimportantName", &session, "session.gui");

-------—Load GUI session global writer in config file-------— framework load GuiSessionWriter load RootGlobalReader load RootGlobalWriter load ASCIIGlobalReader load ASCIIGlobalWriter

endfw

-------—Makefile for module should contain-------— CXXFLAGS += -I..//pkg/guisession

CXXFLAGS += -I$(DIANA_INSTALL)/pkg/dianaguicommon

Definition at line 69 of file QGuiSession.hh.

Constructor & Destructor Documentation

◆ QGuiSession()

QGuiSession::QGuiSession ( const std::string &  name = "GUI Session")

Default constructor.

Definition at line 12 of file QGuiSession.cc.

References SetName().

◆ ~QGuiSession()

QGuiSession::~QGuiSession ( )
virtual

Default destructor.

Definition at line 18 of file QGuiSession.cc.

Member Function Documentation

◆ CalibrationWindow()

QGuiCalibrationWindow & QGuiSession::CalibrationWindow ( std::string  name)

Access calibration window.

Definition at line 22 of file QGuiSession.cc.

References fCalibrationWindow, and QGuiSessionItem::SetName().

◆ Clear()

void QGuiSession::Clear ( )
inline

Definition at line 77 of file QGuiSession.hh.

◆ Dump()

void QGuiSession::Dump ( std::ostream &  o) const

Dump session to string to be written to file.

Definition at line 32 of file QGuiSession.cc.

References CANVAS_WINDOW_NAME_KEY, fCalibrationWindow, fHistogram, and fScatterPlot.

◆ GetUseReaderFileList()

bool QGuiSession::GetUseReaderFileList ( ) const
inline

Get name MV FIXME (commented out)

Get flag to use file list from the reader

Definition at line 93 of file QGuiSession.hh.

◆ Histogram()

QGuiHistogram & QGuiSession::Histogram ( std::string  name)

Access histogram.

Definition at line 61 of file QGuiSession.cc.

References fHistogram, and QGuiSessionItem::SetName().

◆ QObjectDef()

QGuiSession::QObjectDef ( QGuiSession  ,
 
)
private

◆ ScatterPlot()

QGuiScatterPlot & QGuiSession::ScatterPlot ( std::string  name)

Access scatter plot.

Definition at line 71 of file QGuiSession.cc.

References fScatterPlot, and QGuiSessionItem::SetName().

◆ SetName()

void QGuiSession::SetName ( const std::string &  name)
inline

Set name of session, becomes canvas window name.

Definition at line 102 of file QGuiSession.hh.

Referenced by QGuiSession().

◆ SetUseReaderFileList()

void QGuiSession::SetUseReaderFileList ( const bool  flag = true)
inline

Set a flag to use file list from the reader.

Definition at line 105 of file QGuiSession.hh.

Member Data Documentation

◆ fCalibrationWindow

std::map<std::string, QGuiCalibrationWindow> QGuiSession::fCalibrationWindow
private

Calibration windows.

Definition at line 109 of file QGuiSession.hh.

Referenced by CalibrationWindow(), and Dump().

◆ fHistogram

std::map<std::string, QGuiHistogram> QGuiSession::fHistogram
private

Histograms.

Definition at line 112 of file QGuiSession.hh.

Referenced by Dump(), and Histogram().

◆ fName

std::string QGuiSession::fName
private

Name.

Definition at line 115 of file QGuiSession.hh.

◆ fScatterPlot

std::map<std::string, QGuiScatterPlot> QGuiSession::fScatterPlot
private

Scatter plots.

Definition at line 118 of file QGuiSession.hh.

Referenced by Dump(), and ScatterPlot().

◆ fUseReaderFileList

bool QGuiSession::fUseReaderFileList
private

Flag to use file list from the reader (default is to use file list from the writer)

Definition at line 122 of file QGuiSession.hh.


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