65 fMainWindow->
GetTab()->Connect(
"Selected(Int_t)",
"TRootanaDisplay",
this,
"UpdatePlotsAction()");
80 skipButton->Connect(
"ValueSet(Long_t)",
"TRootanaDisplay",
this,
"EventSkipButtonPushed()");
81 skipButton->GetNumberEntry()->Connect(
"ReturnPressed()",
"TRootanaDisplay",
this,
"EventSkipButtonPushed()");
95 std::cerr <<
"Error in TRootanaDisplay: you have not created any canvases; you must create at least one canvas. Exiting. " << std::endl;
119 if(index.second == 0){
121 tab->Connect(
"Selected(Int_t)",
"TRootanaDisplay",
this,
"UpdatePlotsAction()");
165 struct timeval nowTime;
166 gettimeofday(&nowTime, NULL);
168 double dnowtime = nowTime.tv_sec + (nowTime.tv_usec)/1000000.0;
193 std::cout <<
"Found next interesting event " << std::endl;
222 gSystem->ProcessEvents();
253 std::cout <<
"Found next interesting event " << std::endl;
260 double firstFreeRunningTime = 0.0;
275 struct timeval nowTime;
276 gettimeofday(&nowTime, NULL);
278 double dnowtime = nowTime.tv_sec + (nowTime.tv_usec)/1000000.0;
279 if(fabs(firstFreeRunningTime) < 0.00000001){
280 firstFreeRunningTime = dnowtime;
282 double diffTime = dnowtime - firstFreeRunningTime;
284 firstFreeRunningTime = 0.0;
289 firstFreeRunningTime = 0.0;
297 gSystem->ProcessEvents();
306 std::cout <<
"Begin of run " << run <<
" at time " << time << std::endl;
314 std::cout <<
"End of run " << run <<
" at time " << time << std::endl;
331 gSystem->ProcessEvents();
341 char displayTitle[200];
342 sprintf(displayTitle,
"%s (): run %i (no events yet)",
362 char displayTitle[200];
364 sprintf(displayTitle,
"%s (online): run %i event %i",
368 sprintf(displayTitle,
"%s (offline): run %i event %i",
407 gApplication->Terminate(0);
static int gMainDisplayDefaultWidth
ClassImp(TRootanaDisplay) TRootanaDisplay
static int gMainDisplayDefaultHeight
virtual void SetUpCompositeFrame(TGCompositeFrame *, TRootanaDisplay *display)
TMidasEvent & GetMidasData() const
Get the MIDAS data for this event, in TMidasEvent format.
void Reset()
Reset state of manager = set to not interesting event.
static TInterestingEventManager * instance()
std::pair< int, int > GetCurrentTabIndex()
Return an pair<int> index for current tab/sub-tab;.
std::pair< int, int > AddCanvas(std::string subtabname, std::string tabname=std::string(""))
bool IsDisplayFreeRunning()
TGTab * GetSubTab(int index)
TGTab * GetTab(std::pair< int, int > tabindex)
TGTextButton * GetQuitButton()
TGTextButton * GetResetButton()
TGTextButton * GetNextButton()
TGTextButton * GetNextInterestingButton()
TRootEmbeddedCanvas * GetCurrentEmbeddedCanvas()
Return the current embedded canvas.
TGCompositeFrame * GetCompositeFrame(std::pair< int, int > index)
TGNumberEntry * GetSkipEventButton()
uint32_t GetSerialNumber() const
return the serial number
void AddSingleCanvas(std::string name, std::string subtab_name=std::string(""))
Add a new canvas; user will interactively fill it.
virtual void ResetHistograms()
This method can be implemented by users to plotting of current canvas.
std::string GetDisplayName()
Get Display name.
bool fQuitPushed
Flag to keep track of if quite button has been pushed.
TMainDisplayWindow * fMainWindow
The pointer to our display window.
virtual ~TRootanaDisplay()
void QuitButtonAction()
Method to call when 'quit' button is pressed.
void SetDisplayName(std::string name)
Set Display name.
void EndRunRAD(int transition, int run, int time)
int fNumberSkipEventsOnline
virtual void PlotCanvas(TDataContainer &dataContainer)
This method can be implemented by users to plotting of current canvas.
virtual void UpdateHistograms(TDataContainer &dataContainer)
This method can be implemented by users to update user histograms.
double fSecondsBeforeUpdating
bool ProcessMidasEvent(TDataContainer &dataContainer)
Process each midas event.
virtual void AddAllCanvases()=0
User must.
TMainDisplayWindow * GetDisplayWindow()
void SetCachedDataContainer(TDataContainer &dataContainer)
int fNumberSkipEventsOffline
std::vector< std::pair< std::pair< int, int >,TCanvasHandleBase * > > fCanvasHandlers
void InitializeMainWindow()
Method to initialize the Main display window.
bool ProcessMidasEventOnline(TDataContainer &dataContainer)
Process each online midas event.
bool waitingForNextInterestingButton
bool ProcessMidasEventOffline(TDataContainer &dataContainer)
Process each offline midas event.
bool fUpdatingBasedSeconds
void BeginRunRAD(int transition, int run, int time)
TDataContainer * fCachedDataContainer
We keep a cached copy of the midas event (so that it can used for callback).
bool waitingForNextButton
void DisableAutoMainWindow()
Disable automatic creation of MainWindow.
void DisableRootOutput(bool disable=true)
int GetCurrentRunNumber() const
Current Run Number.
void CloseRootFile()
Cloe output ROOT file.
virtual void EndRun(int transition, int run, int time)
bool IsOffline() const
Are we processing offline data?
bool IsOnline() const
Are we processing online data?