ROOTANA
|
#include <TRootanaDisplay.hxx>
Public Member Functions | |
TRootanaDisplay () | |
virtual | ~TRootanaDisplay () |
virtual void | AddAllCanvases ()=0 |
User must. | |
void | AddSingleCanvas (std::string name, std::string subtab_name=std::string("")) |
Add a new canvas; user will interactively fill it. | |
void | AddSingleCanvas (TCanvasHandleBase *handleClass, std::string subtab_name=std::string("")) |
TMainDisplayWindow * | GetDisplayWindow () |
virtual void | UpdateHistograms (TDataContainer &dataContainer) |
This method can be implemented by users to update user histograms. | |
virtual void | PlotCanvas (TDataContainer &dataContainer) |
This method can be implemented by users to plotting of current canvas. | |
virtual void | ResetHistograms () |
This method can be implemented by users to plotting of current canvas. | |
void | NextButtonPushed () |
Method for when next button is pushed. | |
void | NextInterestingButtonPushed () |
Method for when next interesting button is pushed. | |
void | EventSkipButtonPushed () |
Method for when skip event button is pushed (online mode) | |
void | Reset () |
void | UpdatePlotsAction () |
void | QuitButtonAction () |
Method to call when 'quit' button is pressed. | |
void | SetNumberSkipEvent (int number) |
void | SetSecondsBeforeUpdating (double SecondsBeforeUpdating) |
Function so that user can skip how many seconds to wait in free-running mode. | |
void | SetOnlineUpdatingBasedSeconds (bool updateBasedSeconds=true) |
std::string | GetDisplayName () |
Get Display name. | |
void | SetDisplayName (std::string name) |
Set Display name. | |
void | InitializeRAD () |
Special version of Init method, to be used only by TRootanaDisplay. | |
bool | CheckOptionRAD (std::string option) |
void | UsageRAD () |
Also a special version of usage for TRootanaDisplay. See CheckOptionRAD. | |
Public Member Functions inherited from TRootanaEventLoop | |
virtual | ~TRootanaEventLoop () |
TDataContainer * | GetDataContainer () |
Method to get the data container that event loop owns. | |
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? | |
bool | IsOffline () const |
Are we processing offline data? | |
int | GetCurrentRunNumber () const |
Current Run Number. | |
void | SetCurrentRunNumber (int run) |
Current Run Number. | |
int | ExecuteLoop (int argc, char *argv[]) |
Method to actually process the Midas information, either as file or online. | |
int | ProcessMidasFile (TApplication *app, const char *fname) |
int | ProcessMidasOnline (TApplication *app, const char *hostname, const char *exptname) |
void | DisableAutoMainWindow () |
Disable automatic creation of MainWindow. | |
void | UseBatchMode () |
Use a batch mode, where we don't check ROOT status. | |
MVOdb * | GetODB () |
Get pointer to ODB variables. | |
void | OpenRootFile (int run, std::string midasFilename=std::string("")) |
Open output ROOT file. | |
void | CloseRootFile () |
Cloe output ROOT file. | |
bool | IsRootFileValid () |
Check if output ROOT file is valid and open. | |
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. | |
void | SuppressTimestampWarnings () |
bool | GetSuppressTimestampWarnings () |
Suppress timestamp warnings? true = suppress warnings. | |
void | UseOnlyRecent (bool setting=true) |
void | SetTHttpServerReadWrite (bool readwrite=true) |
Private Member Functions | |
void | InitializeMainWindow () |
Method to initialize the Main display window. | |
bool | ProcessMidasEvent (TDataContainer &dataContainer) |
Process each midas event. | |
bool | ProcessMidasEventOnline (TDataContainer &dataContainer) |
Process each online midas event. | |
bool | ProcessMidasEventOffline (TDataContainer &dataContainer) |
Process each offline midas event. | |
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. | |
TMainDisplayWindow * | fMainWindow |
The pointer to our display window. | |
TDataContainer * | fCachedDataContainer |
We keep a cached copy of the midas event (so that it can used for callback). | |
std::string | fDisplayName |
Display name. | |
std::vector< std::pair< std::pair< int, int >,TCanvasHandleBase * > > | fCanvasHandlers |
Additional Inherited Members | |
Static Public Member Functions inherited from TRootanaEventLoop | |
static TRootanaEventLoop & | Get (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 | |
TDirectory * | fOnlineHistDir |
TDirectory for online histograms. | |
Static Protected Attributes inherited from TRootanaEventLoop | |
static TRootanaEventLoop * | fTRootanaEventLoop = NULL |
The static pointer to the singleton instance. | |
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.
TRootanaDisplay::TRootanaDisplay | ( | ) |
|
virtual |
|
inline |
Add a new canvas; user will interactively fill it.
Definition at line 71 of file TRootanaDisplay.hxx.
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.
|
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.
|
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.
|
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.
|
inline |
Method for when skip event button is pushed (online mode)
Definition at line 108 of file TRootanaDisplay.hxx.
|
inline |
Get Display name.
Definition at line 152 of file TRootanaDisplay.hxx.
|
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.
|
private |
Method to initialize the Main display window.
Definition at line 52 of file TRootanaDisplay.cxx.
Special version of Init method, to be used only by TRootanaDisplay.
Reimplemented from TRootanaEventLoop.
Definition at line 156 of file TRootanaDisplay.hxx.
|
inline |
Method for when next button is pushed.
Definition at line 95 of file TRootanaDisplay.hxx.
|
inline |
Method for when next interesting button is pushed.
Definition at line 101 of file TRootanaDisplay.hxx.
|
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.
|
privatevirtual |
Process each midas event.
Make separate treatment of online and offline data, since both are quite different.
Implements TRootanaEventLoop.
Definition at line 129 of file TRootanaDisplay.cxx.
|
private |
Process each offline midas event.
Definition at line 231 of file TRootanaDisplay.cxx.
|
private |
Process each online midas event.
Handle online processing of MIDAS events.
Definition at line 146 of file TRootanaDisplay.cxx.
void TRootanaDisplay::QuitButtonAction | ( | ) |
Method to call when 'quit' button is pressed.
Definition at line 390 of file TRootanaDisplay.cxx.
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.
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.
|
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.
|
inline |
Set Display name.
Definition at line 154 of file TRootanaDisplay.hxx.
|
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.
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.
|
inline |
Function so that user can skip how many seconds to wait in free-running mode.
Definition at line 141 of file TRootanaDisplay.hxx.
|
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.
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.
Also a special version of usage for TRootanaDisplay. See CheckOptionRAD.
Reimplemented from TRootanaEventLoop.
Definition at line 173 of file TRootanaDisplay.hxx.
|
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.
|
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.
|
private |
Display name.
Definition at line 247 of file TRootanaDisplay.hxx.
|
private |
Definition at line 201 of file TRootanaDisplay.hxx.
|
private |
The pointer to our display window.
Definition at line 213 of file TRootanaDisplay.hxx.
|
private |
Definition at line 204 of file TRootanaDisplay.hxx.
|
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.
|
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.
|
private |
Flag to keep track of if quite button has been pushed.
Definition at line 210 of file TRootanaDisplay.hxx.
|
private |
Definition at line 207 of file TRootanaDisplay.hxx.
|
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.
|
private |
Definition at line 184 of file TRootanaDisplay.hxx.
|
private |
Definition at line 187 of file TRootanaDisplay.hxx.