First version of the online reco + AliEVE attached to it. (Matevz and Cvetan)
[u/mrichter/AliRoot.git] / EVE / EveBase / AliEveEventManager.h
CommitLineData
d810d0de 1// $Id$
2// Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
5a5a1232 3
d810d0de 4/**************************************************************************
5 * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
6 * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
51346b82 7 * full copyright notice. *
d810d0de 8 **************************************************************************/
9
a15e6d7d 10#ifndef AliEveEventManaget_H
11#define AliEveEventManager_H
5a5a1232 12
84aff7a4 13#include <TEveEventManager.h>
5a5a1232 14
15class AliRunLoader;
af885e0f 16class AliESDEvent;
3aecaefc 17class AliESDfriend;
c2c4b7a2 18class AliRawReader;
5a5a1232 19
93845f6c 20class AliMagF;
21
5a5a1232 22class TFile;
23class TTree;
632d2b03 24class TGeoManager;
5a5a1232 25
a15e6d7d 26//==============================================================================
27//
28// AliEveEventManager
29//
30// Interface to ALICE event-data (RunLoader, ESD), magnetic field and
31// geometry.
32//
33
5a5a1232 34
d810d0de 35class AliEveEventManager : public TEveEventManager
5a5a1232 36{
5a5a1232 37public:
c2c4b7a2 38 static void SetESDFileName(const Text_t* esd);
39 static void SetRawFileName(const Text_t* raw);
40 static void SetCdbUri(const Text_t* cdb);
41 static void SetAssertElements(Bool_t assertRunloader, Bool_t assertEsd, Bool_t assertRaw);
632d2b03 42
d810d0de 43 AliEveEventManager();
44 AliEveEventManager(TString path, Int_t ev=0);
a15e6d7d 45 virtual ~AliEveEventManager();
46
5a5a1232 47
32e219c2 48 virtual void Open();
319f3084 49 void SetEvent(AliRunLoader *runLoader, AliRawReader *rawReader, AliESDEvent *esd);
50
32e219c2 51 virtual void GotoEvent(Int_t event);
319f3084 52 virtual void NextEvent();
53 virtual void PrevEvent();
32e219c2 54 virtual void Close();
90fa773e 55
5a5a1232 56 Int_t GetEventId() const { return fEventId; }
57 AliRunLoader* GetRunLoader() const { return fRunLoader; }
58 TTree* GetESDTree() const { return fESDTree; }
32e219c2 59 AliESDEvent* GetESD() const { return fESD; }
2cea771a 60 AliESDfriend* GetESDfriend() const { return fESDfriend; }
61 Bool_t GetESDfriendExists() const { return fESDfriendExists; }
62 virtual const Text_t* GetTitle() const { return fPath.Data(); }
319f3084 63 const char* GetEventInfo() const;
5a5a1232 64
65 static AliRunLoader* AssertRunLoader();
32e219c2 66 static AliESDEvent* AssertESD();
3aecaefc 67 static AliESDfriend* AssertESDfriend();
c2c4b7a2 68 static AliRawReader* AssertRawReader();
5a5a1232 69
93845f6c 70 static AliMagF* AssertMagField();
71
632d2b03 72 static TGeoManager* AssertGeometry();
73
319f3084 74 Bool_t GetAutoLoad() const {return fAutoLoad;}
75 Double_t GetAutoLoadTime() const {return fAutoLoadTime;}
76 void SetAutoLoad(Bool_t autoLoad);
77 void SetAutoLoadTime(Double_t time);
78 Bool_t GetIsOnline() const {return fIsOnline;}
79
80 void StartStopAutoLoadTimer();
81
4b456ebb 82protected:
83 TString fPath; // URL to event-data.
84 Int_t fEventId; // Id of current event.
85
86 AliRunLoader* fRunLoader; // Run loader.
87
88 TFile* fESDFile; // ESD file.
89 TTree* fESDTree; // ESD tree.
90 AliESDEvent* fESD; // ESDEvent object.
91 AliESDfriend* fESDfriend; // ESDfriend object.
92 Bool_t fESDfriendExists; // Flag specifying if ESDfriend was found during opening of the event-data.
93
c2c4b7a2 94 AliRawReader* fRawReader; // Raw-adata reader.
95
319f3084 96 Bool_t fAutoLoad; // Automatic loading of events (online)
97 Double_t fAutoLoadTime; // Auto-load time in seconds
98 TTimer *fAutoLoadTimer; // Timer for automatic event loading
99 Bool_t fIsOnline; // Are we running online?
100
c2c4b7a2 101 static TString fgESDFileName; // Name by which to open ESD.
102 static TString fgRawFileName; // Name by which to open raw-data file.
4b456ebb 103 static TString fgCdbUri; // Global URI to CDB.
104 static Bool_t fgAssertRunLoader; // Global flag specifying if AliRunLoader must be asserted during opening of the event-data.
105 static Bool_t fgAssertESD; // Global flag specifying if ESDEvent must be asserted during opening of the event-data.
c2c4b7a2 106 static Bool_t fgAssertRaw; // Global flag specifying if raw-data presence must be asserted during opening of the event-data.
4b456ebb 107
108 static AliMagF* fgMagField; // Global pointer to magneti field.
109
110private:
111 AliEveEventManager(const AliEveEventManager&); // Not implemented
112 AliEveEventManager& operator=(const AliEveEventManager&); // Not implemented
113
114 ClassDef(AliEveEventManager, 0); // Interface for getting all event components in a uniform way.
115};
5a5a1232 116
a15e6d7d 117extern AliEveEventManager* gAliEveEvent;
5a5a1232 118
119#endif