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