]>
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 | |
f944f125 | 17 | #include <AliEventInfo.h> |
18 | ||
f6afd0e1 | 19 | class AliEveMacroExecutor; |
3d94b490 | 20 | class AliEveEventSelector; |
f6afd0e1 | 21 | |
5a5a1232 | 22 | class AliRunLoader; |
af885e0f | 23 | class AliESDEvent; |
3aecaefc | 24 | class AliESDfriend; |
b3b7b8d3 | 25 | class AliAODEvent; |
c2c4b7a2 | 26 | class AliRawReader; |
5a5a1232 | 27 | |
8661a211 | 28 | class AliGRPObject; |
f944f125 | 29 | class AliRecoParam; |
93845f6c | 30 | class AliMagF; |
31 | ||
3d94b490 | 32 | class TEveElement; |
5a5a1232 | 33 | class TFile; |
34 | class TTree; | |
632d2b03 | 35 | class TGeoManager; |
3d94b490 | 36 | class TString; |
37 | class TMap; | |
5a5a1232 | 38 | |
a15e6d7d | 39 | //============================================================================== |
40 | // | |
41 | // AliEveEventManager | |
42 | // | |
43 | // Interface to ALICE event-data (RunLoader, ESD), magnetic field and | |
44 | // geometry. | |
45 | // | |
46 | ||
5a5a1232 | 47 | |
f76c9e9b | 48 | class AliEveEventManager : public TEveEventManager, |
49 | public TQObject | |
5a5a1232 | 50 | { |
5a5a1232 | 51 | public: |
4d62585e | 52 | static void SetESDFileName(const TString& esd); |
be736e6d | 53 | static void SetESDfriendFileName(const TString& esdf); |
b3b7b8d3 | 54 | static void SetAODFileName(const TString& aod); |
55 | static void AddAODfriend (const TString& friendFileName); | |
4d62585e | 56 | static void SetRawFileName(const TString& raw); |
57 | static void SetCdbUri (const TString& cdb); | |
be736e6d | 58 | static void SetGAliceFileName(const TString& galice); |
59 | ||
60 | // set Local Directory or URL where the files are located | |
61 | // it can also be a path to root_archive.zip | |
62 | // assumes the filenames of ESD, AOD, etc are standard ALICE names | |
63 | // (AliESDs.root, AliESDfriends.root, AliAOD.root, AliAODfriend.root, galice.root,raw.root) | |
64 | static void SetFilesPath(const TString& path); | |
65 | ||
b3b7b8d3 | 66 | static void SetAssertElements(Bool_t assertRunloader, Bool_t assertEsd, |
67 | Bool_t assertAod, Bool_t assertRaw); | |
25dddcb1 | 68 | static void SearchRawForCentralReconstruction(); |
08b0f222 | 69 | |
be736e6d | 70 | AliEveEventManager(const TString& name="Event", Int_t ev=0); |
a15e6d7d | 71 | virtual ~AliEveEventManager(); |
72 | ||
516389a2 | 73 | virtual void Open(); |
482d0751 | 74 | void SetEvent(AliRunLoader *runLoader, AliRawReader *rawReader, AliESDEvent *esd, AliESDfriend *esdf); |
f76c9e9b | 75 | virtual Int_t GetMaxEventId(Bool_t refreshESD=kFALSE) const; |
516389a2 | 76 | virtual void GotoEvent(Int_t event); |
77 | virtual void NextEvent(); | |
e10d437c | 78 | virtual void PrevEvent(); |
516389a2 | 79 | virtual void Close(); |
e10d437c | 80 | void Timeout(); // * SIGNAL* |
90fa773e | 81 | |
b3b7b8d3 | 82 | Int_t GetEventId() const { return fEventId; } |
83 | AliRunLoader* GetRunLoader() const { return fRunLoader; } | |
84 | TFile* GetESDFile() const { return fESDFile; } | |
85 | TTree* GetESDTree() const { return fESDTree; } | |
86 | AliESDEvent* GetESD() const { return fESD; } | |
2cea771a | 87 | AliESDfriend* GetESDfriend() const { return fESDfriend; } |
88 | Bool_t GetESDfriendExists() const { return fESDfriendExists; } | |
b3b7b8d3 | 89 | TFile* GetAODFile() const { return fAODFile; } |
90 | TTree* GetAODTree() const { return fAODTree; } | |
91 | AliAODEvent* GetAOD() const { return fAOD; } | |
008ac94c | 92 | AliEveEventSelector* GetEventSelector() const { return fPEventSelector; } |
12365217 | 93 | TString GetEventInfoHorizontal() const; |
94 | TString GetEventInfoVertical() const; | |
f944f125 | 95 | const AliEventInfo* GetEventInfo(); |
5a5a1232 | 96 | |
ba014dea | 97 | static Int_t CurrentEventId(); |
98 | ||
f6afd0e1 | 99 | static Bool_t HasRunLoader(); |
100 | static Bool_t HasESD(); | |
101 | static Bool_t HasESDfriend(); | |
b3b7b8d3 | 102 | static Bool_t HasAOD(); |
f6afd0e1 | 103 | static Bool_t HasRawReader(); |
104 | ||
5a5a1232 | 105 | static AliRunLoader* AssertRunLoader(); |
32e219c2 | 106 | static AliESDEvent* AssertESD(); |
3aecaefc | 107 | static AliESDfriend* AssertESDfriend(); |
b3b7b8d3 | 108 | static AliAODEvent* AssertAOD(); |
c2c4b7a2 | 109 | static AliRawReader* AssertRawReader(); |
5a5a1232 | 110 | |
8661a211 | 111 | static AliMagF* AssertMagField(); |
632d2b03 | 112 | static TGeoManager* AssertGeometry(); |
f944f125 | 113 | static AliRecoParam* AssertRecoParams(); |
632d2b03 | 114 | |
ba5d58f2 | 115 | static AliEveEventManager* AddDependentManager(const TString& name, const TString& path); |
116 | static AliEveEventManager* GetDependentManager(const TString& name); | |
4d62585e | 117 | |
118 | static AliEveEventManager* GetMaster(); | |
119 | static AliEveEventManager* GetCurrent(); | |
120 | ||
8661a211 | 121 | static void RegisterTransient (TEveElement* element); |
122 | static void RegisterTransientList(TEveElement* element); | |
08b0f222 | 123 | |
124 | ||
488869c1 | 125 | Double_t GetAutoLoadTime() const { return fAutoLoadTime; } |
126 | Bool_t GetAutoLoad() const { return fAutoLoad; } | |
127 | void SetAutoLoadTime(Float_t time); | |
319f3084 | 128 | void SetAutoLoad(Bool_t autoLoad); |
969d3431 | 129 | void SetTrigSel(Int_t trig); |
488869c1 | 130 | void AutoLoadNextEvent(); |
80547f2d | 131 | |
488869c1 | 132 | Bool_t AreEventFilesOpened() const { return fIsOpen; } |
133 | Bool_t IsEventAvailable() const { return fHasEvent; } | |
134 | Bool_t IsUnderExternalControl() const { return fExternalCtrl; } | |
3d94b490 | 135 | |
136 | Bool_t InsertGlobal(const TString& tag, TEveElement* model); | |
137 | Bool_t InsertGlobal(const TString& tag, TEveElement* model, | |
138 | Bool_t replace, Bool_t update); | |
139 | TEveElement* FindGlobal(const TString& tag); | |
319f3084 | 140 | |
f6afd0e1 | 141 | virtual void AfterNewEventLoaded(); |
c12be4d4 | 142 | void NewEventDataLoaded(); // *SIGNAL* |
f6afd0e1 | 143 | void NewEventLoaded(); // *SIGNAL* |
144 | ||
145 | AliEveMacroExecutor* GetExecutor() const { return fExecutor; } | |
f76c9e9b | 146 | |
4b456ebb | 147 | protected: |
4b456ebb | 148 | Int_t fEventId; // Id of current event. |
149 | ||
150 | AliRunLoader* fRunLoader; // Run loader. | |
151 | ||
4d62585e | 152 | TFile *fESDFile; // ESD file. |
153 | TTree *fESDTree; // ESD tree. | |
154 | AliESDEvent *fESD; // ESDEvent object. | |
155 | AliESDfriend *fESDfriend; // ESDfriend object. | |
4b456ebb | 156 | Bool_t fESDfriendExists; // Flag specifying if ESDfriend was found during opening of the event-data. |
b3b7b8d3 | 157 | TFile *fAODFile; // AOD file. |
158 | TTree *fAODTree; // AOD tree. | |
159 | AliAODEvent *fAOD; // AODEvent object. | |
4b456ebb | 160 | |
4d62585e | 161 | AliRawReader *fRawReader; // Raw-data reader. |
f944f125 | 162 | AliEventInfo fEventInfo; // Current Event Info |
163 | ||
319f3084 | 164 | Bool_t fAutoLoad; // Automatic loading of events (online) |
488869c1 | 165 | Float_t fAutoLoadTime; // Auto-load time in seconds |
319f3084 | 166 | TTimer *fAutoLoadTimer; // Timer for automatic event loading |
80547f2d | 167 | |
168 | Bool_t fIsOpen; // Are event-files opened. | |
169 | Bool_t fHasEvent; // Is an event available. | |
170 | Bool_t fExternalCtrl; // Are we under external event-loop. | |
171 | ||
3d94b490 | 172 | TMap* fGlobal; |
173 | Bool_t fGlobalReplace; // Are global replace | |
174 | Bool_t fGlobalUpdate; // Are global updates | |
175 | ||
f6afd0e1 | 176 | AliEveMacroExecutor *fExecutor; // Executor for std macros |
177 | ||
08b0f222 | 178 | TEveElementList *fTransients; // Container for additional transient (per event) elements. |
8661a211 | 179 | TEveElementList *fTransientLists; // Container for lists of transient (per event) elements. |
08b0f222 | 180 | |
008ac94c | 181 | AliEveEventSelector* fPEventSelector; // Event filter |
182 | ||
4d62585e | 183 | TList *fSubManagers; // Dependent event-managers, used for event embedding. |
184 | ||
be736e6d | 185 | static TString fgGAliceFileName; // galice.root file |
c2c4b7a2 | 186 | static TString fgESDFileName; // Name by which to open ESD. |
2e29a658 | 187 | static TString fgESDfriendsFileName; |
b3b7b8d3 | 188 | static TString fgAODFileName; // Name by which to open AOD. |
c2c4b7a2 | 189 | static TString fgRawFileName; // Name by which to open raw-data file. |
4b456ebb | 190 | static TString fgCdbUri; // Global URI to CDB. |
191 | static Bool_t fgAssertRunLoader; // Global flag specifying if AliRunLoader must be asserted during opening of the event-data. | |
192 | static Bool_t fgAssertESD; // Global flag specifying if ESDEvent must be asserted during opening of the event-data. | |
b3b7b8d3 | 193 | static Bool_t fgAssertAOD; // Global flag specifying if AODEvent must be asserted during opening of the event-data. |
c2c4b7a2 | 194 | static Bool_t fgAssertRaw; // Global flag specifying if raw-data presence must be asserted during opening of the event-data. |
4b456ebb | 195 | |
b3b7b8d3 | 196 | static TList *fgAODfriends; // Global list of AOD friend names to be attached during opening of the event-data (empty by default). |
4b456ebb | 197 | |
25dddcb1 | 198 | static Bool_t fgRawFromStandardLoc; // Global flag to enable looking for raw data in ../../../raw/, as it is stored for central reco. |
199 | ||
55216596 | 200 | static Bool_t fgGRPLoaded; // Global run parameters loaded? |
8661a211 | 201 | static AliMagF *fgMagField; // Global pointer to magnetic field. |
f944f125 | 202 | static AliRecoParam* fgRecoParam; |
8661a211 | 203 | static Bool_t fgUniformField; // Track with uniform field. |
204 | ||
4b456ebb | 205 | private: |
206 | AliEveEventManager(const AliEveEventManager&); // Not implemented | |
207 | AliEveEventManager& operator=(const AliEveEventManager&); // Not implemented | |
208 | ||
488869c1 | 209 | void InitInternals(); |
210 | void StartAutoLoadTimer(); | |
211 | void StopAutoLoadTimer(); | |
212 | ||
8661a211 | 213 | static Bool_t InitGRP(); |
f944f125 | 214 | static Bool_t InitRecoParam(); |
8661a211 | 215 | |
488869c1 | 216 | Bool_t fAutoLoadTimerRunning; // State of auto-load timer. |
217 | ||
4d62585e | 218 | static AliEveEventManager* fgMaster; |
219 | static AliEveEventManager* fgCurrent; | |
220 | ||
4b456ebb | 221 | ClassDef(AliEveEventManager, 0); // Interface for getting all event components in a uniform way. |
222 | }; | |
5a5a1232 | 223 | |
5a5a1232 | 224 | #endif |