1 // Author: 2010 Svein Lindal <slindal@fys.uio.no> *
2 // for The ALICE HLT Project. *
4 #include "AliHLTEveHLT.h"
5 #include "AliHLTEvePhos.h"
6 #include "AliHLTEveEmcal.h"
9 #include "AliESDEvent.h"
10 #include "AliEveHLTEventManager.h"
11 #include "AliEveEventBufferOffline.h"
12 #include "AliEveHLTEventManagerHomer.h"
14 #include "AliEveHOMERManager.h"
15 #include "TEveManager.h"
17 #include "TGLOverlayButton.h"
18 #include "TGLViewer.h"
20 ClassImp(AliEveHLTEventManagerHomer)
22 AliEveHLTEventManagerHomer::AliEveHLTEventManagerHomer() :
23 AliEveHLTEventManager(),
25 fNextEventTimer(NULL),
28 // see header file for class documentation
30 fEventBuffer = new AliEveEventBufferHomer();
31 fEventBuffer->StartBufferMonitor();
33 fNextEventTimer = new TTimer();
34 fNextEventTimer->Connect("Timeout()", "AliEveHLTEventManagerHomer", this, "TryNextEvent()" );
36 fInfoButton = new TGLOverlayButton(dynamic_cast<TGLViewerBase*>(gEve->GetDefaultGLViewer()), "", 0, 540, 210, 25);
37 fInfoButton->SetAlphaValues(0.0, 0.8);
44 AliEveHLTEventManagerHomer::~AliEveHLTEventManagerHomer() {
47 //DestroyDetectorElements();
54 ///________________________________________________________________________________
55 void AliEveHLTEventManagerHomer::ProcessList(TList * blockList) {
57 ProcessEvent(blockList);
61 void AliEveHLTEventManagerHomer::NextEvent() {
62 fNextEventTimer->Start(1000);
65 ///________________________________________________________________________________
66 void AliEveHLTEventManagerHomer::TryNextEvent() {
67 //See header file for documentation
69 if ( fEventBuffer->LockMutex() ) {
70 fInfoButton->SetAlphaValues(0.8, 0.8);
71 fInfoButton->SetText("Waiting for buffer...");
72 gEve->Redraw3D(kFALSE);
73 cout << "try again in 1 sec"<<endl;
76 fInfoButton->SetAlphaValues(0.8, 0.8);
78 fNextEventTimer->Stop();
80 cout << "Mutex is freeee!!"<<endl;
81 TList * aSyncEvent = fEventBuffer->GetASyncEvent();
82 TList * event = static_cast<TList*>(fEventBuffer->NextEvent());
84 cout << "Got the event, reset the display " <<endl;
85 fInfoButton->SetText("Reset display..");
87 cout << "Process event"<<endl;
88 fInfoButton->SetText("Processing event..");
91 cout << "Process asynchroneous event" << endl;
92 ProcessEvent(aSyncEvent);
94 cout << "Could not get async event"<<endl;
97 cout << "Upate the display"<<endl;
98 fInfoButton->SetText("Updating display...");
102 cout << "couldn't get the sync event"<<endl;
103 fInfoButton->SetAlphaValues(0.8, 0.8);
104 fInfoButton->SetText("Waiting for buffer...");
105 fEventBuffer->UnLockMutex();
106 fEventBuffer->CreateBufferThread();
107 fNextEventTimer->Start(3000);
111 fInfoButton->SetAlphaValues(0.0, 0.0);
112 fInfoButton->SetText("Done..");
113 fEventBuffer->UnLockMutex();
118 ///____________________________________________________________________________________
119 void AliEveHLTEventManagerHomer::NavigateFwd() {
120 //See header file for documentation
121 TList * fEvent = dynamic_cast<TList*>(fEventBuffer->Fwd());
124 ProcessEvent(fEvent);
127 cout << "couldn't get the fwd event"<<endl;
132 ///______________________________________________________________________________________
133 void AliEveHLTEventManagerHomer::NavigateBack() {
134 //See header file for documentation
135 TList * fEvent = dynamic_cast<TList*>(fEventBuffer->Back());
138 ProcessEvent(fEvent);
141 cout << "couldn't get the back event"<<endl;