-Fixed bug in offline buffer that deleted event object.
[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
239fdf4e 55 AliESDEvent * event = dynamic_cast<AliESDEvent*>(fEventBuffer->NextEvent());
56
57 if(event) {
58 //Int_t eventId = fBuffer->GetEventId();
59 ProcessEvent(event);
60 } else {
61 cout << "couldn't get the event"<<endl;
62 }
30e7579c 63 }
64}
65
66void AliEveHLTEventManagerOffline::NavigateFwd() {
67 //See header file for documentation
239fdf4e 68 AliESDEvent * event = dynamic_cast<AliESDEvent*>(fEventBuffer->Fwd());
69 if(event) {
70 ProcessEvent(event);
30e7579c 71 } else {
72 cout << "couldn't get the fwd event"<<endl;
73 }
74}
75
76void AliEveHLTEventManagerOffline::NavigateBack() {
77 //See header file for documentation
239fdf4e 78 AliESDEvent * event = dynamic_cast<AliESDEvent*>(fEventBuffer->Back());
79 if(event) {
80 ProcessEvent(event);
30e7579c 81 } else {
82 cout << "couldn't get the back event"<<endl;
83 }
84}
85