]>
Commit | Line | Data |
---|---|---|
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 | ||
17 | ClassImp(AliEveHLTEventManagerHomer) | |
18 | ||
19 | AliEveHLTEventManagerHomer::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 | ||
37 | AliEveHLTEventManagerHomer::~AliEveHLTEventManagerHomer() { | |
38 | ||
39 | //DestroyElements(); | |
40 | //DestroyDetectorElements(); | |
41 | if(fEventBuffer) | |
42 | delete fEventBuffer; | |
43 | fEventBuffer = NULL; | |
44 | ||
45 | } | |
46 | ||
0ddb492b | 47 | ///________________________________________________________________________________ |
48 | void AliEveHLTEventManagerHomer::ProcessList(TList * blockList) { | |
49 | ||
50 | ProcessEvent(blockList); | |
51 | UpdateDisplay(); | |
52 | ||
53 | } | |
54 | ||
55 | ||
30e7579c | 56 | |
57 | ///________________________________________________________________________________ | |
58 | void AliEveHLTEventManagerHomer::NextEvent() { | |
59 | //See header file for documentation | |
d63d227e | 60 | if(fEventBuffer->GetBusy() ) { |
61 | cout << "event buffer already busy"<<endl; | |
62 | return; | |
63 | }else { | |
64 | fEventBuffer->SetBusy(kTRUE); | |
65 | } | |
d63d227e | 66 | |
cc87822c | 67 | TList * aSyncEvent = fEventBuffer->GetASyncEvent(); |
68 | TList * event = static_cast<TList*>(fEventBuffer->NextEvent()); | |
69 | if(event) { | |
70 | cout << "Got the event, reset the display " <<endl; | |
71 | ResetDisplay(); | |
72 | cout << "Process event"<<endl; | |
73 | ProcessEvent(event); | |
74 | if(aSyncEvent) { | |
75 | cout << "Process asynchroneous event" << endl; | |
76 | ProcessEvent(aSyncEvent); | |
77 | } else { | |
78 | cout << "Could not get async event"<<endl; | |
79 | } | |
80 | ||
81 | cout << "Upate the display"<<endl; | |
82 | UpdateDisplay(); | |
83 | ||
30e7579c | 84 | } else { |
0ddb492b | 85 | cout << "couldn't get the sync event"<<endl; |
30e7579c | 86 | } |
d5180d24 | 87 | |
cc87822c | 88 | // cout << "doint async block"<<endl; |
89 | // TList * async = static_cast<TList*>(fEventBuffer->GetAList()); | |
90 | // if(async) { | |
91 | // ProcessEvent(async); | |
92 | // } else { | |
93 | // cout << "No async bloc"<<endl; | |
94 | // } | |
95 | ||
96 | fEventBuffer->SetBusy(kFALSE); | |
30e7579c | 97 | } |
98 | ||
99 | ||
100 | ///____________________________________________________________________________________ | |
101 | void AliEveHLTEventManagerHomer::NavigateFwd() { | |
102 | //See header file for documentation | |
103 | TList * fEvent = dynamic_cast<TList*>(fEventBuffer->Fwd()); | |
104 | if(fEvent) { | |
0ddb492b | 105 | ResetDisplay(); |
30e7579c | 106 | ProcessEvent(fEvent); |
0ddb492b | 107 | UpdateDisplay(); |
30e7579c | 108 | } else { |
109 | cout << "couldn't get the fwd event"<<endl; | |
110 | } | |
111 | } | |
112 | ||
113 | ||
114 | ///______________________________________________________________________________________ | |
115 | void AliEveHLTEventManagerHomer::NavigateBack() { | |
116 | //See header file for documentation | |
117 | TList * fEvent = dynamic_cast<TList*>(fEventBuffer->Back()); | |
118 | if(fEvent) { | |
0ddb492b | 119 | ResetDisplay(); |
30e7579c | 120 | ProcessEvent(fEvent); |
0ddb492b | 121 | UpdateDisplay(); |
30e7579c | 122 | } else { |
123 | cout << "couldn't get the back event"<<endl; | |
124 | } | |
125 | } | |
126 |