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