Prepare for the new TPC layout
[u/mrichter/AliRoot.git] / EVE / macros / alieve_online.C
CommitLineData
319f3084 1/**************************************************************************
2 * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
3 * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
4 * full copyright notice. *
5 **************************************************************************/
6
2a6fc1f9 7class TEveProjectionManager;
8class TEveGeoShape;
9class TEveUtil;
e6f9543d 10class AliTriggerAnalysis;
2be6d65c 11class AliSysInfo;
e6f9543d 12
13TH2D* V0StateHistogram;
2a6fc1f9 14
2a6fc1f9 15Bool_t gCenterProjectionsAtPrimaryVertex = kFALSE;
16
de33999e 17void alieve_online_init()
319f3084 18{
89b6d213 19
20 if (gSystem->Getenv("ALICE_ROOT") != 0)
21 {
22 gInterpreter->AddIncludePath(Form("%s/MUON", gSystem->Getenv("ALICE_ROOT")));
23 gInterpreter->AddIncludePath(Form("%s/MUON/mapping", gSystem->Getenv("ALICE_ROOT")));
24 }
25
a9e18d1c 26 TEveUtil::AssertMacro("VizDB_scan.C");
27
06f4984c 28 TEveBrowser *browser = gEve->GetBrowser();
2a6fc1f9 29 browser->ShowCloseTab(kFALSE);
30
3545fba9 31 // Gentle-geom loading changes gGeoManager.
32 TEveGeoManagerHolder mgrRestore;
2a6fc1f9 33
5f4e9982 34 AliEveMultiView *multiView = new AliEveMultiView(kTRUE);
3545fba9 35
36 TEveUtil::LoadMacro("geom_gentle.C");
d2a137c1 37 multiView->InitGeomGentle(geom_gentle(),
9cd7053b 38 geom_gentle_rphi(),
5f4e9982 39 geom_gentle_rhoz(),
9cd7053b 40 geom_gentle_rhoz());
3545fba9 41
e2673345 42 TEveUtil::LoadMacro("geom_gentle_trd.C");
43 multiView->InitGeomGentleTrd(geom_gentle_trd());
44
89b6d213 45 TEveUtil::LoadMacro("geom_gentle_muon.C");
5f4e9982 46 multiView->InitGeomGentleMuon(geom_gentle_muon(), kFALSE, kFALSE, kTRUE);
2a6fc1f9 47
c027b127 48 //============================================================================
49 // Standard macros to execute -- not all are enabled by default.
50 //============================================================================
51
52 AliEveMacroExecutor *exec = AliEveEventManager::GetMaster()->GetExecutor();
53
54 exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX", "primary_vertex.C", "primary_vertex", "", kTRUE));
55 exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Ellipse", "primary_vertex.C", "primary_vertex_ellipse", "", kTRUE));
56 exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Box", "primary_vertex.C", "primary_vertex_box", "kFALSE, 3, 3, 3", kFALSE));
57 exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX", "primary_vertex.C", "primary_vertex_spd", "", kTRUE));
58 exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Ellipse", "primary_vertex.C", "primary_vertex_ellipse_spd", "", kTRUE));
59 exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Box", "primary_vertex.C", "primary_vertex_box_spd", "kFALSE, 3, 3, 3", kFALSE));
60 exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX", "primary_vertex.C", "primary_vertex_tpc", "", kFALSE));
61 exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Ellipse", "primary_vertex.C", "primary_vertex_ellipse_tpc", "", kFALSE));
62 exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Box", "primary_vertex.C", "primary_vertex_box_tpc", "kFALSE, 3, 3, 3", kFALSE));
63
64 exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clus ITS", "its_clusters.C++", "its_clusters"));
65 exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clus TPC", "tpc_clusters.C++", "tpc_clusters"));
72d099dc 66 exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clus TRD", "trd_clusters.C++", "trd_clusters"));
c027b127 67 exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clus TOF", "tof_clusters.C++", "tof_clusters"));
68 exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clus HMPID", "hmpid_clusters.C++", "hmpid_clusters"));
89b6d213 69 exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clus MUON", "muon_clusters.C++", "muon_clusters"));
c027b127 70
2be6d65c 71 exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "DIG EMCAL", "emcal_digits.C++", "emcal_digits"));
c027b127 72
73 exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW ITS", "its_raw.C", "its_raw"));
2be6d65c 74 // exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW TPC", "tpc_raw.C", "tpc_raw"));
c027b127 75 exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW TOF", "tof_raw.C", "tof_raw"));
2608fef9 76 exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW VZERO", "vzero_raw.C", "vzero_raw", "", kFALSE));
c14ef7a5 77 exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW ACORDE", "acorde_raw.C", "acorde_raw", "", kFALSE));
08bc045d 78 exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW MUON", "muon_raw.C++", "muon_raw"));
74155242 79 exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW FMD", "fmd_raw.C", "fmd_raw"));
c027b127 80
2be6d65c 81 exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Track", "esd_tracks.C++", "esd_tracks", "", kFALSE));
82 exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Track", "esd_tracks.C++", "esd_tracks_MI", "", kFALSE));
83 exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Track", "esd_tracks.C++", "esd_tracks_by_category", "", kTRUE));
74155242 84 exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Track MUON", "esd_muon_tracks.C++", "esd_muon_tracks", "kTRUE,kFALSE", kTRUE));
85 exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC FMD", "fmd_esd.C", "fmd_esd", "", kTRUE));
c027b127 86
87 // ???
74155242 88 // exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC TRD", "trd_detectors.C++", "trd_detectors", "", kFALSE));
c027b127 89 // trd_tracks disabled due to memory leaks
90
91 //----------------------------------------------------------------------------
92
93 slot = TEveWindow::CreateWindowInTab(browser->GetTabRight());
94 slot->StartEmbedding();
95 AliEveMacroExecutorWindow* exewin = new AliEveMacroExecutorWindow(exec);
96 slot->StopEmbedding("DataSelection");
97 exewin->PopulateMacros();
98
99 //============================================================================
e6f9543d 100 // VZERO state histogram
101 //============================================================================
102
103 slot = TEveWindow::CreateWindowInTab(browser->GetTabRight());
104 slot->StartEmbedding();
105 TCanvas* pad = new TCanvas();
106
107 gStyle->SetCanvasColor(0);
108
109 V0StateHistogram = new TH2D("V0 Histogram","V0 Trigger State", 4, 0, 4, 4, 0, 4);
110 V0StateHistogram->Draw("colz");
111
112 V0StateHistogram->GetXaxis()->SetBinLabel(1,"V0A Invalid");
113 V0StateHistogram->GetXaxis()->SetBinLabel(2,"V0A Empty");
114 V0StateHistogram->GetXaxis()->SetBinLabel(3,"V0A BB");
115 V0StateHistogram->GetXaxis()->SetBinLabel(4,"V0A BG");
116
117 V0StateHistogram->GetYaxis()->SetBinLabel(1,"V0C Invalid");
118 V0StateHistogram->GetYaxis()->SetBinLabel(2,"V0C Empty");
119 V0StateHistogram->GetYaxis()->SetBinLabel(3,"V0C BB");
120 V0StateHistogram->GetYaxis()->SetBinLabel(4,"V0C BG");
121
122 slot->StopEmbedding("V0 Trigger State");
123
124 //============================================================================
c027b127 125 // Final GUI setup
126 //============================================================================
127
14a4b686 128 browser->GetTabRight()->SetTab(1);
de33999e 129
47aab29b 130 browser->StartEmbedding(TRootBrowser::kBottom);
4d62585e 131 new AliEveEventManagerWindow(AliEveEventManager::GetMaster());
47aab29b 132 browser->StopEmbedding("EventCtrl");
133
06f4984c 134 browser->MoveResize(0, 0, gClient->GetDisplayWidth(),
135 gClient->GetDisplayHeight() - 32);
136
137 gEve->GetViewers()->SwitchColorSet();
138
139 TString autoRun(gSystem->Getenv("ONLINERECO_AUTORUN"));
140 if (autoRun == "1" || autoRun.CompareTo("true", TString::kIgnoreCase) == 0)
141 {
142 AliEveEventManager::GetMaster()->SetAutoLoad(kTRUE);
143 }
144
1110f3fe 145 {
146 TGTab *tab = gEve->GetBrowser()->GetTab(2);
147
148 TGHorizontalFrame *hf = (TGHorizontalFrame*) tab->GetParent();
149 TGVerticalFrame *vf = (TGVerticalFrame*) hf ->GetParent();
150
151 hf->Resize(hf->GetWidth(), hf->GetHeight() + 80);
152 vf->Layout();
153 }
154
5f4e9982 155 gEve->GetWindowManager()->HideAllEveDecorations();
156
2608fef9 157 if(gEve->GetScenes()->FindChild("Geometry scene")->FindChild("Gentle MUON"))
158 {
159 gEve->GetScenes()->FindChild("Geometry scene")->FindChild("Gentle MUON")->SetRnrSelf(kFALSE);
160 gEve->GetScenes()->FindChild("Geometry scene")->FindChild("Gentle MUON")->SetRnrChildren(kFALSE);
161 }
162
163 if(gEve->GetScenes()->FindChild("Muon Geometry")->FindChild("Gentle MUON [P]"))
164 {
165 gEve->GetScenes()->FindChild("Muon Geometry")->FindChild("Gentle MUON [P]")->SetRnrSelf(kTRUE);
166 gEve->GetScenes()->FindChild("Muon Geometry")->FindChild("Gentle MUON [P]")->SetRnrChildren(kTRUE);
167 }
3e6470df 168
5f4e9982 169 gEve->FullRedraw3D(kTRUE);
2608fef9 170
171 TGLViewer *glv1 = multiView->Get3DView()->GetGLViewer();
172 TGLViewer *glv2 = multiView->GetRPhiView()->GetGLViewer();
173 TGLViewer *glv3 = multiView->GetRhoZView()->GetGLViewer();
174
175 glv1->CurrentCamera().RotateRad(-0.4, -1.8);
176 glv2->CurrentCamera().Dolly(450, kFALSE, kFALSE);
177 glv3->CurrentCamera().Dolly(1500, kFALSE, kFALSE);
178
179 gEve->FullRedraw3D();
5f4e9982 180
de33999e 181}
182
9cd7053b 183Int_t g_pic_id = 0;
08bc045d 184Int_t g_pic_max = 100;
9cd7053b 185TTimeStamp g_pic_prev(0, 0);
44854372 186
de33999e 187void alieve_online_on_new_event()
188{
2be6d65c 189 AliSysInfo::AddStamp("on_new_event_start");
e6f9543d 190
e3f0d71c 191 AliTriggerAnalysis atr;
e6f9543d 192
de33999e 193 AliESDEvent* esd = AliEveEventManager::AssertESD();
74155242 194 Double_t x[3] = { 0, 0, 0 };
de33999e 195 esd->GetPrimaryVertex()->GetXYZ(x);
196
197 TEveElement* top = gEve->GetCurrentEvent();
198
d2a137c1 199 AliEveMultiView *multiView = AliEveMultiView::Instance();
200
5f4e9982 201/*
08bc045d 202 TGLViewer *glv = (dynamic_cast<TEveViewer*>(gEve->GetViewers()->FindChild("3D View")))->GetGLViewer();
203
204 if(gEve->GetScenes()->FirstChild()->FindChild("Gentle MUON"))
205 {
206 if (esd->GetNumberOfMuonTracks() == 0 && !gEve->GetKeepEmptyCont())
207 {
208 gEve->GetScenes()->FirstChild()->FindChild("Gentle MUON")->SetRnrChildren(kFALSE);
209
210 if(gEve->GetEventScene()->FirstChild()->FindChild("MUON Clusters"))
211 gEve->GetEventScene()->FirstChild()->FindChild("MUON Clusters")->SetRnrSelf(kFALSE);
212 if(gEve->GetEventScene()->FirstChild()->FindChild("MUON Raw digits"))
213 gEve->GetEventScene()->FirstChild()->FindChild("MUON Raw digits")->SetRnrChildren(kFALSE);
214
215 gEve->FullRedraw3D(kTRUE);
216 glv->CurrentCamera().RotateRad(-0.4, -1.8);
217 }
218 else
219 {
220 gEve->GetScenes()->FirstChild()->FindChild("Gentle MUON")->SetRnrChildren(kTRUE);
221
222 if(gEve->GetEventScene()->FirstChild()->FindChild("MUON Clusters"))
223 gEve->GetEventScene()->FirstChild()->FindChild("MUON Clusters")->SetRnrSelf(kTRUE);
224 if(gEve->GetEventScene()->FirstChild()->FindChild("MUON Raw digits"))
225 gEve->GetEventScene()->FirstChild()->FindChild("MUON Raw digits")->SetRnrChildren(kTRUE);
226
227 gEve->FullRedraw3D(kTRUE);
228 glv->CurrentCamera().RotateRad(-0.4, 1);
229 }
230 }
231
232 glv->DoDraw();
5f4e9982 233*/
e6f9543d 234
e3f0d71c 235 AliTriggerAnalysis::V0Decision decisionV0a =
236 atr.V0Trigger(esd, AliTriggerAnalysis::kASide, kFALSE);
237 AliTriggerAnalysis::V0Decision decisionV0c =
238 atr.V0Trigger(esd, AliTriggerAnalysis::kCSide, kFALSE);
e6f9543d 239
240 Double_t a = 0;
241 Double_t c = 0;
242
e3f0d71c 243 if( decisionV0a == AliTriggerAnalysis::kV0Invalid ) a = 0.5;
244 if( decisionV0a == AliTriggerAnalysis::kV0Empty ) a = 1.5;
245 if( decisionV0a == AliTriggerAnalysis::kV0BB ) a = 2.5;
246 if( decisionV0a == AliTriggerAnalysis::kV0BG ) a = 3.5;
e6f9543d 247
e3f0d71c 248 if( decisionV0c == AliTriggerAnalysis::kV0Invalid ) c = 0.5;
249 if( decisionV0c == AliTriggerAnalysis::kV0Empty ) c = 1.5;
250 if( decisionV0c == AliTriggerAnalysis::kV0BB ) c = 2.5;
251 if( decisionV0c == AliTriggerAnalysis::kV0BG ) c = 3.5;
e6f9543d 252
253 V0StateHistogram->Fill(a,c);
2be6d65c 254 AliSysInfo::AddStamp("on_new_event_after_trig");
e6f9543d 255
2608fef9 256 TGLViewer *glv = multiView->Get3DView()->GetGLViewer();
257 TGLViewer *glv1 = multiView->GetRPhiView()->GetGLViewer();
258 TGLViewer *glv2 = multiView->GetRhoZView()->GetGLViewer();
6aafad45 259
260 Double_t RPhiCameraFrustrumCenter = TMath::Sqrt(glv1->CurrentCamera().FrustumCenter().X()*glv1->CurrentCamera().FrustumCenter().X() + glv1->CurrentCamera().FrustumCenter().Y()*glv1->CurrentCamera().FrustumCenter().Y());
261
262 Double_t RhoZCameraFrustrumCenter = TMath::Sqrt(glv2->CurrentCamera().FrustumCenter().X()*glv2->CurrentCamera().FrustumCenter().X() + glv2->CurrentCamera().FrustumCenter().Y()*glv2->CurrentCamera().FrustumCenter().Y());
263
264 if(RPhiCameraFrustrumCenter > 500 || RhoZCameraFrustrumCenter > 500)
265 {
266
267 glv->ResetCurrentCamera();
6aafad45 268 glv1->ResetCurrentCamera();
269 glv2->ResetCurrentCamera();
270
2608fef9 271 glv->CurrentCamera().RotateRad(-0.4, -1.8);
272 glv1->CurrentCamera().Dolly(450, kFALSE, kFALSE);
273 glv2->CurrentCamera().Dolly(1500, kFALSE, kFALSE);
274
6aafad45 275 gEve->FullRedraw3D();
276
277 }
278
d2a137c1 279 multiView->DestroyEventRPhi();
3545fba9 280 if (gCenterProjectionsAtPrimaryVertex)
d2a137c1 281 multiView->SetCenterRPhi(x[0], x[1], x[2]);
282 multiView->ImportEventRPhi(top);
3545fba9 283
d2a137c1 284 multiView->DestroyEventRhoZ();
3545fba9 285 if (gCenterProjectionsAtPrimaryVertex)
d2a137c1 286 multiView->SetCenterRhoZ(x[0], x[1], x[2]);
287 multiView->ImportEventRhoZ(top);
44854372 288
2be6d65c 289 AliSysInfo::AddStamp("on_new_event_after_rozphi");
290
2608fef9 291 if(multiView->IsMuonView()) { multiView->DestroyEventMuon(); multiView->ImportEventMuon(top); }
292
293 if(gEve->GetScenes()->FindChild("Event scene")->FindChild("Online Event")->FindChild("MUON Clusters"))
294 {
295 gEve->GetScenes()->FindChild("Event scene")->FindChild("Online Event")->FindChild("MUON Clusters")->SetRnrSelf(kFALSE);
296 gEve->GetScenes()->FindChild("Event scene")->FindChild("Online Event")->FindChild("MUON Clusters")->SetRnrChildren(kFALSE);
297 }
298
299 if(gEve->GetScenes()->FindChild("Event scene")->FindChild("Online Event")->FindChild("ESD MUON Clusters"))
300 {
301 gEve->GetScenes()->FindChild("Event scene")->FindChild("Online Event")->FindChild("ESD MUON Clusters")->SetRnrSelf(kFALSE);
302 gEve->GetScenes()->FindChild("Event scene")->FindChild("Online Event")->FindChild("ESD MUON Clusters")->SetRnrChildren(kFALSE);
303 }
304
305 if(gEve->GetScenes()->FindChild("Event scene")->FindChild("Online Event")->FindChild("ESD MUON Tracks"))
306 {
307 gEve->GetScenes()->FindChild("Event scene")->FindChild("Online Event")->FindChild("ESD MUON Tracks")->SetRnrSelf(kFALSE);
308 gEve->GetScenes()->FindChild("Event scene")->FindChild("Online Event")->FindChild("ESD MUON Tracks")->SetRnrChildren(kFALSE);
309 }
310
311 if(gEve->GetScenes()->FindChild("Event scene")->FindChild("Online Event")->FindChild("MUON Raw digits"))
312 {
313 gEve->GetScenes()->FindChild("Event scene")->FindChild("Online Event")->FindChild("MUON Raw digits")->SetRnrSelf(kFALSE);
314 gEve->GetScenes()->FindChild("Event scene")->FindChild("Online Event")->FindChild("MUON Raw digits")->SetRnrChildren(kFALSE);
315 }
316
317 if(gEve->GetScenes()->FindChild("Muon Event Data"))
318 {
319 if(gEve->GetScenes()->FindChild("Muon Event Data")->FindChild("Online Event [P]"))
320 {
321 if(gEve->GetScenes()->FindChild("Muon Event Data")->FindChild("Online Event [P]")->FindChild("MUON Clusters [P]"))
322 {
2be6d65c 323 gEve->GetScenes()->FindChild("Muon Event Data")->FindChild("Online Event [P]")->FindChild("MUON Clusters [P]")->SetRnrSelf(kTRUE);
324 gEve->GetScenes()->FindChild("Muon Event Data")->FindChild("Online Event [P]")->FindChild("MUON Clusters [P]")->SetRnrChildren(kTRUE);
2608fef9 325 }
326
327 if(gEve->GetScenes()->FindChild("Muon Event Data")->FindChild("Online Event [P]")->FindChild("ESD MUON Clusters [P]"))
328 {
2be6d65c 329 gEve->GetScenes()->FindChild("Muon Event Data")->FindChild("Online Event [P]")->FindChild("ESD MUON Clusters [P]")->SetRnrSelf(kTRUE);
330 gEve->GetScenes()->FindChild("Muon Event Data")->FindChild("Online Event [P]")->FindChild("ESD MUON Clusters [P]")->SetRnrChildren(kTRUE);
2608fef9 331 }
332
333 if(gEve->GetScenes()->FindChild("Muon Event Data")->FindChild("Online Event [P]")->FindChild("ESD MUON Tracks [P]"))
334 {
2be6d65c 335 gEve->GetScenes()->FindChild("Muon Event Data")->FindChild("Online Event [P]")->FindChild("ESD MUON Tracks [P]")->SetRnrSelf(kTRUE);
336 gEve->GetScenes()->FindChild("Muon Event Data")->FindChild("Online Event [P]")->FindChild("ESD MUON Tracks [P]")->SetRnrChildren(kTRUE);
2608fef9 337 }
338 }
339 }
340
341 if(gEve->GetScenes()->FindChild("RhoZ Event Data"))
342 {
343 if(gEve->GetScenes()->FindChild("RhoZ Event Data")->FindChild("Online Event [P]"))
344 {
345 if(gEve->GetScenes()->FindChild("RhoZ Event Data")->FindChild("Online Event [P]")->FindChild("FMD [P]"))
346 {
2be6d65c 347 gEve->GetScenes()->FindChild("RhoZ Event Data")->FindChild("Online Event [P]")->FindChild("FMD [P]")->SetRnrSelf(kFALSE);
348 gEve->GetScenes()->FindChild("RhoZ Event Data")->FindChild("Online Event [P]")->FindChild("FMD [P]")->SetRnrChildren(kFALSE);
2608fef9 349 }
350 }
351 }
352
353 if(gEve->GetScenes()->FindChild("RPhi Event Data"))
354 {
355 if(gEve->GetScenes()->FindChild("RPhi Event Data")->FindChild("Online Event [P]"))
356 {
357 if(gEve->GetScenes()->FindChild("RPhi Event Data")->FindChild("Online Event [P]")->FindChild("FMD [P]"))
358 {
359 gEve->GetScenes()->FindChild("RPhi Event Data")->FindChild("Online Event [P]")->FindChild("FMD [P]")->SetRnrSelf(kFALSE);
360 gEve->GetScenes()->FindChild("RPhi Event Data")->FindChild("Online Event [P]")->FindChild("FMD [P]")->SetRnrChildren(kFALSE);
361 }
362 }
363 }
2be6d65c 364 AliSysInfo::AddStamp("on_new_event_after_muon");
2608fef9 365
366 gEve->FullRedraw3D();
5f4e9982 367
9cd7053b 368 // Register image to amore.
2608fef9 369 // const TString pichost("aldaqacrs3");
8da4a930 370 const TString pichost(gEnv->GetValue("AliEve.imageDumpHost", "aldaqacrs3"));
9cd7053b 371 TTimeStamp now;
372 Double_t delta = now.AsDouble() - g_pic_prev.AsDouble();
373
374 printf("Pre image dump: host='%s', delta=%f.\n",
375 gSystem->HostName(), delta);
376
2be6d65c 377 AliSysInfo::AddStamp("on_new_event_pic");
44854372 378 if (pichost == gSystem->HostName() && delta >= 30)
379 {
380 TString id; id.Form("online-viz-%03d", g_pic_id);
381 TString pic(id); pic += ".png";
382
9cd7053b 383 printf("In image dump: file='%s'.\n", pic.Data());
384
44854372 385 gEve->GetBrowser()->RaiseWindow();
386 gEve->FullRedraw3D();
387 gSystem->ProcessEvents();
44854372 388
9cd7053b 389 Int_t status;
390
98043c37 391 // create screenshots from OpenGL views
392 TEveUtil::LoadMacro("saveViews.C+");
393 saveViews(pic.Data());
9cd7053b 394
98043c37 395 // send screenshot to AMORE
9cd7053b 396 status = gSystem->Exec(TString::Format("SendImageToAmore %s %s %d",
397 id.Data(), pic.Data(),
398 AliEveEventManager::AssertRawReader()->GetRunNumber()));
399
400 printf("Post AMORE reg -- status=%d, run=%d.\n", status,
401 AliEveEventManager::AssertRawReader()->GetRunNumber());
44854372 402
403 if (++g_pic_id >= g_pic_max)
404 g_pic_id = 0;
9cd7053b 405 g_pic_prev.Set();
44854372 406 }
2be6d65c 407 AliSysInfo::AddStamp("on_new_event_end");
408
319f3084 409}