]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/EveHLT/AliEveHLTEventManagerHomer.cxx
Updated homer buffer to not start source list timer
[u/mrichter/AliRoot.git] / EVE / EveHLT / AliEveHLTEventManagerHomer.cxx
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();
29   //AliEveHOMERManager * hm = fEventBuffer->GetHomerManager();
30   //if(hm) GetEveManager()->AddToListTree(hm, kTRUE);
31   
32
33 }
34
35  
36 AliEveHLTEventManagerHomer::~AliEveHLTEventManagerHomer() {
37
38   //DestroyElements();
39   //DestroyDetectorElements();  
40   if(fEventBuffer)
41     delete fEventBuffer;
42   fEventBuffer = NULL;
43
44 }
45
46 ///________________________________________________________________________________
47 void AliEveHLTEventManagerHomer::ProcessList(TList * blockList) {
48
49   ProcessEvent(blockList);
50   UpdateDisplay();
51
52 }
53
54
55
56 ///________________________________________________________________________________
57 void AliEveHLTEventManagerHomer::NextEvent() {
58   //See header file for documentation
59   if(fEventBuffer->GetBusy() ) {
60     cout << "event buffer already busy"<<endl;
61     return;
62   }else {
63     fEventBuffer->SetBusy(kTRUE);
64   }
65
66   TList * aSyncEvent = fEventBuffer->GetASyncEvent();
67   TList * event = static_cast<TList*>(fEventBuffer->NextEvent());
68   if(event) {
69     cout << "Got the event, reset the display " <<endl;
70     ResetDisplay();
71     cout << "Process event"<<endl;
72     ProcessEvent(event);
73     if(aSyncEvent) {
74       cout  << "Process asynchroneous event" << endl;
75       ProcessEvent(aSyncEvent);
76     }  else {
77       cout << "Could not get async event"<<endl;
78     }
79     
80     cout << "Upate the display"<<endl;
81     UpdateDisplay();
82   
83   } else {
84     cout << "couldn't get the sync event"<<endl;
85   }
86   
87   //  cout  << "doint async block"<<endl;
88   //  TList * async = static_cast<TList*>(fEventBuffer->GetAList());
89   //  if(async) {
90   //    ProcessEvent(async);
91   //   }  else {
92   //     cout << "No async bloc"<<endl;
93   // }
94
95   fEventBuffer->SetBusy(kFALSE);
96 }
97
98
99 ///____________________________________________________________________________________
100 void AliEveHLTEventManagerHomer::NavigateFwd() {
101   //See header file for documentation
102   TList * fEvent = dynamic_cast<TList*>(fEventBuffer->Fwd());
103   if(fEvent) {
104     ResetDisplay();
105     ProcessEvent(fEvent);
106     UpdateDisplay();
107   } else {
108     cout << "couldn't get the fwd event"<<endl;
109   }
110 }
111
112
113 ///______________________________________________________________________________________
114 void AliEveHLTEventManagerHomer::NavigateBack() {
115   //See header file for documentation
116   TList * fEvent = dynamic_cast<TList*>(fEventBuffer->Back());
117   if(fEvent) {
118     ResetDisplay();
119     ProcessEvent(fEvent);
120     UpdateDisplay();
121   } else {
122     cout << "couldn't get the back event"<<endl;
123   }
124 }
125