]>
Commit | Line | Data |
---|---|---|
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 | ||
ecb84424 | 10 | #ifndef AliEveEventManager_H |
a15e6d7d | 11 | #define AliEveEventManager_H |
5a5a1232 | 12 | |
84aff7a4 | 13 | #include <TEveEventManager.h> |
f76c9e9b | 14 | #include <TQObject.h> |
ecb84424 | 15 | #include <TObjArray.h> |
5a5a1232 | 16 | |
f6afd0e1 | 17 | class AliEveMacroExecutor; |
18 | ||
5a5a1232 | 19 | class AliRunLoader; |
af885e0f | 20 | class AliESDEvent; |
3aecaefc | 21 | class AliESDfriend; |
b3b7b8d3 | 22 | class AliAODEvent; |
c2c4b7a2 | 23 | class AliRawReader; |
5a5a1232 | 24 | |
93845f6c | 25 | class AliMagF; |
26 | ||
5a5a1232 | 27 | class TFile; |
28 | class TTree; | |
632d2b03 | 29 | class TGeoManager; |
5a5a1232 | 30 | |
a15e6d7d | 31 | //============================================================================== |
32 | // | |
33 | // AliEveEventManager | |
34 | // | |
35 | // Interface to ALICE event-data (RunLoader, ESD), magnetic field and | |
36 | // geometry. | |
37 | // | |
38 | ||
5a5a1232 | 39 | |
f76c9e9b | 40 | class AliEveEventManager : public TEveEventManager, |
41 | public TQObject | |
5a5a1232 | 42 | { |
5a5a1232 | 43 | public: |
4d62585e | 44 | static void SetESDFileName(const TString& esd); |
b3b7b8d3 | 45 | static void SetAODFileName(const TString& aod); |
46 | static void AddAODfriend (const TString& friendFileName); | |
4d62585e | 47 | static void SetRawFileName(const TString& raw); |
48 | static void SetCdbUri (const TString& cdb); | |
b3b7b8d3 | 49 | static void SetAssertElements(Bool_t assertRunloader, Bool_t assertEsd, |
50 | Bool_t assertAod, Bool_t assertRaw); | |
632d2b03 | 51 | |
ba5d58f2 | 52 | AliEveEventManager(const TString& name="Event"); |
53 | AliEveEventManager(const TString& name, const TString& path, Int_t ev=0); | |
a15e6d7d | 54 | virtual ~AliEveEventManager(); |
55 | ||
516389a2 | 56 | virtual void Open(); |
482d0751 | 57 | void SetEvent(AliRunLoader *runLoader, AliRawReader *rawReader, AliESDEvent *esd, AliESDfriend *esdf); |
f76c9e9b | 58 | virtual Int_t GetMaxEventId(Bool_t refreshESD=kFALSE) const; |
516389a2 | 59 | virtual void GotoEvent(Int_t event); |
60 | virtual void NextEvent(); | |
61 | virtual void PrevEvent(); | |
62 | virtual void Close(); | |
ecb84424 | 63 | Bool_t FindNextByTrigger(Int_t& i); |
64 | Bool_t FindPrevByTrigger(Int_t& i); | |
516389a2 | 65 | |
90fa773e | 66 | |
b3b7b8d3 | 67 | Int_t GetEventId() const { return fEventId; } |
68 | AliRunLoader* GetRunLoader() const { return fRunLoader; } | |
69 | TFile* GetESDFile() const { return fESDFile; } | |
70 | TTree* GetESDTree() const { return fESDTree; } | |
71 | AliESDEvent* GetESD() const { return fESD; } | |
2cea771a | 72 | AliESDfriend* GetESDfriend() const { return fESDfriend; } |
73 | Bool_t GetESDfriendExists() const { return fESDfriendExists; } | |
b3b7b8d3 | 74 | TFile* GetAODFile() const { return fAODFile; } |
75 | TTree* GetAODTree() const { return fAODTree; } | |
76 | AliAODEvent* GetAOD() const { return fAOD; } | |
2cea771a | 77 | virtual const Text_t* GetTitle() const { return fPath.Data(); } |
12365217 | 78 | TString GetEventInfoHorizontal() const; |
79 | TString GetEventInfoVertical() const; | |
5a5a1232 | 80 | |
f6afd0e1 | 81 | static Bool_t HasRunLoader(); |
82 | static Bool_t HasESD(); | |
83 | static Bool_t HasESDfriend(); | |
b3b7b8d3 | 84 | static Bool_t HasAOD(); |
f6afd0e1 | 85 | static Bool_t HasRawReader(); |
86 | ||
5a5a1232 | 87 | static AliRunLoader* AssertRunLoader(); |
32e219c2 | 88 | static AliESDEvent* AssertESD(); |
3aecaefc | 89 | static AliESDfriend* AssertESDfriend(); |
b3b7b8d3 | 90 | static AliAODEvent* AssertAOD(); |
c2c4b7a2 | 91 | static AliRawReader* AssertRawReader(); |
5a5a1232 | 92 | |
93845f6c | 93 | static AliMagF* AssertMagField(); |
94 | ||
632d2b03 | 95 | static TGeoManager* AssertGeometry(); |
96 | ||
ba5d58f2 | 97 | static AliEveEventManager* AddDependentManager(const TString& name, const TString& path); |
98 | static AliEveEventManager* GetDependentManager(const TString& name); | |
4d62585e | 99 | |
100 | static AliEveEventManager* GetMaster(); | |
101 | static AliEveEventManager* GetCurrent(); | |
102 | ||
488869c1 | 103 | Double_t GetAutoLoadTime() const { return fAutoLoadTime; } |
104 | Bool_t GetAutoLoad() const { return fAutoLoad; } | |
105 | void SetAutoLoadTime(Float_t time); | |
319f3084 | 106 | void SetAutoLoad(Bool_t autoLoad); |
488869c1 | 107 | void AutoLoadNextEvent(); |
80547f2d | 108 | |
ecb84424 | 109 | Bool_t GetSelectOnTriggerType() const { return fSelectOnTriggerType; } |
110 | TString GetTriggerType() const { return fTriggerType; } | |
111 | void SetTriggerType(const TString& triggertype) { fTriggerType = triggertype; } | |
112 | void SetSelectOnTriggerType(Bool_t sel) { fSelectOnTriggerType = sel; } | |
113 | ||
488869c1 | 114 | Bool_t AreEventFilesOpened() const { return fIsOpen; } |
115 | Bool_t IsEventAvailable() const { return fHasEvent; } | |
116 | Bool_t IsUnderExternalControl() const { return fExternalCtrl; } | |
319f3084 | 117 | |
f6afd0e1 | 118 | virtual void AfterNewEventLoaded(); |
119 | void NewEventLoaded(); // *SIGNAL* | |
120 | ||
121 | AliEveMacroExecutor* GetExecutor() const { return fExecutor; } | |
f76c9e9b | 122 | |
4b456ebb | 123 | protected: |
124 | TString fPath; // URL to event-data. | |
125 | Int_t fEventId; // Id of current event. | |
126 | ||
127 | AliRunLoader* fRunLoader; // Run loader. | |
128 | ||
4d62585e | 129 | TFile *fESDFile; // ESD file. |
130 | TTree *fESDTree; // ESD tree. | |
131 | AliESDEvent *fESD; // ESDEvent object. | |
132 | AliESDfriend *fESDfriend; // ESDfriend object. | |
4b456ebb | 133 | Bool_t fESDfriendExists; // Flag specifying if ESDfriend was found during opening of the event-data. |
b3b7b8d3 | 134 | TFile *fAODFile; // AOD file. |
135 | TTree *fAODTree; // AOD tree. | |
136 | AliAODEvent *fAOD; // AODEvent object. | |
4b456ebb | 137 | |
4d62585e | 138 | AliRawReader *fRawReader; // Raw-data reader. |
c2c4b7a2 | 139 | |
319f3084 | 140 | Bool_t fAutoLoad; // Automatic loading of events (online) |
488869c1 | 141 | Float_t fAutoLoadTime; // Auto-load time in seconds |
319f3084 | 142 | TTimer *fAutoLoadTimer; // Timer for automatic event loading |
80547f2d | 143 | |
144 | Bool_t fIsOpen; // Are event-files opened. | |
145 | Bool_t fHasEvent; // Is an event available. | |
146 | Bool_t fExternalCtrl; // Are we under external event-loop. | |
147 | ||
4d62585e | 148 | Bool_t fSelectOnTriggerType; // Whether to select on trigger-type. |
149 | TString fTriggerType; // Trigger-type to select on. | |
319f3084 | 150 | |
f6afd0e1 | 151 | AliEveMacroExecutor *fExecutor; // Executor for std macros |
152 | ||
4d62585e | 153 | TList *fSubManagers; // Dependent event-managers, used for event embedding. |
154 | ||
c2c4b7a2 | 155 | static TString fgESDFileName; // Name by which to open ESD. |
b3b7b8d3 | 156 | static TString fgAODFileName; // Name by which to open AOD. |
c2c4b7a2 | 157 | static TString fgRawFileName; // Name by which to open raw-data file. |
4b456ebb | 158 | static TString fgCdbUri; // Global URI to CDB. |
159 | static Bool_t fgAssertRunLoader; // Global flag specifying if AliRunLoader must be asserted during opening of the event-data. | |
160 | static Bool_t fgAssertESD; // Global flag specifying if ESDEvent must be asserted during opening of the event-data. | |
b3b7b8d3 | 161 | static Bool_t fgAssertAOD; // Global flag specifying if AODEvent must be asserted during opening of the event-data. |
c2c4b7a2 | 162 | static Bool_t fgAssertRaw; // Global flag specifying if raw-data presence must be asserted during opening of the event-data. |
4b456ebb | 163 | |
b3b7b8d3 | 164 | static AliMagF *fgMagField; // Global pointer to magnetic field. |
165 | ||
166 | static TList *fgAODfriends; // Global list of AOD friend names to be attached during opening of the event-data (empty by default). | |
4b456ebb | 167 | |
168 | private: | |
169 | AliEveEventManager(const AliEveEventManager&); // Not implemented | |
170 | AliEveEventManager& operator=(const AliEveEventManager&); // Not implemented | |
171 | ||
488869c1 | 172 | void InitInternals(); |
173 | void StartAutoLoadTimer(); | |
174 | void StopAutoLoadTimer(); | |
175 | ||
176 | Bool_t fAutoLoadTimerRunning; // State of auto-load timer. | |
177 | ||
4d62585e | 178 | static AliEveEventManager* fgMaster; |
179 | static AliEveEventManager* fgCurrent; | |
180 | ||
4b456ebb | 181 | ClassDef(AliEveEventManager, 0); // Interface for getting all event components in a uniform way. |
182 | }; | |
5a5a1232 | 183 | |
5a5a1232 | 184 | #endif |