Use TList::Delete, change some output
[u/mrichter/AliRoot.git] / EVE / EveHLT / AliEveHLTEventManagerOffline.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#include "TEveManager.h"
8
9#include "AliESDEvent.h"
10#include "AliEveHLTEventManager.h"
11#include "AliEveEventBufferOffline.h"
12#include "AliEveHLTEventManagerOffline.h"
13
14
15ClassImp(AliEveHLTEventManagerOffline)
16
17AliEveHLTEventManagerOffline::AliEveHLTEventManagerOffline() :
18 AliEveHLTEventManager(),
30e7579c 19 fEventBuffer(NULL)
20{
21 // see header file for class documentation
22 // or
23 // refer to README to build package
24 // or
25 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
26
27}
28
29AliEveHLTEventManagerOffline::AliEveHLTEventManagerOffline(TString filename) :
30 AliEveHLTEventManager(),
30e7579c 31 fEventBuffer(NULL)
32{
33 // see header file for class documentation
34 // or
35 // refer to README to build package
36 // or
37 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
38
39 fEventBuffer = new AliEveEventBufferOffline(filename);
40}
41
42AliEveHLTEventManagerOffline::~AliEveHLTEventManagerOffline() {
43
44 //DestroyElements();
45 //DestroyDetectorElements();
46
30e7579c 47 if(fEventBuffer)
48 delete fEventBuffer;
49 fEventBuffer = NULL;
50
51}
52
53void AliEveHLTEventManagerOffline::NextEvent() {
54 //See header file for documentation
a08b6b88 55 AliESDEvent * event = dynamic_cast<AliESDEvent*>(fEventBuffer->NextEvent());
56
57 if(event) {
58 //Int_t eventId = fBuffer->GetEventId();
fc482d0c 59 ResetDisplay();
a08b6b88 60 ProcessEvent(event);
fc482d0c 61 UpdateDisplay();
a08b6b88 62 } else {
63 cout << "couldn't get the event"<<endl;
30e7579c 64 }
65}
66
a08b6b88 67
30e7579c 68void AliEveHLTEventManagerOffline::NavigateFwd() {
69 //See header file for documentation
239fdf4e 70 AliESDEvent * event = dynamic_cast<AliESDEvent*>(fEventBuffer->Fwd());
71 if(event) {
fc482d0c 72 ResetDisplay();
239fdf4e 73 ProcessEvent(event);
fc482d0c 74 UpdateDisplay();
30e7579c 75 } else {
76 cout << "couldn't get the fwd event"<<endl;
77 }
78}
79
80void AliEveHLTEventManagerOffline::NavigateBack() {
81 //See header file for documentation
239fdf4e 82 AliESDEvent * event = dynamic_cast<AliESDEvent*>(fEventBuffer->Back());
83 if(event) {
fc482d0c 84 ResetDisplay();
239fdf4e 85 ProcessEvent(event);
fc482d0c 86 UpdateDisplay();
30e7579c 87 } else {
88 cout << "couldn't get the back event"<<endl;
89 }
90}
91