]>
Commit | Line | Data |
---|---|---|
9e78371d | 1 | //-*- Mode: C++ -*- |
2 | ||
3 | // ** USED macros : | |
4 | // *************************************************** | |
5 | // - hlt_alieve_init.C | |
6 | // - VizDB_scan.C | |
7 | // - geom_gentle_hlt.C | |
8 | // - geom_gentle_muon.C | |
9 | // *************************************************** | |
10 | ||
11 | #include "unistd.h" | |
12 | #include <TEvePointSet.h> | |
13 | #include "EveBase/AliEveEventManager.h" | |
14 | #include <AliCluster.h> | |
15 | #include <TPC/AliTPCClustersRow.h> | |
16 | ||
17 | class TEveProjectionManager; | |
18 | class TEveGeoShape; | |
19 | class TEveUtil; | |
20 | class AliEveMacroExecutor; | |
21 | class TEveScene; | |
22 | class TEveElement; | |
23 | class TEveText; | |
24 | class AliHLTTriggerDecision; | |
25 | class TEvePointSet; | |
26 | ||
27 | // ----------------------------------------------------------------- | |
28 | // -- Geometry / Scenes -- | |
29 | // ----------------------------------------------------------------- | |
30 | ||
31 | TEveProjectionManager *gRPhiMgr = 0; | |
32 | TEveProjectionManager *gRhoZMgr = 0; | |
33 | ||
34 | // ----------------------------------------------------------------- | |
35 | // -- Geometry / Scenes Parameters -- | |
36 | // ----------------------------------------------------------------- | |
37 | ||
38 | // -- Parameters to show different geometries | |
39 | Bool_t gShowMUON = kTRUE; | |
40 | Bool_t gShowMUONRPhi = kFALSE; | |
41 | Bool_t gShowMUONRhoZ = kTRUE; | |
42 | ||
43 | // ----------------------------------------------------------------- | |
44 | // -- Members -- | |
45 | // ----------------------------------------------------------------- | |
46 | ||
47 | // -- Timer for automatic event loop | |
48 | TTimer eventTimer; | |
49 | ||
50 | // -- HOMERManager | |
51 | AliEveHOMERManager* gHomerManager = 0; | |
52 | ||
53 | // -- Cluster members | |
54 | TEvePointSet* gPHOSClusters = 0; | |
55 | TEvePointSet* gTPCClusters = 0; | |
56 | TEvePointSet* gSPDClusters = 0; | |
57 | ||
58 | // -- Tracks members | |
59 | TEveTrackList* gTPCTrack = 0; | |
60 | ||
61 | // ----------------------------------------------------------------- | |
62 | // -- Methods -- | |
63 | // ----------------------------------------------------------------- | |
64 | ||
65 | Int_t initializeEveViewer( Bool_t showExtraGeo ); | |
66 | ||
67 | Int_t nextEvent(); | |
68 | ||
69 | Int_t processPHOSClusters( AliHLTHOMERBlockDesc* block); | |
70 | ||
71 | Int_t processEsdTracks( AliHLTHOMERBlockDesc* block, TEveTrackList* cont ); | |
72 | ||
73 | Int_t processHLTRDLST( AliHLTHOMERBlockDesc* block ); | |
74 | ||
75 | Int_t processROOTTOBJ( AliHLTHOMERBlockDesc* block ); | |
76 | ||
77 | Int_t processTPCClusters (AliHLTHOMERBlockDesc * block, TEvePointSet cont ); | |
78 | ||
79 | // ################################################################# | |
80 | // ################################################################# | |
81 | // ################################################################# | |
82 | ||
83 | // ----------------------------------------------------------------- | |
84 | void onlineDisplay(Bool_t showMuonGeo=kFALSE) { | |
85 | ||
86 | // -- Loading Geometry | |
87 | // --------------------- | |
88 | Int_t run = 67179; | |
89 | AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/OCDB"); | |
90 | AliCDBManager::Instance()->SetRun(run); | |
91 | AliGeomManager::LoadGeometry(); | |
92 | ||
93 | // -- Create new hM object | |
94 | // ------------------------- | |
95 | gHomerManager = new AliEveHOMERManager(); | |
96 | gHomerManager->SetRetryCount(50,5); | |
97 | ||
98 | Int_t iResult = gHomerManager->Initialize(); | |
99 | if (iResult) { | |
100 | printf("Error Initializing AliHLTHOMERManager, quitting"); | |
101 | return; | |
102 | } | |
103 | ||
104 | // -- Add hM to EveTree | |
105 | // ---------------------- | |
106 | gEve->AddToListTree(gHomerManager, kTRUE); | |
107 | ||
108 | // -- Create SourceList | |
109 | // ---------------------- | |
110 | iResult = gHomerManager->CreateEveSourcesListLoop(); | |
111 | if (iResult) { | |
112 | printf ("Couldn't find active services. returning\n"); | |
113 | return; | |
114 | } | |
115 | ||
116 | // -- Initialize pointsets and add macros | |
117 | // ---------------------------------------- | |
118 | TEveUtil::LoadMacro("hlt_alieve_init.C"); | |
119 | hlt_alieve_init(".", -1); | |
120 | ||
121 | // -- Initialize Eve | |
122 | // ------------------- | |
123 | initializeEveViewer( showMuonGeo ); | |
124 | ||
125 | // -- Finalize Eve | |
126 | // ----------------- | |
127 | gSystem->ProcessEvents(); | |
128 | gEve->Redraw3D(kTRUE); | |
129 | } | |
130 | ||
131 | // ----------------------------------------------------------------- | |
132 | Int_t initializeEveViewer( Bool_t showMuonGeo ) { | |
133 | ||
134 | //============================================================================== | |
135 | // Geometry, scenes, projections and viewers | |
136 | //============================================================================== | |
137 | ||
138 | TEveGeoShape *geomGentle = 0; | |
139 | TEveGeoShape *geomGentleRPhi = 0; | |
140 | TEveGeoShape *geomGentleRhoZ = 0; | |
141 | TEveGeoShape *geomGentleTRD = 0; | |
142 | TEveGeoShape *geomGentleMUON = 0; | |
143 | ||
144 | // -- Disable extra geometry | |
145 | // --------------------------- | |
146 | if ( ! showMuonGeo ) { | |
147 | gShowMUON = gShowMUONRPhi = gShowMUONRhoZ = kFALSE; | |
148 | } | |
149 | ||
150 | // -- Load Geometry | |
151 | // ------------------ | |
152 | TEveUtil::LoadMacro("geom_gentle_hlt.C"); | |
153 | geomGentle = geom_gentle_hlt(); | |
154 | geomGentleRPhi = geom_gentle_rphi(); geomGentleRPhi->IncDenyDestroy(); | |
155 | geomGentleRhoZ = geom_gentle_rhoz(); geomGentleRhoZ->IncDenyDestroy(); | |
156 | geomGentleTRD = geom_gentle_trd(); | |
157 | ||
158 | if (gShowMUON) { | |
159 | TEveUtil::LoadMacro("geom_gentle_muon.C"); | |
160 | geomGentleMUON = geom_gentle_muon(kFALSE); | |
161 | } | |
162 | ||
163 | // -- Scenes | |
164 | // ----------- | |
165 | ||
166 | TEveScene *rPhiGeomScene = gEve->SpawnNewScene("RPhi Geometry", | |
167 | "Scene holding projected geometry for the RPhi view."); | |
168 | TEveScene *rhoZGeomScene = gEve->SpawnNewScene("RhoZ Geometry", | |
169 | "Scene holding projected geometry for the RhoZ view."); | |
170 | TEveScene *rPhiEventScene = gEve->SpawnNewScene("RPhi Event Data", | |
171 | "Scene holding projected geometry for the RPhi view."); | |
172 | TEveScene *rhoZEventScene = gEve->SpawnNewScene("RhoZ Event Data", | |
173 | "Scene holding projected geometry for the RhoZ view."); | |
174 | ||
175 | // -- Projection managers | |
176 | // ------------------------ | |
177 | ||
178 | // -- R-Phi Projection | |
179 | gRPhiMgr = new TEveProjectionManager(); | |
180 | gRPhiMgr->SetProjection(TEveProjection::kPT_RPhi); | |
181 | gEve->AddToListTree(gRPhiMgr, kFALSE); | |
182 | { | |
183 | TEveProjectionAxes* a = new TEveProjectionAxes(gRPhiMgr); | |
184 | a->SetMainColor(kWhite); | |
185 | a->SetTitle("R-Phi"); | |
186 | a->SetTitleSize(0.05); | |
187 | a->SetTitleFont(102); | |
188 | a->SetLabelSize(0.025); | |
189 | a->SetLabelFont(102); | |
190 | rPhiGeomScene->AddElement(a); | |
191 | } | |
192 | ||
193 | gRPhiMgr->SetCurrentDepth(-10); | |
194 | gRPhiMgr->ImportElements(geomGentleRPhi, rPhiGeomScene); | |
195 | gRPhiMgr->SetCurrentDepth(0); | |
196 | gRPhiMgr->ImportElements(geomGentleTRD, rPhiGeomScene); | |
197 | if (gShowMUONRPhi) gRPhiMgr->ImportElements(geomGentleMUON, rPhiGeomScene); | |
198 | ||
199 | // -- Rho-Z Projection | |
200 | gRhoZMgr = new TEveProjectionManager(); | |
201 | gRhoZMgr->SetProjection(TEveProjection::kPT_RhoZ); | |
202 | gEve->AddToListTree(gRhoZMgr, kFALSE); | |
203 | { | |
204 | TEveProjectionAxes* a = new TEveProjectionAxes(gRhoZMgr); | |
205 | a->SetMainColor(kWhite); | |
206 | a->SetTitle("Rho-Z"); | |
207 | a->SetTitleSize(0.05); | |
208 | a->SetTitleFont(102); | |
209 | a->SetLabelSize(0.025); | |
210 | a->SetLabelFont(102); | |
211 | rhoZGeomScene->AddElement(a); | |
212 | } | |
213 | gRhoZMgr->SetCurrentDepth(-10); | |
214 | gRhoZMgr->ImportElements(geomGentleRhoZ, rhoZGeomScene); | |
215 | gRhoZMgr->SetCurrentDepth(0); | |
216 | gRhoZMgr->ImportElements(geomGentleTRD, rhoZGeomScene); | |
217 | if (gShowMUONRhoZ) gRhoZMgr->ImportElements(geomGentleMUON, rhoZGeomScene); | |
218 | ||
219 | // -- Viewers | |
220 | // ------------ | |
221 | TEveBrowser *browser = gEve->GetBrowser(); | |
222 | browser->ShowCloseTab(kFALSE); | |
223 | ||
9e78371d | 224 | TEveViewer *threeDView = 0; |
225 | TEveViewer *rPhiView = 0; | |
226 | TEveViewer *rhoZView = 0; | |
227 | ||
228 | TEveWindowSlot *slot = TEveWindow::CreateWindowInTab(browser->GetTabRight()); | |
229 | TEveWindowPack *pack = slot->MakePack(); | |
230 | pack->SetElementName("Multi View"); | |
231 | pack->SetHorizontal(); | |
232 | pack->SetShowTitleBar(kFALSE); | |
233 | pack->NewSlot()->MakeCurrent(); | |
234 | threeDView = gEve->SpawnNewViewer("3D View", ""); | |
235 | threeDView->AddScene(gEve->GetGlobalScene()); | |
236 | threeDView->AddScene(gEve->GetEventScene()); | |
237 | ||
238 | pack = pack->NewSlot()->MakePack(); | |
239 | pack->SetShowTitleBar(kFALSE); | |
240 | pack->NewSlot()->MakeCurrent(); | |
241 | rPhiView = gEve->SpawnNewViewer("RPhi View", ""); | |
242 | rPhiView->GetGLViewer()->SetCurrentCamera(TGLViewer::kCameraOrthoXOY); | |
243 | rPhiView->AddScene(rPhiGeomScene); | |
244 | rPhiView->AddScene(rPhiEventScene); | |
245 | ||
246 | pack->NewSlot()->MakeCurrent(); | |
247 | rhoZView = gEve->SpawnNewViewer("RhoZ View", ""); | |
248 | rhoZView->GetGLViewer()->SetCurrentCamera(TGLViewer::kCameraOrthoXOY); | |
249 | rhoZView->AddScene(rhoZGeomScene); | |
250 | rhoZView->AddScene(rhoZEventScene); | |
251 | ||
252 | TEveViewerList *viewerlist = new TEveViewerList(); | |
253 | viewerlist->AddElement(gEve->GetDefaultViewer()); | |
254 | ||
255 | viewerlist->AddElement(threeDView); | |
256 | viewerlist->AddElement(rhoZView); | |
257 | viewerlist->AddElement(rPhiView); | |
258 | viewerlist->AddElement(threeDView); | |
259 | viewerlist->SwitchColorSet(); | |
260 | ||
261 | //============================================================================== | |
262 | // Macros / QA histograms | |
263 | //============================================================================== | |
264 | ||
265 | // -- Registration of per-event macros | |
266 | // ------------------------------------- | |
267 | ||
268 | AliEveMacroExecutor *exec = new AliEveMacroExecutor(); | |
269 | #if 0 | |
270 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "SIM Track", "kine_tracks.C", "kine_tracks", "", kFALSE)); | |
271 | ||
272 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "SIM Hit ITS", "its_hits.C", "its_hits", "", kFALSE)); | |
273 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "SIM Hit TPC", "tpc_hits.C", "tpc_hits", "", kFALSE)); | |
274 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "SIM Hit T0", "t0_hits.C", "t0_hits", "", kFALSE)); | |
275 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "SIM Hit FMD", "fmd_hits.C", "fmd_hits", "", kFALSE)); | |
276 | ||
277 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "DIG FMD", "fmd_digits.C", "fmd_digits", "", kFALSE)); | |
278 | ||
279 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW TPC", "tpc_raw.C", "tpc_raw", "", kFALSE)); | |
280 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW T0", "t0_raw.C", "t0_raw", "", kFALSE)); | |
281 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW FMD", "fmd_raw.C", "fmd_raw", "", kFALSE)); | |
282 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW VZERO", "vzero_raw.C", "vzero_raw", "", kFALSE)); | |
283 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW ACORDE", "acorde_raw.C", "acorde_raw", "", kFALSE)); | |
284 | ||
285 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX", "primary_vertex.C", "primary_vertex", "", kTRUE)); | |
286 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Ellipse", "primary_vertex.C", "primary_vertex_ellipse", "", kTRUE)); | |
287 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Box", "primary_vertex.C", "primary_vertex_box", "kFALSE, 3, 3, 3", kFALSE)); | |
288 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX", "primary_vertex.C", "primary_vertex_spd", "", kTRUE)); | |
289 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Ellipse", "primary_vertex.C", "primary_vertex_ellipse_spd", "", kTRUE)); | |
290 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Box", "primary_vertex.C", "primary_vertex_box_spd", "kFALSE, 3, 3, 3", kFALSE)); | |
291 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX", "primary_vertex.C", "primary_vertex_tpc", "", kFALSE)); | |
292 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Ellipse", "primary_vertex.C", "primary_vertex_ellipse_tpc", "", kFALSE)); | |
293 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Box", "primary_vertex.C", "primary_vertex_box_tpc", "kFALSE, 3, 3, 3", kFALSE)); | |
294 | #endif | |
295 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC V0", "esd_V0_points.C", "esd_V0_points_onfly")); | |
296 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC V0", "esd_V0_points.C", "esd_V0_points_offline")); | |
297 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC V0", "esd_V0.C", "esd_V0")); | |
298 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC CSCD", "esd_cascade_points.C", "esd_cascade_points")); | |
299 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC CSCD", "esd_cascade.C", "esd_cascade")); | |
300 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC KINK", "esd_kink_points.C", "esd_kink_points")); | |
301 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC KINK", "esd_kink.C", "esd_kink")); | |
302 | ||
303 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Track", "esd_tracks.C", "esd_tracks", "", kFALSE)); | |
304 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Track", "esd_tracks.C", "esd_tracks_MI", "", kFALSE)); | |
305 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Track", "esd_tracks.C", "esd_tracks_by_category", "", kTRUE)); | |
306 | ||
307 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Tracklet", "esd_spd_tracklets.C", "esd_spd_tracklets", "", kFALSE)); | |
308 | ||
309 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC ZDC", "esd_zdc.C", "esd_zdc", "", kFALSE)); | |
310 | #if 0 | |
311 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clus", "clusters.C+", "clusters", "", kFALSE)); | |
312 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clus ITS", "its_clusters.C+", "its_clusters")); | |
313 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clus TPC", "tpc_clusters.C+", "tpc_clusters")); | |
314 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clus TRD", "trd_clusters.C+", "trd_clusters")); | |
315 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clus TOF", "tof_clusters.C+", "tof_clusters")); | |
316 | ||
317 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clus TPC", "vplot_tpc.C+", "vplot_tpc", "", kFALSE)); | |
318 | ||
319 | exec->AddMacro(new AliEveMacro(AliEveMacro::kAOD, "ANA HF", "aod_HF.C", "aod_HF", "", kFALSE)); | |
320 | exec->AddMacro(new AliEveMacro(AliEveMacro::kAOD, "ANA Jets", "jetplane.C", "jetplane", "", kFALSE)); | |
321 | ||
322 | // -- QA Viewer | |
323 | // -------------- | |
324 | ||
325 | slot = TEveWindow::CreateWindowInTab(browser->GetTabRight()); | |
326 | slot->StartEmbedding(); | |
327 | new AliQAHistViewer(gClient->GetRoot(), 600, 400, kTRUE); | |
328 | slot->StopEmbedding("QA histograms"); | |
329 | ||
330 | #endif | |
331 | ||
332 | //============================================================================== | |
333 | // Additional GUI components | |
334 | //============================================================================== | |
335 | ||
336 | slot = TEveWindow::CreateWindowInTab(browser->GetTabRight()); | |
337 | TEveWindowTab *store_tab = slot->MakeTab(); | |
338 | store_tab->SetElementNameTitle("WindowStore", | |
339 | "Undocked windows whose previous container is not known\n" | |
340 | "are placed here when the main-frame is closed."); | |
341 | gEve->GetWindowManager()->SetDefaultContainer(store_tab); | |
342 | ||
343 | return 0; | |
344 | } | |
345 | ||
346 | // ----------------------------------------------------------------- | |
347 | Int_t nextEvent() { | |
348 | ||
349 | Int_t iResult = 0; | |
350 | ||
351 | gStyle->SetPalette(1, 0); | |
352 | gEve->DisableRedraw(); | |
353 | ||
354 | // -- Get Next Event from HOMER | |
355 | // ------------------------------ | |
356 | if ( ( iResult = gHomerManager->NextEvent()) ){ | |
357 | return iResult; | |
358 | } | |
359 | ||
360 | // -- Reset | |
361 | // ---------- | |
362 | if ( gTPCClusters ) gTPCClusters->Reset(); | |
363 | if ( gPHOSClusters ) gPHOSClusters->Reset(); | |
364 | if ( gTPCTrack ) gTPCTrack->DestroyElements(); | |
365 | ||
366 | if (gHomerManager->GetBlockList()->IsEmpty() ) { | |
367 | printf ("No Blocks in list ... "); | |
368 | return; | |
369 | } | |
370 | ||
371 | TIter next(gHomerManager->GetBlockList()); | |
372 | AliHLTHOMERBlockDesc* block = 0; | |
373 | ||
374 | // -- Iterate over blocks in the block list | |
375 | // ------------------------------------------ | |
376 | while ((block = (AliHLTHOMERBlockDesc*)next())) { | |
377 | ||
378 | printf( "------------------- xxxxxxxxxxxxxxx ----------------------\n"); | |
379 | printf( "Detector : %s\n", block->GetDetector().Data() ); | |
380 | printf( "Datatype : %s\n", block->GetDataType().Data() ); | |
381 | if (block->IsTObject() ) | |
382 | printf( "Is TObject of class: %s\n", block->GetClassName().Data() ); | |
383 | printf( "------------------- xxxxxxxxxxxxxxx ----------------------\n"); | |
384 | ||
385 | // -- CHECK SOURCE | |
386 | // ----------------------------------------------------- | |
387 | ||
388 | // ++ HLT BLOCK | |
389 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
390 | if ( ! block->GetDetector().CompareTo("HLT") ) { | |
391 | ||
392 | // -- ESDTREE | |
393 | if ( ! block->GetDataType().CompareTo("ALIESDV0") ) { | |
394 | cout << "ALIESDV0 ------- ALIESDV0 ------ ALIESDV0" << endl; | |
395 | ||
396 | if(!gTPCTrack){ | |
397 | gTPCTrack = new TEveTrackList("ESD Tracks"); | |
398 | gTPCTrack->SetMainColor(6); | |
399 | gEve->AddElement(gTPCTrack); | |
400 | } | |
401 | ||
402 | iResult = processEsdTracks(block, gTPCTrack); | |
403 | } | |
404 | ||
405 | // -- Process ROOTObj | |
406 | else if ( ! block->GetDataType().CompareTo("ROOTTOBJ") ) { | |
407 | processROOTTOBJ( block ); | |
408 | } | |
409 | ||
410 | // -- Process HLT RDLST | |
411 | else if ( ! block->GetDataType().CompareTo("HLTRDLST") ) { | |
412 | processHLTRDLST( block ); | |
413 | } | |
414 | } // if ( ! block->GetDetector().CompareTo("HLT") ) { | |
415 | ||
416 | // ++ TPC BLOCK | |
417 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
418 | else if ( ! block->GetDetector().CompareTo("TPC") ) { | |
419 | ||
420 | // -- ESDTREE | |
421 | if ( ! block->GetDataType().CompareTo("ALIESDV0") ) { | |
422 | ||
423 | } | |
424 | } // else if ( ! block->GetDetector().CompareTo("HLT") ) { | |
425 | ||
426 | // ++ ITS - SPD BLOCK | |
427 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
428 | else if ( ! block->GetDetector().CompareTo("ISPD") ){ | |
429 | if ( block->GetDataType().CompareTo("CLUSTERS") == 0 ) { | |
430 | //processISPDClusters( block ); | |
431 | } | |
432 | } // else if ( ! block->GetDetector().CompareTo("ISPD") ){ | |
433 | ||
434 | } // while ((block = (AliHLTHOMERBlockDesc*)next())) { | |
435 | ||
436 | if ( gTPCClusters ) gTPCClusters->ResetBBox(); | |
437 | if ( gPHOSClusters ) gPHOSClusters->ResetBBox(); | |
438 | if ( gSPDClusters ) gSPDClusters->ResetBBox(); | |
439 | if ( gTPCTrack ) gTPCTrack->ElementChanged(); | |
440 | ||
441 | ||
442 | #if 0 | |
443 | TTimeStamp ts(esd->GetTimeStamp()); | |
444 | TString win_title("Eve Main Window -- Timestamp: "); | |
445 | win_title += ts.AsString("s"); | |
446 | win_title += "; Event # in ESD file: "; | |
447 | win_title += esd->GetEventNumberInFile(); | |
448 | gEve->GetBrowser()->SetWindowName(win_title); | |
449 | #endif | |
450 | ||
451 | // -- Set Projections | |
452 | // -------------------------------------------- | |
453 | TEveElement* top = gEve->GetCurrentEvent(); | |
454 | ||
455 | // XXX Primary vertex ... to be retrieved from the ESD | |
456 | Double_t x[3] = { 0, 0, 0 }; | |
457 | ||
458 | if (gRPhiMgr && top) { | |
459 | gRPhiMgr->DestroyElements(); | |
460 | gRPhiMgr->SetCenter(x[0], x[1], x[2]); | |
461 | gRPhiMgr->ImportElements(geomGentleRPhi); | |
462 | gRPhiMgr->ImportElements(top); | |
463 | } | |
464 | if (gRhoZMgr && top) { | |
465 | gRhoZMgr->DestroyElements(); | |
466 | gRhoZMgr->SetCenter(x[0], x[1], x[2]); | |
467 | gRhoZMgr->ImportElements(geomGentleRhoZ); | |
468 | gRhoZMgr->ImportElements(geomMuon); | |
469 | gRhoZMgr->ImportElements(top); | |
470 | } | |
471 | // -------------------------------------------- | |
472 | ||
473 | gEve->Redraw3D(0,1); // (0, 1) | |
474 | gEve->EnableRedraw(); | |
475 | ||
476 | return iResult; | |
477 | } | |
478 | ||
479 | // ----------------------------------------------------------------- | |
480 | void loopEvent() { | |
481 | eventTimer.SetCommand("nextEvent()"); | |
482 | eventTimer.Start(6000); | |
483 | } | |
484 | ||
485 | // ----------------------------------------------------------------- | |
486 | void stopLoopEvent() { | |
487 | eventTimer.Stop(); | |
488 | } | |
489 | ||
490 | // ----------------------------------------------------------------- | |
491 | Int_t processHLTRDLST(AliHLTHOMERBlockDesc* block) { | |
492 | ||
493 | return 0; | |
494 | } | |
495 | ||
496 | // ----------------------------------------------------------------- | |
497 | Int_t processISPDClusters(AliHLTHOMERBlockDesc* block) { | |
498 | cout<<"ISPD dump:"<<endl; | |
499 | TObject ob = block->GetTObject(); | |
500 | ob.Dump(); | |
501 | ||
502 | return 0; | |
503 | } | |
504 | ||
505 | // ----------------------------------------------------------------- | |
506 | Int_t processROOTTOBJ(AliHLTHOMERBlockDesc* block) { | |
507 | ||
508 | // -- AliHLTGlobalTriggerDecision | |
509 | if ( ! block->GetClassName().CompareTo("AliHLTGlobalTriggerDecision") ) { | |
510 | ||
511 | AliHLTGlobalTriggerDecision *trig = dynamic_cast<AliHLTGlobalTriggerDecision*> block->GetTObject(); | |
512 | trig->Print(); | |
513 | ||
514 | TEveText* tt = new TEveText("Trigger: Class is known ;-) "); | |
515 | gEve->AddElement(tt); | |
516 | ||
517 | } | |
518 | else { | |
519 | printf(" Unknown root object %s",block->GetClassName().Data() ); | |
520 | } | |
521 | ||
522 | return 0; | |
523 | } | |
524 | ||
525 | // ----------------------------------------------------------------- | |
526 | Int_t processEsdTracks( AliHLTHOMERBlockDesc* block, TEveTrackList* cont ) { | |
527 | ||
528 | AliESDEvent* esd = (AliESDEvent *) (block->GetTObject()); | |
529 | esd->GetStdContent(); | |
530 | ||
531 | esd_track_propagator_setup(cont->GetPropagator(),0.1*esd->GetMagneticField(), 520); | |
532 | ||
533 | printf( "Number of ESD Tracks : %d \n", esd->GetNumberOfTracks()); | |
534 | ||
535 | for (Int_t iter = 0; iter < esd->GetNumberOfTracks(); ++iter) { | |
536 | AliEveTrack* track = esd_make_track(esd->GetTrack(iter), cont); | |
537 | cont->AddElement(track); | |
538 | } | |
539 | ||
540 | cont->SetTitle(Form("N=%d", esd->GetNumberOfTracks()) ); | |
541 | cont->MakeTracks(); | |
542 | ||
543 | return 0; | |
544 | } | |
545 | ||
546 | ||
547 | // Int_t tpc_clusters(TEveElement* cont=0, Float_t maxR=270) | |
548 | // { | |
549 | ||
550 | ||
551 | // AliTPCClustersRow *clrow = new AliTPCClustersRow(); | |
552 | // clrow->SetClass("AliTPCclusterMI"); | |
553 | // clrow->SetArray(kMaxCl); | |
554 | // cTree->SetBranchAddress("Segment", &clrow); | |
555 | ||
556 | // tTPCClusters->SetOwnIds(kTRUE); | |
557 | ||
558 | ||
559 | // Float_t maxRsqr = maxR*maxR; | |
560 | // Int_t nentr=(Int_t)cTree->GetEntries(); | |
561 | // for (Int_t i=0; i<nentr; i++) | |
562 | // { | |
563 | // if (!cTree->GetEvent(i)) continue; | |
564 | ||
565 | // TClonesArray *cl = clrow->GetArray(); | |
566 | // Int_t ncl = cl->GetEntriesFast(); | |
567 | ||
568 | // while (ncl--) | |
569 | // { | |
570 | // AliCluster *c = (AliCluster*) cl->UncheckedAt(ncl); | |
571 | // Float_t g[3]; //global coordinates | |
572 | // c->GetGlobalXYZ(g); | |
573 | // if (g[0]*g[0]+g[1]*g[1] < maxRsqr) | |
574 | // { | |
575 | // clusters->SetNextPoint(g[0], g[1], g[2]); | |
576 | // AliCluster *atp = new AliCluster(*c); | |
577 | // clusters->SetPointId(atp); | |
578 | // } | |
579 | // } | |
580 | // cl->Clear(); | |
581 | // } | |
582 | ||
583 | // delete clrow; | |
584 | ||
585 | // if (clusters->Size() == 0 && gEve->GetKeepEmptyCont() == kFALSE) | |
586 | // { | |
587 | // Warning("tpc_clusters.C", "No TPC clusters"); | |
588 | // delete clusters; | |
589 | // return 1; | |
590 | // } | |
591 | ||
592 | // char form[1000]; | |
593 | // sprintf(form,"TPC Clusters"); | |
594 | // gTPCClusters->SetName(form); | |
595 | ||
596 | // char tip[1000]; | |
597 | // sprintf(tip,"N=%d", gTPCClusters->Size()); | |
598 | // gTPCClusters->SetTitle(tip); | |
599 | ||
600 | // const TString viz_tag("TPC Clusters"); | |
601 | // gTPCClusters->ApplyVizTag(viz_tag, "Clusters"); | |
602 | ||
603 | // return 0; | |
604 | // } | |
605 | ||
606 | ||
607 | ||
608 | Int_t processTPCClusters(AliHLTHOMERBlockDesc* block, TEvePointSet * cont) { | |
609 | Int_t iResult = 0; | |
610 | ||
611 | Int_t slice = block->GetSubDetector().Atoi(); | |
612 | Int_t patch = block->GetSubSubDetector().Atoi(); | |
613 | Float_t phi = ( slice + 0.5 ) * TMath::Pi() / 9.0; | |
614 | Float_t cos = TMath::Cos( phi ); | |
615 | Float_t sin = TMath::Sin( phi ); | |
616 | ||
617 | AliHLTTPCClusterData *cd = (AliHLTTPCClusterData*) block->GetData(); | |
618 | UChar_t *data = (UChar_t*) cd->fSpacePoints; | |
619 | ||
620 | if ( cd->fSpacePointCnt == 0 ) { | |
621 | printf ("No Clusters found in sector %d patch %d.\n", slice, patch ); | |
622 | iResult = -1; | |
623 | } | |
624 | else { | |
625 | ||
626 | for (Int_t ii = 0; ii < cd->fSpacePointCnt; ++ii, data += sizeof(AliHLTTPCSpacePointData)) { | |
627 | AliHLTTPCSpacePointData *sp = (AliHLTTPCSpacePointData *) data; | |
628 | ||
629 | cont->SetNextPoint(cos*sp->fX - sin*sp->fY, sin*sp->fX + cos*sp->fY, sp->fZ); | |
630 | } | |
631 | } | |
632 | ||
633 | return iResult; | |
634 | } | |
635 |