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 | |
1d8ae8b6 |
11 | #if !defined(__CINT__) || defined(__MAKECINT__) |
12 | |
ea48ba6e |
13 | //****************** ROOT ****************************************** |
1d8ae8b6 |
14 | #include "TTimer.h" |
15 | #include "TRandom.h" |
16 | #include "TVirtualPad.h" |
17 | #include "TGLViewer.h" |
18 | #include "TThread.h" |
19 | #include "TGFileBrowser.h" |
20 | #include "TStyle.h" |
21 | #include "TList.h" |
22 | #include "TDirectory.h" |
23 | #include "TFile.h" |
24 | #include "TH2.h" |
25 | #include "TCanvas.h" |
26 | #include "TColor.h" |
c5e3aa8e |
27 | #include "TVector3.h" |
1d8ae8b6 |
28 | |
ea48ba6e |
29 | //****************** ROOT/EVE ************************************** |
1d8ae8b6 |
30 | #include "TEveManager.h" |
31 | #include "TEvePointSet.h" |
32 | #include "TEveTrack.h" |
33 | #include "TEveVSDStructs.h" |
34 | #include "TEveTrackPropagator.h" |
35 | #include "TEveScene.h" |
36 | #include "TEveElement.h" |
37 | #include "TEveUtil.h" |
38 | #include "TEveEventManager.h" |
39 | #include "TEveProjectionAxes.h" |
40 | #include "TEveWindowManager.h" |
41 | #include "TEveViewer.h" |
42 | #include "TEveText.h" |
43 | #include "TEveProjectionManager.h" |
44 | #include "TEveGeoShape.h" |
c5e3aa8e |
45 | #include "TEveBoxSet.h" |
46 | #include "TEveTrans.h" |
47 | #include "TEveRGBAPalette.h" |
cfa641b1 |
48 | #include "TLine.h" |
49 | #include "TEveStraightLineSet.h" |
50 | #include "TGeoNode.h" |
51 | #include "TGeoManager.h" |
52 | #include "TGLOverlayButton.h" |
ea48ba6e |
53 | //****************** AliRoot *************************************** |
1d8ae8b6 |
54 | #include "AliESDEvent.h" |
55 | #include "AliCDBManager.h" |
56 | #include "AliRawReaderMemory.h" |
57 | #include "AliTPCRawStream.h" |
58 | #include "AliGeomManager.h" |
ea48ba6e |
59 | |
60 | //****************** AliRoot/EVE *********************************** |
1d8ae8b6 |
61 | #include "AliHLTHOMERManager.h" |
62 | #include "AliEveHOMERManager.h" |
63 | #include "AliEveTPCLoader.h" |
64 | #include "AliEveTPCData.h" |
65 | #include "AliEveITSDigitsInfo.h" |
66 | #include "AliEveITSModule.h" |
67 | #include "AliEveMacroExecutor.h" |
68 | #include "AliEveMacro.h" |
69 | #include "AliEveTrack.h" |
ea48ba6e |
70 | |
71 | //****************** AliRoot/HLT *********************************** |
1d8ae8b6 |
72 | #include "AliHLTHOMERBlockDesc.h" |
73 | #include "AliHLTHOMERReader.h" |
c5e3aa8e |
74 | #include "AliHLTMUONUtils.h" |
1d8ae8b6 |
75 | #include "AliHLTMUONDataBlockReader.h" |
76 | #include "AliHLTTriggerDecision.h" |
1d8ae8b6 |
77 | #include "AliHLTGlobalTriggerDecision.h" |
c5e3aa8e |
78 | #include "AliHLTTPCCATrackParam.h" |
cfa641b1 |
79 | |
ea48ba6e |
80 | //****************** AliRoot/MUON ********************************** |
1d8ae8b6 |
81 | #include "AliMUONCalibrationData.h" |
82 | #include "AliMUONVCalibParam.h" |
83 | #include "AliMUONGeometryTransformer.h" |
84 | #include "AliMUONGeometryDetElement.h" |
cfa641b1 |
85 | #include "AliMUONConstants.h" |
1d8ae8b6 |
86 | |
87 | #include "AliMpCDB.h" |
88 | #include "AliMpDDLStore.h" |
89 | #include "AliMpDetElement.h" |
90 | #include "AliMpDEIterator.h" |
91 | #include "AliMpVSegmentation.h" |
92 | #include "AliMpSegmentation.h" |
93 | #include "AliMpTriggerCrate.h" |
94 | #include "AliMpLocalBoard.h" |
1d8ae8b6 |
95 | |
ff64d287 |
96 | //****************** AliRoot/ITS *********************************** |
c5e3aa8e |
97 | #include "AliITSRecPoint.h" |
98 | |
ea48ba6e |
99 | //****************** AliRoot/TRD *********************************** |
100 | #include "AliHLTTRDCluster.h" |
101 | #include "AliTRDcluster.h" |
cfa641b1 |
102 | #include "AliTRDCalibraVdriftLinearFit.h" |
ea48ba6e |
103 | |
ff64d287 |
104 | //****************** AliRoot/EMCAL ********************************* |
cfa641b1 |
105 | #include "AliHLTCaloClusterDataStruct.h" |
106 | #include "AliHLTCaloClusterReader.h" |
107 | |
108 | #include "HLT/CALO/AliHLTCaloChannelDataHeaderStruct.h" |
109 | #include "HLT/CALO/AliHLTCaloChannelDataStruct.h" |
110 | |
ff64d287 |
111 | //****************** AliRoot/PHOS ********************************** |
cfa641b1 |
112 | #include "AliPHOSGeometry.h" |
113 | #include "HLT/PHOS/AliHLTPHOSDigitDataStruct.h" |
114 | #include "AliHLTPHOSChannelDataHeaderStruct.h" |
115 | #include "AliHLTPHOSChannelDataStruct.h" |
ea48ba6e |
116 | //****************** Macros **************************************** |
1d8ae8b6 |
117 | #include "hlt_structs.C" |
118 | #include "hlt_alieve_init.C" |
119 | #include "geom_gentle_hlt.C" |
120 | #include "alice-macros/esd_tracks.C" |
cfa641b1 |
121 | #include "hlt_esd_tracks.C" |
122 | //#include "alieve_vizdb.C" |
1d8ae8b6 |
123 | |
f1fefc07 |
124 | #endif |
9e78371d |
125 | |
f1fefc07 |
126 | class TEveTrackList; |
9e78371d |
127 | class TEveProjectionManager; |
128 | class TEveGeoShape; |
129 | class TEveUtil; |
130 | class AliEveMacroExecutor; |
131 | class TEveScene; |
132 | class TEveElement; |
133 | class TEveText; |
134 | class AliHLTTriggerDecision; |
135 | class TEvePointSet; |
1d8ae8b6 |
136 | class TEvePointSetArray; |
f1fefc07 |
137 | class AliHLTHOMERBlockDesc; |
9e78371d |
138 | |
f1fefc07 |
139 | class TEveViewer; |
ea48ba6e |
140 | |
cfa641b1 |
141 | |
9e78371d |
142 | // ----------------------------------------------------------------- |
143 | // -- Geometry / Scenes -- |
144 | // ----------------------------------------------------------------- |
145 | |
f1fefc07 |
146 | TEveGeoShape *gGeomGentle = 0; |
147 | TEveGeoShape *gGeomGentleRPhi = 0; |
148 | TEveGeoShape *gGeomGentleRhoZ = 0; |
149 | TEveGeoShape *gGeomGentleTRD = 0; |
150 | TEveGeoShape *gGeomGentleMUON = 0; |
151 | |
152 | TEveScene *gRPhiGeomScene = 0; |
153 | TEveScene *gRhoZGeomScene = 0; |
154 | TEveScene *gRPhiEventScene = 0; |
155 | TEveScene *gRhoZEventScene = 0; |
156 | |
9e78371d |
157 | TEveProjectionManager *gRPhiMgr = 0; |
158 | TEveProjectionManager *gRhoZMgr = 0; |
159 | |
f1fefc07 |
160 | TEveViewer *g3DView = 0; |
161 | TEveViewer *gRPhiView = 0; |
162 | TEveViewer *gRhoZView = 0; |
163 | |
9e78371d |
164 | // ----------------------------------------------------------------- |
165 | // -- Geometry / Scenes Parameters -- |
166 | // ----------------------------------------------------------------- |
167 | |
168 | // -- Parameters to show different geometries |
169 | Bool_t gShowMUON = kTRUE; |
170 | Bool_t gShowMUONRPhi = kFALSE; |
171 | Bool_t gShowMUONRhoZ = kTRUE; |
f1fefc07 |
172 | Bool_t gShowTRD = kFALSE; |
173 | |
174 | Bool_t gCenterProjectionsAtPrimaryVertex = kFALSE; |
9e78371d |
175 | |
176 | // ----------------------------------------------------------------- |
177 | // -- Members -- |
178 | // ----------------------------------------------------------------- |
179 | |
180 | // -- Timer for automatic event loop |
181 | TTimer eventTimer; |
1d8ae8b6 |
182 | TTimer eventTimerFast; |
9e78371d |
183 | |
184 | // -- HOMERManager |
c5e3aa8e |
185 | AliEveHOMERManager* gHomerManager = 0; |
186 | |
187 | // -- Geometry Manager |
188 | TGeoManager* gGeoManager = 0; |
189 | AliPHOSGeometry* gPHOSGeom = 0; |
9e78371d |
190 | |
191 | // -- Cluster members |
c5e3aa8e |
192 | TEvePointSet* gSPDClusters = 0; |
193 | TEvePointSet* gSSDClusters = 0; |
194 | TEvePointSet* gSDDClusters = 0; |
195 | TEvePointSet* gTRDClusters = 0; |
196 | TEvePointSetArray* gTRDColClusters = 0; |
197 | TEvePointSet* gTPCClusters = 0; |
49993c6f |
198 | TEvePointSet* gTPCTestClusters = 0; |
c5e3aa8e |
199 | TEvePointSetArray* gTPCColClusters = 0; |
200 | TEveBoxSet* gPHOSBoxSet[5] = {0, 0, 0, 0, 0}; |
cfa641b1 |
201 | TEveBoxSet* gEMCALBoxSet[13] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; |
c5e3aa8e |
202 | TEvePointSet* gMUONClusters = 0; |
cfa641b1 |
203 | TEveStraightLineSet* gMUONTracks = 0; |
9e78371d |
204 | |
f1fefc07 |
205 | // -- Text output members |
c5e3aa8e |
206 | TEveText* gHLTText = 0; |
f1fefc07 |
207 | |
9e78371d |
208 | // -- Tracks members |
c5e3aa8e |
209 | TEveTrackList* gTPCTrack = 0; |
9e78371d |
210 | |
1d8ae8b6 |
211 | // -- Canvas for histograms |
c5e3aa8e |
212 | TCanvas* gTRDCanvas = 0; |
213 | TCanvas* gTPCCanvas = 0; |
ff64d287 |
214 | TCanvas* gTRDCalibCanvas = 0; |
215 | TCanvas* gTRDEORCanvas = 0; |
216 | TCanvas* gPrimVertexCanvas = 0; |
217 | TCanvas* gSPDVertexCanvas = 0; |
218 | TCanvas* gITSCanvas = 0; |
219 | TCanvas* gSSDCanvas0 = 0; |
220 | TCanvas* gSSDCanvas1 = 0; |
221 | TCanvas* gV0Canvas = 0; |
222 | |
223 | // -- vertex -- |
224 | Int_t gSPDVertexHistoCount = 0; |
cfa641b1 |
225 | |
ff64d287 |
226 | |
227 | // -- ITS -- |
228 | Int_t gITSHistoCount = 0; |
229 | Int_t gSSDHistoCount0 = 0; |
230 | Int_t gSSDHistoCount1 = 0; |
1d8ae8b6 |
231 | |
ea48ba6e |
232 | // -- TRD -- |
c5e3aa8e |
233 | Int_t gTRDHistoCount = 0; |
234 | Int_t gTRDEvents = 0; |
235 | Int_t gTRDBins = 12; |
236 | |
237 | // -- TPC -- |
238 | Int_t gTPCBins = 15; |
239 | TH1F* gTPCCharge = 0; |
240 | TH1F* gTPCQMax = 0; |
241 | TH1F* gTPCQMaxOverCharge = 0; |
ea48ba6e |
242 | |
c5e3aa8e |
243 | // -- PHOS -- |
244 | TEveElementList* gPHOSElementList = 0; |
1d8ae8b6 |
245 | |
cfa641b1 |
246 | // -- EMCAL |
247 | TEveElementList* gEMCALElementList = 0; |
ff64d287 |
248 | TGeoNode* gEMCALNode = 0; |
cfa641b1 |
249 | |
1d8ae8b6 |
250 | // --- Flag if eventloop is running |
251 | Bool_t gEventLoopStarted = kFALSE; |
f1fefc07 |
252 | |
cfa641b1 |
253 | |
254 | //Container for gGeoManager till it is broken |
255 | TGeoManager *fGeoManager = 0; |
9e78371d |
256 | // ----------------------------------------------------------------- |
257 | // -- Methods -- |
258 | // ----------------------------------------------------------------- |
259 | |
1d8ae8b6 |
260 | Int_t initializeEveViewer( Bool_t TPCMode, Bool_t MUONMode, Bool_t TRDMode ); |
9e78371d |
261 | |
1d8ae8b6 |
262 | void nextEvent(); |
5de5a293 |
263 | |
ea9a0e13 |
264 | Int_t processEvent(); |
9e78371d |
265 | |
c5e3aa8e |
266 | Int_t processPHOSClusters( AliHLTHOMERBlockDesc* block); |
9e78371d |
267 | |
cfa641b1 |
268 | Int_t processEMCALClusters( AliHLTHOMERBlockDesc* block); |
269 | |
9e78371d |
270 | Int_t processEsdTracks( AliHLTHOMERBlockDesc* block, TEveTrackList* cont ); |
271 | |
272 | Int_t processHLTRDLST( AliHLTHOMERBlockDesc* block ); |
273 | |
1d8ae8b6 |
274 | Int_t processROOTTOBJ( AliHLTHOMERBlockDesc* block, TEveText* text ); |
275 | |
49993c6f |
276 | Int_t processTPCClusters( AliHLTHOMERBlockDesc * block, TEvePointSet *cont, TEvePointSetArray *contCol = NULL ); |
1d8ae8b6 |
277 | |
c5e3aa8e |
278 | Int_t processTRDClusters( AliHLTHOMERBlockDesc * block, TEvePointSet *cont, TEvePointSetArray *contCol); |
1d8ae8b6 |
279 | |
ff64d287 |
280 | Int_t processTRDHistograms( AliHLTHOMERBlockDesc * block, TCanvas * canvas ); |
281 | |
282 | Int_t processITSHistograms( AliHLTHOMERBlockDesc * block, TCanvas * canvas ); |
283 | |
284 | Int_t processSSDHistograms( AliHLTHOMERBlockDesc * block, TCanvas * canvas, TCanvas * canvas1 ); |
1d8ae8b6 |
285 | |
ff64d287 |
286 | Int_t processPrimVertexHistograms( AliHLTHOMERBlockDesc * block, TCanvas * canvas ); |
cfa641b1 |
287 | |
ff64d287 |
288 | Int_t processSPDVertexHistograms( AliHLTHOMERBlockDesc * block, TCanvas * canvas ); |
cfa641b1 |
289 | |
ff64d287 |
290 | Int_t processV0Histograms( AliHLTHOMERBlockDesc * block, TCanvas * canvas ); |
9e78371d |
291 | |
ff64d287 |
292 | Int_t processTRDCalibHistograms( AliHLTHOMERBlockDesc *block, TCanvas *canvas ); |
cfa641b1 |
293 | |
ff64d287 |
294 | Int_t processMUONClusters( AliHLTHOMERBlockDesc* block ); |
c5e3aa8e |
295 | |
ff64d287 |
296 | Int_t processMUONTracks( AliHLTHOMERBlockDesc* block ); |
297 | |
298 | Int_t processITSClusters( AliHLTHOMERBlockDesc* block, TEvePointSet* cont ); |
299 | |
300 | Int_t processITSHist( AliHLTHOMERBlockDesc* block ); |
9e78371d |
301 | |
cfa641b1 |
302 | void writeToFile(); |
303 | |
304 | |
9e78371d |
305 | // ################################################################# |
306 | // ################################################################# |
307 | // ################################################################# |
308 | |
309 | // ----------------------------------------------------------------- |
1d8ae8b6 |
310 | void onlineDisplay(Bool_t TPCMode = kTRUE, Bool_t MUONMode = kFALSE, Bool_t TRDMode = kFALSE) { |
f1fefc07 |
311 | |
9e78371d |
312 | // -- Loading Geometry |
313 | // --------------------- |
314 | Int_t run = 67179; |
315 | AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/OCDB"); |
316 | AliCDBManager::Instance()->SetRun(run); |
317 | AliGeomManager::LoadGeometry(); |
318 | |
c5e3aa8e |
319 | // Get the pointer to gGeoManager before it's broken (bug in alieve) |
cfa641b1 |
320 | fGeoManager = gGeoManager; |
c5e3aa8e |
321 | |
9e78371d |
322 | // -- Create new hM object |
323 | // ------------------------- |
324 | gHomerManager = new AliEveHOMERManager(); |
cfa641b1 |
325 | gHomerManager->SetRetryCount(1000,15); |
9e78371d |
326 | |
327 | Int_t iResult = gHomerManager->Initialize(); |
328 | if (iResult) { |
329 | printf("Error Initializing AliHLTHOMERManager, quitting"); |
330 | return; |
331 | } |
332 | |
333 | // -- Add hM to EveTree |
334 | // ---------------------- |
335 | gEve->AddToListTree(gHomerManager, kTRUE); |
336 | |
337 | // -- Create SourceList |
338 | // ---------------------- |
339 | iResult = gHomerManager->CreateEveSourcesListLoop(); |
340 | if (iResult) { |
341 | printf ("Couldn't find active services. returning\n"); |
342 | return; |
343 | } |
344 | |
345 | // -- Initialize pointsets and add macros |
346 | // ---------------------------------------- |
1d8ae8b6 |
347 | //TEveUtil::LoadMacro("hlt_alieve_init.C"); |
348 | //hlt_alieve_init(".", -1); |
9e78371d |
349 | |
350 | // -- Initialize Eve |
351 | // ------------------- |
1d8ae8b6 |
352 | initializeEveViewer( TPCMode, MUONMode, TRDMode); |
9e78371d |
353 | |
c5e3aa8e |
354 | // -- Reset gGeoManager to the original pointer |
355 | // ---------------------------------------------- |
cfa641b1 |
356 | gGeoManager = fGeoManager; |
c5e3aa8e |
357 | gPHOSGeom = AliPHOSGeometry::GetInstance("IHEP", "IHEP"); |
358 | |
9e78371d |
359 | // -- Finalize Eve |
360 | // ----------------- |
361 | gSystem->ProcessEvents(); |
362 | gEve->Redraw3D(kTRUE); |
f1fefc07 |
363 | |
1d8ae8b6 |
364 | if ( TPCMode ) { |
365 | gHomerManager->ConnectEVEtoHOMER("TPC" ); |
366 | } else if ( MUONMode ) { |
367 | gHomerManager->ConnectEVEtoHOMER("MUON"); |
368 | } else if( TRDMode ) { |
369 | gHomerManager->ConnectEVEtoHOMER("TRD"); |
370 | } else { |
371 | cout<<" No detectors selected, nothing will be displayed"<<endl; |
372 | } |
c5e3aa8e |
373 | |
374 | g_esd_tracks_true_field = kFALSE; |
cfa641b1 |
375 | |
9e78371d |
376 | } |
377 | |
1d8ae8b6 |
378 | // ------------------------------------------------------------------------- |
379 | Int_t initializeEveViewer( Bool_t TPCMode, Bool_t MUONMode, Bool_t TRDMode) { |
9e78371d |
380 | |
cfa641b1 |
381 | //============================================================================= |
382 | // Visualization database |
383 | //============================================================================ |
384 | |
385 | TEveUtil::AssertMacro("VizDB_scan.C"); |
386 | |
387 | // alieve_vizdb(); |
388 | |
389 | |
390 | |
9e78371d |
391 | //============================================================================== |
ea48ba6e |
392 | // -- Geometry, scenes, projections and viewers |
9e78371d |
393 | //============================================================================== |
394 | |
f1fefc07 |
395 | TEveBrowser *browser = gEve->GetBrowser(); |
396 | browser->ShowCloseTab(kFALSE); |
397 | |
9e78371d |
398 | // -- Disable extra geometry |
399 | // --------------------------- |
ea48ba6e |
400 | if (!MUONMode) |
9e78371d |
401 | gShowMUON = gShowMUONRPhi = gShowMUONRhoZ = kFALSE; |
ea48ba6e |
402 | |
9e78371d |
403 | // -- Load Geometry |
404 | // ------------------ |
405 | TEveUtil::LoadMacro("geom_gentle_hlt.C"); |
f1fefc07 |
406 | gGeomGentle = geom_gentle_hlt(); |
407 | gGeomGentleRPhi = geom_gentle_rphi(); gGeomGentleRPhi->IncDenyDestroy(); |
408 | gGeomGentleRhoZ = geom_gentle_rhoz(); gGeomGentleRhoZ->IncDenyDestroy(); |
409 | gGeomGentleTRD = geom_gentle_trd(); |
410 | |
cfa641b1 |
411 | gGeoManager = fGeoManager; |
412 | |
413 | gEMCALNode = gGeoManager->GetTopVolume()->FindNode("XEN1_1"); |
414 | |
415 | TEveGeoTopNode* emcal_re = new TEveGeoTopNode(gGeoManager, gEMCALNode); |
416 | gEve->AddGlobalElement(emcal_re); |
417 | gEve->Redraw3D(); |
418 | |
ea48ba6e |
419 | if (gShowMUON) |
f1fefc07 |
420 | gGeomGentleMUON = geom_gentle_muon(kFALSE); |
ea48ba6e |
421 | |
422 | // -- Scenes |
423 | // ----------- |
f1fefc07 |
424 | gRPhiGeomScene = gEve->SpawnNewScene("RPhi Geometry", |
425 | "Scene holding projected geometry for the RPhi view."); |
426 | gRhoZGeomScene = gEve->SpawnNewScene("RhoZ Geometry", |
427 | "Scene holding projected geometry for the RhoZ view."); |
428 | gRPhiEventScene = gEve->SpawnNewScene("RPhi Event Data", |
429 | "Scene holding projected geometry for the RPhi view."); |
430 | gRhoZEventScene = gEve->SpawnNewScene("RhoZ Event Data", |
431 | "Scene holding projected geometry for the RhoZ view."); |
9e78371d |
432 | |
ea48ba6e |
433 | // -- Projection managers |
434 | // ------------------------ |
f1fefc07 |
435 | |
9e78371d |
436 | gRPhiMgr = new TEveProjectionManager(); |
437 | gRPhiMgr->SetProjection(TEveProjection::kPT_RPhi); |
438 | gEve->AddToListTree(gRPhiMgr, kFALSE); |
439 | { |
440 | TEveProjectionAxes* a = new TEveProjectionAxes(gRPhiMgr); |
441 | a->SetMainColor(kWhite); |
442 | a->SetTitle("R-Phi"); |
443 | a->SetTitleSize(0.05); |
444 | a->SetTitleFont(102); |
445 | a->SetLabelSize(0.025); |
446 | a->SetLabelFont(102); |
f1fefc07 |
447 | gRPhiGeomScene->AddElement(a); |
9e78371d |
448 | } |
9e78371d |
449 | gRPhiMgr->SetCurrentDepth(-10); |
f1fefc07 |
450 | gRPhiMgr->ImportElements(gGeomGentleRPhi, gRPhiGeomScene); |
9e78371d |
451 | gRPhiMgr->SetCurrentDepth(0); |
1d8ae8b6 |
452 | gRPhiMgr->ImportElements(gGeomGentleTRD, gRPhiGeomScene); |
f1fefc07 |
453 | if (gShowMUONRPhi) gRPhiMgr->ImportElements(gGeomGentleMUON, gRPhiGeomScene); |
9e78371d |
454 | |
9e78371d |
455 | gRhoZMgr = new TEveProjectionManager(); |
456 | gRhoZMgr->SetProjection(TEveProjection::kPT_RhoZ); |
457 | gEve->AddToListTree(gRhoZMgr, kFALSE); |
458 | { |
459 | TEveProjectionAxes* a = new TEveProjectionAxes(gRhoZMgr); |
460 | a->SetMainColor(kWhite); |
461 | a->SetTitle("Rho-Z"); |
462 | a->SetTitleSize(0.05); |
463 | a->SetTitleFont(102); |
464 | a->SetLabelSize(0.025); |
465 | a->SetLabelFont(102); |
f1fefc07 |
466 | gRhoZGeomScene->AddElement(a); |
9e78371d |
467 | } |
468 | gRhoZMgr->SetCurrentDepth(-10); |
f1fefc07 |
469 | gRhoZMgr->ImportElements(gGeomGentleRhoZ, gRhoZGeomScene); |
9e78371d |
470 | gRhoZMgr->SetCurrentDepth(0); |
f1fefc07 |
471 | if (gShowTRD) gRhoZMgr->ImportElements(gGeomGentleTRD, gRhoZGeomScene); |
472 | if (gShowMUONRhoZ) gRhoZMgr->ImportElements(gGeomGentleMUON, gRhoZGeomScene); |
9e78371d |
473 | |
ea48ba6e |
474 | // -- Viewers |
475 | // ------------ |
9e78371d |
476 | |
ea48ba6e |
477 | TEveWindowSlot *slot = TEveWindow::CreateWindowInTab(browser->GetTabRight()); |
478 | TEveWindowPack *pack = slot->MakePack(); |
9e78371d |
479 | pack->SetElementName("Multi View"); |
480 | pack->SetHorizontal(); |
481 | pack->SetShowTitleBar(kFALSE); |
482 | pack->NewSlot()->MakeCurrent(); |
f1fefc07 |
483 | g3DView = gEve->SpawnNewViewer("3D View", ""); |
484 | g3DView->AddScene(gEve->GetGlobalScene()); |
485 | g3DView->AddScene(gEve->GetEventScene()); |
486 | |
cfa641b1 |
487 | |
488 | |
489 | |
9e78371d |
490 | pack = pack->NewSlot()->MakePack(); |
491 | pack->SetShowTitleBar(kFALSE); |
492 | pack->NewSlot()->MakeCurrent(); |
f1fefc07 |
493 | gRPhiView = gEve->SpawnNewViewer("RPhi View", ""); |
494 | gRPhiView->GetGLViewer()->SetCurrentCamera(TGLViewer::kCameraOrthoXOY); |
495 | gRPhiView->AddScene(gRPhiGeomScene); |
496 | gRPhiView->AddScene(gRPhiEventScene); |
9e78371d |
497 | |
498 | pack->NewSlot()->MakeCurrent(); |
f1fefc07 |
499 | gRhoZView = gEve->SpawnNewViewer("RhoZ View", ""); |
500 | gRhoZView->GetGLViewer()->SetCurrentCamera(TGLViewer::kCameraOrthoXOY); |
501 | gRhoZView->AddScene(gRhoZGeomScene); |
502 | gRhoZView->AddScene(gRhoZEventScene); |
503 | |
cfa641b1 |
504 | |
505 | |
506 | //Add HLT Text to windows |
507 | |
508 | TGLOverlayButton *ob1 = new TGLOverlayButton(g3DView->GetGLViewer(), "HLT", 0, 20, 110, 60); |
509 | ob1->SetAlphaValues(0.8, 0.8); |
ff64d287 |
510 | // cout << "color" << ob1->GetBackColor() << endl; |
cfa641b1 |
511 | //ob1->SetBackColor(8421631); |
512 | ob1->SetBackColor(10492431); |
513 | TGLOverlayButton *ob2 = new TGLOverlayButton(g3DView->GetGLViewer(), "ALICE", 0, 0, 110, 20); |
514 | ob2->SetAlphaValues(0.8, 0.8); |
515 | ob1->SetBackColor(0.2); |
516 | TGLOverlayButton *ob3 = new TGLOverlayButton(gEve->GetDefaultGLViewer(), "HLT", 0, 20, 110, 60); |
517 | ob3->SetAlphaValues(0.8, 0.8); |
518 | TGLOverlayButton *ob4 = new TGLOverlayButton(gEve->GetDefaultGLViewer(), "ALICE", 0, 0, 110, 20); |
519 | ob4->SetAlphaValues(0.8, 0.8); |
520 | |
521 | |
ea48ba6e |
522 | // -- List of Viewers |
523 | // -------------------- |
9e78371d |
524 | |
525 | TEveViewerList *viewerlist = new TEveViewerList(); |
526 | viewerlist->AddElement(gEve->GetDefaultViewer()); |
527 | |
f1fefc07 |
528 | viewerlist->AddElement(g3DView); |
529 | viewerlist->AddElement(gRhoZView); |
530 | viewerlist->AddElement(gRPhiView); |
9e78371d |
531 | viewerlist->SwitchColorSet(); |
532 | |
533 | //============================================================================== |
ea48ba6e |
534 | // -- Macros / QA histograms |
9e78371d |
535 | //============================================================================== |
536 | |
537 | // -- Registration of per-event macros |
538 | // ------------------------------------- |
539 | |
540 | AliEveMacroExecutor *exec = new AliEveMacroExecutor(); |
541 | #if 0 |
542 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "SIM Track", "kine_tracks.C", "kine_tracks", "", kFALSE)); |
543 | |
544 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "SIM Hit ITS", "its_hits.C", "its_hits", "", kFALSE)); |
545 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "SIM Hit TPC", "tpc_hits.C", "tpc_hits", "", kFALSE)); |
546 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "SIM Hit T0", "t0_hits.C", "t0_hits", "", kFALSE)); |
547 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "SIM Hit FMD", "fmd_hits.C", "fmd_hits", "", kFALSE)); |
548 | |
549 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "DIG FMD", "fmd_digits.C", "fmd_digits", "", kFALSE)); |
550 | |
551 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW TPC", "tpc_raw.C", "tpc_raw", "", kFALSE)); |
552 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW T0", "t0_raw.C", "t0_raw", "", kFALSE)); |
553 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW FMD", "fmd_raw.C", "fmd_raw", "", kFALSE)); |
554 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW VZERO", "vzero_raw.C", "vzero_raw", "", kFALSE)); |
555 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW ACORDE", "acorde_raw.C", "acorde_raw", "", kFALSE)); |
556 | |
557 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX", "primary_vertex.C", "primary_vertex", "", kTRUE)); |
558 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Ellipse", "primary_vertex.C", "primary_vertex_ellipse", "", kTRUE)); |
559 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Box", "primary_vertex.C", "primary_vertex_box", "kFALSE, 3, 3, 3", kFALSE)); |
560 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX", "primary_vertex.C", "primary_vertex_spd", "", kTRUE)); |
561 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Ellipse", "primary_vertex.C", "primary_vertex_ellipse_spd", "", kTRUE)); |
562 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Box", "primary_vertex.C", "primary_vertex_box_spd", "kFALSE, 3, 3, 3", kFALSE)); |
563 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX", "primary_vertex.C", "primary_vertex_tpc", "", kFALSE)); |
564 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Ellipse", "primary_vertex.C", "primary_vertex_ellipse_tpc", "", kFALSE)); |
565 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Box", "primary_vertex.C", "primary_vertex_box_tpc", "kFALSE, 3, 3, 3", kFALSE)); |
566 | #endif |
567 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC V0", "esd_V0_points.C", "esd_V0_points_onfly")); |
568 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC V0", "esd_V0_points.C", "esd_V0_points_offline")); |
569 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC V0", "esd_V0.C", "esd_V0")); |
570 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC CSCD", "esd_cascade_points.C", "esd_cascade_points")); |
571 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC CSCD", "esd_cascade.C", "esd_cascade")); |
572 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC KINK", "esd_kink_points.C", "esd_kink_points")); |
573 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC KINK", "esd_kink.C", "esd_kink")); |
574 | |
575 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Track", "esd_tracks.C", "esd_tracks", "", kFALSE)); |
576 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Track", "esd_tracks.C", "esd_tracks_MI", "", kFALSE)); |
577 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Track", "esd_tracks.C", "esd_tracks_by_category", "", kTRUE)); |
578 | |
579 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Tracklet", "esd_spd_tracklets.C", "esd_spd_tracklets", "", kFALSE)); |
580 | |
581 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC ZDC", "esd_zdc.C", "esd_zdc", "", kFALSE)); |
582 | #if 0 |
583 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clus", "clusters.C+", "clusters", "", kFALSE)); |
584 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clus ITS", "its_clusters.C+", "its_clusters")); |
585 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clus TPC", "tpc_clusters.C+", "tpc_clusters")); |
586 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clus TRD", "trd_clusters.C+", "trd_clusters")); |
587 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clus TOF", "tof_clusters.C+", "tof_clusters")); |
588 | |
589 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clus TPC", "vplot_tpc.C+", "vplot_tpc", "", kFALSE)); |
590 | |
591 | exec->AddMacro(new AliEveMacro(AliEveMacro::kAOD, "ANA HF", "aod_HF.C", "aod_HF", "", kFALSE)); |
592 | exec->AddMacro(new AliEveMacro(AliEveMacro::kAOD, "ANA Jets", "jetplane.C", "jetplane", "", kFALSE)); |
593 | |
594 | // -- QA Viewer |
595 | // -------------- |
1d8ae8b6 |
596 | # endif |
9e78371d |
597 | |
c5e3aa8e |
598 | |
599 | //============================================================================== |
600 | // -- Histograms |
601 | //============================================================================== |
602 | |
603 | if(TRDMode) { |
ea48ba6e |
604 | slot = TEveWindow::CreateWindowInTab(browser->GetTabRight()); |
605 | slot->StartEmbedding(); |
606 | |
607 | gTRDCanvas = new TCanvas("canvasTRD","canvasTRD", 600, 400); |
608 | gTRDCanvas->Divide(3,2); |
609 | slot->StopEmbedding("TRD histograms"); |
cfa641b1 |
610 | |
611 | slot=TEveWindow::CreateWindowInTab(browser->GetTabRight()); |
612 | slot->StartEmbedding(); |
613 | gTRDCalibCanvas=new TCanvas("CalibCanvasTRD","CalibCanvasTRD",600,400); |
614 | gTRDCalibCanvas->Divide(2,2); |
615 | slot->StopEmbedding("TRD Calibration Histograms"); |
616 | |
617 | slot=TEveWindow::CreateWindowInTab(browser->GetTabRight()); |
618 | slot->StartEmbedding(); |
619 | gTRDEORCanvas=new TCanvas("CalibEORTRD","CalibCEORTRD",600,400); |
620 | gTRDEORCanvas->Divide(3,2); |
621 | slot->StopEmbedding("TRD EOR Histograms"); |
ea48ba6e |
622 | } |
623 | else if(TPCMode){ |
c5e3aa8e |
624 | slot = TEveWindow::CreateWindowInTab(browser->GetTabRight()); |
625 | slot->StartEmbedding(); |
626 | |
627 | gTPCCanvas = new TCanvas("canvasTPC","canvasTPC", 600, 400); |
628 | gTPCCharge = new TH1F("ClusterCharge","ClusterCharge",100,0,500); |
629 | gTPCQMax = new TH1F("QMax","QMax",50,0,250); |
630 | gTPCQMaxOverCharge = new TH1F("QMaxOverCharge","QMaxOverCharge",50,0,1); |
631 | slot->StopEmbedding("TPC histograms"); |
ea48ba6e |
632 | } |
f1fefc07 |
633 | |
cfa641b1 |
634 | slot = TEveWindow::CreateWindowInTab(browser->GetTabRight()); |
ff64d287 |
635 | slot->StartEmbedding(); |
636 | gPrimVertexCanvas = new TCanvas("canvasPrimVertex","canvasPrimVertex", 600, 400); |
637 | slot->StopEmbedding("Primary Vertex"); |
638 | |
639 | slot = TEveWindow::CreateWindowInTab(browser->GetTabRight()); |
640 | slot->StartEmbedding(); |
641 | gSPDVertexCanvas = new TCanvas("canvasSPDVertex","canvasSPDVertex", 600, 400); |
642 | slot->StopEmbedding("SPD Vertex"); |
643 | |
644 | slot = TEveWindow::CreateWindowInTab(browser->GetTabRight()); |
645 | slot->StartEmbedding(); |
646 | gV0Canvas = new TCanvas("canvasV0","canvasV0", 600, 400); |
647 | slot->StopEmbedding("V0"); |
cfa641b1 |
648 | |
ff64d287 |
649 | slot = TEveWindow::CreateWindowInTab(browser->GetTabRight()); |
650 | slot->StartEmbedding(); |
651 | gITSCanvas = new TCanvas("canvasITS","canvasITS", 600, 400); |
652 | slot->StopEmbedding("ITS QA Histograms"); |
cfa641b1 |
653 | |
ff64d287 |
654 | slot = TEveWindow::CreateWindowInTab(browser->GetTabRight()); |
655 | slot->StartEmbedding(); |
656 | gSSDCanvas0 = new TCanvas("canvasSSD0","canvasSSD0", 600, 400); |
657 | slot->StopEmbedding("SSD QA Histograms 0"); |
cfa641b1 |
658 | |
ff64d287 |
659 | slot = TEveWindow::CreateWindowInTab(browser->GetTabRight()); |
660 | slot->StartEmbedding(); |
661 | gSSDCanvas1 = new TCanvas("canvasSSD1","canvasSSD1", 600, 400); |
662 | slot->StopEmbedding("SSD QA Histograms 1"); |
cfa641b1 |
663 | |
9e78371d |
664 | //============================================================================== |
ea48ba6e |
665 | // -- Additional GUI components |
9e78371d |
666 | //============================================================================== |
667 | |
668 | slot = TEveWindow::CreateWindowInTab(browser->GetTabRight()); |
5de5a293 |
669 | TEveWindowTab *storeTab = slot->MakeTab(); |
1d8ae8b6 |
670 | storeTab->SetElementNameTitle("WindowStore", |
9e78371d |
671 | "Undocked windows whose previous container is not known\n" |
672 | "are placed here when the main-frame is closed."); |
5de5a293 |
673 | gEve->GetWindowManager()->SetDefaultContainer(storeTab); |
9e78371d |
674 | |
cfa641b1 |
675 | |
676 | |
9e78371d |
677 | return 0; |
678 | } |
679 | |
5de5a293 |
680 | // ----------------------------------------------------------------- |
681 | void nextEvent() { |
682 | |
cfa641b1 |
683 | if ( gHomerManager->NextEvent() ) { |
684 | if (gEventLoopStarted) { |
685 | cout << "HomerManager failed getting next event, trying to reconnect" << endl; |
686 | |
687 | gHomerManager->DisconnectHOMER(); |
688 | gHomerManager->ConnectEVEtoHOMER(); |
689 | nextEvent(); |
690 | |
691 | } else { |
692 | return; |
693 | } |
694 | } |
695 | |
5de5a293 |
696 | processEvent(); |
697 | } |
698 | |
9e78371d |
699 | // ----------------------------------------------------------------- |
ea9a0e13 |
700 | Int_t processEvent() { |
9e78371d |
701 | |
702 | Int_t iResult = 0; |
703 | |
704 | gStyle->SetPalette(1, 0); |
705 | gEve->DisableRedraw(); |
706 | |
ea48ba6e |
707 | //============================================================================== |
9e78371d |
708 | // -- Reset |
ea48ba6e |
709 | //============================================================================== |
ff64d287 |
710 | |
ea48ba6e |
711 | if ( gTRDCanvas ) { |
712 | gTRDCanvas->Clear(); |
713 | gTRDCanvas->Divide(3,2); |
714 | } |
cfa641b1 |
715 | if(gTRDCalibCanvas){ |
ff64d287 |
716 | gTRDCalibCanvas->Clear(); |
717 | gTRDCalibCanvas->Divide(2,2); |
718 | } |
cfa641b1 |
719 | if(gTRDEORCanvas){ |
ff64d287 |
720 | gTRDEORCanvas->Clear(); |
721 | gTRDEORCanvas->Divide(3,2); |
722 | } |
723 | |
724 | if(gSSDCanvas0) { |
725 | gSSDCanvas0->Clear(); |
726 | gSSDCanvas0->Divide(6,6); |
727 | } |
728 | |
729 | if(gSSDCanvas1) { |
730 | gSSDCanvas1->Clear(); |
731 | gSSDCanvas1->Divide(2,3); |
732 | } |
733 | |
734 | if(gITSCanvas) { |
735 | gITSCanvas->Clear(); |
736 | gITSCanvas->Divide(3,3); |
737 | } |
738 | |
739 | if(gPrimVertexCanvas) { |
740 | gPrimVertexCanvas->Clear(); |
741 | gPrimVertexCanvas->Divide(2,2); |
742 | } |
743 | |
744 | if(gSPDVertexCanvas) { |
745 | gSPDVertexCanvas->Clear(); |
746 | gSPDVertexCanvas->Divide(2,2); |
747 | } |
cfa641b1 |
748 | |
ff64d287 |
749 | if(gV0Canvas) { |
750 | gV0Canvas->Clear(); |
751 | gV0Canvas->Divide(2,2); |
cfa641b1 |
752 | } |
ea48ba6e |
753 | |
754 | if ( gTPCTrack ) gTPCTrack->DestroyElements(); |
755 | |
c5e3aa8e |
756 | if ( gSPDClusters ) gSPDClusters->Reset(); |
757 | if ( gSSDClusters ) gSSDClusters->Reset(); |
bdff3917 |
758 | if ( gSDDClusters ) gSDDClusters->Reset(); |
ea48ba6e |
759 | if ( gTPCClusters ) gTPCClusters->Reset(); |
49993c6f |
760 | if ( gTPCTestClusters ) gTPCTestClusters->Reset(); |
ea48ba6e |
761 | if ( gTRDClusters ) gTRDClusters->Reset(); |
c5e3aa8e |
762 | if ( gMUONClusters ) gMUONClusters->Reset(); |
cfa641b1 |
763 | if ( gMUONTracks ){ |
764 | gMUONTracks->Destroy(); |
765 | gMUONTracks = 0x0; |
766 | } |
1d8ae8b6 |
767 | |
c5e3aa8e |
768 | if ( gPHOSBoxSet[1] ) |
769 | for(int im = 0; im < 5; im++) |
770 | gPHOSBoxSet[im]->Reset(); |
771 | |
cfa641b1 |
772 | if ( gEMCALElementList) |
773 | for(int i = 0; i < 12; i++) { |
774 | gEMCALBoxSet[i]->Reset(); |
775 | } |
776 | |
c5e3aa8e |
777 | if ( gTPCColClusters ) |
778 | for (Int_t ii = 0; ii <= gTPCBins+1; ++ii) |
779 | gTPCColClusters->GetBin(ii)->Reset(); |
780 | |
781 | if ( gTRDColClusters ) |
782 | for (Int_t ii = 0; ii <= gTRDBins+1; ++ii) |
1d8ae8b6 |
783 | gTRDColClusters->GetBin(ii)->Reset(); |
1d8ae8b6 |
784 | |
ea48ba6e |
785 | gTRDHistoCount = 0; |
ff64d287 |
786 | gSPDVertexHistoCount = 0; |
787 | gSSDHistoCount0 = 0; |
788 | gSSDHistoCount1 = 0; |
789 | gITSHistoCount = 0; |
cfa641b1 |
790 | |
1d8ae8b6 |
791 | |
ea48ba6e |
792 | //============================================================================== |
793 | // -- Process Blocks |
794 | //============================================================================== |
1d8ae8b6 |
795 | |
796 | if ( gHomerManager->GetBlockList() == NULL) { |
ff64d287 |
797 | printf ("onlineDisplay: No BlockList ... \n"); |
cfa641b1 |
798 | cout << endl; |
ea9a0e13 |
799 | return -1; |
800 | } |
9e78371d |
801 | if (gHomerManager->GetBlockList()->IsEmpty() ) { |
ff64d287 |
802 | printf ("onlineDisplay: No Blocks in list ... \n"); |
cfa641b1 |
803 | cout<<endl; |
ea9a0e13 |
804 | return -2; |
9e78371d |
805 | } |
806 | |
807 | TIter next(gHomerManager->GetBlockList()); |
808 | AliHLTHOMERBlockDesc* block = 0; |
809 | |
810 | // -- Iterate over blocks in the block list |
811 | // ------------------------------------------ |
812 | while ((block = (AliHLTHOMERBlockDesc*)next())) { |
ea9a0e13 |
813 | |
ff64d287 |
814 | #if 0 //DEBUG |
ea9a0e13 |
815 | printf( "------------------- xxxxxxxxxxxxxxx ----------------------\n"); |
816 | printf( "Detector : %s\n", block->GetDetector().Data() ); |
817 | printf( "Datatype : %s\n", block->GetDataType().Data() ); |
818 | if (block->IsTObject() ) |
819 | printf( "Is TObject of class: %s\n", block->GetClassName().Data() ); |
820 | printf( "------------------- xxxxxxxxxxxxxxx ----------------------\n"); |
821 | #endif |
9e78371d |
822 | |
9e78371d |
823 | // ++ HLT BLOCK |
824 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
825 | if ( ! block->GetDetector().CompareTo("HLT") ) { |
826 | |
827 | // -- ESDTREE |
828 | if ( ! block->GetDataType().CompareTo("ALIESDV0") ) { |
9e78371d |
829 | if(!gTPCTrack){ |
830 | gTPCTrack = new TEveTrackList("ESD Tracks"); |
831 | gTPCTrack->SetMainColor(6); |
832 | gEve->AddElement(gTPCTrack); |
833 | } |
9e78371d |
834 | iResult = processEsdTracks(block, gTPCTrack); |
ea48ba6e |
835 | gTPCTrack->ElementChanged(); |
c5e3aa8e |
836 | } // if ( ! block->GetDataType().CompareTo("ALIESDV0") ) { |
f1fefc07 |
837 | |
9e78371d |
838 | // -- Process ROOTObj |
839 | else if ( ! block->GetDataType().CompareTo("ROOTTOBJ") ) { |
f1fefc07 |
840 | if(!gHLTText){ |
ea48ba6e |
841 | //gHLTText = new TEveText(); |
f1fefc07 |
842 | //gHLTText->BBoxZero(5, -5, -5, 0); |
843 | //gHLTText->SetExtrude(25); |
844 | //gHLTText->AssertBBoxExtents(25,25,25); |
ea48ba6e |
845 | //gEve->AddElement(gHLTText); |
f1fefc07 |
846 | } |
847 | processROOTTOBJ( block, gHLTText ); |
c5e3aa8e |
848 | } // else if ( ! block->GetDataType().CompareTo("ROOTTOBJ") ) { |
9e78371d |
849 | |
850 | // -- Process HLT RDLST |
851 | else if ( ! block->GetDataType().CompareTo("HLTRDLST") ) { |
c5e3aa8e |
852 | processHLTRDLST( block ); |
853 | } // else if ( ! block->GetDataType().CompareTo("HLTRDLST") ) { |
854 | |
9e78371d |
855 | } // if ( ! block->GetDetector().CompareTo("HLT") ) { |
856 | |
857 | // ++ TPC BLOCK |
858 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
859 | else if ( ! block->GetDetector().CompareTo("TPC") ) { |
860 | |
f1fefc07 |
861 | // -- Process TPC Clusters |
862 | if ( ! block->GetDataType().CompareTo("CLUSTERS") ) { |
cfa641b1 |
863 | if(!gTPCClusters){ |
f1fefc07 |
864 | gTPCClusters = new TEvePointSet("TPC Clusters"); |
cfa641b1 |
865 | //gTPCClusters->ApplyVizTag("TPC Clusters"); |
f1fefc07 |
866 | gTPCClusters->SetMainColor(kRed); |
867 | gTPCClusters->SetMarkerStyle((Style_t)kFullDotSmall); |
ff64d287 |
868 | //gEve->AddElement(gTPCClusters); |
f1fefc07 |
869 | } |
c5e3aa8e |
870 | |
871 | if(!gTPCColClusters){ |
872 | gTPCColClusters = new TEvePointSetArray("TPC Clusters Colorized"); |
873 | gTPCColClusters->SetMainColor(kRed); |
874 | gTPCColClusters->SetMarkerStyle(4); // antialiased circle |
ff64d287 |
875 | gTPCColClusters->SetMarkerSize(0.4); |
c5e3aa8e |
876 | gTPCColClusters->InitBins("Cluster Charge", gTPCBins, 0., gTPCBins*20.); |
877 | |
878 | const Int_t nCol = TColor::GetNumberOfColors(); |
cfa641b1 |
879 | |
c5e3aa8e |
880 | for (Int_t ii = 0; ii < gTPCBins+1; ++ii) |
881 | gTPCColClusters->GetBin(ii)->SetMainColor(TColor::GetColorPalette(ii * nCol / (gTPCBins+2))); |
882 | |
883 | gEve->AddElement(gTPCColClusters); |
884 | } |
885 | |
886 | iResult = processTPCClusters(block, gTPCClusters, gTPCColClusters); |
ff64d287 |
887 | //gTPCClusters->ElementChanged(); |
c5e3aa8e |
888 | gTPCColClusters->ElementChanged(); |
9e78371d |
889 | } |
ea48ba6e |
890 | |
f1fefc07 |
891 | } // else if ( ! block->GetDetector().CompareTo("TPC") ) { |
892 | |
1d8ae8b6 |
893 | // ++ TRD BLOCK |
894 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
895 | else if ( ! block->GetDetector().CompareTo("TRD") ) { |
896 | |
897 | // -- Process TRD Clusters |
898 | if ( ! block->GetDataType().CompareTo("CLUSTERS") ) { |
899 | |
900 | if(!gTRDClusters){ |
901 | gTRDClusters = new TEvePointSet("TRD Clusters"); |
902 | gTRDClusters->SetMainColor(kBlue); |
903 | gTRDClusters->SetMarkerStyle((Style_t)kFullDotSmall); |
ff64d287 |
904 | //gEve->AddElement(gTRDClusters); |
1d8ae8b6 |
905 | } |
1d8ae8b6 |
906 | |
907 | if(!gTRDColClusters){ |
1d8ae8b6 |
908 | gTRDColClusters = new TEvePointSetArray("TRD Clusters Colorized"); |
909 | gTRDColClusters->SetMainColor(kRed); |
910 | gTRDColClusters->SetMarkerStyle(4); // antialiased circle |
911 | // gTRDColClusters->SetMarkerStyle((Style_t)kFullDotSmall); |
ff64d287 |
912 | gTRDColClusters->SetMarkerSize(0.4); |
1d8ae8b6 |
913 | gTRDColClusters->InitBins("Cluster Charge", gTRDBins, 0., gTRDBins*100.); |
914 | |
ea48ba6e |
915 | //TColor::SetPalette(1, 0); // Spectrum palette |
1d8ae8b6 |
916 | const Int_t nCol = TColor::GetNumberOfColors(); |
917 | for (Int_t ii = 0; ii < gTRDBins+1; ++ii) |
918 | gTRDColClusters->GetBin(ii)->SetMainColor(TColor::GetColorPalette(ii * nCol / (gTRDBins+2))); |
ea48ba6e |
919 | |
1d8ae8b6 |
920 | gEve->AddElement(gTRDColClusters); |
921 | } |
922 | |
923 | iResult = processTRDClusters( block, gTRDClusters, gTRDColClusters ); |
ff64d287 |
924 | //gTRDClusters->ElementChanged(); |
1d8ae8b6 |
925 | gTRDColClusters->ElementChanged(); |
926 | } |
927 | |
928 | // -- Process TRD Histograms |
929 | else if ( block->GetDataType().CompareTo("ROOTHIST") == 0 ) { |
930 | iResult = processTRDHistograms( block, gTRDCanvas ); |
ea48ba6e |
931 | if ( gTRDCanvas) gTRDCanvas->Update(); |
ff64d287 |
932 | } |
933 | else if(block->GetDataType().CompareTo("CALIBRAH")==0){ |
cfa641b1 |
934 | iResult=processTRDCalibHistograms(block,gTRDCalibCanvas); |
935 | if(gTRDCalibCanvas)gTRDCalibCanvas->Update(); |
936 | } |
cfa641b1 |
937 | else if(block->GetDataType().CompareTo("CALIBEOR")==0){ |
938 | iResult=processTRDCalibHistograms(block,gTRDEORCanvas); |
939 | if(gTRDEORCanvas)gTRDEORCanvas->Update(); |
1d8ae8b6 |
940 | } |
1d8ae8b6 |
941 | } // else if ( ! block->GetDetector().CompareTo("TRD") ) { |
942 | |
1d8ae8b6 |
943 | // ++ MUON BLOCK |
944 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
ea48ba6e |
945 | else if ( ! block->GetDetector().CompareTo("MUON") && gShowMUON ) { |
1d8ae8b6 |
946 | |
ea48ba6e |
947 | // -- Process MUON Clusters |
1d8ae8b6 |
948 | if ( (block->GetDataType().CompareTo("RECHITS") == 0) || (block->GetDataType().CompareTo("TRIGRECS") == 0) ) { |
ea48ba6e |
949 | |
1d8ae8b6 |
950 | if ( !gMUONClusters ) { |
951 | gMUONClusters = new TEvePointSet("MUON RecHits"); |
952 | gMUONClusters->SetMainColor(kBlue); |
953 | gMUONClusters->SetMarkerStyle(20); |
954 | gEve->AddElement(gMUONClusters); |
955 | } |
956 | |
1d8ae8b6 |
957 | processMUONClusters( block ); |
ea48ba6e |
958 | gMUONClusters->ElementChanged(); |
1d8ae8b6 |
959 | |
cfa641b1 |
960 | }else if(block->GetDataType().CompareTo("MANTRACK") == 0){ |
961 | |
962 | if ( !gMUONTracks ) { |
963 | gMUONTracks = new TEveStraightLineSet("MUON Tracks"); |
964 | gMUONTracks->SetMainColor(kRed); |
965 | gMUONTracks->SetLineWidth(3); |
966 | gEve->AddElement(gMUONTracks); |
967 | } |
968 | |
969 | processMUONTracks( block ); |
970 | gMUONTracks->ElementChanged(); |
971 | |
972 | |
ea48ba6e |
973 | } |
974 | } // else if ( ! block->GetDetector().CompareTo("MUON") && gShowMUON ) { |
c5e3aa8e |
975 | |
976 | // ++ ISPD BLOCK |
9e78371d |
977 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
978 | else if ( ! block->GetDetector().CompareTo("ISPD") ){ |
979 | if ( block->GetDataType().CompareTo("CLUSTERS") == 0 ) { |
c5e3aa8e |
980 | |
981 | if(!gSPDClusters){ |
982 | gSPDClusters = new TEvePointSet("SPD Clusters"); |
983 | gSPDClusters->SetMainColor(kBlack); |
ff64d287 |
984 | gSPDClusters->SetMarkerStyle((Style_t)kFullDotMedium); |
c5e3aa8e |
985 | gEve->AddElement(gSPDClusters); |
986 | } |
987 | |
988 | processITSClusters( block , gSPDClusters); |
989 | gSPDClusters->ElementChanged(); |
cfa641b1 |
990 | |
991 | } else if ( block->GetDataType().CompareTo("ROOTHIST") == 0 ) { |
992 | |
993 | // -- Process Vertex Histos |
ff64d287 |
994 | processSPDVertexHistograms( block , gSPDVertexCanvas); |
995 | gSPDVertexCanvas->Update(); |
9e78371d |
996 | } |
997 | } // else if ( ! block->GetDetector().CompareTo("ISPD") ){ |
c5e3aa8e |
998 | |
999 | // ++ ISDD BLOCK |
1000 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1001 | else if ( ! block->GetDetector().CompareTo("ISDD") ){ |
1002 | if ( block->GetDataType().CompareTo("CLUSTERS") == 0 ) { |
1003 | |
1004 | if(!gSDDClusters){ |
1005 | gSDDClusters = new TEvePointSet("SDD Clusters"); |
1006 | gSDDClusters->SetMainColor(kPink); |
ff64d287 |
1007 | gSDDClusters->SetMarkerStyle((Style_t)kFullDotMedium); |
c5e3aa8e |
1008 | gEve->AddElement(gSDDClusters); |
1009 | } |
1010 | |
1011 | processITSClusters( block , gSDDClusters); |
1012 | gSDDClusters->ElementChanged(); |
1013 | } |
1014 | } // else if ( ! block->GetDetector().CompareTo("ISDD") ){ |
1015 | |
1016 | // ++ ISSD BLOCK |
1017 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1018 | else if ( ! block->GetDetector().CompareTo("ISSD") ){ |
1019 | if ( block->GetDataType().CompareTo("CLUSTERS") == 0 ) { |
1020 | |
1021 | if(!gSSDClusters){ |
1022 | gSSDClusters = new TEvePointSet("SSD Clusters"); |
ff64d287 |
1023 | gSSDClusters->SetMainColor(kBlue); |
1024 | gSSDClusters->SetMarkerStyle((Style_t)kFullDotMedium); |
c5e3aa8e |
1025 | gEve->AddElement(gSSDClusters); |
1026 | } |
1027 | |
1028 | processITSClusters( block , gSSDClusters); |
1029 | gSSDClusters->ElementChanged(); |
1030 | } |
1031 | } // else if ( ! block->GetDetector().CompareTo("ISSD") ){ |
1032 | |
1033 | // ++ ITS BLOCK |
1034 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
ea48ba6e |
1035 | else if ( ! block->GetDetector().CompareTo("ITS") ){ |
f1fefc07 |
1036 | if ( block->GetDataType().CompareTo("ROOTHIST") == 0 ) { |
c5e3aa8e |
1037 | iResult = processITSHist( block ); |
f1fefc07 |
1038 | } |
c5e3aa8e |
1039 | } // else if ( ! block->GetDetector().CompareTo("ITS") ){ |
ea48ba6e |
1040 | |
c5e3aa8e |
1041 | // ++ PHOS BLOCK |
1042 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1043 | else if ( ! block->GetDetector().CompareTo("PHOS") ) { |
1044 | |
1045 | // -- Process Digits |
cfa641b1 |
1046 | //if ( block->GetDataType().CompareTo("DIGITTYP") == 0 ) { |
1047 | if ( block->GetDataType().CompareTo("CHANNELT") == 0 ) { |
c5e3aa8e |
1048 | |
1049 | if( !gPHOSElementList ){ |
1050 | gPHOSElementList = new TEveElementList("PHOS Cells"); |
1051 | gEve->AddElement(gPHOSElementList); |
1052 | |
1053 | TVector3 center; |
1054 | Float_t angle; |
1055 | |
1056 | // -- Create boxsets |
1057 | for(int im = 0; im < 5; im++) { |
1058 | |
cfa641b1 |
1059 | TEveRGBAPalette* pal = new TEveRGBAPalette(0,120); |
1060 | pal->SetLimits(-0.1, 1024); |
c5e3aa8e |
1061 | gPHOSBoxSet[im] = new TEveBoxSet(Form("Cells Module %d" , im)); |
1062 | gPHOSBoxSet[im]->SetPalette(pal); |
1063 | gPHOSBoxSet[im]->Reset(TEveBoxSet::kBT_AABox, kFALSE, 64); |
1064 | gPHOSBoxSet[im]->SetOwnIds(kTRUE); |
1065 | |
cfa641b1 |
1066 | |
c5e3aa8e |
1067 | gPHOSGeom->GetModuleCenter(center, "CPV", im+1); |
1068 | angle = gPHOSGeom->GetPHOSAngle(im+1)*TMath::Pi()/180; |
1069 | |
1070 | gPHOSBoxSet[im]->RefitPlex(); |
1071 | TEveTrans& t = gPHOSBoxSet[im]->RefMainTrans(); |
1072 | t.SetupRotation(1, 2, angle ); |
1073 | t.SetPos(center.X(), center.Y(), center.Z()); |
1074 | |
1075 | gPHOSElementList->AddElement(gPHOSBoxSet[im]); |
1076 | } |
1077 | } // for(int im = 0; im < 5; im++) { |
1078 | |
1079 | iResult = processPHOSClusters( block ); |
1080 | |
1081 | for(int im = 0; im < 5; im++) |
1082 | gPHOSBoxSet[im]->ElementChanged(); |
1083 | |
1084 | } // if ( block->GetDataType().CompareTo("DIGITTYP") == 0 ) { |
1085 | |
1086 | } // else if ( ! block->GetDetector().CompareTo("PHOS") ){ |
f1fefc07 |
1087 | |
cfa641b1 |
1088 | else if ( ! block->GetDetector().CompareTo("EMCAL") ){ |
1089 | if ( block->GetDataType().CompareTo("CHANNELT") == 0 ) { |
1090 | |
cfa641b1 |
1091 | if( !gEMCALElementList ){ |
cfa641b1 |
1092 | gEMCALElementList = new TEveElementList("EMCAL Cells"); |
1093 | gEMCALElementList->SetTitle("Tooltip"); |
1094 | gEve->AddElement(gEMCALElementList); |
1095 | |
1096 | |
1097 | gStyle->SetPalette(1, 0); |
1098 | TEveRGBAPalette* pal = new TEveRGBAPalette(0, 512); |
1099 | pal->SetLimits(0, 1024); |
1100 | |
1101 | |
1102 | for (Int_t sm=0; sm<12; ++sm) { |
1103 | |
1104 | TEveBoxSet* q = new TEveBoxSet(Form("SM %d", sm+1)); |
1105 | q->SetOwnIds(kTRUE); |
1106 | |
1107 | q->Reset(TEveBoxSet::kBT_AABox, kFALSE, 64); |
1108 | q->RefMainTrans().SetFrom(*gEMCALNode->GetDaughter(sm)->GetMatrix()); |
1109 | q->SetPalette(pal); |
1110 | |
1111 | gEve->AddElement(q, gEMCALElementList); |
1112 | gEMCALBoxSet[sm] = q; |
1113 | } |
1114 | } |
1115 | |
cfa641b1 |
1116 | iResult = processEMCALClusters( block ); |
1117 | |
1118 | for(int sm = 0; sm < 12; sm++) { |
1119 | gEMCALBoxSet[sm]->ElementChanged(); |
1120 | } |
1121 | |
1122 | |
1123 | } |
1124 | |
1125 | } // "EMCAL" blocks end |
1126 | |
f1fefc07 |
1127 | // --------------------------------------------------------- |
9e78371d |
1128 | } // while ((block = (AliHLTHOMERBlockDesc*)next())) { |
1129 | |
cfa641b1 |
1130 | |
1131 | //============================================================================ |
1132 | // Reading out the histograms |
1133 | //=========================================================================== |
1134 | TIter anext(gHomerManager->GetAsyncBlockList()); |
49993c6f |
1135 | |
cfa641b1 |
1136 | while ( (block = (AliHLTHOMERBlockDesc*)anext()) ) { |
1137 | |
ff64d287 |
1138 | #if 0 //DEBUG |
cfa641b1 |
1139 | printf( "------------------- xxxxxxxxxxxxxxx ----------------------\n"); |
1140 | printf( "Detector : %s\n", block->GetDetector().Data() ); |
1141 | printf( "Datatype : %s\n", block->GetDataType().Data() ); |
1142 | if (block->IsTObject() ) |
1143 | printf( "Is TObject of class: %s\n", block->GetClassName().Data() ); |
1144 | printf( "------------------- xxxxxxxxxxxxxxx ----------------------\n"); |
1145 | #endif |
1146 | |
ff64d287 |
1147 | // ++ V0 BLOCK |
1148 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1149 | if ( block->GetDataType().CompareTo("ROOTHIST") == 0 ) { |
1150 | // -- Process V0 Histos |
1151 | processV0Histograms( block , gV0Canvas); |
1152 | } |
1153 | |
1154 | // ++ vertex BLOCK |
1155 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1156 | if ( ! block->GetDetector().CompareTo("HLT") && |
1157 | !block->GetDataType().CompareTo("ROOTHIST") ) { |
1158 | // -- Process Vertex Histos |
1159 | processPrimVertexHistograms( block , gPrimVertexCanvas); |
1160 | gPrimVertexCanvas->Update(); |
1161 | } |
cfa641b1 |
1162 | |
ff64d287 |
1163 | // ++ ISPD Vertex BLOCK |
cfa641b1 |
1164 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1165 | if ( ! block->GetDetector().CompareTo("ISPD") ){ |
1166 | if ( block->GetDataType().CompareTo("ROOTHIST") == 0 ) { |
1167 | |
1168 | // -- Process Vertex Histos |
ff64d287 |
1169 | processSPDVertexHistograms( block , gSPDVertexCanvas); |
1170 | gSPDVertexCanvas->Update(); |
1171 | } |
1172 | } |
1173 | |
1174 | // ++ ITS BLOCK |
1175 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1176 | if ( ! block->GetDetector().CompareTo("ITS") ){ |
1177 | if ( block->GetDataType().CompareTo("ROOTHIST") == 0 ) { |
1178 | |
1179 | // -- Process Vertex Histos |
1180 | processITSHistograms( block , gITSCanvas); |
1181 | gITSCanvas->Update(); |
cfa641b1 |
1182 | } |
1183 | } |
1184 | |
ff64d287 |
1185 | // ++ ISSD BLOCK |
1186 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1187 | if ( ! block->GetDetector().CompareTo("ISSD") ){ |
1188 | if ( block->GetDataType().CompareTo("ROOTOBAR") == 0 ) { |
1189 | |
1190 | // -- Process Vertex Histos |
1191 | processSSDHistograms( block , gSSDCanvas0, gSSDCanvas1); |
1192 | gSSDCanvas0->Update(); |
1193 | gSSDCanvas1->Update(); |
1194 | } |
1195 | } |
cfa641b1 |
1196 | |
1197 | // ++ PHOS BLOCK |
1198 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
ff64d287 |
1199 | if ( ! block->GetDetector().CompareTo("PHOS") ) { |
cfa641b1 |
1200 | |
1201 | // -- Process Digits |
1202 | //if ( block->GetDataType().CompareTo("DIGITTYP") == 0 ) { |
1203 | if ( block->GetDataType().CompareTo("CHANNELT") == 0 ) { |
1204 | |
1205 | if( !gPHOSElementList ){ |
1206 | gPHOSElementList = new TEveElementList("PHOS Cells"); |
1207 | gEve->AddElement(gPHOSElementList); |
1208 | |
1209 | TVector3 center; |
1210 | Float_t angle; |
1211 | |
1212 | // -- Create boxsets |
1213 | for(int im = 0; im < 5; im++) { |
1214 | |
1215 | TEveRGBAPalette* pal = new TEveRGBAPalette(0,120); |
1216 | pal->SetLimits(-0.1, 1024); |
1217 | gPHOSBoxSet[im] = new TEveBoxSet(Form("Cells Module %d" , im)); |
1218 | gPHOSBoxSet[im]->SetPalette(pal); |
1219 | gPHOSBoxSet[im]->Reset(TEveBoxSet::kBT_AABox, kFALSE, 64); |
1220 | gPHOSBoxSet[im]->SetOwnIds(kTRUE); |
1221 | |
1222 | |
1223 | gPHOSGeom->GetModuleCenter(center, "CPV", im+1); |
1224 | angle = gPHOSGeom->GetPHOSAngle(im+1)*TMath::Pi()/180; |
1225 | |
1226 | gPHOSBoxSet[im]->RefitPlex(); |
1227 | TEveTrans& t = gPHOSBoxSet[im]->RefMainTrans(); |
1228 | t.SetupRotation(1, 2, angle ); |
1229 | t.SetPos(center.X(), center.Y(), center.Z()); |
1230 | |
1231 | gPHOSElementList->AddElement(gPHOSBoxSet[im]); |
1232 | } |
1233 | } // for(int im = 0; im < 5; im++) { |
1234 | |
1235 | iResult = processPHOSClusters( block ); |
1236 | |
1237 | for(int im = 0; im < 5; im++) |
1238 | gPHOSBoxSet[im]->ElementChanged(); |
1239 | |
1240 | } // if ( block->GetDataType().CompareTo("DIGITTYP") == 0 ) { |
1241 | |
1242 | } // else if ( ! block->GetDetector().CompareTo("PHOS") ){ |
1243 | |
1244 | else if ( ! block->GetDetector().CompareTo("EMCA") ){ |
1245 | if ( block->GetDataType().CompareTo("CHANNELT") == 0 ) { |
1246 | |
cfa641b1 |
1247 | if( !gEMCALElementList ){ |
1248 | |
1249 | |
1250 | gEMCALElementList = new TEveElementList("EMCAL Cells"); |
1251 | gEMCALElementList->SetTitle("Tooltip"); |
1252 | gEve->AddElement(gEMCALElementList); |
1253 | |
1254 | |
1255 | gStyle->SetPalette(1, 0); |
1256 | TEveRGBAPalette* pal = new TEveRGBAPalette(0, 512); |
1257 | pal->SetLimits(0, 1024); |
1258 | |
1259 | |
1260 | for (Int_t sm=0; sm<12; ++sm) { |
1261 | |
1262 | TEveBoxSet* q = new TEveBoxSet(Form("SM %d", sm+1)); |
1263 | q->SetOwnIds(kTRUE); |
1264 | |
1265 | q->Reset(TEveBoxSet::kBT_AABox, kFALSE, 64); |
1266 | q->RefMainTrans().SetFrom(*gEMCALNode->GetDaughter(sm)->GetMatrix()); |
1267 | q->SetPalette(pal); |
1268 | |
1269 | gEve->AddElement(q, gEMCALElementList); |
1270 | gEMCALBoxSet[sm] = q; |
1271 | } |
1272 | } |
1273 | |
1274 | |
ff64d287 |
1275 | // cout << "Processing emcal digits" << endl; |
cfa641b1 |
1276 | iResult = processEMCALClusters( block ); |
1277 | |
1278 | for(int sm = 0; sm < 12; sm++) { |
1279 | gEMCALBoxSet[sm]->ElementChanged(); |
1280 | } |
1281 | |
1282 | |
1283 | } |
1284 | |
1285 | } // "EMCAL" blocks end |
1286 | |
49993c6f |
1287 | //Extra TPC clusters set for testing |
1288 | else if ( ! block->GetDetector().CompareTo("TPC") ) { |
1289 | if ( ! block->GetDataType().CompareTo("HWCL_ALT") ) { |
1290 | if(!gTPCTestClusters){ |
1291 | |
1292 | gTPCTestClusters = new TEvePointSet("TPC Clusters Test"); |
1293 | //ggTPCTestClusters->ApplyVizTag("TPC Clusters"); |
1294 | gTPCTestClusters->SetMainColor(kBlue); |
1295 | gTPCTestClusters->SetMarkerStyle((Style_t)kFullDotSmall); |
1296 | gEve->AddElement(gTPCTestClusters); |
1297 | } |
1298 | |
1299 | iResult = processTPCClusters(block, gTPCTestClusters); |
1300 | gTPCTestClusters->ElementChanged(); |
1301 | } |
1302 | |
1303 | |
1304 | } |
cfa641b1 |
1305 | |
1306 | |
1307 | } |
1308 | |
c5e3aa8e |
1309 | //============================================================================== |
1310 | // -- Update Objects |
1311 | //============================================================================== |
1312 | |
1313 | // -- TPC Histograms |
1314 | if ( gTPCCanvas && gTPCCharge && gTPCQMax) { |
cfa641b1 |
1315 | |
c5e3aa8e |
1316 | gTPCCanvas->Clear(); |
1317 | gTPCCanvas->Divide(1,3); |
1318 | |
1319 | gTPCCanvas->cd(1); |
1320 | gTPCCharge->Draw(); |
1321 | |
1322 | gTPCCanvas->cd(2); |
1323 | gTPCQMax->Draw(); |
1324 | |
1325 | gTPCCanvas->cd(3); |
1326 | gTPCQMaxOverCharge->Draw(); |
1327 | |
1328 | gTPCCanvas->Update(); |
1329 | } |
f1fefc07 |
1330 | |
9e78371d |
1331 | if ( gTPCClusters ) gTPCClusters->ResetBBox(); |
49993c6f |
1332 | if ( gTPCTestClusters ) gTPCTestClusters->ResetBBox(); |
1d8ae8b6 |
1333 | if ( gTRDClusters ) gTRDClusters->ResetBBox(); |
9e78371d |
1334 | if ( gSPDClusters ) gSPDClusters->ResetBBox(); |
c5e3aa8e |
1335 | if ( gSDDClusters ) gSDDClusters->ResetBBox(); |
1336 | if ( gSSDClusters ) gSSDClusters->ResetBBox(); |
1337 | if ( gMUONClusters ) gMUONClusters->ResetBBox(); |
1338 | |
1339 | if ( gPHOSBoxSet[1] ) |
1340 | for(int im = 0; im < 5; im++) |
1341 | gPHOSBoxSet[im]->ResetBBox(); |
ea9a0e13 |
1342 | |
cfa641b1 |
1343 | if ( gEMCALElementList ) |
1344 | for(int sm = 0; sm < 12; sm++) |
1345 | gEMCALBoxSet[sm]->ResetBBox(); |
1346 | |
c5e3aa8e |
1347 | //============================================================================== |
ea9a0e13 |
1348 | // -- Set EventID in Window Title |
c5e3aa8e |
1349 | // -- Update Objects |
1350 | //============================================================================== |
1351 | |
ea9a0e13 |
1352 | TString winTitle("Eve Main Window -- Event ID : "); |
1353 | winTitle += Form("0x%016X ", gHomerManager->GetEventID() ); |
1354 | gEve->GetBrowser()->SetWindowName(winTitle); |
9e78371d |
1355 | |
c5e3aa8e |
1356 | //============================================================================== |
9e78371d |
1357 | // -- Set Projections |
c5e3aa8e |
1358 | //============================================================================== |
9e78371d |
1359 | |
1360 | // XXX Primary vertex ... to be retrieved from the ESD |
ea48ba6e |
1361 | Double_t x[3] = { 0, 0, 0 }; |
1362 | |
f1fefc07 |
1363 | TEveElement* top = gEve->GetCurrentEvent(); |
ea48ba6e |
1364 | |
ea9a0e13 |
1365 | if (gRPhiMgr && top) { |
f1fefc07 |
1366 | gRPhiEventScene->DestroyElements(); |
1367 | if (gCenterProjectionsAtPrimaryVertex) |
1368 | gRPhiMgr->SetCenter(x[0], x[1], x[2]); |
1369 | gRPhiMgr->ImportElements(top, gRPhiEventScene); |
9e78371d |
1370 | } |
ea9a0e13 |
1371 | |
1372 | if (gRhoZMgr && top) { |
f1fefc07 |
1373 | gRhoZEventScene->DestroyElements(); |
1374 | if (gCenterProjectionsAtPrimaryVertex) |
1375 | gRhoZMgr->SetCenter(x[0], x[1], x[2]); |
1376 | gRhoZMgr->ImportElements(top, gRhoZEventScene); |
9e78371d |
1377 | } |
9e78371d |
1378 | |
c5e3aa8e |
1379 | //============================================================================== |
ea9a0e13 |
1380 | |
1381 | gEve->Redraw3D(0,1); // (0, 1) |
9e78371d |
1382 | gEve->EnableRedraw(); |
f1fefc07 |
1383 | |
9e78371d |
1384 | return iResult; |
1385 | } |
1386 | |
f1fefc07 |
1387 | // ----------------------------------------------------------------- |
c5e3aa8e |
1388 | Int_t processITSHist(AliHLTHOMERBlockDesc* /*block*/) { |
f1fefc07 |
1389 | return 0; |
1390 | } |
1d8ae8b6 |
1391 | |
9e78371d |
1392 | // ----------------------------------------------------------------- |
1d8ae8b6 |
1393 | Int_t processHLTRDLST(AliHLTHOMERBlockDesc* /*block*/) { |
9e78371d |
1394 | return 0; |
1395 | } |
1396 | |
1397 | // ----------------------------------------------------------------- |
1d8ae8b6 |
1398 | Int_t processROOTTOBJ(AliHLTHOMERBlockDesc* block, TEveText* /*et*/) { |
9e78371d |
1399 | |
1400 | // -- AliHLTGlobalTriggerDecision |
1401 | if ( ! block->GetClassName().CompareTo("AliHLTGlobalTriggerDecision") ) { |
1402 | |
1d8ae8b6 |
1403 | AliHLTGlobalTriggerDecision *trig = dynamic_cast<AliHLTGlobalTriggerDecision*>( block->GetTObject()); |
5de5a293 |
1404 | trig->Print(); |
f1fefc07 |
1405 | |
ea9a0e13 |
1406 | // et->SetText("balle");; |
9e78371d |
1407 | |
ea9a0e13 |
1408 | // TEveText* tt = new TEveText("Trigger: Class is known ;-) "); |
1409 | // gEve->AddElement(tt); |
9e78371d |
1410 | |
1411 | } |
1412 | else { |
1413 | printf(" Unknown root object %s",block->GetClassName().Data() ); |
1414 | } |
1415 | |
1416 | return 0; |
1417 | } |
1418 | |
1419 | // ----------------------------------------------------------------- |
1420 | Int_t processEsdTracks( AliHLTHOMERBlockDesc* block, TEveTrackList* cont ) { |
1421 | |
1422 | AliESDEvent* esd = (AliESDEvent *) (block->GetTObject()); |
1423 | esd->GetStdContent(); |
1424 | |
ff64d287 |
1425 | esd_track_propagator_setup(cont->GetPropagator(),-0.1*esd->GetMagneticField(), 520); |
9e78371d |
1426 | |
cfa641b1 |
1427 | // printf( "Number of ESD Tracks : %d \n", esd->GetNumberOfTracks()); |
9e78371d |
1428 | |
1429 | for (Int_t iter = 0; iter < esd->GetNumberOfTracks(); ++iter) { |
cfa641b1 |
1430 | //AliEveTrack* track = dynamic_cast<AliEveTrack*>(esd_make_track(esd->GetTrack(iter), cont)); |
1431 | AliEveTrack* track = dynamic_cast<AliEveTrack*>(hlt_esd_make_track(esd->GetTrack(iter), cont)); |
9e78371d |
1432 | cont->AddElement(track); |
1433 | } |
1434 | |
1435 | cont->SetTitle(Form("N=%d", esd->GetNumberOfTracks()) ); |
1436 | cont->MakeTracks(); |
1437 | |
1438 | return 0; |
1439 | } |
1440 | |
c5e3aa8e |
1441 | // ----------------------------------------------------------------- |
cfa641b1 |
1442 | Int_t processPHOSClusters(AliHLTHOMERBlockDesc* block) { |
c5e3aa8e |
1443 | |
ff64d287 |
1444 | |
cfa641b1 |
1445 | AliHLTPHOSChannelDataHeaderStruct *chh = reinterpret_cast<AliHLTPHOSChannelDataHeaderStruct*> (block->GetData()); |
1446 | |
cfa641b1 |
1447 | AliHLTPHOSChannelDataStruct *chd = reinterpret_cast<AliHLTPHOSChannelDataStruct*>(chh+1); |
1448 | |
ff64d287 |
1449 | for(Int_t i = 0; i < chh->fNChannels; i++, chd++) { |
cfa641b1 |
1450 | |
1451 | Int_t gain = (chd->fChannelID >> 12)&0x1; |
1452 | Int_t module = (chd->fChannelID >> 13)&0x1f; |
1453 | module = 4 -module; |
c5e3aa8e |
1454 | |
c5e3aa8e |
1455 | |
cfa641b1 |
1456 | if(gain == 0) |
1457 | |
1458 | { |
1459 | Float_t x = (static_cast<Float_t>(chd->fChannelID&0x3f) - 32)* 2.2; |
1460 | Float_t z = (static_cast<Float_t>((chd->fChannelID >> 6)&0x3f) - 28) * 2.2; |
1461 | // gPHOSBoxSet[ds->fModule]->AddBox(ds->fLocX, 0, ds->fLocZ, 2.2, ds->fEnergy*20, 2.2); |
1462 | gPHOSBoxSet[module]->AddBox(x, 0, z, 2.2, chd->fEnergy/15, 2.2); |
1463 | gPHOSBoxSet[module]->DigitValue(static_cast<Int_t>(chd->fEnergy)); |
cfa641b1 |
1464 | } |
c5e3aa8e |
1465 | |
cfa641b1 |
1466 | |
1467 | |
1468 | } |
1469 | |
1470 | return 0; |
1471 | } |
1472 | |
1473 | // // ----------------------------------------------------------------- |
1474 | // Int_t processPHOSClusters(AliHLTHOMERBlockDesc* block) { |
1475 | |
1476 | // AliHLTPHOSDigitHeaderStruct *dh = reinterpret_cast<AliHLTPHOSDigitHeaderStruct*> (block->GetData()); |
1477 | // //UInt_t nClusters = block->GetSize()/sizeof(AliHLTPHOSDigitDataStruct); |
1478 | |
1479 | // UInt_t nDigits = dh->fNDigits; |
1480 | |
1481 | // AliHLTPHOSDigitDataStruct *ds = reinterpret_cast<AliHLTPHOSDigitDataStruct*>(reinterpret_cast<UChar_t*>(dh)+sizeof(AliHLTPHOSDigitHeaderStruct)); |
1482 | |
1483 | // for(UInt_t i = 0; i < nDigits; i++, ds++) { |
1484 | // gPHOSBoxSet[ds->fModule]->AddBox(ds->fLocX, 0, ds->fLocZ, 2.2, ds->fEnergy*20, 2.2); |
1485 | // gPHOSBoxSet[ds->fModule]->DigitValue(static_cast<Int_t>(ds->fEnergy*100)); |
1486 | // } |
c5e3aa8e |
1487 | |
1488 | // return 0; |
1489 | // } |
1490 | |
c5e3aa8e |
1491 | // ----------------------------------------------------------------- |
cfa641b1 |
1492 | Int_t processEMCALClusters(AliHLTHOMERBlockDesc* block) { |
c5e3aa8e |
1493 | |
cfa641b1 |
1494 | AliHLTCaloChannelDataHeaderStruct *dhs = reinterpret_cast<AliHLTCaloChannelDataHeaderStruct*> (block->GetData()); |
1495 | Short_t nC = dhs->fNChannels; |
1496 | AliHLTUInt8_t *ui = reinterpret_cast<AliHLTUInt8_t*>(dhs) + sizeof(AliHLTCaloChannelDataHeaderStruct); |
1497 | AliHLTCaloChannelDataStruct *ds = reinterpret_cast<AliHLTCaloChannelDataStruct*>(ui); |
1498 | |
1499 | UShort_t fX =0; |
1500 | UShort_t fZ =0; |
1501 | UShort_t fGain =0; |
1502 | UShort_t fModuleId =0; |
1503 | |
c5e3aa8e |
1504 | |
c5e3aa8e |
1505 | |
cfa641b1 |
1506 | for(Short_t s = 0; s < nC; s++ ) { |
ff64d287 |
1507 | |
cfa641b1 |
1508 | fX = ds->fChannelID&0x3f; |
1509 | fZ = (ds->fChannelID >> 6)&0x3f; |
1510 | fGain = (ds->fChannelID >> 12)&0x1; |
1511 | fModuleId = (ds->fChannelID >> 13)&0x1f; |
1512 | |
1513 | // cout << fX << " " << fZ << " " << fGain << " " << fModuleId <<endl; |
1514 | |
ff64d287 |
1515 | if ( ( fModuleId >= 0 && fModuleId < 12 ) ) { |
cfa641b1 |
1516 | gEMCALBoxSet[fModuleId]->AddBox(10, fX*6-12*6, fZ*6-24*6, ds->fEnergy/4, 6, 6); |
1517 | gEMCALBoxSet[fModuleId]->DigitValue(static_cast<Int_t>(ds->fEnergy)); |
1518 | } |
1519 | ds++; |
cfa641b1 |
1520 | |
ff64d287 |
1521 | } |
1522 | |
c5e3aa8e |
1523 | return 0; |
1524 | } |
1525 | |
ea9a0e13 |
1526 | // ----------------------------------------------------------------- |
c5e3aa8e |
1527 | Int_t processITSClusters(AliHLTHOMERBlockDesc* block, TEvePointSet* cont) { |
1528 | |
1529 | AliHLTITSClusterData *cd = reinterpret_cast<AliHLTITSClusterData*> (block->GetData()); |
1530 | UChar_t *data = reinterpret_cast<UChar_t*> (cd->fSpacePoints); |
1531 | |
1532 | if ( cd->fSpacePointCnt != 0 ) { |
1533 | for (Int_t iter = 0; iter < cd->fSpacePointCnt; ++iter, data += sizeof(AliHLTITSSpacePointData)) { |
1534 | AliHLTITSSpacePointData *sp = reinterpret_cast<AliHLTITSSpacePointData*> (data); |
f1fefc07 |
1535 | |
c5e3aa8e |
1536 | Int_t lab[4] = {0,0,0,0}; |
1537 | Float_t hit[6] = {0,0,0,0,0,0}; |
1538 | Int_t info[3] = {0,0,0}; |
1539 | |
1540 | lab[0] = sp->fTracks[0]; |
1541 | lab[1] = sp->fTracks[1]; |
1542 | lab[2] = sp->fTracks[2]; |
1543 | lab[3] = sp->fIndex; |
1544 | hit[0] = sp->fY; |
1545 | hit[1] = sp->fZ; |
1546 | hit[2] = sp->fSigmaY2; |
1547 | hit[3] = sp->fSigmaZ2; |
1548 | hit[4] = sp->fQ; |
1549 | hit[5] = sp->fSigmaYZ; |
1550 | info[0] = sp->fNy; |
1551 | info[1] = sp->fNz; |
1552 | info[2] = sp->fLayer; |
1553 | |
1554 | Float_t xyz[3]; |
1555 | AliITSRecPoint recpoint(lab,hit,info); |
1556 | recpoint.GetGlobalXYZ(xyz); |
1557 | |
1558 | cont->SetNextPoint(xyz[0], xyz[1], xyz[2]); |
1559 | } |
1560 | } |
1561 | return 0; |
1562 | } |
1563 | |
1564 | // ----------------------------------------------------------------- |
1565 | Int_t processTPCClusters(AliHLTHOMERBlockDesc* block, TEvePointSet* cont, TEvePointSetArray *contCol ) { |
1566 | |
f1fefc07 |
1567 | Int_t slice = block->GetSubDetector(); |
9e78371d |
1568 | Float_t phi = ( slice + 0.5 ) * TMath::Pi() / 9.0; |
1569 | Float_t cos = TMath::Cos( phi ); |
1570 | Float_t sin = TMath::Sin( phi ); |
ea9a0e13 |
1571 | |
1572 | AliHLTTPCClusterData *cd = reinterpret_cast<AliHLTTPCClusterData*> (block->GetData()); |
1573 | UChar_t *data = reinterpret_cast<UChar_t*> (cd->fSpacePoints); |
9e78371d |
1574 | |
ea9a0e13 |
1575 | if ( cd->fSpacePointCnt != 0 ) { |
1576 | for (Int_t iter = 0; iter < cd->fSpacePointCnt; ++iter, data += sizeof(AliHLTTPCSpacePointData)) { |
1577 | AliHLTTPCSpacePointData *sp = reinterpret_cast<AliHLTTPCSpacePointData*> (data); |
9e78371d |
1578 | cont->SetNextPoint(cos*sp->fX - sin*sp->fY, sin*sp->fX + cos*sp->fY, sp->fZ); |
49993c6f |
1579 | if (contCol) |
1580 | contCol->Fill(cos*sp->fX - sin*sp->fY, sin*sp->fX + cos*sp->fY, sp->fZ, sp->fCharge); |
c5e3aa8e |
1581 | |
1582 | gTPCCharge->Fill(sp->fCharge); |
1583 | gTPCQMax->Fill(sp->fQMax); |
1584 | gTPCQMaxOverCharge->Fill(((Float_t)sp->fQMax)/((Float_t)sp->fCharge)); |
9e78371d |
1585 | } |
1586 | } |
1587 | |
ea9a0e13 |
1588 | return 0; |
9e78371d |
1589 | } |
1d8ae8b6 |
1590 | |
ea48ba6e |
1591 | // ----------------------------------------------------------------- |
1d8ae8b6 |
1592 | Int_t processMUONClusters(AliHLTHOMERBlockDesc* block) { |
ea48ba6e |
1593 | |
1d8ae8b6 |
1594 | Int_t iResult = 0; |
1595 | |
1596 | unsigned long size = block->GetSize(); |
ea48ba6e |
1597 | Int_t * buffer ; |
1d8ae8b6 |
1598 | |
ea48ba6e |
1599 | buffer = (Int_t *)block->GetData(); |
1d8ae8b6 |
1600 | // cout<<"block size : "<<size<<", buffer : "<<buffer<<", DataType : "<<block->GetDataType()<<endl; |
1601 | |
1602 | // // for(int idata=0;idata<int(size);idata++) |
1603 | // // printf("\tbuffer[%d] : %d\n",idata,buffer[idata]); |
1604 | |
1605 | |
1606 | |
1607 | if(block->GetDataType().CompareTo("RECHITS") == 0){ |
1608 | |
1609 | AliHLTMUONRecHitsBlockReader trackblock((char*)buffer, size); |
1610 | const AliHLTMUONRecHitStruct* hit = trackblock.GetArray(); |
1611 | |
1612 | for(AliHLTUInt32_t ientry = 0; ientry < trackblock.Nentries(); ientry++){ |
1613 | // cout << setw(13) << left << hit->fX << setw(0); |
1614 | // cout << setw(13) << left << hit->fY << setw(0); |
1615 | // cout << hit->fZ << setw(0) << endl; |
1616 | if(hit->fX!=0.0 && hit->fY!=0.0 && hit->fZ!=0.0) |
1617 | gMUONClusters->SetNextPoint(hit->fX,hit->fY,hit->fZ); |
1618 | hit++; |
1619 | |
1620 | }// track hit loop |
1621 | } |
1622 | |
1623 | else{// if rechits |
1624 | // if(!strcmp((BlockType(ULong64_t(reader->GetBlockDataType(i)))).Data(),"TRIGRECS")){ |
1625 | |
1626 | AliHLTMUONTriggerRecordsBlockReader trigblock(buffer, size); |
1627 | const AliHLTMUONTriggerRecordStruct* trigrec = trigblock.GetArray(); |
1628 | for(AliHLTUInt32_t ientry = 0; ientry < trigblock.Nentries(); ientry++){ |
1629 | |
1630 | const AliHLTMUONRecHitStruct* hit = &trigrec->fHit[0]; |
1631 | for(AliHLTUInt32_t ch = 0; ch < 4; ch++) |
1632 | { |
cfa641b1 |
1633 | // cout << setw(10) << left << ch + 11 << setw(0); |
1634 | // cout << setw(13) << left << hit->fX << setw(0); |
1635 | // cout << setw(13) << left << hit->fY << setw(0); |
1636 | // cout << hit->fZ << setw(0) << endl; |
1d8ae8b6 |
1637 | if(hit->fX!=0.0 && hit->fY!=0.0 && hit->fZ!=0.0) |
1638 | gMUONClusters->SetNextPoint(hit->fX,hit->fY,hit->fZ); |
1639 | hit++; |
1640 | }// trig chamber loop |
1641 | trigrec++; |
1642 | }//trig hit loop |
1643 | }//else trigger |
1644 | |
1645 | return iResult; |
1646 | } |
1647 | |
cfa641b1 |
1648 | // ----------------------------------------------------------------- |
1649 | Int_t processMUONTracks(AliHLTHOMERBlockDesc* block) { |
1650 | |
1651 | Int_t iResult = 0; |
1652 | |
1653 | unsigned long size = block->GetSize(); |
1654 | Int_t * buffer = (Int_t *)block->GetData(); |
1655 | AliHLTMUONRecHitStruct hit1,hit2; |
1656 | hit1.fX = hit1.fY = hit1.fZ = hit2.fX = hit2.fY = hit2.fZ = 0; |
1657 | Int_t ch1=0, ch2=0; |
1658 | Float_t x0=0.0,y0=0.0,z0=0.0; |
1659 | Float_t x3=0.0,y3=0.0,z3=0.0; |
1660 | if(block->GetDataType().CompareTo("MANTRACK") == 0){ |
1661 | AliHLTMUONMansoTracksBlockReader mantrackblock(buffer, size); |
1662 | const AliHLTMUONMansoTrackStruct* mtrack = mantrackblock.GetArray(); |
1663 | for(AliHLTUInt32_t ientry = 0; ientry < mantrackblock.Nentries(); ientry++){ |
1664 | const AliHLTMUONRecHitStruct* hit = &mtrack->fHit[0]; |
1665 | for(AliHLTUInt32_t ch = 0; ch < 4; ch++){ |
1666 | // cout << setw(10) << left << ch + 7 << setw(0); |
1667 | // cout << setw(13) << left << hit->fX << setw(0); |
1668 | // cout << setw(13) << left << hit->fY << setw(0); |
1669 | // cout << hit->fZ << setw(0) << endl; |
1670 | if(hit->fZ != 0.0){ |
1671 | if(ch==0 || ch==1){ |
1672 | hit1 = *hit; ch1 = ch+6; |
1673 | }else{ |
1674 | hit2 = *hit; ch2 = ch+6; |
1675 | } |
1676 | } |
1677 | hit++; |
1678 | }// trig chamber loop |
1679 | // printf("ch : %d, (X,Y,Z) : (%f,%f,%f)\n",ch1,hit1.fX,hit1.fY,hit1.fZ); |
1680 | // printf("ch : %d, (X,Y,Z) : (%f,%f,%f)\n",ch2,hit2.fX,hit2.fY,hit2.fZ); |
1681 | // meminfo(); |
1682 | z3 = AliMUONConstants::DefaultChamberZ(ch2+4); |
1683 | y3 = hit1.fY - (hit1.fZ-z3)*(hit1.fY - hit2.fY)/(hit1.fZ - hit2.fZ) ; |
1684 | x3 = hit1.fX - (hit1.fZ-z3)*(hit1.fX - hit2.fX)/(hit1.fZ - hit2.fZ) ; |
1685 | |
1686 | z0 = AliMUONConstants::DefaultChamberZ(ch1); |
1687 | y0 = hit1.fY - (hit1.fZ-z0)*(hit1.fY - hit2.fY)/(hit1.fZ - hit2.fZ) ; |
1688 | x0 = hit1.fX - (hit1.fZ-z0)*(hit1.fX - hit2.fX)/(hit1.fZ - hit2.fZ) ; |
1689 | |
1690 | |
1691 | gMUONTracks->AddLine(x0,y0,z0,x3,y3,z3); |
1692 | mtrack++; |
1693 | } |
1694 | cout<<"NofManso Tracks : "<<mantrackblock.Nentries()<<endl; |
1695 | } |
1696 | |
1697 | return iResult; |
1698 | |
1699 | } |
1700 | |
9e78371d |
1701 | |
1d8ae8b6 |
1702 | // ----------------------------------------------------------------- |
1703 | Int_t processTRDClusters(AliHLTHOMERBlockDesc* block, TEvePointSet *cont, TEvePointSetArray *contCol) { |
1704 | |
1705 | Int_t iResult = 0; |
1706 | |
ea48ba6e |
1707 | Int_t sm = block->GetSubDetector(); |
1d8ae8b6 |
1708 | if ( sm == 6 ) sm = 7; |
ea48ba6e |
1709 | |
1d8ae8b6 |
1710 | Float_t phi = ( sm + 0.5 ) * TMath::Pi() / 9.0; |
1711 | Float_t cos = TMath::Cos( phi ); |
1712 | Float_t sin = TMath::Sin( phi ); |
1713 | |
ea48ba6e |
1714 | Byte_t* ptrData = reinterpret_cast<Byte_t*>(block->GetData()); |
1d8ae8b6 |
1715 | UInt_t ptrSize = block->GetSize(); |
1716 | |
1717 | for (UInt_t size = 0; size+sizeof(AliHLTTRDCluster) <= ptrSize; size+=sizeof(AliHLTTRDCluster) ) { |
1718 | AliHLTTRDCluster *cluster = reinterpret_cast<AliHLTTRDCluster*>(&(ptrData[size])); |
1719 | |
1720 | AliTRDcluster *trdCluster = new AliTRDcluster; |
1721 | cluster->ExportTRDCluster( trdCluster ); |
1722 | |
1723 | contCol->Fill(cos*trdCluster->GetX() - sin*trdCluster->GetY(), |
1724 | sin*trdCluster->GetX() + cos*trdCluster->GetY(), |
1725 | trdCluster->GetZ(), |
1726 | trdCluster->GetQ() ); |
1727 | |
1728 | cont->SetNextPoint(cos*trdCluster->GetX() - sin*trdCluster->GetY(), |
ea48ba6e |
1729 | sin*trdCluster->GetX() + cos*trdCluster->GetY(), trdCluster->GetZ()); |
1d8ae8b6 |
1730 | } |
1731 | |
1732 | return iResult; |
1733 | } |
1734 | |
1735 | // ----------------------------------------------------------------- |
1736 | Int_t processTRDHistograms(AliHLTHOMERBlockDesc* block, TCanvas * canvas) { |
1737 | |
1738 | Int_t iResult = 0; |
1739 | |
1740 | if ( ! block->GetClassName().CompareTo("TH1D")) { |
1741 | TH1D* histo = reinterpret_cast<TH1D*>(block->GetTObject()); |
ea48ba6e |
1742 | ++gTRDHistoCount; |
1d8ae8b6 |
1743 | |
ea48ba6e |
1744 | TVirtualPad* pad = canvas->cd(gTRDHistoCount); |
1d8ae8b6 |
1745 | histo->Draw(); |
1746 | pad->SetGridy(); |
1747 | pad->SetGridx(); |
1748 | |
1749 | if ( ! strcmp(histo->GetName(), "nscls") ) { |
1750 | gTRDEvents = static_cast<Int_t>(histo->GetEntries()); |
1751 | histo->GetXaxis()->SetRangeUser(0.,15.); |
1752 | } |
1753 | |
1754 | if ( ! strcmp(histo->GetName(),"sclsdist") || |
1755 | ! strcmp(histo->GetName(),"qClsCand") ) |
1756 | pad->SetLogy(); |
1757 | } |
1758 | else if ( ! block->GetClassName().CompareTo("TH2F")) { |
1759 | TH2F *hista = reinterpret_cast<TH2F*>(block->GetTObject()); |
ea48ba6e |
1760 | ++gTRDHistoCount; |
1d8ae8b6 |
1761 | |
ea48ba6e |
1762 | TVirtualPad* pad = canvas->cd(gTRDHistoCount); |
1d8ae8b6 |
1763 | |
1764 | if (gTRDEvents > 0) |
1765 | hista->Scale(1./gTRDEvents); |
1766 | |
1767 | hista->Draw("COLZ"); |
1768 | pad->SetLogz(); |
1769 | pad->SetGridy(); |
1770 | pad->SetGridx(); |
1771 | } |
1772 | |
1773 | return iResult; |
1774 | } |
1775 | |
ff64d287 |
1776 | // ----------------------------------------------------------------- |
1777 | Int_t processPrimVertexHistograms(AliHLTHOMERBlockDesc* block, TCanvas * canvas) { |
1778 | |
1779 | Int_t iResult = 0; |
1780 | |
1781 | if ( ! block->GetClassName().CompareTo("TH1F")) { |
1782 | TH1F* histo = reinterpret_cast<TH1F*>(block->GetTObject()); |
1783 | if( histo ){ |
1784 | TString name(histo->GetName()); |
1785 | if( !name.CompareTo("primVertexZ") ){ |
1786 | canvas->cd(2); |
1787 | histo->Draw(); |
1788 | }else if( !name.CompareTo("primVertexX") ){ |
1789 | canvas->cd(3); |
1790 | histo->Draw(); |
1791 | }else if( !name.CompareTo("primVertexY") ){ |
1792 | canvas->cd(4); |
1793 | histo->Draw(); |
1794 | } |
1795 | } |
1796 | } else if ( ! block->GetClassName().CompareTo("TH2F")) { |
1797 | TH2F *hista = reinterpret_cast<TH2F*>(block->GetTObject()); |
1798 | if (hista ){ |
1799 | TString name(hista->GetName()); |
1800 | if( !name.CompareTo("primVertexXY")) { |
1801 | canvas->cd(1); |
1802 | hista->Draw(); |
1803 | } |
1804 | } |
1805 | } |
1806 | canvas->cd(); |
1807 | |
1808 | return iResult; |
1809 | } |
cfa641b1 |
1810 | |
1811 | // ----------------------------------------------------------------- |
ff64d287 |
1812 | Int_t processSPDVertexHistograms(AliHLTHOMERBlockDesc* block, TCanvas * canvas) { |
cfa641b1 |
1813 | |
1814 | Int_t iResult = 0; |
cfa641b1 |
1815 | |
1816 | if ( ! block->GetClassName().CompareTo("TH1F")) { |
cfa641b1 |
1817 | TH1F* histo = reinterpret_cast<TH1F*>(block->GetTObject()); |
ff64d287 |
1818 | ++gSPDVertexHistoCount; |
cfa641b1 |
1819 | |
ff64d287 |
1820 | canvas->cd(gSPDVertexHistoCount); |
cfa641b1 |
1821 | histo->Draw(); |
cfa641b1 |
1822 | |
ff64d287 |
1823 | } |
1824 | else if ( ! block->GetClassName().CompareTo("TH2F")) { |
cfa641b1 |
1825 | TH2F *hista = reinterpret_cast<TH2F*>(block->GetTObject()); |
1826 | if (hista) { |
ff64d287 |
1827 | ++gSPDVertexHistoCount; |
cfa641b1 |
1828 | |
ff64d287 |
1829 | canvas->cd(gSPDVertexHistoCount); |
cfa641b1 |
1830 | hista->Draw(); |
1831 | } |
1832 | } |
1833 | canvas->cd(); |
1834 | |
cfa641b1 |
1835 | return iResult; |
ff64d287 |
1836 | } |
cfa641b1 |
1837 | |
ff64d287 |
1838 | // ----------------------------------------------------------------- |
1839 | Int_t processV0Histograms(AliHLTHOMERBlockDesc* block, TCanvas * canvas) { |
cfa641b1 |
1840 | |
ff64d287 |
1841 | Int_t iResult = 0; |
1842 | bool update = 0; |
1843 | if ( ! block->GetClassName().CompareTo("TH1F")) { |
1844 | TH1F* histo = reinterpret_cast<TH1F*>(block->GetTObject()); |
1845 | if( histo ){ |
1846 | TString name(histo->GetName()); |
1847 | if( !name.CompareTo("hKShort") ){ |
1848 | canvas->cd(1); |
1849 | histo->Draw(); |
1850 | update = 1; |
1851 | }else if( !name.CompareTo("hLambda") ){ |
1852 | canvas->cd(3); |
1853 | histo->Draw(); |
1854 | update = 1; |
1855 | } |
1856 | } |
1857 | } else if ( ! block->GetClassName().CompareTo("TH2F")) { |
1858 | TH2F *hista = reinterpret_cast<TH2F*>(block->GetTObject()); |
1859 | if (hista ){ |
1860 | TString name(hista->GetName()); |
1861 | if( !name.CompareTo("hAP")) { |
1862 | canvas->cd(2); |
1863 | hista->Draw(); |
1864 | update = 1; |
1865 | } |
1866 | else if( !name.CompareTo("hGammaXY")) { |
1867 | canvas->cd(4); |
1868 | hista->Draw(); |
1869 | update = 1; |
1870 | } |
1871 | } |
1872 | } |
1873 | if( update ){ |
1874 | canvas->cd(); |
1875 | canvas->Update(); |
1876 | } |
1877 | return iResult; |
cfa641b1 |
1878 | } |
1879 | |
ff64d287 |
1880 | |
1881 | // ----------------------------------------------------------------- |
1882 | Int_t processITSHistograms(AliHLTHOMERBlockDesc* block, TCanvas * canvas) { |
1883 | |
1884 | Int_t iResult = 0; |
1885 | |
1886 | if ( ! block->GetClassName().CompareTo("TH1F")) { |
1887 | TH1F* histo = reinterpret_cast<TH1F*>(block->GetTObject()); |
1888 | ++gITSHistoCount; |
1889 | |
1890 | canvas->cd(gITSHistoCount); |
1891 | histo->Draw(); |
1892 | |
1893 | } |
1894 | else if ( ! block->GetClassName().CompareTo("TH2F")) { |
1895 | TH2F *hista = reinterpret_cast<TH2F*>(block->GetTObject()); |
1896 | if (hista) { |
1897 | ++gITSHistoCount; |
1898 | |
1899 | canvas->cd(gITSHistoCount); |
1900 | hista->Draw("COLZ"); |
1901 | } |
1902 | } |
1903 | canvas->cd(); |
1904 | |
1905 | return iResult; |
1906 | } |
1907 | |
1908 | // ----------------------------------------------------------------- |
1909 | Int_t processSSDHistograms(AliHLTHOMERBlockDesc* block, TCanvas *canvas0, TCanvas *canvas1) { |
1910 | |
1911 | Int_t iResult = 0; |
1912 | |
1913 | if ( ! block->GetClassName().CompareTo("TH1F")) { |
1914 | TH1F* histo = reinterpret_cast<TH1F*>(block->GetTObject()); |
1915 | ++gSSDHistoCount0; |
1916 | |
1917 | canvas0->cd(gSSDHistoCount0); |
1918 | histo->Draw(); |
1919 | } |
1920 | else if ( ! block->GetClassName().CompareTo("TH2F")) { |
1921 | TH2F *hista = reinterpret_cast<TH2F*>(block->GetTObject()); |
1922 | if (hista) { |
1923 | ++gSSDHistoCount1; |
1924 | |
1925 | canvas1->cd(gSSDHistoCount1); |
1926 | hista->Draw("COLZ"); |
1927 | } |
1928 | } else if ( ! block->GetClassName().CompareTo("TObjArray")) { |
1929 | TIter next((TObjArray*)(block->GetTObject())); |
1930 | TObject *object; |
1931 | while (( object = (TObject*) next())) { |
1932 | TString string; |
1933 | string = "TH1F"; |
1934 | TString string2; |
1935 | string2 = "TH2F"; |
1936 | |
1937 | if ( !(string.CompareTo(object->ClassName())) ) { |
1938 | TH1F* histo = reinterpret_cast<TH1F*>(object); |
1939 | ++gSSDHistoCount0; |
1940 | |
1941 | canvas0->cd(gSSDHistoCount0); |
1942 | histo->Draw(); |
1943 | |
1944 | } |
1945 | else if ( !(string2.CompareTo(object->ClassName()) ) ) { |
1946 | TH2F* histo = reinterpret_cast<TH2F*>(object); |
1947 | ++gSSDHistoCount1; |
1948 | |
1949 | canvas1->cd(gSSDHistoCount1); |
1950 | histo->Draw("COLZ"); |
1951 | } |
1952 | } |
1953 | } |
1954 | |
1955 | canvas0->cd(); canvas1->cd(); |
1956 | |
1957 | return iResult; |
1958 | } |
1959 | |
1960 | |
cfa641b1 |
1961 | //*-------------------------------------------------------------------------------------- |
1962 | Int_t processTRDCalibHistograms(AliHLTHOMERBlockDesc* block, TCanvas * canvas) { |
1963 | Int_t iResult = 0; |
1964 | |
1965 | TObjArray *HistArray=(TObjArray*)block->GetTObject(); |
1966 | Int_t nCalibHistos=HistArray->GetEntriesFast(); |
1967 | for(Int_t CalibHistoCount=0;CalibHistoCount<nCalibHistos;CalibHistoCount++){ |
1968 | canvas->cd(CalibHistoCount+1); |
1969 | |
1970 | if(HistArray->At(CalibHistoCount)->InheritsFrom("TH2S")){ |
1971 | TH2S *histCalib=(TH2S*)(HistArray->At(CalibHistoCount)); |
1972 | histCalib->Draw("colz"); |
1973 | } |
1974 | else if(HistArray->At(CalibHistoCount)->InheritsFrom("TH2")){ |
1975 | //TH2D *histCalib=dynamic_cast<TH2D*>(HistArray->At(CalibHistoCount)); |
1976 | TH2D *histCalib=(TH2D*)(HistArray->At(CalibHistoCount)); |
1977 | histCalib->Draw("lego2"); |
1978 | } |
1979 | else if(HistArray->At(CalibHistoCount)->InheritsFrom("TH1")){ |
1980 | //TH1D *histCalib=dynamic_cast<TH1D*>(HistArray->At(CalibHistoCount)); |
1981 | TH1D *histCalib=(TH1D*)(HistArray->At(CalibHistoCount)); |
1982 | histCalib->Draw(); |
1983 | } |
1984 | else if(HistArray->At(CalibHistoCount)->InheritsFrom("AliTRDCalibraVdriftLinearFit")){ |
1985 | //TH2S *histCalib = ((dynamic_cast<AliTRDCalibraVdriftLinearFit*>(HistArray->At(CalibHistoCount)))->GetLinearFitterHisto(10,kTRUE)); |
1986 | TH2S *histCalib =(TH2S*)(((AliTRDCalibraVdriftLinearFit*)HistArray->At(CalibHistoCount))->GetLinearFitterHisto(10,kTRUE)); |
1987 | |
1988 | histCalib->Draw(); |
1989 | } |
1990 | |
1991 | |
1992 | } |
1993 | return iResult; |
1994 | } |
ea48ba6e |
1995 | //**************************************************************************** |
1996 | |
cfa641b1 |
1997 | void writeToFile(){ |
1998 | |
cfa641b1 |
1999 | TList * bList = gHomerManager->GetBlockList(); |
2000 | TFile * file = TFile::Open(Form("Event_0x%016X_ITS.root", gHomerManager->GetEventID()), "RECREATE"); |
2001 | bList->Write("blockList", TObject::kSingleKey); |
2002 | file->Close(); |
2003 | |
2004 | bList = gHomerManager->GetAsyncBlockList(); |
2005 | TFile * afile = TFile::Open(Form("Event_0x%016X_Async.root", gHomerManager->GetEventID()), "RECREATE"); |
2006 | bList->Write("blockList", TObject::kSingleKey); |
2007 | afile->Close(); |
2008 | |
2009 | |
2010 | // TIter next(bList); |
2011 | |
2012 | // AliHLTHOMERBlockDesc* block = 0; |
2013 | |
2014 | // // -- Iterate over blocks in the block list |
2015 | // // ------------------------------------------ |
2016 | // while ((block = (AliHLTHOMERBlockDesc*)next())) { |
2017 | // cout << "balle " << endl; |
2018 | // } |
2019 | |
2020 | } |
2021 | |
2022 | |
ea48ba6e |
2023 | // ----------------------------------------------------------------- |
2024 | void loopEvent() { |
2025 | eventTimer.SetCommand("nextEvent()"); |
2026 | eventTimer.Start(6000); |
2027 | } |
2028 | |
2029 | // ----------------------------------------------------------------- |
2030 | void stopLoopEvent() { |
2031 | eventTimer.Stop(); |
2032 | } |
2033 | |
2034 | |
2035 | // ----------------------------------------------------------------- |
2036 | void loopEventFast() { |
2037 | eventTimerFast.SetCommand("nextEvent()"); |
2038 | eventTimerFast.Start(500); |
2039 | } |
2040 | |
2041 | // ----------------------------------------------------------------- |
2042 | void stopLoopEventFast() { |
2043 | eventTimerFast.Stop(); |
2044 | } |
2045 | |
1d8ae8b6 |
2046 | // ----------------------------------------------------------------- |
2047 | void EventLoopFast() { |
2048 | |
2049 | // Start/stop event loop |
2050 | if ( gEventLoopStarted ) { |
2051 | loopEventFast(); |
2052 | gEventLoopStarted = kTRUE; |
cfa641b1 |
2053 | |
2054 | } else { |
1d8ae8b6 |
2055 | stopLoopEventFast(); |
2056 | gEventLoopStarted = kFALSE; |
cfa641b1 |
2057 | |
1d8ae8b6 |
2058 | } |
2059 | } |