Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TProofProgressDialog.cxx
Go to the documentation of this file.
1// @(#)root/sessionviewer:$Id$
2// Author: Fons Rademakers 21/03/03
3
4/*************************************************************************
5 * Copyright (C) 1995-2003, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12
13/** \class TProofProgressDialog
14 \ingroup sessionviewer
15
16This class provides a query progress bar.
17
18*/
19
20
22#include "TProofProgressLog.h"
24#include "TEnv.h"
25#include "TError.h"
26#include "TGLabel.h"
27#include "TGButton.h"
28#include "TGTextEntry.h"
29#include "TGProgressBar.h"
30#include "TGSpeedo.h"
31#include "TProof.h"
32#include "TSlave.h"
33#include "TSystem.h"
34#include "TTimer.h"
35#include "TGraph.h"
36#include "TNtuple.h"
37#include "TCanvas.h"
38#include "TLine.h"
39#include "TAxis.h"
40#include "TPaveText.h"
41#include "TMath.h"
42#include "TH1F.h"
43#include "THLimitsFinder.h"
44#include "TVirtualX.h"
45
46
47#ifdef PPD_SRV_NEWER
48#undef PPD_SRV_NEWER
49#endif
50#define PPD_SRV_NEWER(v) (fProof && fProof->GetRemoteProtocol() > v)
51
55
56//static const Int_t gSVNMemPlot = 25090;
57
59
60////////////////////////////////////////////////////////////////////////////////
61/// Create PROOF processing progress dialog.
62
64 Int_t files, Long64_t first,
65 Long64_t entries) : fDialog(0),
66 fBar(0), fClose(0), fStop(0), fAbort(0), fAsyn(0), fLog(0), fRatePlot(0),
67 fMemPlot(0), fKeepToggle(0), fLogQueryToggle(0), fTextQuery(0), fEntry(0),
68 fTitleLab(0), fFilesEvents(0), fTimeLab(0), fProcessed(0), fEstim(0),
69 fTotal(0), fRate(0), fInit(0), fSelector(0), fSpeedo(0), fSmoothSpeedo(0)
70{
71 fProof = proof;
72 fFiles = files;
73 fFirst = first;
74 fEntries = entries;
76 fPrevTotal = 0;
77 fLogWindow = 0;
78 fMemWindow = 0;
82 fRatePoints = 0;
83 fRateGraph = 0;
84 fMBRtGraph = 0;
85 fActWGraph = 0;
86 fTotSGraph = 0;
87 fEffSGraph = 0;
88 fProcTime = 0.;
89 fInitTime = 0.;
90 fAvgRate = 0.;
91 fAvgMBRate = 0.;
92 fRightInfo = 0;
94 fSpeedo = 0;
95 fUpdtSpeedo = 0;
96 fSmoothSpeedo = 0;
97
98 // Make sure we are attached to a good instance
99 if (!proof || !(proof->IsValid())) {
100 Error("TProofProgressDialog", "proof instance is invalid (%p, %s): protocol error?",
101 proof, (proof && !(proof->IsValid())) ? "invalid" : "undef");
102 return;
103 }
104
105 // Have to save this information here, in case gProof is dead when
106 // the logs are requested
107 fSessionUrl = (proof && proof->GetManager()) ? proof->GetManager()->GetUrl() : "";
108
109 if (PPD_SRV_NEWER(25)) {
110 fRatePoints = new TNtuple("RateNtuple","Rate progress info","tm:evr:mbr:act:tos:efs");
111 } else if (PPD_SRV_NEWER(11)) {
112 fRatePoints = new TNtuple("RateNtuple","Rate progress info","tm:evr:mbr");
113 }
114
115 fDialog = new TGTransientFrame(0, 0, 10, 10);
116 fDialog->Connect("CloseWindow()", "TProofProgressDialog", this, "DoClose()");
119
120//=======================================================================================
121
122 TGHorizontalFrame *hf4 = new TGHorizontalFrame(fDialog, 100, 100);
123
124 TGVerticalFrame *vf4 = new TGVerticalFrame(hf4, 100, 100);
125
126 // Title label
127 TString buf;
128 buf.Form("Executing on PROOF cluster \"%s\" with %d parallel workers:",
129 fProof ? fProof->GetMaster() : "<dummy>",
130 fProof ? fProof->GetParallel() : 0);
131 fTitleLab = new TGLabel(vf4, buf);
133 vf4->AddFrame(fTitleLab, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 10, 10, 5, 0));
134 buf.Form("Selector: %s", selector);
135 fSelector = new TGLabel(vf4, buf);
137 vf4->AddFrame(fSelector, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 10, 10, 5, 0));
138 buf.Form("%d files, number of events %lld, starting event %lld",
140 fFilesEvents = new TGLabel(vf4, buf);
143
144 // Progress bar
146 fBar->SetBarColor("green");
150 kLHintsExpandX, 10, 10, 5, 5));
151
152 // Status labels
153 if (PPD_SRV_NEWER(11)) {
154 TGHorizontalFrame *hf0 = new TGHorizontalFrame(vf4, 0, 0);
155 TGCompositeFrame *cf0 = new TGCompositeFrame(hf0, 110, 0, kFixedWidth);
156 cf0->AddFrame(new TGLabel(cf0, "Initialization time:"));
157 hf0->AddFrame(cf0);
158 fInit = new TGLabel(hf0, "- secs");
160 hf0->AddFrame(fInit, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 10, 10, 0, 0));
161 vf4->AddFrame(hf0, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 10, 10, 5, 0));
162 }
163
164 TGHorizontalFrame *hf1 = new TGHorizontalFrame(vf4, 0, 0);
165 TGCompositeFrame *cf1 = new TGCompositeFrame(hf1, 110, 0, kFixedWidth);
166 fTimeLab = new TGLabel(cf1, "Estimated time left:");
169 hf1->AddFrame(cf1);
170 fEstim = new TGLabel(hf1, "- sec");
172 hf1->AddFrame(fEstim, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 10, 10, 0, 0));
173 vf4->AddFrame(hf1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 10, 10, 5, 0));
174
175 hf1 = new TGHorizontalFrame(vf4, 0, 0);
176 cf1 = new TGCompositeFrame(hf1, 110, 0, kFixedWidth);
177 fProcessed = new TGLabel(cf1, "Processing status:");
180 hf1->AddFrame(cf1);
181 fTotal= new TGLabel(hf1, "- / - events");
183 hf1->AddFrame(fTotal, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 10, 10, 0, 0));
184
185 vf4->AddFrame(hf1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 10, 10, 5, 0));
186
187 TGHorizontalFrame *hf2 = new TGHorizontalFrame(vf4, 0, 0);
188 TGCompositeFrame *cf2 = new TGCompositeFrame(hf2, 110, 0, kFixedWidth);
189 cf2->AddFrame(new TGLabel(cf2, "Processing rate:"));
190 hf2->AddFrame(cf2);
191 fRate = new TGLabel(hf2, "- events/sec \n");
193 hf2->AddFrame(fRate, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 10, 10, 0, 0));
194 vf4->AddFrame(hf2, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 10, 10, 5, 0));
195
196 // Keep toggle button
197 fKeepToggle = new TGCheckButton(vf4,
198 new TGHotString("Close dialog when processing is complete"));
200 fKeepToggle->Connect("Toggled(Bool_t)",
201 "TProofProgressDialog", this, "DoKeep(Bool_t)");
202 vf4->AddFrame(fKeepToggle, new TGLayoutHints(kLHintsBottom, 10, 10, 10, 5));
203
205
206 TGVerticalFrame *vf51 = new TGVerticalFrame(hf4, 20, 20);
207
208 Int_t enablespeedo = gEnv->GetValue("Proof.EnableSpeedo", 0);
209 if (enablespeedo) fSpeedoEnabled = kTRUE;
210
211 fSpeedo = new TGSpeedo(vf51, 0.0, 1.0, "", " Ev/s");
212 if (fSpeedoEnabled) {
213 fSpeedo->Connect("OdoClicked()", "TProofProgressDialog", this, "ToggleOdometerInfos()");
214 fSpeedo->Connect("LedClicked()", "TProofProgressDialog", this, "ToggleThreshold()");
215 }
216 vf51->AddFrame(fSpeedo);
217 fSpeedo->SetDisplayText("Init Time", "[ms]");
219 fSpeedo->SetThresholds(0.0, 25.0, 50.0);
223
224 fSmoothSpeedo = new TGCheckButton(vf51, new TGHotString("Smooth speedometer update"));
225 if (fSpeedoEnabled) {
227 fSmoothSpeedo->SetToolTipText("Control smoothness in refreshing the speedo");
228 } else {
229 fSmoothSpeedo->SetToolTipText("Speedo refreshing is disabled");
231 }
233
234 hf4->AddFrame(vf51, new TGLayoutHints(kLHintsBottom, 5, 5, 5, 5));
235
236 fDialog->AddFrame(hf4, new TGLayoutHints(kLHintsTop | kLHintsExpandX, 5, 5, 5, 5));
237
238//==========================================================================================
239
240 // Stop, cancel and close buttons
241 TGHorizontalFrame *hf3 = new TGHorizontalFrame(fDialog, 60, 20);
242
243 fAsyn = new TGTextButton(hf3, "&Run in background");
244 if (fProof->GetRemoteProtocol() >= 22 && fProof->IsSync()) {
245 fAsyn->SetToolTipText("Continue running in the background (asynchronous mode), releasing the ROOT prompt");
246 } else {
247 fAsyn->SetToolTipText("Switch to asynchronous mode disabled: functionality not supported by the server");
249 }
250 fAsyn->Connect("Clicked()", "TProofProgressDialog", this, "DoAsyn()");
251 hf3->AddFrame(fAsyn, new TGLayoutHints(kLHintsCenterY | kLHintsExpandX, 7, 7, 0, 0));
252
253 fStop = new TGTextButton(hf3, "&Stop");
254 fStop->SetToolTipText("Stop processing, Terminate() will be executed");
255 fStop->Connect("Clicked()", "TProofProgressDialog", this, "DoStop()");
256 hf3->AddFrame(fStop, new TGLayoutHints(kLHintsCenterY | kLHintsExpandX, 7, 7, 0, 0));
257
258 fAbort = new TGTextButton(hf3, "&Cancel");
259 fAbort->SetToolTipText("Cancel processing, Terminate() will NOT be executed");
260 fAbort->Connect("Clicked()", "TProofProgressDialog", this, "DoAbort()");
262
263 fClose = new TGTextButton(hf3, "&Close");
264 fClose->SetToolTipText("Close this dialog");
266 fClose->Connect("Clicked()", "TProofProgressDialog", this, "DoClose()");
268
270
271 TGHorizontalFrame *hf5 = new TGHorizontalFrame(fDialog, 60, 20);
272
273 fLog = new TGTextButton(hf5, "&Show Logs");
274 fLog->SetToolTipText("Show query log messages");
275 fLog->Connect("Clicked()", "TProofProgressDialog", this, "DoLog()");
276 hf5->AddFrame(fLog, new TGLayoutHints(kLHintsCenterY | kLHintsExpandX, 7, 7, 0, 0));
277
278 if (PPD_SRV_NEWER(11)) {
279 fRatePlot = new TGTextButton(hf5, "&Performance plot");
280 fRatePlot->SetToolTipText("Show rates, chunck sizes, cluster activities ... vs time");
282 fRatePlot->Connect("Clicked()", "TProofProgressDialog", this, "DoPlotRateGraph()");
284 }
285
286 fMemPlot = new TGTextButton(hf5, "&Memory Plot");
287 fMemPlot->Connect("Clicked()", "TProofProgressDialog", this, "DoMemoryPlot()");
288 fMemPlot->SetToolTipText("Show memory consumption vs entry / merging phase");
290
291 fUpdtSpeedo = new TGTextButton(hf5, "&Enable speedometer");
292 fUpdtSpeedo->Connect("Clicked()", "TProofProgressDialog", this, "DoEnableSpeedo()");
293 if (fSpeedoEnabled) {
294 fUpdtSpeedo->ChangeText("&Disable speedometer");
295 fUpdtSpeedo->SetToolTipText("Disable speedometer");
296 } else {
297 fUpdtSpeedo->ChangeText("&Enable speedometer");
298 fUpdtSpeedo->SetToolTipText("Enable speedometer (may have an impact on performance)");
299 }
301
303
304 // Only enable if master supports it
305 if (!PPD_SRV_NEWER(18)) {
307 TString tip = TString::Format("Not supported by the master: required protocol 19 > %d",
308 (fProof ? fProof->GetRemoteProtocol() : -1));
310 } else {
311 fMemPlot->SetToolTipText("Show memory consumption");
312 }
313
314 // Connect slot to proof progress signal
315 if (fProof) {
316 fProof->Connect("Progress(Long64_t,Long64_t)", "TProofProgressDialog",
317 this, "Progress(Long64_t,Long64_t)");
318 fProof->Connect("Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)",
319 "TProofProgressDialog", this,
320 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)");
321 fProof->Connect("Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t,Int_t,Int_t,Float_t)",
322 "TProofProgressDialog", this,
323 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t,Int_t,Int_t,Float_t)");
324 fProof->Connect("StopProcess(Bool_t)", "TProofProgressDialog", this,
325 "IndicateStop(Bool_t)");
326 fProof->Connect("ResetProgressDialog(const char*,Int_t,Long64_t,Long64_t)",
327 "TProofProgressDialog", this,
328 "ResetProgressDialog(const char*,Int_t,Long64_t,Long64_t)");
329 fProof->Connect("CloseProgressDialog()", "TProofProgressDialog", this, "DoClose()");
330 fProof->Connect("DisableGoAsyn()", "TProofProgressDialog", this, "DisableAsyn()");
331 }
332
333 // Set dialog title
334 if (fProof) {
335 if (strlen(fProof->GetUser()) > 0)
336 fDialog->SetWindowName(Form("PROOF Query Progress: %s@%s",
338 else
339 fDialog->SetWindowName(Form("PROOF Query Progress: %s", fProof->GetMaster()));
340 } else
341 fDialog->SetWindowName("PROOF Query Progress: <dummy>");
342
343 // Map all widgets and calculate size of dialog
345
347
348 const TGWindow *main = gClient->GetRoot();
349 // Position relative to the parent window (which is the root window)
350 Window_t wdum;
351 int ax, ay;
352 Int_t mw = ((TGFrame *) main)->GetWidth();
353 Int_t mh = ((TGFrame *) main)->GetHeight();
356
357 gVirtualX->TranslateCoordinates(main->GetId(), main->GetId(),
358 (mw - width), (mh - height) >> 1, ax, ay, wdum);
359
360 // Make the message box non-resizable
363
369
370 fDialog->Move(ax-10, ay - mh/4);
371 fDialog->SetWMPosition(ax-10, ay - mh/4);
372 // Popup dialog and wait till user replies
374
376}
377
378////////////////////////////////////////////////////////////////////////////////
379/// Toggle information displayed in Analog Meter
380
382{
383 if (fRightInfo < 1)
384 fRightInfo++;
385 else
386 fRightInfo = 0;
387 if (fRightInfo == 0) {
388 fSpeedo->SetDisplayText("Init Time", "[ms]");
389 fSpeedo->SetOdoValue((Int_t)(fInitTime * 1000.0));
390 }
391 else if (fRightInfo == 1) {
392 fSpeedo->SetDisplayText("Proc Time", "[ms]");
393 fSpeedo->SetOdoValue((Int_t)(fProcTime * 1000.0));
394 }
395}
396
397////////////////////////////////////////////////////////////////////////////////
398
400{
401 if (fSpeedo->IsThresholdActive()) {
404 }
405 else
407}
408
409////////////////////////////////////////////////////////////////////////////////
410/// Reset dialog box preparing for new query
411
413 Int_t files, Long64_t first,
414 Long64_t entries)
415{
416 TString buf;
417
418 // Update title
419 buf.Form("Executing on PROOF cluster \"%s\" with %d parallel workers:",
420 fProof ? fProof->GetMaster() : "<dummy>",
421 fProof ? fProof->GetParallel() : 0);
422 fTitleLab->SetText(buf);
423
424 // Reset members
425 fFiles = files;
426 fFirst = first;
427 fEntries = entries;
428 fPrevProcessed = 0;
429 fPrevTotal = 0;
431
432 // Update selector name
433 buf.Form("Selector: %s", selec);
434 fSelector->SetText(buf);
435
436 // Reset 'estim' and 'processed' text
437 fTimeLab->SetText("Estimated time left:");
438 fProcessed->SetText("Processing status:");
439
440 // Update numbers
441 buf.Form("%d files, number of events %lld, starting event %lld",
443 fFilesEvents->SetText(buf);
444
445 // Reset progress bar
446 fBar->SetBarColor("green");
447 fBar->Reset();
448
449 // Reset speedo
450 fSpeedo->SetMinMaxScale(0.0, 1.0);
451 fSpeedo->SetMeanValue(0.0);
453
454 // Reset buttons
458 if (fProof && fProof->IsSync() && fProof->GetRemoteProtocol() >= 22) {
460 } else {
462 }
463
464 // Reconnect the slots
465 if (fProof) {
466 fProof->Connect("Progress(Long64_t,Long64_t)", "TProofProgressDialog",
467 this, "Progress(Long64_t,Long64_t)");
468 fProof->Connect("Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)",
469 "TProofProgressDialog", this,
470 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)");
471 fProof->Connect("Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t,Int_t,Int_t,Float_t)",
472 "TProofProgressDialog", this,
473 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t,Int_t,Int_t,Float_t)");
474 fProof->Connect("StopProcess(Bool_t)", "TProofProgressDialog", this,
475 "IndicateStop(Bool_t)");
476 fProof->Connect("DisableGoAsyn()", "TProofProgressDialog", this, "DisableAsyn()");
477 }
478
479 // Reset start time
481
482 // Clear the list of performances points
483 if (PPD_SRV_NEWER(11))
490 fAvgRate = 0.;
491 fAvgMBRate = 0.;
492}
493
494////////////////////////////////////////////////////////////////////////////////
495/// Update progress bar and status labels.
496/// Use "processed == total" or "processed < 0" to indicate end of processing.
497
499{
500 Long_t tt;
501 UInt_t hh=0, mm=0, ss=0;
502 TString buf;
503 TString stm;
504 static const char *cproc[] = { "running", "done",
505 "STOPPED", "ABORTED", "***EVENTS SKIPPED***"};
506
507 // Update title
508 buf.Form("Executing on PROOF cluster \"%s\" with %d parallel workers:",
509 fProof ? fProof->GetMaster() : "<dummy>",
510 fProof ? fProof->GetParallel() : 0);
511 fTitleLab->SetText(buf);
512
513 if (total < 0)
515 else
517
518 // Nothing to update
519 if (fPrevProcessed == processed)
520 return;
521
522 // Number of processed events
523 Long64_t evproc = (processed >= 0) ? processed : fPrevProcessed;
524
525 if (fEntries != total) {
526 fEntries = total;
527 buf.Form("%d files, number of events %lld, starting event %lld",
529 fFilesEvents->SetText(buf);
530 }
531
532 // Update position
533 Float_t pos = Float_t(Double_t(evproc * 100)/Double_t(total));
534 fBar->SetPosition(pos);
535
536 // get current time
537 fEndTime = gSystem->Now();
538 TTime tdiff = fEndTime - fStartTime;
539 Float_t eta = 0;
540 if (evproc > 0)
541 eta = ((Float_t)((Long64_t)tdiff)*total/Float_t(evproc) - Long64_t(tdiff))/1000.;
542
543 if (processed >= 0 && processed >= total) {
544 tt = (Long_t)Long64_t(tdiff)/1000;
545 if (tt > 0) {
546 hh = (UInt_t)(tt / 3600);
547 mm = (UInt_t)((tt % 3600) / 60);
548 ss = (UInt_t)((tt % 3600) % 60);
549 }
550 if (hh)
551 stm.Form("%d h %d min %d sec", hh, mm, ss);
552 else if (mm)
553 stm.Form("%d min %d sec", mm, ss);
554 else
555 stm.Form("%d sec", ss);
556 fProcessed->SetText("Processed:");
557 buf.Form("%lld events in %s\n", total, stm.Data());
558 fTotal->SetText(buf);
559
560 fEstim->SetText("0 sec");
561
562 if (fProof) {
563 fProof->Disconnect("Progress(Long64_t,Long64_t)", this,
564 "Progress(Long64_t,Long64_t)");
565 fProof->Disconnect("StopProcess(Bool_t)", this,
566 "IndicateStop(Bool_t)");
567 fProof->Disconnect("DisableGoAsyn()", this, "DisableAsyn()");
568 }
569
570 // Set button state
575 if (!fKeep) DoClose();
576
577 // Set the status to done
578 fStatus = kDone;
579
580 } else {
581 // A negative value for process indicates that we are finished,
582 // no matter whether the processing was complete
583 Bool_t incomplete = (processed < 0 &&
585 ? kTRUE : kFALSE;
586 if (incomplete) {
588 // We use a different color to highlight incompletion
589 fBar->SetBarColor("magenta");
590 }
591 tt = (Long_t)eta;
592 if (tt > 0) {
593 hh = (UInt_t)(tt / 3600);
594 mm = (UInt_t)((tt % 3600) / 60);
595 ss = (UInt_t)((tt % 3600) % 60);
596 }
597 if (hh)
598 stm.Form("%d h %d min %d sec", hh, mm, ss);
599 else if (mm)
600 stm.Form("%d min %d sec", mm, ss);
601 else
602 stm.Form("%d sec", ss);
603
604 fEstim->SetText(stm.Data());
605 buf.Form("%lld / %lld events", evproc, total);
606 if (fStatus > kDone) {
607 buf += TString::Format(" - %s", cproc[fStatus]);
608 }
609 fTotal->SetText(buf);
610
611 buf.Form("%.1f events/sec\n", Float_t(evproc)/Long64_t(tdiff)*1000.);
612 fRate->SetText(buf);
613
614 if (processed < 0) {
615 // And we disable the buttons
620
621 // Set the status to done
622 fStatus = kDone;
623 }
624 }
625 fPrevProcessed = evproc;
626}
627
628////////////////////////////////////////////////////////////////////////////////
629/// Update progress bar and status labels.
630/// Use "processed == total" or "processed < 0" to indicate end of processing.
631
633 Long64_t bytesread,
634 Float_t initTime, Float_t procTime,
635 Float_t evtrti, Float_t mbrti,
636 Int_t actw, Int_t tses, Float_t eses)
637{
638 Double_t BinLow, BinHigh;
639 Int_t nbins;
640 Long_t tt;
641 UInt_t hh=0, mm=0, ss=0;
642 TString buf;
643 TString stm;
644 static const char *cproc[] = { "running", "done",
645 "STOPPED", "ABORTED", "***EVENTS SKIPPED***"};
646
647 // Update title
648 buf.Form("Executing on PROOF cluster \"%s\" with %d parallel workers:",
649 fProof ? fProof->GetMaster() : "<dummy>",
650 fProof ? fProof->GetParallel() : 0);
651 fTitleLab->SetText(buf);
652
653 if (gDebug > 1)
654 Info("Progress","t: %lld, p: %lld, itm: %f, ptm: %f", total, processed, initTime, procTime);
655
656 if (initTime >= 0.) {
657 // Set init time
658 fInitTime = initTime;
659 buf.Form("%.1f secs", initTime);
660 fInit->SetText(buf);
661 if (fSpeedoEnabled && fRightInfo == 0)
662 fSpeedo->SetOdoValue((Int_t)(fInitTime * 1000.0));
663 }
664
665 Bool_t over = kFALSE;
666 if (total < 0) {
668 over = kTRUE;
669 } else {
671 }
672
673 // Show proc time by default when switching from init to proc
674 if (processed > 0 && fPrevProcessed <= 0)
675 while (fRightInfo != 1)
677
678 // Nothing to update
679 if (fPrevProcessed == processed)
680 return;
681
682 // Number of processed events
683 Long64_t evproc = (processed >= 0) ? processed : fPrevProcessed;
684 Float_t mbsproc = bytesread / TMath::Power(2.,20.);
685
686 if (fEntries != total) {
687 fEntries = total;
688 buf.Form("%d files, number of events %lld, starting event %lld",
690 fFilesEvents->SetText(buf);
691 }
692
693 // Update position
694 Float_t pos = Float_t(Double_t(evproc * 100)/Double_t(total));
695 fBar->SetPosition(pos);
696
697 Float_t eta = 0;
698 if (evproc > 0 && procTime > 0.)
699 eta = (Float_t) (total - evproc) / (Double_t)evproc * procTime;
700
701 // Update average rates
702 if (procTime > 0.) {
703 fProcTime = procTime;
704 fAvgRate = Float_t(evproc) / procTime;
705 fAvgMBRate = mbsproc / procTime;
706 }
707
708 if (fSpeedoEnabled) {
709 if (fRightInfo == 0)
710 fSpeedo->SetOdoValue((Int_t)(fInitTime * 1000.0));
711 else if (fRightInfo == 1)
712 fSpeedo->SetOdoValue((Int_t)(fProcTime * 1000.0));
713 }
714
715 if (over || (processed >= 0 && processed >= total)) {
716
717 // A negative value for process indicates that we are finished,
718 // no matter whether the processing was complete
719 Bool_t incomplete = (processed < 0 &&
721 ? kTRUE : kFALSE;
722 TString st = "";
723 if (incomplete) {
725 // We use a different color to highlight incompletion
726 fBar->SetBarColor("magenta");
727 st = TString::Format(" %s", cproc[fStatus]);
728 }
729
731 if (tt > 0) {
732 hh = (UInt_t)(tt / 3600);
733 mm = (UInt_t)((tt % 3600) / 60);
734 ss = (UInt_t)((tt % 3600) % 60);
735 }
736 if (hh)
737 stm.Form("%d h %d min %d sec", hh, mm, ss);
738 else if (mm)
739 stm.Form("%d min %d sec", mm, ss);
740 else
741 stm.Form("%d sec", ss);
742 fProcessed->SetText("Processed:");
743 TString sf("MB");
745 xb = AdjustBytes(xb, sf);
746 buf.Form("%lld events (%.2f %s)\n",
747 std::max(fPrevProcessed, processed), xb, sf.Data());
748 fTotal->SetText(buf);
749 buf.Form("%s %s\n", stm.Data(), st.Data());
750 fTimeLab->SetText("Processing time:");
751 fEstim->SetText(buf);
752 buf.Form("%.1f evts/sec (%.1f MB/sec)\n", fAvgRate, fAvgMBRate);
753 fRate->SetText(buf);
754 // Fill rate graph
755 Bool_t useAvg = gEnv->GetValue("Proof.RatePlotUseAvg", 0);
756 if (useAvg) {
757 if (fAvgRate > 0.) {
758 fRatePoints->Fill(procTime, fAvgRate, fAvgMBRate);
760 }
761 } else {
762 if (evtrti > 0.) {
763 fRatePoints->Fill(procTime, evtrti, mbrti, (Float_t)actw, (Float_t)tses, eses);
765 }
766 }
767
768 if (fProof) {
769 fProof->Disconnect("Progress(Long64_t,Long64_t)", this,
770 "Progress(Long64_t,Long64_t)");
771 fProof->Disconnect("Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)",
772 this,
773 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)");
774 fProof->Disconnect("Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t,Int_t,Int_t,Float_t)",
775 this,
776 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t,Int_t,Int_t,Float_t)");
777 fProof->Disconnect("StopProcess(Bool_t)", this, "IndicateStop(Bool_t)");
778 fProof->Disconnect("DisableGoAsyn()", this, "DisableAsyn()");
779 }
780
781 // Set button state
786
788 fSpeedo->SetScaleValue(0.0, 0);
789 else
792
793 if (!fKeep) DoClose();
794
795 // Set the status to done
796 fStatus = kDone;
797
798 } else {
799 // A negative value for process indicates that we are finished,
800 // no matter whether the processing was complete
801 Bool_t incomplete = (processed < 0 &&
803 ? kTRUE : kFALSE;
804 if (incomplete) {
806 // We use a different color to highlight incompletion
807 fBar->SetBarColor("magenta");
808 }
809 tt = (Long_t)eta;
810 if (tt > 0) {
811 hh = (UInt_t)(tt / 3600);
812 mm = (UInt_t)((tt % 3600) / 60);
813 ss = (UInt_t)((tt % 3600) % 60);
814 }
815 if (hh)
816 stm.Form("%d h %d min %d sec", hh, mm, ss);
817 else if (mm)
818 stm.Form("%d min %d sec", mm, ss);
819 else
820 stm.Form("%d sec", ss);
821
822 fEstim->SetText(stm.Data());
823 TString sf("MB");
824 Float_t xb = AdjustBytes(mbsproc, sf);
825 buf.Form("%lld / %lld events - %.2f %s", evproc, total, xb, sf.Data());
826 if (fStatus > kDone) {
827 buf += TString::Format(" - %s", cproc[fStatus]);
828 }
829 fTotal->SetText(buf);
830
831 // Post
832 if (evtrti > 0.) {
833 buf.Form("%.1f evts/sec \navg: %.1f evts/sec (%.1f MB/sec)",
834 evtrti, fAvgRate, fAvgMBRate);
835 fRatePoints->Fill(procTime, evtrti, mbrti, (Float_t)actw, (Float_t)tses, eses);
837 if (fSpeedoEnabled) {
838 if (evtrti > fSpeedo->GetScaleMax()) {
839 nbins = 4;
840 BinLow = fSpeedo->GetScaleMin();
841 BinHigh = 1.5 * evtrti;
842 THLimitsFinder::OptimizeLimits(4, nbins, BinLow, BinHigh, kFALSE);
844 }
846 fSpeedo->SetScaleValue(evtrti, 0);
847 else
848 fSpeedo->SetScaleValue(evtrti);
850 }
851 } else {
852 buf.Form("avg: %.1f evts/sec (%.1f MB/sec)", fAvgRate, fAvgMBRate);
853 }
854 fRate->SetText(buf);
855
856 if (processed < 0) {
857 // And we disable the buttons
862
863 if (fSpeedoEnabled) {
865 fSpeedo->SetScaleValue(0.0, 0);
866 else
869 }
870
871 // Set the status to done
872 fStatus = kDone;
873 }
874 }
875 fPrevProcessed = evproc;
876}
877
878////////////////////////////////////////////////////////////////////////////////
879/// Transform MBs to GBs ot TBs and get the correct suffix
880
882{
883 Float_t xb = mbs;
884 sf = "MB";
885 if (xb > 1024.) {
886 xb = xb / 1024.;
887 sf = "GB";
888 }
889 if (xb > 1024.) {
890 xb = xb / 1024.;
891 sf = "TB";
892 }
893 // Done
894 return xb;
895}
896
897////////////////////////////////////////////////////////////////////////////////
898/// Cleanup dialog.
899
901{
902 if (fProof) {
903 fProof->Disconnect("Progress(Long64_t,Long64_t)", this,
904 "Progress(Long64_t,Long64_t)");
905 fProof->Disconnect("Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)",
906 this,
907 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)");
908 fProof->Disconnect("Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t,Int_t,Int_t,Float_t)",
909 this,
910 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t,Int_t,Int_t,Float_t)");
911 fProof->Disconnect("StopProcess(Bool_t)", this, "IndicateStop(Bool_t)");
912 fProof->Disconnect("DisableGoAsyn()", this, "DisableAsyn()");
913 fProof->Disconnect("ResetProgressDialog(const char*,Int_t,Long64_t,Long64_t)",
914 this,
915 "ResetProgressDialog(const char*,Int_t,Long64_t,Long64_t)");
916 fProof->Disconnect("CloseProgressDialog()", this, "CloseProgressDialog()");
918 // We are called after a TProofDetach: we delete the instance
919 if (!fProof->IsValid())
921 }
922 if (fLogWindow)
923 delete fLogWindow;
924 if (fMemWindow)
925 delete fMemWindow;
926 fDialog->Cleanup();
927 delete fDialog;
928}
929
930////////////////////////////////////////////////////////////////////////////////
931/// Called when dialog is closed.
932
934{
935 delete this;
936}
937
938////////////////////////////////////////////////////////////////////////////////
939/// Disable the asyn switch when an external request for going asynchronous is issued
940
942{
943 fProof->Disconnect("DisableGoAsyn()", this, "DisableAsyn()");
945}
946
947////////////////////////////////////////////////////////////////////////////////
948/// Indicate that Cancel or Stop was clicked.
949
951{
952 if (aborted == kTRUE)
953 fBar->SetBarColor("red");
954 else
955 fBar->SetBarColor("yellow");
956
957 if (fProof) {
958 fProof->Disconnect("Progress(Long64_t,Long64_t)", this,
959 "Progress(Long64_t,Long64_t)");
960 fProof->Disconnect("Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)",
961 this,
962 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)");
963 fProof->Disconnect("Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t,Int_t,Int_t,Float_t)",
964 this,
965 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t,Int_t,Int_t,Float_t)");
966 fProof->Disconnect("StopProcess(Bool_t)", this, "IndicateStop(Bool_t)");
967 fProof->Disconnect("DisableGoAsyn()", this, "DisableAsyn()");
968 // These buttons are meaningless at this point
972 }
973
975 if (!fKeep)
976 DoClose();
977}
978
979////////////////////////////////////////////////////////////////////////////////
980/// Load/append a log msg in the log frame, if open
981
982void TProofProgressDialog::LogMessage(const char *msg, Bool_t all)
983{
984 if (fLogWindow) {
985 if (all) {
986 // load buffer
988 } else {
989 // append
990 fLogWindow->AddBuffer(msg);
991 }
992 }
993}
994
995////////////////////////////////////////////////////////////////////////////////
996/// Close dialog.
997
999{
1001 TTimer::SingleShot(50, "TProofProgressDialog", this, "CloseWindow()");
1002}
1003
1004////////////////////////////////////////////////////////////////////////////////
1005/// Ask proof session for logs
1006
1008{
1009 if (fProof) {
1010 if (!fLogWindow) {
1011 fLogWindow = new TProofProgressLog(this);
1013 fLogWindow->DoLog();
1014 } else {
1015 // Clear window
1017 fLogWindow->Clear();
1018 fLogWindow->DoLog();
1019 }
1020 }
1021 }
1022}
1023
1024////////////////////////////////////////////////////////////////////////////////
1025/// Handle keep toggle button.
1026
1028{
1029 fKeep = !fKeep;
1030
1031 // Last choice will be the default for the future
1033}
1034
1035////////////////////////////////////////////////////////////////////////////////
1036/// Handle log-current-query-only toggle button.
1037
1039{
1042 if (fLogQuery)
1043 fEntry->SetToolTipText("Enter the query number ('last' for the last query)",50);
1044 else
1046
1047 // Last choice will be the default for the future
1049}
1050
1051////////////////////////////////////////////////////////////////////////////////
1052/// Handle Stop button.
1053
1055{
1056 // Do not wait for ever, but al least 10 seconds
1057 Long_t timeout = gEnv->GetValue("Proof.ShutdownTimeout", 60) / 2;
1058 timeout = (timeout > 10) ? timeout : 10;
1059 fProof->StopProcess(kFALSE, timeout);
1060 fStatus = kStopped;
1061
1062 // Set buttons states
1067}
1068
1069////////////////////////////////////////////////////////////////////////////////
1070/// Handle Cancel button.
1071
1073{
1075 fStatus = kAborted;
1076
1077 // Set buttons states
1082}
1083
1084////////////////////////////////////////////////////////////////////////////////
1085/// Handle Asyn button.
1086
1088{
1090
1091 // Set buttons states
1093}
1094
1095////////////////////////////////////////////////////////////////////////////////
1096/// Handle Plot Rate Graph.
1097
1099{
1100 // We must have some point to plot
1101 if (!fRatePoints || fRatePoints->GetEntries() <= 0) {
1102 Info("DoPlotRateGraph","list is empty!");
1103 return;
1104 }
1105
1106 // Fill the graphs
1108 Double_t eymx = -1., bymx = -1., wymx = -1., tymx=-1., symx = -1.;
1114 fRateGraph = new TGraph(np);
1115 fMBRtGraph = new TGraph(np);
1116 if (PPD_SRV_NEWER(25)) {
1117 fActWGraph = new TGraph(np);
1118 fTotSGraph = new TGraph(np);
1119 fEffSGraph = new TGraph(np);
1120 }
1121 Float_t *nar = fRatePoints->GetArgs();
1122 Int_t ii = 0;
1123 for ( ; ii < np; ++ii) {
1124 fRatePoints->GetEntry(ii);
1125 if (!(nar[1] > 0.)) continue;
1126 // Evts/s
1127 fRateGraph->SetPoint(ii, (Double_t) nar[0], (Double_t) nar[1]);
1128 eymx = (nar[1] > eymx) ? nar[1] : eymx;
1129 // MBs/s
1130 fMBRtGraph->SetPoint(ii, (Double_t) nar[0], (Double_t) nar[2]);
1131 bymx = (nar[2] > bymx) ? nar[2] : bymx;
1132 // Active workers
1133 if (PPD_SRV_NEWER(25)) {
1134 fActWGraph->SetPoint(ii, (Double_t) nar[0], (Double_t) nar[3]);
1135 wymx = (nar[3] > wymx) ? nar[3] : wymx;
1136 }
1137 // Sessions info
1138 if (PPD_SRV_NEWER(25)) {
1139 fTotSGraph->SetPoint(ii, (Double_t) nar[0], (Double_t) nar[4]);
1140 tymx = (nar[4] > tymx) ? nar[4] : tymx;
1141 fEffSGraph->SetPoint(ii, (Double_t) nar[0], (Double_t) nar[5]);
1142 symx = (nar[5] > symx) ? nar[5] : symx;
1143 }
1144 }
1145
1146 // Pad numbering
1147 Int_t npads = 4;
1148 Int_t kEvrt = 1;
1149 Int_t kMBrt = 2;
1150 Int_t kActW = 3;
1151 Int_t kSess = 4;
1152 if (bymx <= 0.) {
1154 npads--;
1155 kActW--;
1156 kSess--;
1157 }
1158 if (wymx <= 0.) {
1160 npads--;
1161 kSess--;
1162 }
1163 // Plot only if more than one active session during the query
1164 if (tymx <= 1.) {
1167 npads--;
1168 kSess--;
1169 }
1170 if (tymx <= 0.) SafeDelete(fTotSGraph);
1171 if (symx <= 0.) SafeDelete(fEffSGraph);
1172
1173 // Create a canvas
1174 Int_t jsz = 200*npads;
1175 TCanvas *c1 = new TCanvas("c1","Rate vs Time",200,10,700,jsz);
1176 c1->SetFillColor(0);
1177 c1->SetGrid();
1178 c1->SetBorderMode(0);
1179 c1->SetFrameBorderMode(0);
1180
1181 // Padding
1182 c1->Divide(1, npads);
1183
1184 // Event Rate plot
1185 TPad *cpad = (TPad *) c1->GetPad(kEvrt);
1186 if (cpad) {
1187 cpad->cd();
1188 cpad->SetFillColor(0);
1189 cpad->SetBorderMode(20);
1190 cpad->SetFrameBorderMode(0);
1191 }
1193 fRateGraph->SetMaximum(eymx*1.1);
1199 fRateGraph->SetTitle("Processing rate (evts/sec)");
1200 fRateGraph->GetXaxis()->SetTitle("elapsed time (sec)");
1201 fRateGraph->Draw("ALP");
1202
1203 // Line with average
1206 line->SetLineColor(8);
1207 line->SetLineStyle(2);
1208 line->SetLineWidth(2);
1209 line->Draw();
1210
1211 // Label
1212 Double_t xax0 = fRateGraph->GetXaxis()->GetXmin();
1213 Double_t xax1 = fRateGraph->GetXaxis()->GetXmax();
1214 Double_t yax0 = 0.;
1215 Double_t yax1 = eymx*1.1;
1216 Double_t x0 = xax0 + 0.05 * (xax1 - xax0);
1217 Double_t x1 = xax0 + 0.60 * (xax1 - xax0);
1218 Double_t y0 = yax0 + 0.10 * (yax1 - yax0);
1219 Double_t y1 = yax0 + 0.20 * (yax1 - yax0);
1220 TPaveText *pt = new TPaveText(x0, y0, x1, y1, "br");
1221 pt->SetFillColor(0);
1222 pt->AddText(Form("Global average: %.2f evts/sec", fAvgRate));
1223 pt->Draw();
1224
1225 // MB Rate plot
1226 if (fMBRtGraph) {
1227 cpad = (TPad *) c1->GetPad(kMBrt);
1228 if (cpad) {
1229 cpad->cd();
1230 cpad->SetFillColor(0);
1231 cpad->SetBorderMode(0);
1232 cpad->SetFrameBorderMode(0);
1233 }
1235 TH1F *graph2 = new TH1F("graph2","Average read chunck size (MBs/request)",100,
1237 graph2->SetMinimum(0);
1238 graph2->SetMaximum(1.1*bymx);
1239 graph2->SetDirectory(0);
1240 graph2->SetStats(0);
1241 graph2->GetXaxis()->SetTitle("elapsed time (sec)");
1242 fMBRtGraph->SetHistogram(graph2);
1243 fMBRtGraph->Draw("AB");
1244 }
1245
1246 // MB Rate plot
1247 if (fActWGraph) {
1248 cpad = (TPad *) c1->GetPad(kActW);
1249 if (cpad) {
1250 cpad->cd();
1251 cpad->SetFillColor(0);
1252 cpad->SetBorderMode(0);
1253 cpad->SetFrameBorderMode(0);
1254 }
1256 fActWGraph->SetMaximum(wymx*1.1);
1262 fActWGraph->SetTitle("Active workers");
1263 fActWGraph->GetXaxis()->SetTitle("elapsed time (sec)");
1264 fActWGraph->Draw("ALP");
1265 }
1266
1267 // MB Rate plot
1268 if (fTotSGraph) {
1269 cpad = (TPad *) c1->GetPad(kSess);
1270 if (cpad) {
1271 cpad->cd();
1272 cpad->SetFillColor(0);
1273 cpad->SetBorderMode(0);
1274 cpad->SetFrameBorderMode(0);
1275 }
1277 fTotSGraph->SetMaximum(tymx*1.1);
1283 fTotSGraph->SetTitle("Active, Effective sessions");
1284 fTotSGraph->GetXaxis()->SetTitle("elapsed time (sec)");
1285 fTotSGraph->Draw("ALP");
1286
1287 // Effective sessions
1288 if (fEffSGraph) {
1290 fEffSGraph->SetMaximum(tymx*1.1);
1296 fEffSGraph->Draw("SLP");
1297 }
1298 }
1299
1300 c1->Modified();
1301}
1302
1303////////////////////////////////////////////////////////////////////////////////
1304/// Do a memory plot
1305
1307{
1308 if (!fMemWindow) {
1309 fMemWindow = new TProofProgressMemoryPlot(this, 500, 300);
1310 fMemWindow->DoPlot();
1311 } else {
1312 // Clear window
1313 fMemWindow->Clear();
1314 fMemWindow->DoPlot();
1315 }
1316}
1317
1318////////////////////////////////////////////////////////////////////////////////
1319/// Enable/Disable speedometer
1320
1322{
1323 if (!fSpeedoEnabled) {
1324 // Enable and connect
1326 fSpeedo->Connect("OdoClicked()", "TProofProgressDialog", this, "ToggleOdometerInfos()");
1327 fSpeedo->Connect("LedClicked()", "TProofProgressDialog", this, "ToggleThreshold()");
1328 fUpdtSpeedo->ChangeText("&Disable speedometer");
1329 fUpdtSpeedo->SetToolTipText("Disable speedometer");
1331 fSmoothSpeedo->SetToolTipText("Control smoothness in refreshing the speedo");
1332 } else {
1333 // Disable and disconnect
1335 // Reset speedo
1337 fUpdtSpeedo->ChangeText("&Enable speedometer");
1338 fUpdtSpeedo->SetToolTipText("Enable speedometer (may have an impact on performance)");
1339 fSmoothSpeedo->SetToolTipText("Speedo refreshing is disabled");
1341 }
1342}
Handle_t Window_t
Window handle.
Definition GuiTypes.h:29
@ kFixedWidth
Definition GuiTypes.h:387
int main()
Definition Prototype.cxx:12
#define SafeDelete(p)
Definition RConfig.hxx:525
bool Bool_t
Definition RtypesCore.h:63
int Int_t
Definition RtypesCore.h:45
long Long_t
Definition RtypesCore.h:54
unsigned int UInt_t
Definition RtypesCore.h:46
float Float_t
Definition RtypesCore.h:57
constexpr Bool_t kFALSE
Definition RtypesCore.h:94
double Double_t
Definition RtypesCore.h:59
long long Long64_t
Definition RtypesCore.h:69
constexpr Bool_t kTRUE
Definition RtypesCore.h:93
#define ClassImp(name)
Definition Rtypes.h:382
R__EXTERN TEnv * gEnv
Definition TEnv.h:170
void Info(const char *location, const char *msgfmt,...)
Use this function for informational messages.
Definition TError.cxx:218
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
Definition TError.cxx:185
@ kButtonDown
Definition TGButton.h:54
@ kButtonDisabled
Definition TGButton.h:56
@ kButtonUp
Definition TGButton.h:53
#define gClient
Definition TGClient.h:156
@ kMWMDecorResizeH
Definition TGFrame.h:65
@ kMWMFuncAll
Definition TGFrame.h:49
@ kMWMFuncResize
Definition TGFrame.h:50
@ kMWMDecorMaximize
Definition TGFrame.h:69
@ kMWMDecorMinimize
Definition TGFrame.h:68
@ kMWMDecorMenu
Definition TGFrame.h:67
@ kMWMDecorAll
Definition TGFrame.h:63
@ kMWMFuncMaximize
Definition TGFrame.h:53
@ kMWMInputModeless
Definition TGFrame.h:57
@ kMWMFuncMinimize
Definition TGFrame.h:52
@ kDeepCleanup
Definition TGFrame.h:42
@ kLHintsExpandY
Definition TGLayout.h:31
@ kLHintsLeft
Definition TGLayout.h:24
@ kLHintsCenterY
Definition TGLayout.h:28
@ kLHintsCenterX
Definition TGLayout.h:25
@ kLHintsBottom
Definition TGLayout.h:29
@ kLHintsTop
Definition TGLayout.h:27
@ kLHintsExpandX
Definition TGLayout.h:30
@ kTextLeft
Definition TGWidget.h:23
@ kTextTop
Definition TGWidget.h:26
static unsigned int total
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t np
Option_t Option_t TPoint TPoint const char x1
Option_t Option_t width
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t height
Option_t Option_t TPoint TPoint const char y1
#define PPD_SRV_NEWER(v)
Int_t gDebug
Definition TROOT.cxx:597
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Definition TString.cxx:2489
R__EXTERN TSystem * gSystem
Definition TSystem.h:561
#define gVirtualX
Definition TVirtualX.h:337
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
Definition TAttFill.h:37
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
Definition TAttLine.h:42
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
Definition TAttLine.h:43
virtual void SetLineColor(Color_t lcolor)
Set the line color.
Definition TAttLine.h:40
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
Definition TAttMarker.h:38
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
Definition TAttMarker.h:40
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
Definition TAttMarker.h:45
void SetFrameBorderMode(Int_t mode=1)
Definition TAttPad.h:79
Double_t GetXmax() const
Definition TAxis.h:140
Double_t GetXmin() const
Definition TAxis.h:139
The Canvas class.
Definition TCanvas.h:23
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
Definition TEnv.cxx:491
virtual void SetToolTipText(const char *text, Long_t delayms=400)
Set tool tip text associated with this button.
Definition TGButton.cxx:445
virtual EButtonState GetState() const
Definition TGButton.h:112
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set button state.
Definition TGButton.cxx:235
Selects different options.
Definition TGButton.h:264
void SetState(EButtonState state, Bool_t emit=kFALSE) override
Set check button state.
The base class for composite widgets (menu bars, list boxes, etc.).
Definition TGFrame.h:287
TGDimension GetDefaultSize() const override
std::cout << fWidth << "x" << fHeight << std::endl;
Definition TGFrame.h:316
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1117
UInt_t GetDefaultWidth() const override
Definition TGFrame.h:312
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
Definition TGFrame.cxx:967
void MapSubwindows() override
Map all sub windows that are part of the composite frame.
Definition TGFrame.cxx:1164
UInt_t GetDefaultHeight() const override
Definition TGFrame.h:314
void SetCleanup(Int_t mode=kLocalCleanup) override
Turn on automatic cleanup of child frames in dtor.
Definition TGFrame.cxx:1072
A subclasses of TGWindow, and is used as base class for some simple widgets (buttons,...
Definition TGFrame.h:80
void Resize(UInt_t w=0, UInt_t h=0) override
Resize the frame.
Definition TGFrame.cxx:605
void MapWindow() override
map window
Definition TGFrame.h:204
void Move(Int_t x, Int_t y) override
Move frame.
Definition TGFrame.cxx:593
A composite frame that layout their children in horizontal way.
Definition TGFrame.h:385
TGHotString is a string with a "hot" character underlined.
Definition TGString.h:42
This class handles GUI labels.
Definition TGLabel.h:24
void SetTextJustify(Int_t tmode)
Set text justification.
Definition TGLabel.cxx:396
virtual void SetText(TGString *newText)
Set new text in label.
Definition TGLabel.cxx:180
This class describes layout hints used by the layout classes.
Definition TGLayout.h:50
void DontCallClose()
Typically call this method in the slot connected to the CloseWindow() signal to prevent the calling o...
Definition TGFrame.cxx:1780
void SetWMSize(UInt_t w, UInt_t h)
Give the window manager a window size hint.
Definition TGFrame.cxx:1893
void SetWMPosition(Int_t x, Int_t y)
Give the window manager a window position hint.
Definition TGFrame.cxx:1881
void SetWindowName(const char *name=nullptr) override
Set window name. This is typically done via the window manager.
Definition TGFrame.cxx:1788
void SetMWMHints(UInt_t value, UInt_t funcs, UInt_t input)
Set decoration style for MWM-compatible wm (mwm, ncdwm, fvwm?).
Definition TGFrame.cxx:1868
void SetWMSizeHints(UInt_t wmin, UInt_t hmin, UInt_t wmax, UInt_t hmax, UInt_t winc, UInt_t hinc)
Give the window manager minimum and maximum size hints.
Definition TGFrame.cxx:1906
void SetPosition(Float_t pos)
Set progress position between [min,max].
virtual void SetBarColor(Pixel_t color)
Set progress bar color.
virtual void Percent(Bool_t on)
virtual void ShowPos(Bool_t on)
virtual void Reset()
Reset progress bar (i.e. set pos to 0).
TGSpeedo is a widget looking like a speedometer, with a needle, a counter and a small odometer window...
Definition TGSpeedo.h:22
void SetOdoValue(Int_t val)
Set actual value of odo meter.
Definition TGSpeedo.cxx:334
void ResetPeakVal()
Definition TGSpeedo.h:95
Float_t GetScaleMin() const
Definition TGSpeedo.h:71
void EnableThreshold()
Definition TGSpeedo.h:89
void SetDisplayText(const char *text1, const char *text2="")
Set small display text (two lines).
Definition TGSpeedo.cxx:347
@ kOrange
Definition TGSpeedo.h:25
@ kNoglow
Definition TGSpeedo.h:25
Bool_t IsThresholdActive()
Definition TGSpeedo.h:73
void Glow(EGlowColor col=kGreen)
Make speedo glowing.
Definition TGSpeedo.cxx:241
void SetMinMaxScale(Float_t min, Float_t max)
Set min and max scale values.
Definition TGSpeedo.cxx:377
void DisableThreshold()
Definition TGSpeedo.h:90
void SetThresholds(Float_t th1=0.0, Float_t th2=0.0, Float_t th3=0.0)
Definition TGSpeedo.h:85
void SetThresholdColors(EGlowColor col1, EGlowColor col2, EGlowColor col3)
Definition TGSpeedo.h:87
void SetScaleValue(Float_t val)
Set actual scale (needle position) value.
Definition TGSpeedo.cxx:393
void EnableMeanMark()
Definition TGSpeedo.h:93
void SetMeanValue(Float_t mean)
Definition TGSpeedo.h:96
void EnablePeakMark()
Definition TGSpeedo.h:91
Float_t GetScaleMax() const
Definition TGSpeedo.h:72
Yield an action as soon as it is clicked.
Definition TGButton.h:142
void ChangeText(const char *title)
Definition TGButton.h:217
void SetEnabled(Bool_t flag=kTRUE)
virtual void SetToolTipText(const char *text, Long_t delayms=500)
Set tool tip text associated with this text entry.
Defines transient windows that typically are used for dialogs windows.
Definition TGFrame.h:498
A composite frame that layout their children in vertical way.
Definition TGFrame.h:374
ROOT GUI Window base class.
Definition TGWindow.h:23
A TGraph is an object made of two arrays X and Y with npoints each.
Definition TGraph.h:41
virtual void SetPoint(Int_t i, Double_t x, Double_t y)
Set x and y values for point number i.
Definition TGraph.cxx:2342
virtual void SetMaximum(Double_t maximum=-1111)
Set the maximum of the graph.
Definition TGraph.cxx:2324
void Draw(Option_t *chopt="") override
Draw this graph with its current attributes.
Definition TGraph.cxx:831
TAxis * GetXaxis() const
Get x axis of the graph.
Definition TGraph.cxx:1566
virtual void SetHistogram(TH1F *h)
Definition TGraph.h:186
void SetTitle(const char *title="") override
Change (i.e.
Definition TGraph.cxx:2397
virtual void SetMinimum(Double_t minimum=-1111)
Set the minimum of the graph.
Definition TGraph.cxx:2333
1-D histogram with a float per channel (see TH1 documentation)
Definition TH1.h:622
virtual void SetDirectory(TDirectory *dir)
By default, when a histogram is created, it is added to the list of histogram objects in the current ...
Definition TH1.cxx:8937
TAxis * GetXaxis()
Definition TH1.h:324
virtual void SetMaximum(Double_t maximum=-1111)
Definition TH1.h:404
virtual void SetMinimum(Double_t minimum=-1111)
Definition TH1.h:405
virtual void SetStats(Bool_t stats=kTRUE)
Set statistics option on/off.
Definition TH1.cxx:8990
static void OptimizeLimits(Int_t nbins, Int_t &newbins, Double_t &xmin, Double_t &xmax, Bool_t isInteger)
Optimize axis limits.
Use the TLine constructor to create a simple line.
Definition TLine.h:22
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
Definition TNamed.cxx:164
A simple TTree restricted to a list of float variables only.
Definition TNtuple.h:28
Float_t * GetArgs() const
Definition TNtuple.h:56
Int_t Fill() override
Fill a Ntuple with current values in fArgs.
Definition TNtuple.cxx:169
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Definition TObject.h:199
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
Definition TObject.cxx:280
@ kInvalidObject
if object ctor succeeded but object should not be used
Definition TObject.h:72
The most important graphics class in the ROOT system.
Definition TPad.h:28
TVirtualPad * cd(Int_t subpadnumber=0) override
Set Current pad.
Definition TPad.cxx:693
void SetBorderMode(Short_t bordermode) override
Definition TPad.h:325
TVirtualPad * GetPad(Int_t subpadnumber) const override
Get a pointer to subpadnumber of this pad.
Definition TPad.cxx:3000
A Pave (see TPave) with text, lines or/and boxes inside.
Definition TPaveText.h:21
virtual TText * AddText(Double_t x1, Double_t y1, const char *label)
Add a new Text line to this pavetext at given coordinates.
void Draw(Option_t *option="") override
Draw this pavetext with its current attributes.
virtual const char * GetUrl()
Definition TProofMgr.h:94
This class provides a query progress bar.
TProofProgressDialog(TProof *proof, const char *selector, Int_t files, Long64_t first, Long64_t entries)
Create PROOF processing progress dialog.
Float_t AdjustBytes(Float_t mbs, TString &sf)
Transform MBs to GBs ot TBs and get the correct suffix.
TProofProgressLog * fLogWindow
virtual ~TProofProgressDialog()
Cleanup dialog.
void DoEnableSpeedo()
Enable/Disable speedometer.
void DisableAsyn()
Disable the asyn switch when an external request for going asynchronous is issued.
friend class TProofProgressMemoryPlot
void DoKeep(Bool_t on)
Handle keep toggle button.
static TString fgTextQueryDefault
void DoLog()
Ask proof session for logs.
void Progress(Long64_t total, Long64_t processed)
Update progress bar and status labels.
void DoStop()
Handle Stop button.
void LogMessage(const char *msg, Bool_t all)
Load/append a log msg in the log frame, if open.
TGTransientFrame * fDialog
void DoMemoryPlot()
Do a memory plot.
void DoPlotRateGraph()
Handle Plot Rate Graph.
void DoAsyn()
Handle Asyn button.
TProofProgressMemoryPlot * fMemWindow
void CloseWindow()
Called when dialog is closed.
TGCheckButton * fSmoothSpeedo
void DoSetLogQuery(Bool_t on)
Handle log-current-query-only toggle button.
void ResetProgressDialog(const char *sel, Int_t sz, Long64_t fst, Long64_t ent)
Reset dialog box preparing for new query.
void DoAbort()
Handle Cancel button.
void DoClose()
Close dialog.
void IndicateStop(Bool_t aborted)
Indicate that Cancel or Stop was clicked.
void ToggleOdometerInfos()
Toggle information displayed in Analog Meter.
void DoLog(Bool_t grep=kFALSE)
Display logs.
void LoadBuffer(const char *buffer)
Load a text buffer in the window.
void AddBuffer(const char *buffer)
Add text to the window.
void Clear(Option_t *=nullptr) override
Clear log window.
void Clear(Option_t *=nullptr) override
Clear the canvases.
void DoPlot()
Draw the plot from the logs.
This class controls a Parallel ROOT Facility, PROOF, cluster.
Definition TProof.h:316
Bool_t IsValid() const
Definition TProof.h:937
Int_t GetRemoteProtocol() const
Definition TProof.h:913
Bool_t IsSync() const
Definition TProof.h:669
Int_t GetParallel() const
Returns number of slaves active in parallel mode.
Definition TProof.cxx:2304
void GoAsynchronous()
Send GOASYNC message to the master.
Definition TProof.cxx:6267
void ResetProgressDialogStatus()
Definition TProof.h:1021
void StopProcess(Bool_t abort, Int_t timeout=-1)
Send STOPPROCESS message to master and workers.
Definition TProof.cxx:6224
const char * GetUser() const
Definition TProof.h:906
const char * GetMaster() const
Definition TProof.h:903
TProofMgr * GetManager()
Definition TProof.h:1037
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot.
Definition TQObject.cxx:869
Bool_t Disconnect(const char *signal=nullptr, void *receiver=nullptr, const char *slot=nullptr)
Disconnects signal of this object from slot of receiver.
Basic string class.
Definition TString.h:139
const char * Data() const
Definition TString.h:376
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Definition TString.cxx:2378
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Definition TString.cxx:2356
virtual TTime Now()
Get current time in milliseconds since 0:00 Jan 1 1995.
Definition TSystem.cxx:463
Basic time type with millisecond precision.
Definition TTime.h:27
static void SingleShot(Int_t milliSec, const char *receiver_class, void *receiver, const char *method)
This static function calls a slot after a given time interval.
Definition TTimer.cxx:258
virtual Int_t GetEntry(Long64_t entry, Int_t getall=0)
Read all branches of entry and return total number of bytes read.
Definition TTree.cxx:5638
virtual Long64_t GetEntries() const
Definition TTree.h:463
virtual void Reset(Option_t *option="")
Reset baskets, buffers and entries count in all branches and leaves.
Definition TTree.cxx:8003
TPaveText * pt
TLine * line
return c1
Definition legend1.C:41
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
Returns x raised to the power y.
Definition TMath.h:721
auto * tt
Definition textangle.C:16