Additional forward declaration
[u/mrichter/AliRoot.git] / EVE / EveHLT / AliEveHLTEventManagerHomer.cxx
CommitLineData
30e7579c 1// Author: 2010 Svein Lindal <slindal@fys.uio.no> *
2// for The ALICE HLT Project. *
3
4#include "AliHLTEveHLT.h"
5#include "AliHLTEvePhos.h"
6#include "AliHLTEveEmcal.h"
7
8
9#include "AliESDEvent.h"
10#include "AliEveHLTEventManager.h"
11#include "AliEveEventBufferOffline.h"
12#include "AliEveHLTEventManagerHomer.h"
13#include "TList.h"
14#include "AliEveHOMERManager.h"
15#include "TEveManager.h"
16
17ClassImp(AliEveHLTEventManagerHomer)
18
19AliEveHLTEventManagerHomer::AliEveHLTEventManagerHomer() :
20 AliEveHLTEventManager(),
21 fEventBuffer(NULL)
22{
23 // see header file for class documentation
24 // or
25 // refer to README to build package
26 // or
27 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
28 fEventBuffer = new AliEveEventBufferHomer();
11757805 29 fEventBuffer->StartBufferMonitor();
30e7579c 30 //AliEveHOMERManager * hm = fEventBuffer->GetHomerManager();
31 //if(hm) GetEveManager()->AddToListTree(hm, kTRUE);
32
33
34}
35
36
37AliEveHLTEventManagerHomer::~AliEveHLTEventManagerHomer() {
38
39 //DestroyElements();
40 //DestroyDetectorElements();
41 if(fEventBuffer)
42 delete fEventBuffer;
43 fEventBuffer = NULL;
44
45}
46
0ddb492b 47///________________________________________________________________________________
48void AliEveHLTEventManagerHomer::ProcessList(TList * blockList) {
49
50 ProcessEvent(blockList);
51 UpdateDisplay();
52
53}
54
55
30e7579c 56
57///________________________________________________________________________________
58void AliEveHLTEventManagerHomer::NextEvent() {
59 //See header file for documentation
765675f2 60 if(fEventBuffer->LockMutex() ) {
d63d227e 61 cout << "event buffer already busy"<<endl;
62 return;
765675f2 63 } else {
d63d227e 64
cc87822c 65 TList * aSyncEvent = fEventBuffer->GetASyncEvent();
66 TList * event = static_cast<TList*>(fEventBuffer->NextEvent());
67 if(event) {
68 cout << "Got the event, reset the display " <<endl;
69 ResetDisplay();
70 cout << "Process event"<<endl;
71 ProcessEvent(event);
72 if(aSyncEvent) {
73 cout << "Process asynchroneous event" << endl;
74 ProcessEvent(aSyncEvent);
75 } else {
76 cout << "Could not get async event"<<endl;
77 }
78
79 cout << "Upate the display"<<endl;
80 UpdateDisplay();
81
30e7579c 82 } else {
0ddb492b 83 cout << "couldn't get the sync event"<<endl;
30e7579c 84 }
d5180d24 85
cc87822c 86 // cout << "doint async block"<<endl;
87 // TList * async = static_cast<TList*>(fEventBuffer->GetAList());
88 // if(async) {
89 // ProcessEvent(async);
90 // } else {
91 // cout << "No async bloc"<<endl;
92 // }
765675f2 93 }
94
95 fEventBuffer->UnLockMutex();
30e7579c 96}
97
98
99///____________________________________________________________________________________
100void AliEveHLTEventManagerHomer::NavigateFwd() {
101 //See header file for documentation
102 TList * fEvent = dynamic_cast<TList*>(fEventBuffer->Fwd());
103 if(fEvent) {
0ddb492b 104 ResetDisplay();
30e7579c 105 ProcessEvent(fEvent);
0ddb492b 106 UpdateDisplay();
30e7579c 107 } else {
108 cout << "couldn't get the fwd event"<<endl;
109 }
110}
111
112
113///______________________________________________________________________________________
114void AliEveHLTEventManagerHomer::NavigateBack() {
115 //See header file for documentation
116 TList * fEvent = dynamic_cast<TList*>(fEventBuffer->Back());
117 if(fEvent) {
0ddb492b 118 ResetDisplay();
30e7579c 119 ProcessEvent(fEvent);
0ddb492b 120 UpdateDisplay();
30e7579c 121 } else {
122 cout << "couldn't get the back event"<<endl;
123 }
124}
125