ROOTANA
Public Member Functions | Private Member Functions | Private Attributes
TRootanaDisplay Class Referenceabstract

#include <TRootanaDisplay.hxx>

Inheritance diagram for TRootanaDisplay:
Inheritance graph
[legend]
Collaboration diagram for TRootanaDisplay:
Collaboration graph
[legend]

Public Member Functions

 TRootanaDisplay ()
 
virtual ~TRootanaDisplay ()
 
virtual void AddAllCanvases ()=0
 User must. More...
 
void AddSingleCanvas (std::string name, std::string subtab_name=std::string(""))
 Add a new canvas; user will interactively fill it. More...
 
void AddSingleCanvas (TCanvasHandleBase *handleClass, std::string subtab_name=std::string(""))
 
TMainDisplayWindowGetDisplayWindow ()
 
virtual void UpdateHistograms (TDataContainer &dataContainer)
 This method can be implemented by users to update user histograms. More...
 
virtual void PlotCanvas (TDataContainer &dataContainer)
 This method can be implemented by users to plotting of current canvas. More...
 
virtual void ResetHistograms ()
 This method can be implemented by users to plotting of current canvas. More...
 
void NextButtonPushed ()
 Method for when next button is pushed. More...
 
void NextInterestingButtonPushed ()
 Method for when next interesting button is pushed. More...
 
void EventSkipButtonPushed ()
 Method for when skip event button is pushed (online mode) More...
 
void Reset ()
 
void UpdatePlotsAction ()
 
void QuitButtonAction ()
 Method to call when 'quit' button is pressed. More...
 
void SetNumberSkipEvent (int number)
 
void SetSecondsBeforeUpdating (double SecondsBeforeUpdating)
 Function so that user can skip how many seconds to wait in free-running mode. More...
 
void SetOnlineUpdatingBasedSeconds (bool updateBasedSeconds=true)
 
std::string GetDisplayName ()
 Get Display name. More...
 
void SetDisplayName (std::string name)
 Set Display name. More...
 
void InitializeRAD ()
 Special version of Init method, to be used only by TRootanaDisplay. More...
 
bool CheckOptionRAD (std::string option)
 
void UsageRAD ()
 Also a special version of usage for TRootanaDisplay. See CheckOptionRAD. More...
 
- Public Member Functions inherited from TRootanaEventLoop
virtual ~TRootanaEventLoop ()
 
TDataContainerGetDataContainer ()
 Method to get the data container that event loop owns. More...
 
virtual void Initialize (void)
 
virtual void BeginRun (int transition, int run, int time)
 
virtual void EndRun (int transition, int run, int time)
 
virtual void Finalize ()
 
virtual void Usage (void)
 
virtual bool CheckOption (std::string option)
 
virtual bool PreFilter (TDataContainer &dataContainer)
 
bool IsOnline () const
 Are we processing online data? More...
 
bool IsOffline () const
 Are we processing offline data? More...
 
int GetCurrentRunNumber () const
 Current Run Number. More...
 
void SetCurrentRunNumber (int run)
 Current Run Number. More...
 
int ExecuteLoop (int argc, char *argv[])
 Method to actually process the Midas information, either as file or online. More...
 
int ProcessMidasFile (TApplication *app, const char *fname)
 
int ProcessMidasOnline (TApplication *app, const char *hostname, const char *exptname)
 
void DisableAutoMainWindow ()
 Disable automatic creation of MainWindow. More...
 
void UseBatchMode ()
 Use a batch mode, where we don't check ROOT status. More...
 
MVOdbGetODB ()
 Get pointer to ODB variables. More...
 
void OpenRootFile (int run, std::string midasFilename=std::string(""))
 Open output ROOT file. More...
 
void CloseRootFile ()
 Cloe output ROOT file. More...
 
bool IsRootFileValid ()
 Check if output ROOT file is valid and open. More...
 
void DisableRootOutput (bool disable=true)
 
int IsRootOutputEnabled ()
 
void SetOutputFilename (std::string name)
 
virtual std::string SetFullOutputFileName (int run, std::string midasFilename)
 
void SetOnlineName (std::string name)
 
void ProcessThisEventID (int eventID)
 
bool CheckEventID (int eventId)
 Little helper method to check if EventID matchs requested EventID list. More...
 
void SuppressTimestampWarnings ()
 
bool GetSuppressTimestampWarnings ()
 Suppress timestamp warnings? true = suppress warnings. More...
 
void UseOnlyRecent (bool setting=true)
 
void SetTHttpServerReadWrite (bool readwrite=true)
 

Private Member Functions

void InitializeMainWindow ()
 Method to initialize the Main display window. More...
 
bool ProcessMidasEvent (TDataContainer &dataContainer)
 Process each midas event. More...
 
bool ProcessMidasEventOnline (TDataContainer &dataContainer)
 Process each online midas event. More...
 
bool ProcessMidasEventOffline (TDataContainer &dataContainer)
 Process each offline midas event. More...
 
void BeginRunRAD (int transition, int run, int time)
 
void EndRunRAD (int transition, int run, int time)
 
void SetCachedDataContainer (TDataContainer &dataContainer)
 

Private Attributes

bool waitingForNextButton
 
bool waitingForNextInterestingButton
 
int fNumberSkipEventsOnline
 
int fNumberSkipEventsOffline
 
bool fUpdatingBasedSeconds
 
double fLastUpdateTime
 
int fNumberProcessed
 
double fSecondsBeforeUpdating
 
bool fQuitPushed
 Flag to keep track of if quite button has been pushed. More...
 
TMainDisplayWindowfMainWindow
 The pointer to our display window. More...
 
TDataContainerfCachedDataContainer
 We keep a cached copy of the midas event (so that it can used for callback). More...
 
std::string fDisplayName
 Display name. More...
 
std::vector< std::pair< std::pair< int, int >,TCanvasHandleBase * > > fCanvasHandlers
 

Additional Inherited Members

- Static Public Member Functions inherited from TRootanaEventLoop
static TRootanaEventLoopGet (void)
 
template<typename T >
static void CreateSingleton ()
 
- Protected Member Functions inherited from TRootanaEventLoop
bool CreateOutputFile (std::string name, std::string options="RECREATE")
 
 TRootanaEventLoop ()
 
- Protected Attributes inherited from TRootanaEventLoop
TDirectoryfOnlineHistDir
 TDirectory for online histograms. More...
 
- Static Protected Attributes inherited from TRootanaEventLoop
static TRootanaEventLoopfTRootanaEventLoop = NULL
 The static pointer to the singleton instance. More...
 

Detailed Description

This is an abstract base class for event displays.
Users need to define a class that derives from this class in order to make an event display. The only method that users must implement is the method AddAllCanvas(), where the user defines which tabs to use.

The user then needs to define how they what to update and plot histograms. The updating of histograms happens for each event. In online mode, the plotting of histograms only happens for each XX events; for offline mode the plotting happens for each event.

There are two ways that users can decide to update and plot histograms:

1) They can create histograms in their event display class and then fill the methods UpdateHistograms(TDataContainer) and PlotCanvas(TDataContainer). This histograms can then file in the canvases that are added using AddSingleCanvas(std::string name).

2) They can create classes that are derived from TCanvasHandleBase. The derived classes are then added using the method AddSingleCanvas(TCanvasHandleBase* handleClass).

There is no substantial difference between the two methods. The second method is mainly meant to allow the user to separate the methods into separate files for code cleaniness.

Examples of both these methods are available in examples/display_example.cxx

The actual ROOT GUI is encapsulated in a separate class TMainDisplayWindow. The TRootanaDisplay has an instance of this TMainDisplayWindow class. Users will be need to access the TMainDisplayWindow by calling

TRootanaDisplay::GetDisplayWindow()

in order to grab the particular canvas that we want plot on.

There is also the functionality to add sub-tab groups to a particular tab, so that you can have a set of tabs of tabs. To use this functionality you use the syntax

AddSingleCanvas(..., <tab name string>)

to add a new tab to the top level tab named 'tab name string'.

Definition at line 58 of file TRootanaDisplay.hxx.

Constructor & Destructor Documentation

◆ TRootanaDisplay()

TRootanaDisplay::TRootanaDisplay ( )

◆ ~TRootanaDisplay()

TRootanaDisplay::~TRootanaDisplay ( )
virtual

Definition at line 36 of file TRootanaDisplay.cxx.

Member Function Documentation

◆ AddAllCanvases()

virtual void TRootanaDisplay::AddAllCanvases ( )
pure virtual

User must.

Implemented in MyTestLoop, and MyTestLoop.

Here is the caller graph for this function:

◆ AddSingleCanvas() [1/2]

void TRootanaDisplay::AddSingleCanvas ( std::string  name,
std::string  subtab_name = std::string("") 
)
inline

Add a new canvas; user will interactively fill it.

Definition at line 71 of file TRootanaDisplay.hxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddSingleCanvas() [2/2]

void TRootanaDisplay::AddSingleCanvas ( TCanvasHandleBase handleClass,
std::string  subtab_name = std::string("") 
)

Add a new canvas, using a TCanvasHandleBase class. TRootanaDisplay will take ownership of pointer and delete memory it points to.

Definition at line 106 of file TRootanaDisplay.cxx.

Here is the call graph for this function:

◆ BeginRunRAD()

void TRootanaDisplay::BeginRunRAD ( int  transition,
int  run,
int  time 
)
privatevirtual

Called before the first event of a file is read, but you should prefer Initialize() for general initialization. This method will be called once for each input file.

Reimplemented from TRootanaEventLoop.

Definition at line 304 of file TRootanaDisplay.cxx.

Here is the call graph for this function:

◆ CheckOptionRAD()

bool TRootanaDisplay::CheckOptionRAD ( std::string  option)
inlinevirtual

This is a special version of CheckOption that is only used by TRootanaDisplay. This is just so that users still have the ability to set options for
executables derived from TRootanaDisplay.

Reimplemented from TRootanaEventLoop.

Definition at line 160 of file TRootanaDisplay.hxx.

◆ EndRunRAD()

void TRootanaDisplay::EndRunRAD ( int  transition,
int  run,
int  time 
)
privatevirtual

Called after the last event of a file is read, but you should prefer Finalize() for general finalization. This method will be called once for each input file.

Reimplemented from TRootanaEventLoop.

Definition at line 312 of file TRootanaDisplay.cxx.

Here is the call graph for this function:

◆ EventSkipButtonPushed()

void TRootanaDisplay::EventSkipButtonPushed ( )
inline

Method for when skip event button is pushed (online mode)

Definition at line 108 of file TRootanaDisplay.hxx.

Here is the call graph for this function:

◆ GetDisplayName()

std::string TRootanaDisplay::GetDisplayName ( )
inline

Get Display name.

Definition at line 152 of file TRootanaDisplay.hxx.

Here is the caller graph for this function:

◆ GetDisplayWindow()

TMainDisplayWindow* TRootanaDisplay::GetDisplayWindow ( )
inline

Retrieve the main display window, so that users can do things like grab the canvases and update them.

Definition at line 83 of file TRootanaDisplay.hxx.

Here is the caller graph for this function:

◆ InitializeMainWindow()

void TRootanaDisplay::InitializeMainWindow ( )
private

Method to initialize the Main display window.

Definition at line 52 of file TRootanaDisplay.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ InitializeRAD()

void TRootanaDisplay::InitializeRAD ( void  )
inlinevirtual

Special version of Init method, to be used only by TRootanaDisplay.

Reimplemented from TRootanaEventLoop.

Definition at line 156 of file TRootanaDisplay.hxx.

Here is the call graph for this function:

◆ NextButtonPushed()

void TRootanaDisplay::NextButtonPushed ( )
inline

Method for when next button is pushed.

Definition at line 95 of file TRootanaDisplay.hxx.

◆ NextInterestingButtonPushed()

void TRootanaDisplay::NextInterestingButtonPushed ( )
inline

Method for when next interesting button is pushed.

Definition at line 101 of file TRootanaDisplay.hxx.

◆ PlotCanvas()

virtual void TRootanaDisplay::PlotCanvas ( TDataContainer dataContainer)
inlinevirtual

This method can be implemented by users to plotting of current canvas.

Reimplemented in MyTestLoop, and MyTestLoop.

Definition at line 89 of file TRootanaDisplay.hxx.

Here is the caller graph for this function:

◆ ProcessMidasEvent()

bool TRootanaDisplay::ProcessMidasEvent ( TDataContainer dataContainer)
privatevirtual

Process each midas event.

Make separate treatment of online and offline data, since both are quite different.

Implements TRootanaEventLoop.

Reimplemented in MyTestLoop.

Definition at line 129 of file TRootanaDisplay.cxx.

Here is the call graph for this function:

◆ ProcessMidasEventOffline()

bool TRootanaDisplay::ProcessMidasEventOffline ( TDataContainer dataContainer)
private

Process each offline midas event.

Definition at line 231 of file TRootanaDisplay.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ProcessMidasEventOnline()

bool TRootanaDisplay::ProcessMidasEventOnline ( TDataContainer dataContainer)
private

Process each online midas event.

Handle online processing of MIDAS events.

Definition at line 146 of file TRootanaDisplay.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ QuitButtonAction()

void TRootanaDisplay::QuitButtonAction ( )

Method to call when 'quit' button is pressed.

Definition at line 390 of file TRootanaDisplay.cxx.

Here is the call graph for this function:

◆ Reset()

void TRootanaDisplay::Reset ( )

This method calls a couple other methods for resets the histograms. This method is attached using the ROOT signal/input system to the reset button on the canvas.

Definition at line 380 of file TRootanaDisplay.cxx.

Here is the call graph for this function:

◆ ResetHistograms()

virtual void TRootanaDisplay::ResetHistograms ( )
inlinevirtual

This method can be implemented by users to plotting of current canvas.

Reimplemented in MyTestLoop, and MyTestLoop.

Definition at line 92 of file TRootanaDisplay.hxx.

Here is the caller graph for this function:

◆ SetCachedDataContainer()

void TRootanaDisplay::SetCachedDataContainer ( TDataContainer dataContainer)
inlineprivate

Set the cached copy of midas dataContainer. !!! This is very questionable! Caching each dataContainer might add a considerable overhead to the processing!

Definition at line 241 of file TRootanaDisplay.hxx.

Here is the caller graph for this function:

◆ SetDisplayName()

void TRootanaDisplay::SetDisplayName ( std::string  name)
inline

Set Display name.

Definition at line 154 of file TRootanaDisplay.hxx.

Here is the caller graph for this function:

◆ SetNumberSkipEvent()

void TRootanaDisplay::SetNumberSkipEvent ( int  number)
inline

Function so that user can specify at outset how many events to skip before refreshing display (in online mode).

Definition at line 132 of file TRootanaDisplay.hxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetOnlineUpdatingBasedSeconds()

void TRootanaDisplay::SetOnlineUpdatingBasedSeconds ( bool  updateBasedSeconds = true)
inline

Function so user can chose to update display after X seconds, rather than X events in online mode. Must be called in constructor of the display program.

Definition at line 147 of file TRootanaDisplay.hxx.

Here is the caller graph for this function:

◆ SetSecondsBeforeUpdating()

void TRootanaDisplay::SetSecondsBeforeUpdating ( double  SecondsBeforeUpdating)
inline

Function so that user can skip how many seconds to wait in free-running mode.

Definition at line 141 of file TRootanaDisplay.hxx.

◆ UpdateHistograms()

virtual void TRootanaDisplay::UpdateHistograms ( TDataContainer dataContainer)
inlinevirtual

This method can be implemented by users to update user histograms.

Reimplemented in MyTestLoop, and MyTestLoop.

Definition at line 86 of file TRootanaDisplay.hxx.

Here is the caller graph for this function:

◆ UpdatePlotsAction()

void TRootanaDisplay::UpdatePlotsAction ( )

This is a generic action to call when some button gets pushed. Also called in regular event handling loop

Definition at line 338 of file TRootanaDisplay.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UsageRAD()

void TRootanaDisplay::UsageRAD ( void  )
inlinevirtual

Also a special version of usage for TRootanaDisplay. See CheckOptionRAD.

Reimplemented from TRootanaEventLoop.

Definition at line 173 of file TRootanaDisplay.hxx.

Field Documentation

◆ fCachedDataContainer

TDataContainer* TRootanaDisplay::fCachedDataContainer
private

We keep a cached copy of the midas event (so that it can used for callback).

Definition at line 236 of file TRootanaDisplay.hxx.

◆ fCanvasHandlers

std::vector< std::pair<std::pair<int,int> ,TCanvasHandleBase*> > TRootanaDisplay::fCanvasHandlers
private

This is a vector of user-defined canvas handler classes. The first part of pair is the tab number.

Definition at line 251 of file TRootanaDisplay.hxx.

◆ fDisplayName

std::string TRootanaDisplay::fDisplayName
private

Display name.

Definition at line 247 of file TRootanaDisplay.hxx.

◆ fLastUpdateTime

double TRootanaDisplay::fLastUpdateTime
private

Definition at line 201 of file TRootanaDisplay.hxx.

◆ fMainWindow

TMainDisplayWindow* TRootanaDisplay::fMainWindow
private

The pointer to our display window.

Definition at line 213 of file TRootanaDisplay.hxx.

◆ fNumberProcessed

int TRootanaDisplay::fNumberProcessed
private

Definition at line 204 of file TRootanaDisplay.hxx.

◆ fNumberSkipEventsOffline

int TRootanaDisplay::fNumberSkipEventsOffline
private

Variable to keep track of how many events to skip when running offline; defined by command line argument.

Definition at line 195 of file TRootanaDisplay.hxx.

◆ fNumberSkipEventsOnline

int TRootanaDisplay::fNumberSkipEventsOnline
private

Variable to keep track of how many events to skip before updating display; we have separate variable for online and offline modes.

Definition at line 191 of file TRootanaDisplay.hxx.

◆ fQuitPushed

bool TRootanaDisplay::fQuitPushed
private

Flag to keep track of if quite button has been pushed.

Definition at line 210 of file TRootanaDisplay.hxx.

◆ fSecondsBeforeUpdating

double TRootanaDisplay::fSecondsBeforeUpdating
private

Definition at line 207 of file TRootanaDisplay.hxx.

◆ fUpdatingBasedSeconds

bool TRootanaDisplay::fUpdatingBasedSeconds
private

Flag to keep track of whether user wants to update (online) based on time passed (rather than based on number of events

Definition at line 199 of file TRootanaDisplay.hxx.

◆ waitingForNextButton

bool TRootanaDisplay::waitingForNextButton
private

Definition at line 184 of file TRootanaDisplay.hxx.

◆ waitingForNextInterestingButton

bool TRootanaDisplay::waitingForNextInterestingButton
private

Definition at line 187 of file TRootanaDisplay.hxx.


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