]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EVE/EveBase/AliEveEventManager.h
Prototype for visualization-macro manager and gui.
[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>
f76c9e9b 14#include <TQObject.h>
5a5a1232 15
f6afd0e1 16class AliEveMacroExecutor;
17
5a5a1232 18class AliRunLoader;
af885e0f 19class AliESDEvent;
3aecaefc 20class AliESDfriend;
c2c4b7a2 21class AliRawReader;
5a5a1232 22
93845f6c 23class AliMagF;
24
5a5a1232 25class TFile;
26class TTree;
632d2b03 27class TGeoManager;
5a5a1232 28
a15e6d7d 29//==============================================================================
30//
31// AliEveEventManager
32//
33// Interface to ALICE event-data (RunLoader, ESD), magnetic field and
34// geometry.
35//
36
5a5a1232 37
f76c9e9b 38class AliEveEventManager : public TEveEventManager,
39 public TQObject
5a5a1232 40{
5a5a1232 41public:
c2c4b7a2 42 static void SetESDFileName(const Text_t* esd);
43 static void SetRawFileName(const Text_t* raw);
44 static void SetCdbUri(const Text_t* cdb);
45 static void SetAssertElements(Bool_t assertRunloader, Bool_t assertEsd, Bool_t assertRaw);
632d2b03 46
d810d0de 47 AliEveEventManager();
48 AliEveEventManager(TString path, Int_t ev=0);
a15e6d7d 49 virtual ~AliEveEventManager();
50
5a5a1232 51
516389a2 52 virtual void Open();
53 void SetEvent(AliRunLoader *runLoader, AliRawReader *rawReader, AliESDEvent *esd);
f76c9e9b 54 virtual Int_t GetMaxEventId(Bool_t refreshESD=kFALSE) const;
516389a2 55 virtual void GotoEvent(Int_t event);
56 virtual void NextEvent();
57 virtual void PrevEvent();
58 virtual void Close();
59
90fa773e 60
5a5a1232 61 Int_t GetEventId() const { return fEventId; }
62 AliRunLoader* GetRunLoader() const { return fRunLoader; }
63 TTree* GetESDTree() const { return fESDTree; }
32e219c2 64 AliESDEvent* GetESD() const { return fESD; }
2cea771a 65 AliESDfriend* GetESDfriend() const { return fESDfriend; }
66 Bool_t GetESDfriendExists() const { return fESDfriendExists; }
67 virtual const Text_t* GetTitle() const { return fPath.Data(); }
319f3084 68 const char* GetEventInfo() const;
5a5a1232 69
f6afd0e1 70 static Bool_t HasRunLoader();
71 static Bool_t HasESD();
72 static Bool_t HasESDfriend();
73 static Bool_t HasRawReader();
74
5a5a1232 75 static AliRunLoader* AssertRunLoader();
32e219c2 76 static AliESDEvent* AssertESD();
3aecaefc 77 static AliESDfriend* AssertESDfriend();
c2c4b7a2 78 static AliRawReader* AssertRawReader();
5a5a1232 79
93845f6c 80 static AliMagF* AssertMagField();
81
632d2b03 82 static TGeoManager* AssertGeometry();
83
319f3084 84 Bool_t GetAutoLoad() const {return fAutoLoad;}
85 Double_t GetAutoLoadTime() const {return fAutoLoadTime;}
86 void SetAutoLoad(Bool_t autoLoad);
87 void SetAutoLoadTime(Double_t time);
88 Bool_t GetIsOnline() const {return fIsOnline;}
89
90 void StartStopAutoLoadTimer();
91
f6afd0e1 92 virtual void AfterNewEventLoaded();
93 void NewEventLoaded(); // *SIGNAL*
94
95 AliEveMacroExecutor* GetExecutor() const { return fExecutor; }
f76c9e9b 96
4b456ebb 97protected:
98 TString fPath; // URL to event-data.
99 Int_t fEventId; // Id of current event.
100
101 AliRunLoader* fRunLoader; // Run loader.
102
103 TFile* fESDFile; // ESD file.
104 TTree* fESDTree; // ESD tree.
105 AliESDEvent* fESD; // ESDEvent object.
106 AliESDfriend* fESDfriend; // ESDfriend object.
107 Bool_t fESDfriendExists; // Flag specifying if ESDfriend was found during opening of the event-data.
108
c2c4b7a2 109 AliRawReader* fRawReader; // Raw-adata reader.
110
319f3084 111 Bool_t fAutoLoad; // Automatic loading of events (online)
112 Double_t fAutoLoadTime; // Auto-load time in seconds
113 TTimer *fAutoLoadTimer; // Timer for automatic event loading
114 Bool_t fIsOnline; // Are we running online?
115
f6afd0e1 116 AliEveMacroExecutor *fExecutor; // Executor for std macros
117
c2c4b7a2 118 static TString fgESDFileName; // Name by which to open ESD.
119 static TString fgRawFileName; // Name by which to open raw-data file.
4b456ebb 120 static TString fgCdbUri; // Global URI to CDB.
121 static Bool_t fgAssertRunLoader; // Global flag specifying if AliRunLoader must be asserted during opening of the event-data.
122 static Bool_t fgAssertESD; // Global flag specifying if ESDEvent must be asserted during opening of the event-data.
c2c4b7a2 123 static Bool_t fgAssertRaw; // Global flag specifying if raw-data presence must be asserted during opening of the event-data.
4b456ebb 124
125 static AliMagF* fgMagField; // Global pointer to magneti field.
126
127private:
128 AliEveEventManager(const AliEveEventManager&); // Not implemented
129 AliEveEventManager& operator=(const AliEveEventManager&); // Not implemented
130
131 ClassDef(AliEveEventManager, 0); // Interface for getting all event components in a uniform way.
132};
5a5a1232 133
a15e6d7d 134extern AliEveEventManager* gAliEveEvent;
5a5a1232 135
136#endif