GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
TGo4BrowserProxy.cxx
Go to the documentation of this file.
1// $Id$
2//-----------------------------------------------------------------------
3// The GSI Online Offline Object Oriented (Go4) Project
4// Experiment Data Processing at EE department, GSI
5//-----------------------------------------------------------------------
6// Copyright (C) 2000- GSI Helmholtzzentrum fuer Schwerionenforschung GmbH
7// Planckstr. 1, 64291 Darmstadt, Germany
8// Contact: http://go4.gsi.de
9//-----------------------------------------------------------------------
10// This software can be used under the license agreements as stated
11// in Go4License.txt file which is part of the distribution.
12//-----------------------------------------------------------------------
13
14#include "TGo4BrowserProxy.h"
15
16#include "TF1.h"
17#include "TH1.h"
18#include "TH2.h"
19#include "TH3.h"
20#include "THStack.h"
21#include "TProfile.h"
22#include "TProfile2D.h"
23#include "TGraph.h"
24#include "TGraphErrors.h"
25#include "TGraphAsymmErrors.h"
26#include "TMultiGraph.h"
27#include "TList.h"
28#include "TFolder.h"
29#include "TDirectory.h"
30#include "TFile.h"
31#include "TTree.h"
32#include "TLeaf.h"
33#include "TCanvas.h"
34#include "TTimer.h"
35#include "TROOT.h"
36#include "TObjString.h"
37#include "TDatime.h"
38#include "TLatex.h"
39#include "TVirtualTreePlayer.h"
40
41#include "TGo4Log.h"
42#include "TGo4LockGuard.h"
43#include "TGo4ObjectProxy.h"
44#include "TGo4DirProxy.h"
45#include "TGo4LinkProxy.h"
46#include "TGo4Iter.h"
47#include "TGo4ObjectManager.h"
48
49#include "TGo4Fitter.h"
50#include "TGo4Parameter.h"
51#include "TGo4Picture.h"
52#include "TGo4PolyCond.h"
53#include "TGo4WinCond.h"
54#include "TGo4ShapedCond.h"
55#include "TGo4ListCond.h"
56#include "TGo4CondArray.h"
57#include "TGo4HistogramEntry.h"
59#include "TGo4ExportManager.h"
60
61#include "TGo4ServerProxy.h"
62#include "TGo4AnalysisProxy.h"
63#include "TGo4AnalysisStatus.h"
64#include "TGo4HServProxy.h"
65#include "TGo4DabcProxy.h"
66
67// required for ROOT browser
68// #include "TGo4BrowserItem.h"
69// #include "TGClient.h"
70// #include "TGMimeTypes.h"
71
72
74 public:
76 TGo4BrowserObjProxy(TGo4Slot *slot, TObject *obj, Bool_t owner) : TGo4ObjectProxy(obj, owner)
77 {
78 if (slot && obj)
80 }
81
83
84 Bool_t Use() const override { return kFALSE; }
85
86 Bool_t AssignObject(TGo4Slot *slot, TObject *obj, Bool_t owner) override
87 {
88 if (fObject == obj) return kTRUE;
89
90 Bool_t updatedone = false;
91
92 if (fObject && obj)
93 if ((fObject->IsA() == obj->IsA()) &&
94 (strcmp(fObject->GetName(), obj->GetName()) == 0))
96
97 if (obj)
99
100 if (updatedone) {
102 if (owner) delete obj;
103 return kTRUE;
104 }
105
106 return TGo4ObjectProxy::AssignObject(slot, obj, owner);
107 }
108
109 void Update(TGo4Slot *slot, Bool_t strong) override
110 {
111 // can not update object which is not there
112 if (!fObject && !strong) return;
113
114 TGo4Slot *parent = slot->GetParent();
115 TGo4BrowserProxy *browser = nullptr;
116
117 while(parent) {
118 browser = dynamic_cast<TGo4BrowserProxy*> (parent->GetProxy());
119 if (browser) break;
120 parent = parent->GetParent();
121 }
122 if (browser)
123 browser->RequestBrowserObject(slot);
124 }
125};
126
127// ******************************************************************
128
130 const char *viewpath,
131 Bool_t withRootBrowser)
132{
133 fxDataPath = datapath;
134 fxViewPath = viewpath;
135 fbWithRootBrowser = withRootBrowser;
136 fxMemoryPath = "Workspace";
137}
138
140{
141 if (gDebug > 1)
142 Info("~TGo4BrowserProxy", "Called");
143
144 if (fDummyTreePlayer) {
145 delete fDummyTreePlayer;
146 fDummyTreePlayer = nullptr;
147 }
148
149 if (fxWaitingList) {
150 fxWaitingList->Delete();
151 delete fxWaitingList;
152 fxWaitingList = nullptr;
153 }
154
156
157 if (fxSyncTimer) {
158 delete fxSyncTimer;
159 fxSyncTimer = nullptr;
160 }
161
162 if (fxMonitorTimer) {
163 delete fxMonitorTimer;
164 fxMonitorTimer = nullptr;
165 }
166
167 if (gDebug > 1)
168 Info("~TGo4BrowserProxy","Finished");
169}
170
172{
173 fxOM = slot->GetOM();
174 fxBrowserSlot = slot;
175 fxBrowserPath = "";
176 fxBrowserSlot->ProduceFullName(fxBrowserPath);
177
178 gROOT->GetClass("TH1");
179 gROOT->GetClass("TH1C");
180 gROOT->GetClass("TH1D");
181 gROOT->GetClass("TH1F");
182 gROOT->GetClass("TH1I");
183 gROOT->GetClass("TH1S");
184 gROOT->GetClass("TH2");
185 gROOT->GetClass("TH2C");
186 gROOT->GetClass("TH2D");
187 gROOT->GetClass("TH2F");
188 gROOT->GetClass("TH2I");
189 gROOT->GetClass("TH2S");
190 gROOT->GetClass("TH3");
191 gROOT->GetClass("TH3C");
192 gROOT->GetClass("TH3D");
193 gROOT->GetClass("TH3F");
194 gROOT->GetClass("TH3I");
195 gROOT->GetClass("TH3S");
196
197 gROOT->GetClass("TGo4WinCond");
198 gROOT->GetClass("TGo4PolyCond");
199 gROOT->GetClass("TGo4ShapedCond");
200 gROOT->GetClass("TGo4CondArray");
201
202 gROOT->GetClass("TGo4Fitter");
203 gROOT->GetClass("TGo4Parameter");
204 gROOT->GetClass("TGo4Picture");
205
206 gROOT->GetClass("TGo4DynamicEntry");
207 gROOT->GetClass("TGo4HistogramEntry");
208 gROOT->GetClass("TGo4TreeHistogramEntry");
209 gROOT->GetClass("TLatex");
210 gROOT->GetClass("TF1"); // JAM test
211 gROOT->GetClass("TGo4AnalysisStatus");
212
213 if (fxOM)
214 fxOM->RegisterLink(fxOM->GetSlot(fxDataPath.Data()), slot, kTRUE);
215
217}
218
220{
221 if (fxOM)
222 fxOM->UnregisterLink(slot);
223 fxOM = nullptr;
224 fxBrowserSlot = nullptr;
225 fxBrowserPath = "";
226}
227
228Bool_t TGo4BrowserProxy::ProcessEvent(TGo4Slot *slot, TGo4Slot *source, Int_t id, void *param)
229{
230 bool ischildevent = source->IsParent(slot);
231
232// Info("ProcessEvent","Source %x %s event %d", source, source->GetName(), id);
233
234 if ((source!=slot) && !ischildevent) {
235 if (source->GetParent()) {
236 TGo4ServerProxy *serv = dynamic_cast<TGo4ServerProxy *>(source->GetParent()->GetProxy());
237 if (serv && serv->IsGo4Analysis()) return kFALSE; // suppress message from analysis subitems
238 }
239
240 if (!fbBlockSync) {
241 if (!fxSyncTimer) fxSyncTimer = new TTimer(this, 10, kTRUE);
242 fbBlockSync = kTRUE;
243 fxSyncTimer->Start(10, kTRUE);
244 }
245
246 return kFALSE; // do not process further
247 } else if ((source != slot) && ischildevent) {
248 if ((id == TGo4Slot::evObjUpdated) || (id == TGo4Slot::evObjAssigned)) {
249 CheckWaitingList(source);
250 slot->ForwardEvent(slot, TGo4Slot::evSubslotUpdated, (void *) source);
251 CheckPictureMonitor(source);
252 }
253 }
254
255 return kTRUE;
256}
257
258void TGo4BrowserProxy::DataSlotName(const char *item, TString &res) const
259{
260 res = fxDataPath;
261 res += "/";
262 res += item;
263}
264
265void TGo4BrowserProxy::BrowserSlotName(const char *item, TString &res) const
266{
267 res = fxBrowserPath;
268 res += "/";
269 res += item;
270}
271
273{
274 TString slotname;
275 BrowserSlotName(item, slotname);
276 return fxOM->GetSlot(slotname.Data());
277}
278
280{
281 TString slotname;
282 DataSlotName(item, slotname);
283 return fxOM->GetSlot(slotname.Data());
284}
285
290
291Bool_t TGo4BrowserProxy::BrowserItemName(TGo4Slot *itemslot, TString &res)
292{
293 if (!itemslot || !fxBrowserSlot || !itemslot->IsParent(fxBrowserSlot)) return kFALSE;
294 itemslot->ProduceFullName(res, fxBrowserSlot);
295 return kTRUE;
296}
297
299{
300 fxBrowserSlot->Update(kFALSE);
301
302 TGo4Iter iter(fxOM->GetSlot(fxDataPath), kTRUE);
303 while(iter.next()) {
304 TGo4Slot *subslot = iter.getslot();
305 TGo4ServerProxy *ancont = dynamic_cast<TGo4ServerProxy *>(subslot->GetProxy());
306 if (ancont && ancont->IsGo4Analysis()) subslot->Update(kTRUE);
307 }
308}
309
310Int_t TGo4BrowserProxy::RequestBrowserObject(const char *name, Int_t wait_time)
311{
312 if (!name || !fxBrowserSlot || !fxOM) return 0;
313
314 Int_t kind = ItemKind(name);
315 if (kind==TGo4Access::kndObject) {
316 TClass *cl = ItemClass(name);
317 if (!cl || !cl->IsLoaded()) return 0;
318 }
319
320 TString src, tgt;
321
322 DataSlotName(name, src);
323 BrowserSlotName(name, tgt);
324
325 return fxOM->RequestObject(src.Data(), tgt.Data(), wait_time);
326}
327
329{
330 if (!slot || !slot->IsParent(fxBrowserSlot)) return 0;
331 TString name;
332 slot->ProduceFullName(name, fxBrowserSlot);
333 return RequestBrowserObject(name.Data(), wait_time);
334}
335
336Bool_t TGo4BrowserProxy::ProduceExplicitCopy(const char *itemname, const char *tgtpath, Bool_t forcerequest)
337{
338 return ProduceExplicitCopy(BrowserSlot(itemname), tgtpath, forcerequest);
339}
340
341Bool_t TGo4BrowserProxy::ProduceExplicitCopy(TGo4Slot *itemslot, const char *tgtpath, Bool_t forcerequest)
342{
343 TGo4LockGuard lock;
344
345 if (!itemslot) return kFALSE;
346
347 TGo4Slot *memslot = BrowserMemorySlot();
348 if (itemslot->IsParent(memslot) && !tgtpath) return kFALSE;
349 if (tgtpath) {
350 TGo4Slot *tgtslot = BrowserSlot(tgtpath);
351 if (!tgtslot) return kFALSE;
352 if ((tgtslot == itemslot) || tgtslot->IsParent(itemslot)) return kFALSE;
353 }
354
355 if (itemslot->NumChilds() > 0) {
356 Bool_t res = kTRUE;
357 TObjArray childs;
358 for (Int_t n = 0; n < itemslot->NumChilds(); n++)
359 childs.Add(itemslot->GetChild(n));
360
361 TString subpath;
362 // create subpath for paste from clipboard folder
363 if (tgtpath) {
364 TGo4Slot *tgtslot = DataSlot(tgtpath);
365 if (!tgtslot) return kFALSE;
366 if (!tgtslot->GetSlot(itemslot->GetName(), kTRUE)) return kFALSE;
367
368 // synchronize folder structures in browser branch
370
371 subpath = tgtpath;
372 subpath += "/";
373 subpath += itemslot->GetName();
374
375 tgtpath = subpath.Data();
376 }
377
378 for (Int_t n = 0; n <= childs.GetLast(); n++) {
379 Bool_t res1 = ProduceExplicitCopy((TGo4Slot *)childs.At(n), tgtpath, forcerequest);
380 res = res || res1;
381 }
382
383 return res;
384 }
385
386 if (ItemKind(itemslot) != TGo4Access::kndObject) return kFALSE;
387
388 TString pathname;
389 if (tgtpath) {
390 TGo4Slot *tgtslot = ItemSlot(tgtpath);
391 if (!tgtslot) return kFALSE;
392 if (!tgtslot->IsParent(memslot) && (tgtslot!=memslot)) return kFALSE;
393 if (itemslot->GetParent() == tgtslot) return kFALSE;
394 if (memslot!=tgtslot)
395 tgtslot->ProduceFullName(pathname, memslot);
396 } else {
397 if (!BrowserItemName(itemslot->GetParent(), pathname)) return kFALSE;
398 }
399
400 TObject *obj = itemslot->GetAssignedObject();
401
402 if (!obj || forcerequest) {
403 Int_t res = RequestBrowserObject(itemslot);
404 if (res == 0) return kFALSE;
405 obj = nullptr;
406 if ((res == 1) || !forcerequest)
407 obj = itemslot->GetAssignedObject();
408 }
409
410 if (obj) {
411 TString res = SaveToMemory(pathname, obj->Clone(), kTRUE);
412 return res.Length() > 0;
413 }
414
415 AddWaitingList(itemslot, tgtpath);
416
417 return kTRUE;
418}
419
421{
422 if (fxClipboard) {
423 fxClipboard->Delete();
424 delete fxClipboard;
425 fxClipboard = nullptr;
426 }
427}
428
429void TGo4BrowserProxy::AddToClipboard(const char *itemname)
430{
431 if (!fxClipboard) fxClipboard = new TObjArray;
432
433 if (fxClipboard->FindObject(itemname)) return;
434
435 TGo4Slot *itemslot = BrowserSlot(itemname);
436 if (!itemslot) return;
437
438 // check if parent of that item already in clipboard
439 for (Int_t n = 0; n <= fxClipboard->GetLast(); n++) {
440 TNamed *nm = (TNamed *)fxClipboard->At(n);
441 TGo4Slot *slot = ItemSlot(nm->GetName());
442 if (!slot)
443 continue;
444 if (itemslot->IsParent(slot))
445 return;
446 }
447
448 fxClipboard->Add(new TNamed(itemname, "clipboard item"));
449}
450
452{
453 return fxClipboard != nullptr;
454}
455
456void TGo4BrowserProxy::CopyClipboard(const char *tgtpath, Bool_t forcerequest)
457{
458 if (!fxClipboard) return;
459
460 for (Int_t n = 0; n <= fxClipboard->GetLast(); n++)
461 ProduceExplicitCopy(fxClipboard->At(n)->GetName(), tgtpath, forcerequest);
462}
463
464void TGo4BrowserProxy::OpenFile(const char *fname)
465{
466 if (!fname || (*fname == 0)) return;
467
468 fxOM->AddFile(fxDataPath.Data(), fname);
469
471}
472
473
474
475
476
477
478void TGo4BrowserProxy::AddServerProxy(TGo4ServerProxy *serv, const char *slotname, const char *info)
479{
480 fxOM->AddProxy(fxDataPath.Data(), serv, slotname, info);
481
483}
484
485Bool_t TGo4BrowserProxy::ConnectDabc(const char *nodename)
486{
487 if (!nodename || (*nodename == 0)) return kFALSE;
488
489 TGo4DabcProxy* proxy = new TGo4DabcProxy();
490 if (!proxy->Connect(nodename)) {
491 delete proxy;
492 return kFALSE;
493 }
494
495 const char *slotname = nodename;
496 if (strncmp(slotname,"dabc://",7) == 0) slotname+=7;
497
498 AddServerProxy(proxy, slotname, "Connection to DABC server");
499
500 return kTRUE;
501}
502
503
504Bool_t TGo4BrowserProxy::ConnectHServer(const char *servername,
505 Int_t portnumber,
506 const char *basename,
507 const char *userpass,
508 const char *filter)
509{
510 Bool_t res = kFALSE;
511
512 TGo4HServProxy* hserv = new TGo4HServProxy;
513
514 hserv->SetHServConfig(servername,
515 portnumber,
516 basename,
517 userpass,
518 filter);
519
520 if (hserv->RefreshNamesList()) {
521 TString capt = "HServ_";
522 capt += basename;
523
524 AddServerProxy(hserv, capt.Data(), "Connection to histogram server");
525 res = kTRUE;
526 } else {
527 delete hserv;
528 }
529 return res;
530}
531
533{
534 if (!arr) return;
535 arr->Clear();
536 TGo4Slot *slot = fxOM->GetSlot(fxDataPath.Data());
537 if (!slot) return;
538
539 for (Int_t n = 0; n < slot->NumChilds(); n++) {
540 TGo4Slot *subslot = slot->GetChild(n);
541 TGo4DirProxy* pr = dynamic_cast<TGo4DirProxy*> (subslot->GetProxy());
542 if (pr && pr->IsFile())
543 arr->Add(pr);
544 }
545}
546
548{
549 if (!arr) return;
550 arr->Clear();
551 TGo4Slot *slot = fxOM->GetSlot(fxDataPath.Data());
552 if (!slot) return;
553
554 for (Int_t n = 0; n < slot->NumChilds(); n++) {
555 TGo4Slot *subslot = slot->GetChild(n);
556 TGo4HServProxy* pr = dynamic_cast<TGo4HServProxy*> (subslot->GetProxy());
557 if (pr) arr->Add(pr);
558 }
559}
560
562{
563 if (!arr) return;
564 arr->Clear();
565 TGo4Slot *slot = fxOM->GetSlot(fxDataPath.Data());
566 if (!slot) return;
567
568 for (Int_t n = 0; n < slot->NumChilds(); n++) {
569 TGo4Slot *subslot = slot->GetChild(n);
570 TGo4DabcProxy *pr = dynamic_cast<TGo4DabcProxy *>(subslot->GetProxy());
571 if (pr) arr->Add(pr);
572 }
573}
574
576{
577 if (!arr) return;
578 arr->Clear();
579 TGo4Slot *slot = fxOM->GetSlot(fxDataPath.Data());
580 if (!slot) return;
581
582 for (Int_t n = 0; n < slot->NumChilds(); n++) {
583 TGo4Slot *subslot = slot->GetChild(n);
584 TGo4ServerProxy *pr = dynamic_cast<TGo4ServerProxy *>(subslot->GetProxy());
585 if (!pr || strcmp(pr->GetContainedClassName(),"TGo4ServerProxy")) continue;
586
587 if ((strncmp(pr->GetServerName(),"http://",7) == 0) ||
588 (strncmp(pr->GetServerName(),"https://",8) == 0)) arr->Add(pr);
589 }
590}
591
592void TGo4BrowserProxy::RequestObjectStatus(const char *name, TGo4Slot *tgtslot)
593{
594 TString objname;
595 TGo4ServerProxy *an = DefineAnalysisObject(name, objname);
596 if (an) an->RequestObjectStatus(objname.Data(), tgtslot);
597}
598
599void TGo4BrowserProxy::PerformTreeDraw(const char *treename,
600 const char *Xexp,
601 const char *Yexp,
602 const char *Zexp,
603 const char *cutcond,
604 const char *hname,
605 TString &createdhistoname)
606{
607 if (!Xexp || strlen(Xexp) == 0) return;
608
609 TString varexp(Xexp);
610
611 if(Yexp && strlen(Yexp) > 0) {
612 varexp = TString(Yexp) + TString(":") + varexp;
613 if(strlen(Zexp) > 0)
614 varexp = TString(Zexp) + TString(":") + varexp;
615 }
616
617 int drawdim = varexp.CountChar(':') + 1;
618 if (drawdim > 3) drawdim = 3;
619
620 if (IsItemRemote(treename)) {
621 TString objname;
622 TGo4ServerProxy *an = DefineAnalysisObject(treename, objname);
623 if (an) {
624 TString analhname(hname);
625
626 Int_t cnt = 0;
627 TString anitem = "abcdef";
628 if (analhname.IsNull())
629 while (anitem.Length() > 0) {
630 analhname = "hTreeDraw";
631 if (cnt > 0) { analhname+="_"; analhname+=cnt; }
632 cnt++;
633 anitem = FindItemInAnalysis(analhname.Data());
634 }
635
636 an->RemoteTreeDraw(objname.Data(), varexp.Data(), cutcond, analhname.Data());
638 }
639
640 createdhistoname = "";
641
642 return;
643 }
644
645 // take tree directly from data browser while
646 // tree pointer is not stored in browser slots
647 TString treeslotname;
648 DataSlotName(treename, treeslotname);
649 TTree *SelectedTree = dynamic_cast<TTree *> (fxOM->GetObject(treeslotname.Data()));
650 if (!SelectedTree) return;
651
652 TString histoname(hname), hslotname;
653 BrowserSlotName(hname, hslotname);
654 TGo4Slot *hslot = fxOM->GetSlot(hslotname.Data());
655
656 TH1 *histo = nullptr;
657
658 if (hslot && !IsItemRemote(hslot)) {
659 histo = dynamic_cast<TH1 *> (GetBrowserObject(hname, 1));
660 if (histo && (drawdim != histo->GetDimension())) {
661 histo = nullptr;
662 histoname = "";
663 }
664 }
665
666 // find non used entry in memory subfolder
667 int cnt = 0;
668 if (!histo && histoname.IsNull())
669 do {
670 histoname = fxMemoryPath;
671 histoname += "/hTreeDraw_";
672 histoname += cnt++;
673 BrowserSlotName(histoname, hslotname);
674 hslot = fxOM->GetSlot(hslotname.Data());
675 } while (hslot);
676
677 TString hfoldername, hobjectname;
678 TGo4Slot::ProduceFolderAndName(histoname.Data(), hfoldername, hobjectname);
679
680 if (histo)
681 hobjectname = histo->GetName();
682
683 varexp += ">>+";
684 varexp += hobjectname;
685
686 TDirectory *oldhisdir = histo ? histo->GetDirectory() : nullptr;
687 TDirectory *savdir = gDirectory;
688 gDirectory = nullptr;
689 TDirectory dummydir("DummyTreeDraw","Dummy directory to call tree draw");
690 dummydir.cd();
691 if (histo)
692 histo->SetDirectory(&dummydir);
693
694 SelectedTree->Draw(varexp, cutcond, "goff", 10000000, 0);
695
696 if (!histo) { // when new histogram created by Tree::Draw
697 histo = dynamic_cast<TH1 *> (dummydir.FindObject(hobjectname));
698 if(histo) {
699 histo->SetDirectory(nullptr);
700 createdhistoname = SaveToMemory(nullptr, histo, kTRUE);
701 // do sync immediately to be able draw this item in viewpanel
703 }
704 } else {
705 histo->SetDirectory(oldhisdir);
706 TGo4Slot *brslot = BrowserSlot(hname);
707 if (brslot) brslot->ForwardEvent(brslot, TGo4Slot::evObjUpdated);
708 }
709 dummydir.Clear();
710 savdir->cd();
711}
712
713TGo4Slot *TGo4BrowserProxy::FindServerSlot(Bool_t databranch, Int_t kind)
714{
715 // search for slot with TGo4ServerProxy
716 // kind = 0 - should be TGo4AnalysisProxy (default)
717 // kind = 1 - should be TGo4ServerProxy and IsGo4Analysis() == kTRUE
718 // kind = 2 - should be TGo4ServerProxy
719
720 TGo4Slot *dataslot = fxOM->GetSlot(fxDataPath.Data());
721
722 TGo4Iter iter(dataslot, kTRUE);
723 TGo4Slot *res = nullptr;
724
725 while (iter.next()) {
726
727 TGo4Slot *slot = iter.getslot();
728 if (!slot) continue;
729
730 if (kind > 0) {
731 TGo4ServerProxy *serv = dynamic_cast<TGo4ServerProxy *> (slot->GetProxy());
732 if (!serv || ((kind == 1) && !serv->IsGo4Analysis())) continue;
733 } else {
734 if (!dynamic_cast<TGo4AnalysisProxy *>(slot->GetProxy())) continue;
735 }
736
737 res = slot;
738 break;
739 }
740
741 if (res && !databranch) {
742 TString itemname;
743 res->ProduceFullName(itemname, dataslot);
744 res = BrowserSlot(itemname.Data());
745 }
746
747 return res;
748}
749
751{
752 TString slotname;
753 DataSlotName(itemname, slotname);
754
755 TGo4Slot *slot = fxOM->FindSlot(slotname.Data());
756 if (!slot || !itemname)
757 slot = FindServerSlot(kTRUE);
758
759 return slot ? dynamic_cast<TGo4AnalysisProxy *>(slot->GetProxy()) : nullptr;
760}
761
762TGo4ServerProxy *TGo4BrowserProxy::FindServer(const char *itemname, Bool_t asanalysis)
763{
764 // method should be used when analysis can be used via TGo4ServerProxy interface
765
766 TString slotname;
767 DataSlotName(itemname, slotname);
768
769 TGo4Slot *slot = fxOM->FindSlot(slotname.Data());
770 if (!slot || !itemname)
771 slot = FindServerSlot(kTRUE, asanalysis ? 1 : 2);
772
773 return !slot ? nullptr : dynamic_cast<TGo4ServerProxy *>(slot->GetProxy());
774}
775
776TString TGo4BrowserProxy::FindItemInAnalysis(const char *objname)
777{
778 TGo4Slot *analslot = FindServerSlot(kTRUE, 1); // any kind of go4 analysis is ok
779 if (!analslot || !objname) return TString("");
780
781 TGo4Iter iter(analslot);
782 while (iter.next()) {
783 if (strcmp(iter.getname(), objname) != 0) continue;
784 TString res;
785 analslot->ProduceFullName(res, DataSlot(""));
786 res += "/";
787 res += iter.getfullname();
788 return res;
789 }
790
791 return TString("");
792}
793
794TString TGo4BrowserProxy::FindItem(const char *objname)
795{
796 TGo4Slot *topslot = BrowserTopSlot();
797 if (!topslot || !objname) return TString("");
798
799 TGo4Iter iter(topslot);
800 while (iter.next())
801 if (strcmp(iter.getname(), objname) == 0)
802 return iter.getfullname();
803
804 return TString("");
805}
806
808{
809 TGo4Slot *slot = DataSlot(itemname);
810 if (!slot) return nullptr;
811
812 while (slot) {
813 TGo4ServerProxy *pr = dynamic_cast<TGo4ServerProxy *> (slot->GetProxy());
814 if (pr) return pr;
815 slot = slot->GetParent();
816 }
817
818 return nullptr;
819}
820
821TGo4ServerProxy *TGo4BrowserProxy::DefineServerObject(const char *itemname, TString *objname, Bool_t onlyanalysis)
822{
823 TString slotname;
824 DataSlotName(itemname, slotname);
825 const char *objectname = nullptr;
826
827 TGo4Slot *servslot = fxOM->FindSlot(slotname.Data(), &objectname);
828
829 TGo4ServerProxy *serv = !servslot ? nullptr :
830 dynamic_cast<TGo4ServerProxy *>(servslot->GetProxy());
831 if (!serv) return nullptr;
832 if (onlyanalysis && !serv->IsGo4Analysis()) return nullptr;
833 if (objname) *objname = objectname;
834 return serv;
835}
836
837TGo4ServerProxy *TGo4BrowserProxy::DefineAnalysisObject(const char *itemname, TString &analysisname)
838{
839 return DefineServerObject(itemname, &analysisname, kTRUE);
840}
841
842Bool_t TGo4BrowserProxy::UpdateAnalysisItem(const char *itemname, TObject *obj)
843{
844 TGo4Slot *slot = BrowserSlot(itemname);
845 if (!slot) return kFALSE;
846
847 if (!obj) obj = GetBrowserObject(itemname, 0);
848 if (!obj) return kFALSE;
849
850 const char *analysisname = nullptr;
851 TGo4Slot *anslot = nullptr;
852 TString slotname;
853
854 if (IsItemRemote(itemname)) {
855 DataSlotName(itemname, slotname);
856 anslot = fxOM->FindSlot(slotname.Data(), &analysisname);
857 }
858
859 if (!anslot) {
860 analysisname = nullptr;
861 anslot = FindServerSlot(kTRUE, 1);
862 }
863
864 TGo4ServerProxy *serv = anslot ? dynamic_cast<TGo4ServerProxy *>(anslot->GetProxy()) : nullptr;
865 return serv ? serv->UpdateAnalysisObject(analysisname, obj) : kFALSE;
866}
867
868void TGo4BrowserProxy::FetchItem(const char *itemname, Int_t wait_time)
869{
870 TGo4Slot *itemslot = ItemSlot(itemname);
871 if (!itemslot) return;
872
873 if (ItemKind(itemslot) == TGo4Access::kndObject)
874 RequestBrowserObject(itemslot, wait_time);
875
876 TGo4Iter iter(itemslot, kTRUE);
877 while (iter.next()) {
878 TGo4Slot *subslot = iter.getslot();
879 if (ItemKind(subslot)==TGo4Access::kndObject)
880 RequestBrowserObject(subslot, wait_time);
881 }
882
883 if (wait_time == 0) return;
884}
885
886void TGo4BrowserProxy::RedrawItem(const char *itemname)
887{
888 TGo4Slot *slot = BrowserSlot(itemname);
889 if (slot) {
891 SetItemTimeDate(slot);
892 }
893}
894
895TObject *TGo4BrowserProxy::GetBrowserObject(const char *name, int update)
896// update = 0 - without update,
897// 1 - request only if obj == nullptr,
898// 2 - update of object in any case
899// >=100 - update object in any case and wait for specified time in millisec
900{
901 if (!name || !fxBrowserSlot || !fxOM) return nullptr;
902
903 TString src, tgt;
904 BrowserSlotName(name, tgt);
905 TGo4Slot *guislot = fxOM->GetSlot(tgt.Data());
906
907 if (!guislot) return nullptr;
908
909 TObject *obj = guislot->GetAssignedObject();
910
911 if ((update == 0) || ((update == 1) && obj)) return obj;
912
913 if (guislot->IsParent(BrowserMemorySlot())) return obj;
914
915 DataSlotName(name, src);
916
917 fxOM->RequestObject(src.Data(), tgt.Data(), (update < 10) ? 0 : update);
918
919 return guislot->GetAssignedObject();
920}
921
923{
924 fiFilterIndex = filter;
926}
927
933
935{
936 if (!itemslot || !fxBrowserSlot || !fxOM) return kFALSE;
937
938 Int_t cando = ItemCanDo(itemslot);
939
940 Bool_t ismemoryitem = itemslot->IsParent(BrowserMemorySlot());
941
942 if (!ismemoryitem && !CanCloseItem(cando) && !IsCanDelete(itemslot)) return kFALSE;
943
944 if (itemslot->GetPar("::CopyObject") != nullptr) {
945 delete itemslot;
947 } else {
948 TString name = itemslot->GetFullName(fxBrowserSlot);
949 TString src;
950 DataSlotName(name.Data(), src);
951 fxOM->DeleteSlot(src.Data());
952 }
953 return kTRUE;
954}
955
957{
958 if (!slot || !slot->IsParent(fxBrowserSlot)) return;
959
960 slot->Update(kFALSE);
961}
962
967
969{
970 TString slotname;
971 BrowserSlotName(itemname, slotname);
972 return fxOM->GetSlot(slotname.Data());
973}
974
975Bool_t TGo4BrowserProxy::DefineTreeName(const char *itemname, TString &treename)
976{
977 TString slotname;
978 BrowserSlotName(itemname, slotname);
979 TGo4Slot *slot = fxOM->GetSlot(slotname.Data());
980 if (!slot) return kFALSE;
981
982 TGo4Slot *treeslot = slot;
983 while (treeslot) {
984 TClass *cl = ItemClass(treeslot);
985 if (cl && cl->InheritsFrom(TTree::Class())) break;
986 treeslot = treeslot->GetParent();
987 }
988 if (!treeslot) return kFALSE;
989
990 treeslot->ProduceFullName(treename, fxBrowserSlot);
991
992 return kTRUE;
993}
994
995Bool_t TGo4BrowserProxy::DefineLeafName(const char *itemname, const char *treename, TString &leafname)
996{
997 if (!itemname || !treename) return kFALSE;
998
999 TString slotname;
1000 BrowserSlotName(itemname, slotname);
1001 TGo4Slot *slot = fxOM->GetSlot(slotname.Data());
1002 if (!slot) return kFALSE;
1003
1004 if (ItemKind(slot)!=TGo4Access::kndTreeLeaf) return kFALSE;
1005
1006 int ilen = strlen(itemname);
1007 int tlen = strlen(treename);
1008 if ((ilen < tlen) || (strncmp(itemname, treename, tlen) != 0))
1009 return kFALSE;
1010
1011 leafname = slot->GetName();
1012 return kTRUE;
1013}
1014
1015Bool_t TGo4BrowserProxy::DefineRelatedObject(const char *itemname, const char *objname, TString &objectitem, Int_t mask)
1016{
1017 if (!objname || (*objname == 0)) return kFALSE;
1018
1019 if (BrowserSlot(objname)) {
1020 objectitem = objname;
1021 return kTRUE;
1022 }
1023
1024 TGo4Slot *picslot = BrowserSlot(itemname);
1025
1026 if (picslot) {
1027 TGo4Slot *searchslot = picslot->GetParent();
1028
1029 while (searchslot && (searchslot != fxBrowserSlot)) {
1030 TString searchname;
1031 searchslot->ProduceFullName(searchname, fxBrowserSlot);
1032 if (*objname!='/') searchname+="/";
1033 searchname+=objname;
1034
1035 TString fullname;
1036 BrowserSlotName(searchname.Data(), fullname);
1037
1038 TGo4Slot *slot = fxOM->GetSlot(searchname.Data());
1039 if (!slot) {
1040 searchname.Append(";1");
1041 slot = fxOM->GetSlot(searchname.Data());
1042 }
1043
1044 if (slot) {
1045 objectitem = searchname;
1046 return kTRUE;
1047 }
1048
1049 searchslot = searchslot->GetParent();
1050 }
1051 }
1052
1053 if (strchr(objname,'/')) {
1054 // to enable explore missing subfolders, mask should be 2
1055 if ((mask & 2) == 0) return kFALSE;
1056
1057 // it could happen that folder in the file or remote server is not yet read
1058 // we could try to exploit it
1059
1060 // first slash should be always there - any source should provide first level by default
1061 const char *slash = strchr(objname, '/');
1062
1063 while (slash) {
1064 slash = strchr(slash+1, '/');
1065 if (!slash) break;
1066
1067 TString diritem;
1068 if (!DefineRelatedObject(itemname, TString(objname, slash-objname).Data(), diritem, 0)) break;
1069
1070 int kind = ItemKind(diritem.Data());
1071
1072 if ((kind==TGo4Access::kndFolder) || (kind==TGo4Access::kndMoreFolder)) {
1073 GetBrowserObject(diritem.Data(), 1000);
1075 }
1076 }
1077
1078 return DefineRelatedObject(itemname, objname, objectitem, 0);
1079 }
1080
1081 // one should specify mask==1 to enable recursive search
1082 if ((mask & 1) == 0) return kFALSE;
1083
1084 TGo4Slot *searchslot = picslot ? picslot->GetParent() : fxBrowserSlot;
1085
1086 do {
1087 TGo4Iter iter(searchslot, kTRUE);
1088 size_t len = strlen(objname);
1089 while (iter.next()) {
1090 const char *name = iter.getname();
1091
1092 if (strncmp(objname, name, len) != 0) continue;
1093
1094 if ((strlen(name) == len) ||
1095 ((strlen(name)==(len+2)) && (strcmp(name+len,";1") == 0))) {
1096 TGo4Slot *subslot = iter.getslot();
1097 subslot->ProduceFullName(objectitem, fxBrowserSlot);
1098 return kTRUE;
1099 }
1100 }
1101 if (searchslot == fxBrowserSlot) break;
1102 searchslot = searchslot->GetParent();
1103 } while (searchslot);
1104
1105 return kFALSE;
1106}
1107
1108Bool_t TGo4BrowserProxy::DefineFileObject(const char *itemname, TString &fitemname, const char **filepath)
1109{
1110 TGo4Slot *slot = BrowserSlot(itemname);
1111 if (!slot) return kFALSE;
1112
1113 if (!slot->GetAssignedObject()) return kFALSE;
1114
1115 while (slot!=fxBrowserSlot) {
1116 TClass *cl = ItemClass(slot);
1117 if (cl && cl->InheritsFrom(TFile::Class())) break;
1118 slot = slot->GetParent();
1119 }
1120 if (slot==fxBrowserSlot) return kFALSE;
1121
1122 fitemname = "";
1123 slot->ProduceFullName(fitemname, fxBrowserSlot);
1124
1125 *filepath = itemname + fitemname.Length();
1126 if (**filepath=='/') (*filepath)++;
1127
1128 //filedataslot = fitemname;
1129 //DataSlotName(fitemname, filedataslot);
1130
1131 return kTRUE;
1132}
1133
1134Bool_t TGo4BrowserProxy::UpdateObjectInFile(const char *itemname, const char *fileitemname, const char *filepath)
1135{
1136 TGo4Slot *slot = BrowserSlot(itemname);
1137 if (!slot) return kFALSE;
1138
1139 TObject *obj = slot->GetAssignedObject();
1140 if (!obj) return kFALSE;
1141
1142 TGo4Slot *fileslot = DataSlot(fileitemname);
1143 if (!fileslot) return kFALSE;
1144
1145 TGo4DirProxy* dircont = dynamic_cast<TGo4DirProxy*> (fileslot->GetProxy());
1146 if (!dircont) return kFALSE;
1147
1148 Bool_t res = dircont->UpdateObjectInFile(filepath, obj);
1149
1150 if(res)
1151 fileslot->ForwardEvent(fileslot, TGo4Slot::evObjUpdated);
1152
1153 return res;
1154}
1155
1156Bool_t TGo4BrowserProxy::SaveItemToFile(const char *itemname, const char *filename, const char *subfolder)
1157{
1158 TGo4Slot *slot = BrowserSlot(itemname);
1159 if (!slot) return kFALSE;
1160
1161 TObject *obj = slot->GetAssignedObject();
1162 if (!obj) return kFALSE;
1163
1164 TFile *f = TFile::Open(filename,"UPDATE");
1165 if (!f) return kFALSE;
1166
1167 TDirectory *dir = f;
1168
1169 if (subfolder && *subfolder) {
1170 dir = dynamic_cast<TDirectory *> (f->Get(subfolder));
1171 if (!dir) dir = f;
1172 }
1173
1174 dir->cd();
1175 bool res = dir->WriteTObject(obj, obj->GetName(), "Overwrite") > 0;
1176
1177 if (obj->InheritsFrom(TH1::Class()))
1178 ((TH1 *) obj)->SetDirectory(nullptr);
1179
1180 delete f;
1181
1182 return res;
1183}
1184
1185void TGo4BrowserProxy::ExportItemsTo(TObjArray *items, // array of TObjString
1186 Bool_t fetchitems,
1187 const char *filename,
1188 const char *filedir,
1189 const char *format,
1190 const char *description)
1191{
1192 if (!items || (items->GetSize() == 0)) return;
1193
1194 TString convert;
1195 if(!format)
1196 convert="ROOT";
1197 else
1198 convert=format;
1199
1200 Go4Export_t filter;
1201 if (convert.Contains("ASCII")) {
1202 TGo4Log::Message(0, "Export filter is ASCII");
1203 filter = GO4EX_ASCII;
1204 } else if (convert.Contains("Radware")) {
1205 TGo4Log::Message(0, "Export filter is Radware");
1206 filter = GO4EX_RADWARE;
1207 } else if (convert.Contains("ROOT XML")) {
1208 TGo4Log::Message(0, "Export filter is ROOT XML");
1209 filter = GO4EX_XML;
1210 } else if (convert.Contains("ROOT")) {
1211 TGo4Log::Message(0, "Export filter is ROOT");
1212 filter = GO4EX_ROOT;
1213 } else {
1214 TGo4Log::Message(0, "Export filter is unknown, using ROOT");
1215 filter = GO4EX_ROOT;
1216 }
1217
1218 // if root export filter and 1 subfolder, export with complete file structures
1219 if (((filter==GO4EX_ROOT) || (filter==GO4EX_XML)) && (items->GetLast() == 0)) {
1220 TObjString* str = dynamic_cast<TObjString*> (items->At(0));
1221
1222 TGo4Slot *itemslot = !str ? nullptr : ItemSlot(str->GetName());
1223
1224 TString fname = filename;
1225
1226 if (filter==GO4EX_XML) {
1227 if(!fname.Contains(".xml")) fname.Append(".xml");
1228 } else {
1229 if(!fname.Contains(".root")) fname.Append(".root");
1230 }
1231
1232 if (itemslot && (itemslot->NumChilds() > 0)) {
1233 SaveBrowserToFile(fname.Data(), fetchitems, str->GetName(), description);
1234 return;
1235 }
1236 }
1237
1238 TGo4ExportManager exman("BrowserExport");
1239 exman.SetOutFile(filename);
1240 exman.SetOutFileComment(description);
1241 exman.SetStartDir();
1242 exman.SetCurrentDir(filedir);
1243
1244 TGo4Log::Message(1, "Exporting selected browser objects to %s", convert.Data());
1245
1246 TObjArray objs;
1247 for (int n = 0; n <= items->GetLast(); n++) {
1248 TObjString *str = dynamic_cast<TObjString *>(items->At(n));
1249 if (!str)
1250 continue;
1251 TObject *obj = GetBrowserObject(str->GetName(), 0);
1252 if (!obj)
1253 obj = GetBrowserObject(str->GetName(), 2000);
1254
1255 if (obj)
1256 objs.Add(obj);
1257 }
1258
1259 exman.Export(&objs, filter);
1260}
1261
1262void TGo4BrowserProxy::ImportObjectFromFile(const char *filename, const char *filedir,
1263 const char *format)
1264{
1265 TString result,folder;
1266 TString convert;
1267 Go4Import_t filter = GO4IM_ASCII;
1268
1269 if(!format)
1270 convert = "ASCII";
1271 else
1272 convert = format;
1273
1274 if (convert.Contains("ASCII")) {
1275 TGo4Log::Message(0, "Import filter is ASCII");
1276 filter = GO4IM_ASCII;
1277 folder = "Imports/Ascii";
1278 } else if (convert.Contains("Ortec")) {
1279 TGo4Log::Message(0, "Export filter is Ortec MCA");
1280 filter = GO4IM_ORTEC_MCA;
1281 folder = "Imports/OrtecMCA";
1282 }
1283
1284 TGo4ExportManager impman("BrowserImport");
1285 impman.SetStartDir();
1286 impman.SetCurrentDir(filedir);
1287
1288 auto histo = impman.ImportHistogram(filename,filter);
1289 if(histo) {
1290 //TGo4BrowserProxy::SaveToMemory(const char *pathname, TObject *obj, Bool_t ownership, Bool_t overwrite)
1291 result=SaveToMemory(folder.Data(),histo, kTRUE, kFALSE);
1292
1293 TGo4Log::Message(1, "Importing %s Histogram from file %s to %s.", convert.Data(), filename ,result.Data());
1294 }
1295
1296}
1297
1298
1299
1300Bool_t TGo4BrowserProxy::SaveBrowserToFile(const char *filename,
1301 Bool_t prefetch,
1302 const char *selectedpath,
1303 const char *description)
1304{
1305 TGo4Slot *toppath = BrowserSlot(selectedpath);
1306
1307 if (!toppath) return kFALSE;
1308
1309 if (prefetch)
1310 FetchItem(selectedpath, 2000);
1311
1312 TFile *f = TFile::Open(filename, "recreate", description);
1313 if (!f) return kFALSE;
1314
1315 fxOM->SaveDataToFile(f, kTRUE, toppath);
1316
1317 delete f;
1318
1319 return kTRUE;
1320}
1321
1322Bool_t TGo4BrowserProxy::IsItemRemote(const char *name)
1323{
1324 return IsItemRemote(ItemSlot(name));
1325}
1326
1328{
1329 if (!slot) return kFALSE;
1330 Int_t remote = 0;
1331 if (!slot->GetIntPar("GUI::Remote", remote)) return kFALSE;
1332 return remote != 0;
1333}
1334
1335Bool_t TGo4BrowserProxy::IsAnalysisItem(const char *name)
1336{
1337 TString analysisname;
1338 return DefineAnalysisObject(name, analysisname) != nullptr;
1339}
1340
1341void TGo4BrowserProxy::SetItemTimeDate(TGo4Slot *slot, const char *stime, const char *sdate)
1342{
1343 if (stime && sdate) {
1344 slot->SetPar("GUI::Time", stime);
1345 slot->SetPar("GUI::Date", sdate);
1346 return;
1347 }
1348
1349 TDatime t;
1350 const char *datetime = t.AsSQLString();
1351 char *time = (char *) strchr(datetime, ' ');
1352 if (!time) {
1353 slot->SetPar("GUI::Time", datetime);
1354 slot->SetPar("GUI::Date", datetime);
1355 } else {
1356 slot->SetPar("GUI::Time", time+1);
1357 *time = 0;
1358 slot->SetPar("GUI::Date", datetime);
1359 }
1360}
1361
1363{
1364 return !slot ? nullptr : slot->GetPar("GUI::Time");
1365}
1366
1368{
1369 return !slot ? nullptr : slot->GetPar("GUI::Date");
1370}
1371
1372void TGo4BrowserProxy::SetLinkedName(TGo4Slot *slot, const char *itemname)
1373{
1374 if (slot)
1375 slot->SetPar("::LinkedItem", itemname);
1376}
1377
1379{
1380 return !slot ? nullptr : slot->GetPar("::LinkedItem");
1381}
1382
1383Int_t TGo4BrowserProxy::ItemKind(const char *name)
1384{
1385 return ItemKind(ItemSlot(name));
1386}
1387
1389{
1390 if (!slot) return TGo4Access::kndNone;
1391 Int_t kind;
1392 if (!slot->GetIntPar("GUI::Kind", kind)) return TGo4Access::kndNone;
1393 return kind;
1394}
1395
1396void TGo4BrowserProxy::SetItemKind(TGo4Slot *slot, Int_t kind, const char *classname, const char *info, Int_t sizeinfo)
1397{
1398 if (!slot) return;
1399 if (kind >= 0) slot->SetIntPar("GUI::Kind", kind);
1400 else slot->RemovePar("GUI::Kind");
1401 slot->SetPar("GUI::Class", classname);
1402 slot->SetPar("GUI::Info", info);
1403 slot->SetIntPar("GUI::SizeInfo", sizeinfo);
1404}
1405
1407{
1408 return !slot ? nullptr : slot->GetPar("GUI::Info");
1409}
1410
1412{
1413 if (!slot) return -1;
1414 Int_t sizeinfo;
1415 if (!slot->GetIntPar("GUI::SizeInfo", sizeinfo)) return -1;
1416 return sizeinfo;
1417}
1418
1420{
1421 if (slot)
1422 slot->SetIntPar("GUI::CalcSize", size);
1423}
1424
1426{
1427 if (!slot) return 0;
1428 Int_t size;
1429 if (!slot->GetIntPar("GUI::CalcSize", size)) return 0;
1430 return size;
1431}
1432
1434{
1435 return TGo4Proxy::GetClass(ItemClassName(slot));
1436}
1437
1438TClass *TGo4BrowserProxy::ItemClass(const char *name)
1439{
1440 return ItemClass(ItemSlot(name));
1441}
1442
1444{
1445 return !slot ? nullptr : slot->GetPar("GUI::Class");
1446}
1447
1448const char *TGo4BrowserProxy::ItemClassName(const char *name)
1449{
1450 return ItemClassName(ItemSlot(name));
1451}
1452
1453Int_t TGo4BrowserProxy::ItemCanDo(const char *name)
1454{
1455 return ItemCanDo(ItemSlot(name));
1456}
1457
1459{
1460 if (!slot) return 0;
1461
1462 Int_t cando;
1463 if (!slot->GetIntPar("GUI::CanDo", cando)) return 0;
1464 return cando;
1465}
1466
1468{
1469 if (slot) slot->SetIntPar("GUI::CanDo", cando);
1470}
1471
1473{
1474 return !slot ? kTRUE : !slot->GetPar("GUI::NotMonitored");
1475}
1476
1478{
1479 if (!slot) return;
1480
1481 if (ItemKind(slot)==TGo4Access::kndFolder) {
1482 TGo4Iter iter(slot, kTRUE);
1483 while (iter.next()) {
1484 TGo4Slot *subslot = iter.getslot();
1485 if (ItemKind(subslot)==TGo4Access::kndObject)
1486 SetItemMonitored(subslot, on);
1487 }
1488 } else {
1489 if (on) {
1490 slot->RemovePar("GUI::NotMonitored");
1491 CheckPictureMonitor(slot);
1492 } else {
1493 slot->SetPar("GUI::NotMonitored","1");
1494 }
1495 }
1496}
1497
1499{
1500 return (cando % 1000000000) / 100000000 > 0;
1501}
1502
1504{
1505 return (cando % 100000000) / 10000000 > 0;
1506}
1507
1509{
1510 return (cando % 10000000) / 1000000 > 0;
1511}
1512
1514{
1515 return (cando % 1000000) / 100000 > 0;
1516}
1517
1519{
1520 return (cando % 100000) / 10000 > 0;
1521}
1522
1524{
1525 return (cando % 10000) / 1000 > 0;
1526}
1527
1529{
1530 return (cando % 1000) / 100 > 0;
1531}
1532
1534{
1535 return (cando % 100) / 10 > 0;
1536}
1537
1539{
1540 return (cando % 10 > 0);
1541}
1542
1543void TGo4BrowserProxy::CreateMemoryFolder(const char *foldername)
1544{
1545 if (foldername && *foldername)
1546 fxMemoryPath = foldername;
1547
1548 TString fullpathname;
1549 DataSlotName(fxMemoryPath, fullpathname);
1550
1551 fxOM->MakeFolder(fullpathname);
1552}
1553
1554void TGo4BrowserProxy::CreateMemorySubfolder(const char *itemname, const char *newfoldername)
1555{
1556 TGo4Slot *itemslot = BrowserSlot(itemname);
1557
1558 if (!itemslot || !newfoldername || (strlen(newfoldername) == 0)) return;
1559
1560 TGo4Slot *memslot = BrowserMemorySlot();
1561 if (!itemslot->IsParent(memslot) && (memslot!=itemslot)) return;
1562
1563 TGo4Slot *slot = DataSlot(itemname);
1564 if (!slot) return;
1565
1566 TGo4Slot *newslot = slot->GetSlot(newfoldername, kTRUE);
1567
1568 if (newslot)
1570}
1571
1572void TGo4BrowserProxy::RenameMemoryItem(const char *itemname, const char *newname)
1573{
1574 TGo4Slot *itemslot = BrowserSlot(itemname);
1575 if (!itemslot || !newname || (strlen(newname) == 0)) return;
1576
1577 if (strchr(newname,'/') || strchr(newname,'\\')) return;
1578
1579 TGo4Slot *memslot = BrowserMemorySlot();
1580 if (!itemslot->IsParent(memslot)) return;
1581
1582 TGo4Slot *slot = DataSlot(itemname);
1583 if (!slot) return;
1584
1585 // check if item of that name is already existing
1586 if (slot->GetParent()->FindChild(newname)) return;
1587
1588 slot->SetName(newname);
1589 TNamed *n = dynamic_cast<TNamed*> (slot->GetAssignedObject());
1590 if (n) n->SetName(newname);
1591
1593}
1594
1595
1596
1597void TGo4BrowserProxy::ClearMemoryItem(const char *itemname)
1598{
1599 TGo4Slot *itemslot = BrowserSlot(itemname);
1600 if (!itemslot) return;
1601
1602 TGo4Slot *memslot = BrowserMemorySlot();
1603 if (!itemslot->IsParent(memslot)) return;
1604
1605 TGo4Slot *slot = DataSlot(itemname);
1606 if (!slot) return;
1607
1608 TObject *ob = slot->GetAssignedObject();
1609 if (!ob) return;
1610
1611 if(ob->InheritsFrom(TH1::Class())) {
1612 TH1 *his = dynamic_cast<TH1 *>(ob);
1613 if (his) his->Reset(); // histogram has no Clear implementation!
1614 } else
1615 if(ob->InheritsFrom(TGo4DynamicEntry::Class())) {
1616 TGo4DynamicEntry *entry = dynamic_cast<TGo4DynamicEntry *>(ob);
1617 if (entry) entry->Reset(); // dynamic entry has no Clear implementation!
1618 } else
1619 if(ob->InheritsFrom(TGo4Picture::Class())) {
1620 TGo4Picture *pic = dynamic_cast<TGo4Picture *>(ob);
1621 if (pic) pic->Reset(); // picture has no Clear implementation!
1622 } else
1623 if(ob->InheritsFrom(TGraph::Class())) {
1624 TGraph *gr = dynamic_cast<TGraph *>(ob);
1625 if (gr) {
1626 Int_t pn = gr->GetN();
1627 gr->Set(0); // clear array of points
1628 gr->Set(pn); // this should set all to 0
1629 }
1630 } else
1631 if(ob->InheritsFrom(TMultiGraph::Class())) {
1632 TMultiGraph *mg = dynamic_cast<TMultiGraph *>(ob);
1633 if (mg) {
1634 TIter liter(mg->GetListOfGraphs());
1635 while(auto gr = (TGraph *) liter()) {
1636 Int_t pn = gr->GetN();
1637 gr->Set(0); // clear array of points
1638 gr->Set(pn); // this should set all to 0
1639 }
1640 }
1641 } else {
1642 // use virtual Clear of all objects
1643 // make sure that TNamed::Clear is overwritten in subclasses
1644 ob->Clear();
1645 }
1646
1647 itemslot->ForwardEvent(itemslot, TGo4Slot::evObjAssigned);
1648}
1649
1650TString TGo4BrowserProxy::SaveToMemory(const char *pathname, TObject *obj, Bool_t ownership, Bool_t overwrite)
1651{
1652 if (!obj) return TString("");
1653
1654 TString path = fxMemoryPath;
1655 if (pathname && (*pathname != 0)) {
1656 path += "/";
1657 path += pathname;
1658 }
1659
1660 // if overwrite, check if slot of that name exists
1661 if (overwrite) {
1662 TString itemname = path;
1663 itemname+= "/";
1664 itemname+=obj->GetName();
1665 TGo4Slot *slot = DataSlot(itemname);
1666 if (slot) {
1667 slot->AssignObject(obj, ownership);
1668 return itemname;
1669 }
1670 }
1671
1672 TString fullpathname;
1673 DataSlotName(path.Data(), fullpathname);
1674
1675 TGo4Slot *slot = fxOM->Add(fullpathname.Data(), obj, ownership, kTRUE);
1676
1677 return !slot ? TString("") : slot->GetFullName(fxOM->GetSlot(fxDataPath));
1678}
1679
1681{
1682 if (!slot) return;
1683
1684 TObject *obj = slot->GetAssignedObject();
1685 if (!obj) return;
1686
1687 TGo4Picture *pic = dynamic_cast<TGo4Picture *> (obj);
1688 if (!pic) return;
1689
1690 if (!IsItemMonitored(slot)) return;
1691
1692 TString picitemname;
1693 if (!BrowserItemName(slot, picitemname)) return;
1694
1695 CheckPictureMonitor(pic, picitemname.Data());
1696}
1697
1698void TGo4BrowserProxy::CheckPictureMonitor(TGo4Picture *pic, const char *picitemname)
1699{
1700 if (!pic) return;
1701
1702 if (pic->IsDivided())
1703 for (Int_t posy = 0; posy < pic->GetDivY(); posy++)
1704 for (Int_t posx = 0; posx < pic->GetDivX(); posx++)
1705 CheckPictureMonitor(pic->FindPic(posy, posx), picitemname);
1706
1707 for (Int_t n = 0; n < pic->GetNumObjNames(); n++) {
1708
1709 TString drawname;
1710
1711 if (DefineRelatedObject(picitemname, pic->GetObjName(n), drawname))
1712 SetItemMonitored(BrowserSlot(drawname), kTRUE);
1713 }
1714}
1715
1717{
1718 TIter iter(gROOT->GetList());
1719 while (auto obj = iter()) {
1720 SaveToMemory("gROOT", obj, kTRUE);
1721 }
1722
1723 gROOT->GetList()->Clear();
1724}
1725
1727{
1728 if (slot) {
1729 if(on) slot->SetPar("GUI::CanDelete","1");
1730 else slot->RemovePar("GUI::CanDelete");
1731 }
1732}
1733
1735{
1736 return !slot ? kFALSE : slot->GetPar("GUI::CanDelete") != nullptr;
1737}
1738
1740{
1741 fiMonitoringPeriod = rate;
1742
1743 fbBlockMonitoring = kFALSE;
1744
1745 if (fiMonitoringPeriod > 0) {
1746 if (!fxMonitorTimer)
1747 fxMonitorTimer = new TTimer(this, 10, kTRUE);
1748 fxMonitorTimer->Start(10, kTRUE);
1749 } else {
1750 if (fxMonitorTimer) fxMonitorTimer->Reset();
1751 delete fxMonitorTimer;
1752 fxMonitorTimer = nullptr;
1753 }
1754
1756}
1757
1759{
1760 TGo4Slot *viewslot = fxOM->GetSlot(fxViewPath.Data());
1761 if (!viewslot) return 0;
1762
1763 TGo4Slot *brslot = BrowserSlot();
1764
1765 TObjArray UniqueItems;
1766
1767 // first produce list of slots without duplication
1768 TGo4Iter iter(viewslot, kTRUE);
1769 while (iter.next()) {
1770 TGo4Slot *subslot = iter.getslot();
1771
1772 TGo4LinkProxy* link = dynamic_cast<TGo4LinkProxy*> (subslot->GetProxy());
1773 if (link) {
1774 TGo4Slot *srcslot = link->GetLink();
1775 if (srcslot && srcslot->IsParent(brslot) && !UniqueItems.FindObject(srcslot))
1776 UniqueItems.Add(srcslot);
1777 }
1778 }
1779
1780 Int_t nrequests = 0;
1781 for (int n = 0; n <= UniqueItems.GetLast(); n++) {
1782 TGo4Slot *srcslot = (TGo4Slot *)UniqueItems.At(n);
1783 if (!checkmonitor || IsItemMonitored(srcslot)) {
1784 nrequests++;
1785 srcslot->Update(kFALSE);
1786 }
1787 }
1788 return nrequests;
1789}
1790
1792{
1793 Int_t nrequests = 0;
1794
1795 TGo4Iter iter(BrowserSlot(),kTRUE);
1796
1797 while (iter.next()) {
1798 TGo4Slot *subslot = iter.getslot();
1799 if (IsItemMonitored(subslot)) {
1800 nrequests++;
1801 subslot->Update(kTRUE);
1802 }
1803 }
1804
1805 return nrequests;
1806}
1807
1809{
1810 if (timer==fxSyncTimer) {
1812 return kTRUE;
1813 } else if (timer == fxMonitorTimer) {
1814
1815 if (fiMonitoringPeriod <= 0) return kTRUE;
1816
1818
1819 Bool_t anready = kTRUE;
1820 if (an) anready = an->IsConnected() && (an->NumberOfWaitingProxyes() < 3);
1821
1822 // request new objects if total number of proxies is not too big
1823 if (anready && !fbBlockMonitoring) {
1824 if (fbWithRootBrowser) {
1827 } else {
1829 }
1830 }
1831
1832 Int_t period = fiMonitoringPeriod;
1833
1834 // if monitoring is blocked (no request for objects update are called), check again quickly
1835 if (fbBlockMonitoring) period = 1000;
1836
1837 fxMonitorTimer->Start(period, kTRUE);
1838
1839 return kTRUE;
1840 }
1841
1842 return kFALSE;
1843}
1844
1845void TGo4BrowserProxy::SetProtectionBits(TGo4Slot *slot, Int_t delprot, Int_t clearprot)
1846{
1847 if (!slot) return;
1848 if (delprot >= 0)
1849 slot->SetIntPar("GUI::DeleteProtect", delprot);
1850 else
1851 slot->RemovePar("GUI::DeleteProtect");
1852 if (clearprot >= 0)
1853 slot->SetIntPar("GUI::ResetProtect", clearprot);
1854 else
1855 slot->RemovePar("GUI::ResetProtect");
1856}
1857
1858void TGo4BrowserProxy::GetProtectionBits(TGo4Slot *slot, Int_t &delprot, Int_t &clearprot)
1859{
1860 delprot = -1; clearprot = -1;
1861 if (!slot) return;
1862 if (!slot->GetIntPar("GUI::DeleteProtect", delprot)) delprot = -1;
1863 if (!slot->GetIntPar("GUI::ResetProtect", clearprot)) clearprot = -1;
1864}
1865
1867{
1868 TGo4LockGuard lock;
1869
1870 TGo4Slot *targetslot = BrowserTopSlot();
1871
1872 TGo4Slot *source = fxOM->GetSlot(fxDataPath.Data());
1873 if (!source) return;
1874
1875 TGo4Slot *curfold = targetslot;
1876 if (!curfold) return;
1877
1878 TGo4Slot *curslot = curfold->GetChild(0);
1879
1880 TGo4Iter iter(source);
1881
1882 const char *EventsFolder = "EventObjects/Events/";
1883
1884 while (curfold) {
1885
1886 // shift to next item in iterator
1887 Bool_t res = iter.next();
1888
1889 // go to top folders and remove rest items
1890 Int_t levelchange = iter.levelchange();
1891
1892 while (levelchange++ < 0) {
1893 while (curslot) {
1894 TGo4Slot *next = curslot->GetNext();
1895 delete curslot;
1896 curslot = next;
1897 }
1898
1899 curslot = curfold->GetNext();
1900 curfold = curfold->GetParent();
1901 if (!curfold) break;
1902 }
1903
1904 if (!res) break;
1905
1906
1907 TGo4Slot *find = curslot;
1908 while (find && (strcmp(iter.getname(), find->GetName()) != 0))
1909 find = find->GetNext();
1910
1911 if (!find)
1912 find = new TGo4Slot(curfold, iter.getname(), iter.getinfo());
1913
1914 if (find!=curslot) {
1915 curfold->ShiftSlotBefore(find, curslot);
1916 curslot = find;
1917 }
1918
1919 Int_t kind = iter.getkindofitem();
1920 const char *classname = iter.getclassname();
1921 const char *fullname = iter.getfullname();
1922 const char *ppp = strstr(fullname, EventsFolder);
1923 if (ppp) {
1924 ppp += strlen(EventsFolder);
1925 if ((strlen(ppp) != 0) && !strchr(ppp,'/')) {
1927 classname = nullptr;
1928 }
1929 }
1930
1931 SetItemKind(curslot, kind, classname, iter.getinfo(), iter.getsizeinfo());
1932 curslot->SetIntPar("GUI::Remote", iter.getflag("IsRemote")==1);
1933 SetProtectionBits(curslot, iter.getflag("IsDeleteProtect"), iter.getflag("IsResetProtect"));
1934
1935 if (iter.getslot())
1936 SetCanDelete(curslot, IsCanDelete(iter.getslot()));
1937
1938 TObject *assobj = nullptr;
1939 if ((kind==TGo4Access::kndObject) && iter.getslot()) {
1940 TObject *obj = iter.getslot()->GetAssignedObject();
1941 if (obj && !curslot->GetAssignedObject())
1942 assobj = obj;
1943 }
1944
1945 if (!curslot->GetProxy())
1946 curslot->SetProxy(new TGo4BrowserObjProxy(curslot, assobj, kFALSE));
1947 else if (assobj)
1948 curslot->AssignObject(assobj, kFALSE);
1949
1950 if (iter.isfolder()) {
1951 curfold = curslot;
1952 curslot = curfold->GetChild(0);
1953 } else {
1954 curslot->DeleteChilds();
1955 curslot = curslot->GetNext();
1956 }
1957 }
1958
1959 if (curslot && curslot->IsParent(targetslot))
1960 while (curslot) {
1961 TGo4Slot *next = curslot->GetNext();
1962 delete curslot;
1963 curslot = next;
1964 }
1965
1966 CalculateFolderSizes(targetslot);
1967
1968 // inform other world that content was updated
1969 targetslot->ForwardEvent(targetslot, TGo4Slot::evObjUpdated);
1970
1971 if (fxSyncTimer) fxSyncTimer->Reset();
1972
1973 fbBlockSync = kFALSE;
1974}
1975
1977{
1978 if (!topslot) return 0;
1979 Int_t sizeinfo = ItemSizeInfo(topslot);
1980 bool verytop = fxBrowserSlot==topslot;
1981 if (!verytop && ItemKind(topslot)!=TGo4Access::kndFolder) return sizeinfo;
1982
1983 Int_t sum = 0;
1984 for (Int_t n = 0; n < topslot->NumChilds(); n++)
1985 sum += CalculateFolderSizes(topslot->GetChild(n));
1986 if (!verytop) SetCalcSize(topslot, sum);
1987
1988 return sum;
1989}
1990
1991Int_t TGo4BrowserProxy::DefineItemProperties(Int_t kind, TClass *cl, TString &pixmap)
1992{
1993 // 100000000 - execute,
1994 // 10000000 - expand,
1995 // 1000000 - export,
1996 // 100000 - info,
1997 // 10000 - close,
1998 // 1000 - clear,
1999 // 100 - draw,
2000 // 10 - drag,
2001 // 1 - edit
2002
2003 Int_t cando = 0;
2004
2005 // TClass *cl = TGo4Proxy::GetClass(clname);
2006
2007 if (kind==TGo4Access::kndObject) {
2008 if (cl) {
2009 if (cl->InheritsFrom(TProfile::Class())) { cando = 1110; pixmap = "profile_t.png"; } else
2010 if (cl->InheritsFrom(TProfile2D::Class())) { cando = 1110; pixmap = "col.png"; } else
2011 if (cl->InheritsFrom(TGo4Picture::Class())) { cando = 110; pixmap = "picture.png"; } else
2012 if (cl->InheritsFrom(TGo4Parameter::Class())) { cando = 1011; pixmap = "parameter.png"; } else
2013 if (cl->InheritsFrom(TMultiGraph::Class())) { cando = 1110; pixmap = "superimpose.png"; } else
2014 if (cl->InheritsFrom(THStack::Class())) { cando = 1110; pixmap = "superimpose.png"; } else
2015 if (cl->InheritsFrom(TGraph::Class())) { cando = 1001110; pixmap = "tgraph.png"; } else
2016 if (cl->InheritsFrom(TGo4Fitter::Class())) { cando = 11; pixmap = "fitter.png"; } else
2017 if (cl->InheritsFrom(TCanvas::Class())) { cando = 110; pixmap = "canvas.png"; } else
2018 if (cl->InheritsFrom(TFile::Class())) { pixmap = "rootdb_t.png"; } else
2019 if (cl->InheritsFrom(TTree::Class())) { pixmap = "tree_t.png"; } else
2020 if (cl->InheritsFrom(TFolder::Class())) { pixmap = "folder_t.png"; } else
2021 if (cl->InheritsFrom(TDirectory::Class())) { pixmap = "folder_t.png"; } else
2022 if (cl->InheritsFrom(TH3::Class())) { cando = 1101110; pixmap = "h3_t.png"; } else
2023 if (cl->InheritsFrom(TH2::Class())) { cando = 1101110; pixmap = "h2_t.png"; } else
2024 if (cl->InheritsFrom(TH1::Class())) { cando = 1101110; pixmap = "h1_t.png"; } else
2025 if (cl->InheritsFrom(TGo4WinCond::Class())) { cando = 101011; pixmap = "windcond.png"; } else
2026 if (cl->InheritsFrom(TGo4PolyCond::Class())) { cando = 101011; pixmap = "polycond.png"; } else
2027 if (cl->InheritsFrom(TGo4ShapedCond::Class())) { cando = 101011; pixmap = "polycond.png"; } else
2028 if (cl->InheritsFrom(TGo4ListCond::Class())) { cando = 101011; pixmap = "windcond.png"; } else
2029 if (cl->InheritsFrom(TGo4CondArray::Class())) { cando = 101011; pixmap = "windcondarray.png"; } else
2030 if (cl->InheritsFrom(TGo4TreeHistogramEntry::Class())) { cando = 1011; pixmap = "dynentryx.png"; } else
2031 if (cl->InheritsFrom(TGo4HistogramEntry::Class())) { cando = 1011; pixmap = "dynentryx.png"; } else
2032 if (cl->InheritsFrom(TLatex::Class())) { cando = 110; pixmap = "canvas.png"; } else
2033 if (cl->InheritsFrom(TF1::Class())) { cando = 110; pixmap = "draw1dline.png"; } else
2034 if (cl->InheritsFrom(TLeaf::Class())) { cando = 11; pixmap = "leaf_t.png"; } else
2035 if (cl->InheritsFrom(TGo4AnalysisStatus::Class())) { cando = 1; pixmap = "control.png"; }
2036 }
2037 } else if ((kind==TGo4Access::kndFolder) || (kind==TGo4Access::kndMoreFolder)) {
2038 pixmap = "folder_t.png";
2039 if (cl && cl->InheritsFrom(TTree::Class())) { cando = 10; pixmap = "tree_t.png"; } else
2040 if (cl && cl->InheritsFrom(TCanvas::Class())) { cando = 110; pixmap = "canvas.png"; } else
2041 if (cl && cl->InheritsFrom(THStack::Class())) { cando = 110; pixmap = "superimpose.png"; } else
2042 if (cl && cl->InheritsFrom(TFile::Class())) { cando = 10000; pixmap = "rootdb_t.png"; } else
2043 if (cl && cl->InheritsFrom(TGo4HServProxy::Class())) { cando = 10000; pixmap = "histserv.png"; } else
2044 if (cl && cl->InheritsFrom(TGo4DabcProxy::Class())) { cando = 10000; pixmap = "dabc.png"; } else
2045 if (cl && cl->InheritsFrom(TGo4AnalysisProxy::Class())) { pixmap = "analysiswin.png"; } else
2046 if (cl && cl->InheritsFrom(TGo4ServerProxy::Class())) { cando = 10000; pixmap = "http.png"; }
2047 if (kind==TGo4Access::kndMoreFolder) cando += 10000000;
2048 } else if (kind==TGo4Access::kndTreeBranch)
2049 pixmap = "branch_t.png";
2050 else if (kind==TGo4Access::kndTreeLeaf) {
2051 cando = 11; pixmap = "leaf_t.png";
2052 } else if (kind==TGo4Access::kndGo4Param) {
2053 cando = 1011; pixmap = "parameter.png";
2054 } else if (kind==TGo4Access::kndDataMember) {
2055 cando = 10; pixmap = "eventitem.png";
2056 } else if (kind==TGo4Access::kndEventElement) {
2057 cando = 100010; pixmap = "eventobj.png";
2058 } else if (kind==TGo4Access::kndRootCommand) {
2059 cando = 100000000; pixmap = "eventobj.png";
2060 }
2061
2062 return cando;
2063}
2064
2065Bool_t TGo4BrowserProxy::CompareAxisValues(Double_t v1, Double_t v2, Double_t scale)
2066{
2067 if (v1==v2) return kTRUE;
2068
2069 return (fabs(v1-v2) <= scale);
2070}
2071
2072Int_t TGo4BrowserProxy::CompareAxis(TAxis *ax1, TAxis *ax2)
2073{
2074 // return rebin factor
2075 // 0 - axis are different
2076 // 1 - both axis the same
2077 // >1 - rebin factor than ax2->Rebin(n) will produce ax1
2078
2079 if (!ax1 || !ax2) return 0;
2080
2081 Int_t num1 = ax1->GetNbins();
2082 Int_t num2 = ax2->GetNbins();
2083
2084 Double_t scale = fabs(ax1->GetXmax() - ax1->GetXmin()) / (num1+1.) * 1e-3;
2085
2086 if ((num1 != num2)) {
2087 // Minimum number for rebin is 2, therefore num2 should not more than num1/2
2088 if ((num1 > num2/2) || (num1 < 2)) return 0;
2089
2090 Int_t rebin = num2/num1;
2091 if (rebin == 0) return 0;
2092
2093 // support only uniform scale rebinning
2094 if ((ax1->GetXbins()->GetSize() != 0) || (ax2->GetXbins()->GetSize() != 0)) return 0;
2095
2096 // minimum value on both axis should be the same
2097 if (!CompareAxisValues(ax1->GetXmin(), ax2->GetXmin(), scale)) return 0;
2098
2099 Double_t xmax;
2100
2101 if (num1*rebin!=num2) xmax = ax2->GetBinUpEdge(num1*rebin);
2102 else xmax = ax2->GetXmax();
2103
2104 // maximum value on both axis should be the same
2105 if (!CompareAxisValues(ax1->GetXmax(), xmax, scale)) return 0;
2106
2107 return rebin;
2108 }
2109
2110 if ((ax1->GetXbins()->GetSize() == 0) && (ax2->GetXbins()->GetSize() == 0)) {
2111 if (!CompareAxisValues(ax1->GetXmin(), ax2->GetXmin(), scale)) return 0;
2112 if (!CompareAxisValues(ax1->GetXmax(), ax2->GetXmax(), scale)) return 0;
2113 } else
2114 for (Int_t n=1;n<=num1;n++)
2115 if (!CompareAxisValues(ax1->GetBinCenter(n),
2116 ax2->GetBinCenter(n), scale)) return 0;
2117
2118 return 1;
2119}
2120
2121
2122Bool_t TGo4BrowserProxy::UpdateObjectContent(TObject *obj, TObject *newobj, Int_t *hasrebinx, Int_t *hasrebiny)
2123{
2124 Bool_t tdisp = kFALSE;
2125 TString tform;
2126
2127 if (obj->InheritsFrom(TProfile::Class())) {
2128 auto profile = dynamic_cast<TProfile *>(obj);
2129 auto profile2 = dynamic_cast<TProfile *>(newobj);
2130 if (!profile || !profile2) return kFALSE;
2131 if (profile->GetNbinsX() != profile2->GetNbinsX()) return kFALSE;
2132 profile2->Copy(*profile);
2133 return kTRUE;
2134 } else if (obj->InheritsFrom(TProfile2D::Class())) {
2135 auto profile = dynamic_cast<TProfile2D *>(obj);
2136 auto profile2 = dynamic_cast<TProfile2D *>(newobj);
2137 if (!profile || !profile2) return kFALSE;
2138 if ((profile->GetNbinsX() != profile2->GetNbinsX()) || (profile->GetNbinsY() != profile2->GetNbinsY())) return kFALSE;
2139 profile2->Copy(*profile);
2140 return kTRUE;
2141 } else if (obj->InheritsFrom(TH1::Class())) {
2142 auto histo = dynamic_cast<TH1 *>(obj);
2143 auto histo2 = dynamic_cast<TH1 *>(newobj);
2144 if (!histo || !histo2) return kFALSE;
2145
2146 if (dynamic_cast<TProfile *>(obj) || dynamic_cast<TProfile2D *>(obj)) return kFALSE;
2147
2148 if (histo->GetDimension() != histo2->GetDimension()) return kFALSE;
2149
2150 histo->SetTitle(histo2->GetTitle());
2151
2152 Int_t rebinx = 1, rebiny = 1;
2153
2154 rebinx = CompareAxis(histo->GetXaxis(), histo2->GetXaxis());
2155 if (histo->GetDimension()>1)
2156 rebiny = CompareAxis(histo->GetYaxis(), histo2->GetYaxis());
2157 if (histo->GetDimension()>2)
2158 if (CompareAxis(histo->GetZaxis(), histo2->GetZaxis())!=1) return kFALSE;
2159
2160 if ((rebinx == 0) || (rebiny == 0)) return kFALSE;
2161
2162 // in case when object was interactively rebin,
2163 // try to repeat same operation with new object to perform content update
2164 if ((rebinx>1) || (rebiny>1)) {
2165 if (!hasrebinx || !hasrebiny) return kFALSE;
2166
2167 TH1 *clon = (TH1 *) histo2->Clone("____dummyhisto____");
2168 if (!clon) return kFALSE;
2169 clon->SetDirectory(nullptr);
2170 Bool_t rebinres = kFALSE;
2171
2172 if (histo->GetDimension() == 1) {
2173 clon->Rebin(rebinx);
2174 rebinres = UpdateObjectContent(histo, clon);
2175 } else if (histo->GetDimension() == 2) {
2176 TH2 *h2 = dynamic_cast<TH2 *>(clon);
2177 if (h2)
2178 h2->Rebin2D(rebinx, rebiny);
2179 rebinres = UpdateObjectContent(histo, h2);
2180 }
2181 delete clon;
2182
2183 if (rebinres) {
2184 *hasrebinx = rebinx;
2185 *hasrebiny = rebiny;
2186 }
2187
2188 return rebinres;
2189 }
2190
2191 Int_t sz = histo->GetNbinsX()+2;
2192 if (histo->GetDimension()>1)
2193 sz = sz*(histo->GetNbinsY()+2);
2194 if (histo->GetDimension()>2)
2195 sz = sz*(histo->GetNbinsZ()+2);
2196 Bool_t canrebin = histo->CanExtendAllAxes();
2197 histo->SetCanExtend(TH1::kNoAxis);
2198 Double_t sum = 0;
2199 for (int n = 0; n < sz; n++) {
2200 Stat_t value = histo2->GetBinContent(n);
2201 sum += value;
2202 histo->SetBinContent(n, value);
2203 }
2204 UpdateHistoListOfFunctions(histo, histo2); // JAM2024
2205 if (canrebin) histo->SetCanExtend(TH1::kAllAxes);
2206
2207 histo->SetEntries(sum);
2208
2209 TArrayD *sumw_tgt = nullptr, *sumw_src = nullptr;
2210
2211 if (histo2->GetSumw2N() > 0)
2212 sumw_src = histo2->GetSumw2();
2213
2214 // if source has no sumw, target should also not has them
2215 if (!sumw_src) {
2216 histo->GetSumw2()->Set(0);
2217 } else {
2218 if(histo->GetSumw2N() == 0) // JAM2018 workaround to reduce warnings in ROOT 6 (?)
2219 histo->Sumw2();
2220 sumw_tgt = histo->GetSumw2();
2221 }
2222
2223 if (sumw_src && sumw_tgt)
2224 sumw_tgt->Set(sz, sumw_src->GetArray());
2225
2226 return kTRUE;
2227 } else if (obj->InheritsFrom(TGo4Condition::Class())) {
2228 TGo4Condition *cond = dynamic_cast<TGo4Condition *> (obj);
2229 TGo4Condition *newcond = dynamic_cast<TGo4Condition *> (newobj);
2230 if (!cond || !newcond) return kFALSE;
2231
2232 cond->UpdateFrom(newcond, kTRUE);
2233 cond->SetChanged(kFALSE);
2234
2235 return kTRUE;
2236 } else if (obj->InheritsFrom(TGraphAsymmErrors::Class())) {
2237 TGraphAsymmErrors* gr = dynamic_cast<TGraphAsymmErrors*> (obj);
2238 TGraph *newgr = dynamic_cast<TGraph *> (newobj);
2239 if (!gr || !newgr) return kFALSE;
2240 SaveAxisTimeProperties(gr,tdisp,tform);
2241 gr->SetTitle(newgr->GetTitle());
2242
2243 Int_t npoints = newgr->GetN();
2244 gr->Set(npoints);
2245 Double_t xp, yp, exh, exl, eyh, eyl;
2246 for (Int_t n = 0; n < npoints; n++) {
2247 newgr->GetPoint(n, xp, yp);
2248 gr->SetPoint(n, xp, yp);
2249 exh = newgr->GetErrorXhigh(n);
2250 exl = newgr->GetErrorXlow(n);
2251 eyh = newgr->GetErrorYhigh(n);
2252 eyl = newgr->GetErrorYlow(n);
2253 gr->SetPointError(n, exl, exh, eyl, eyh);
2254 }
2255
2256 UpdateListOfFunctions(gr,newgr);
2257 RestoreAxisTimeProperties(gr,tdisp,tform);
2258 return kTRUE;
2259 } else if (obj->InheritsFrom(TGraphErrors::Class())) {
2260 TGraphErrors* gr = dynamic_cast<TGraphErrors*> (obj);
2261 TGraph *newgr = dynamic_cast<TGraph *> (newobj);
2262 if (!gr || !newgr) return kFALSE;
2263 SaveAxisTimeProperties(gr,tdisp,tform);
2264 gr->SetTitle(newgr->GetTitle());
2265
2266 Int_t npoints = newgr->GetN();
2267 gr->Set(npoints);
2268 Double_t xp, yp, ex, ey;
2269 for (Int_t n = 0; n < npoints; n++) {
2270 newgr->GetPoint(n, xp, yp);
2271 gr->SetPoint(n, xp, yp);
2272 ex = newgr->GetErrorX(n);
2273 ey = newgr->GetErrorY(n);
2274 gr->SetPointError(n, ex, ey);
2275 }
2276
2277 UpdateListOfFunctions(gr,newgr);
2278 RestoreAxisTimeProperties(gr,tdisp,tform);
2279
2280 return kTRUE;
2281 } else if (obj->InheritsFrom(TGraph::Class())) {
2282 TGraph *gr = dynamic_cast<TGraph *> (obj);
2283 TGraph *newgr = dynamic_cast<TGraph *> (newobj);
2284 if (!gr || !newgr) return kFALSE;
2285 // JAM: save axis time properties of currently displayed histo
2286 SaveAxisTimeProperties(gr,tdisp,tform);
2287
2288 gr->SetTitle(newgr->GetTitle());
2289
2290 Int_t npoints = newgr->GetN();
2291 gr->Set(npoints);
2292 Double_t xp, yp;
2293 for (Int_t n = 0; n < npoints; n++) {
2294 newgr->GetPoint(n, xp, yp);
2295 gr->SetPoint(n, xp, yp);
2296 }
2297 UpdateListOfFunctions(gr, newgr);
2298 RestoreAxisTimeProperties(gr,tdisp,tform);
2299
2300 return kTRUE;
2301 } else if (obj->InheritsFrom(TLatex::Class())) {
2302 TLatex *l0 = dynamic_cast<TLatex *> (obj);
2303 TLatex *l1 = dynamic_cast<TLatex *> (newobj);
2304 if (!l1 || !l0) return kFALSE;
2305
2306 l0->SetTitle(l1->GetTitle());
2307
2308 return kTRUE;
2309 } else if (obj->InheritsFrom(TF1::Class())) {
2310 TF1 *f0 = dynamic_cast<TF1 *> (obj);
2311 TF1 *f1 = dynamic_cast<TF1 *> (newobj);
2312 if (!f1 || !f0) return kFALSE;
2313 f1->Copy(*f0);
2314 return kTRUE;
2315 }
2316
2317 return kFALSE;
2318}
2319
2320void TGo4BrowserProxy::SaveAxisTimeProperties(TGraph *gr, Bool_t& timedisplay, TString &format)
2321{
2322 if(!gr) return;
2323 TH1 *h1 = gr->GetHistogram();
2324 TAxis *xax = h1->GetXaxis();
2325 timedisplay = xax->GetTimeDisplay();
2326 format = xax->GetTimeFormat();
2327}
2328
2329void TGo4BrowserProxy::RestoreAxisTimeProperties(TGraph *gr, Bool_t& timedisplay, TString &format)
2330{
2331 if(!gr) return;
2332 TH1 *h1 = gr->GetHistogram();
2333 TAxis *xax = h1->GetXaxis();
2334 xax->SetTimeDisplay(timedisplay);
2335 xax->SetTimeFormat(format.Data());
2336}
2337
2338
2339void TGo4BrowserProxy::UpdateListOfFunctions(TGraph *oldgr, TGraph *newgr)
2340{
2341 if(!oldgr || !newgr) return;
2342 TList *theFunctions = oldgr->GetListOfFunctions();
2343 TObject *obj = nullptr;
2344 while ((obj = theFunctions->First()) != nullptr) {
2345 while (theFunctions->Remove(obj)) { }
2346 delete obj;
2347 }
2348
2349 TList *newFunctions = newgr->GetListOfFunctions();
2350 TListIter fiter(newFunctions);
2351 while(auto fun = dynamic_cast<TF1 *>(fiter())) {
2352 TF1 *fclon = dynamic_cast<TF1 *>(fun->Clone());
2353 theFunctions->Add(fclon);
2354 fclon->SetParent(oldgr);
2355 }
2356
2357 // also restore graph axis titles here:
2358 TH1 *oldhis = oldgr->GetHistogram();
2359 TH1 *newhis = newgr->GetHistogram();
2360 if(oldhis && newhis) {
2361 oldhis->GetXaxis()->SetTitle(newhis->GetXaxis()->GetTitle());
2362 oldhis->GetYaxis()->SetTitle(newhis->GetYaxis()->GetTitle());
2363 }
2364}
2365
2366
2368{
2369 // JAM 26-06-2024: provide monitoring of fit results here
2370 if(!oldh || !newh) return;
2371 TList *theFunctions = oldh->GetListOfFunctions();
2372 TObject *obj = nullptr;
2373 while ((obj = theFunctions->First()) != nullptr) {
2374 while (theFunctions->Remove(obj)) { }
2375 delete obj;
2376 }
2377
2378 TList *newFunctions = newh->GetListOfFunctions();
2379 TListIter fiter(newFunctions);
2380 while(auto fun = dynamic_cast<TF1 *>(fiter())) {
2381 TF1 *fclon = dynamic_cast<TF1 *>(fun->Clone());
2382 theFunctions->Add(fclon);
2383 fclon->SetParent(oldh);
2384 }
2385}
2386
2387
2388
2389
2390void TGo4BrowserProxy::AddWaitingList(TGo4Slot *itemslot, const char *destination)
2391{
2392 if (!itemslot) return;
2393 if (!fxWaitingList) fxWaitingList = new TList;
2394
2395 TString itemname;
2396 if (!BrowserItemName(itemslot, itemname)) return;
2397
2398 TNamed *n = (TNamed*) fxWaitingList->FindObject(itemname.Data());
2399 if (n)
2400 n->SetTitle(destination);
2401 else
2402 fxWaitingList->Add(new TNamed(itemname.Data(), destination));
2403}
2404
2406{
2407 if (!fxWaitingList) return;
2408
2409 TString itemname;
2410 if (!BrowserItemName(source, itemname)) return;
2411
2412 TNamed *n = (TNamed*) fxWaitingList->FindObject(itemname.Data());
2413 if (n) {
2414 const char *dest = n->GetTitle();
2415 if (dest && (strlen(dest) == 0)) dest = nullptr;
2416 ProduceExplicitCopy(source, dest, kFALSE);
2417 fxWaitingList->Remove(n);
2418 delete n;
2419 }
2420}
2421
2422// used by ROOT browser
2423
2425{
2426 TIter next(gROOT->GetListOfCanvases());
2427 while (auto pad = (TPad *) next()) {
2428 pad->Modified();
2429
2430 Int_t number = 0;
2431 while (auto subpad = pad->GetPad(number++))
2432 subpad->Modified();
2433
2434 pad->Update();
2435 }
2436}
#define TGo4LockGuard
Go4Import_t
@ GO4IM_ORTEC_MCA
@ GO4IM_ASCII
Go4Export_t
@ GO4EX_RADWARE
@ GO4EX_ROOT
@ GO4EX_ASCII
@ GO4EX_XML
@ kndRootCommand
Definition TGo4Proxy.h:43
@ kndTreeBranch
Definition TGo4Proxy.h:37
@ kndEventElement
Definition TGo4Proxy.h:41
@ kndMoreFolder
Definition TGo4Proxy.h:42
@ kndDataMember
Definition TGo4Proxy.h:40
TGo4BrowserObjProxy(TGo4Slot *slot, TObject *obj, Bool_t owner)
Bool_t Use() const override
Bool_t AssignObject(TGo4Slot *slot, TObject *obj, Bool_t owner) override
void Update(TGo4Slot *slot, Bool_t strong) override
static Bool_t CompareAxisValues(Double_t v1, Double_t v2, Double_t scale)
void CheckWaitingList(TGo4Slot *source)
Int_t RequestBrowserObject(const char *name, Int_t wait_time=0)
void RenameMemoryItem(const char *itemname, const char *newname)
static bool CanExportItem(int cando)
void ImportObjectFromFile(const char *filename, const char *filedir, const char *format)
Bool_t SaveBrowserToFile(const char *filename, Bool_t prefetch=kFALSE, const char *selectedpath=nullptr, const char *description=nullptr)
Bool_t SaveItemToFile(const char *itemname, const char *filename, const char *subfolder=nullptr)
TObjArray * fxClipboard
TGo4AnalysisProxy * FindAnalysis(const char *itemname=nullptr)
Bool_t DefineTreeName(const char *itemname, TString &treename)
Bool_t IsCanDelete(TGo4Slot *slot) const
static void SetLinkedName(TGo4Slot *slot, const char *itemname)
void SetItemKind(TGo4Slot *slot, Int_t kind, const char *classname, const char *info, Int_t sizeinfo)
TGo4Slot * FindServerSlot(Bool_t databranch, Int_t kind=0)
void MakeDabcList(TObjArray *arr)
void PerformTreeDraw(const char *treename, const char *Xexp, const char *Yexp, const char *Zexp, const char *cutcond, const char *hname, TString &createdhistoname)
void Initialize(TGo4Slot *slot) override
Bool_t DeleteDataSource(TGo4Slot *itemslot)
TGo4Slot * BrowserSlot(const char *item=nullptr)
static bool CanCloseItem(int cando)
Bool_t DefineLeafName(const char *itemname, const char *treename, TString &leafname)
TGo4ServerProxy * DefineServerProxy(const char *itemname)
void MakeFilesList(TObjArray *arr)
TGo4Slot * BrowserTopSlot()
TGo4ServerProxy * DefineAnalysisObject(const char *itemname, TString &analysisname)
TGo4Slot * ItemSlot(const char *itemname)
static bool CanExecuteItem(int cando)
Int_t ItemSizeInfo(TGo4Slot *slot)
Bool_t ProduceExplicitCopy(const char *itemname, const char *tgtpath=nullptr, Bool_t forcerequest=kFALSE)
TObject * GetBrowserObject(const char *name, Int_t update=0)
void ToggleMonitoring(Int_t period)
void CreateMemoryFolder(const char *foldername=nullptr)
void CreateMemorySubfolder(const char *itemname, const char *newfoldername)
static bool CanExpandItem(int cando)
static void SetItemCanDo(TGo4Slot *slot, Int_t cando)
TString SaveToMemory(const char *pathname, TObject *obj, Bool_t ownership, Bool_t overwrite=kFALSE)
static bool CanClearItem(int cando)
Int_t ItemCanDo(const char *name)
void SetProtectionBits(TGo4Slot *slot, Int_t delprot, Int_t clearprot)
void ExportItemsTo(TObjArray *items, Bool_t fetchitems, const char *filename, const char *filedir, const char *format, const char *description)
Int_t ItemKind(const char *name)
TGo4Slot * DataSlot(const char *item)
static Int_t CompareAxis(TAxis *ax1, TAxis *ax2)
Int_t GetCalcSize(TGo4Slot *slot)
Bool_t ConnectHServer(const char *servername, Int_t portnumber, const char *basename, const char *userpass, const char *filter)
Bool_t DefineFileObject(const char *itemname, TString &filedataslot, const char **filepath)
TGo4Slot * BrowserMemorySlot()
void RedrawItem(const char *itemname)
void SetCanDelete(TGo4Slot *slot, Bool_t on=kTRUE)
void GetProtectionBits(TGo4Slot *slot, Int_t &delprot, Int_t &clearprot)
static const char * ItemTime(TGo4Slot *slot)
void FetchItem(const char *itemname, Int_t wait_time=0)
TGo4ServerProxy * FindServer(const char *itemname=nullptr, Bool_t asanalysis=kTRUE)
void SetItemsFilter(Int_t filter)
void SetItemMonitored(TGo4Slot *slot, Bool_t on=kTRUE)
void CopyClipboard(const char *tgtpath, Bool_t forcerequest=kFALSE)
static void SaveAxisTimeProperties(TGraph *gr, Bool_t &timedisplay, TString &format)
void ClearMemoryItem(const char *itemname)
static const char * ItemInfo(TGo4Slot *slot)
Int_t UpdateVisibleAnalysisObjects(bool checkmonitor)
void BrowserSlotName(const char *item, TString &res) const
void Finalize(TGo4Slot *slot) override
static Bool_t UpdateObjectContent(TObject *obj, TObject *newobj, Int_t *hasrebinx=nullptr, Int_t *hasrebiny=nullptr)
Bool_t UpdateAnalysisItem(const char *itemname, TObject *obj=nullptr)
Bool_t BrowserItemName(TGo4Slot *itemslot, TString &res)
static Int_t DefineItemProperties(Int_t kind, TClass *cl, TString &pixmap)
static void UpdateListOfFunctions(TGraph *oldgr, TGraph *newgr)
preserve fit result functions contained in any graph-like objects
void AddServerProxy(TGo4ServerProxy *serv, const char *slotname, const char *info)
void AddWaitingList(TGo4Slot *itemslot, const char *destination=nullptr)
TVirtualTreePlayer * fDummyTreePlayer
void AddToClipboard(const char *itemname)
Bool_t IsItemRemote(const char *name)
Bool_t DefineRelatedObject(const char *itemname, const char *objectname, TString &objectitem, Int_t mask=3)
static void RestoreAxisTimeProperties(TGraph *gr, Bool_t &timedisplay, TString &format)
void DataSlotName(const char *item, TString &res) const
static bool CanInfoItem(int cando)
static bool CanEditItem(int cando)
static const char * GetLinkedName(TGo4Slot *slot)
static const char * ItemDate(TGo4Slot *slot)
Bool_t ProcessEvent(TGo4Slot *slot, TGo4Slot *source, Int_t id, void *param) override
Bool_t HandleTimer(TTimer *timer) override
static bool CanDrawItem(int cando)
const char * ItemClassName(const char *name)
TString FindItemInAnalysis(const char *objname)
TGo4ServerProxy * DefineServerObject(const char *itemname, TString *objname=nullptr, Bool_t onlyanalysis=kTRUE)
Int_t CalculateFolderSizes(TGo4Slot *topslot)
Bool_t IsItemMonitored(TGo4Slot *slot) const
TClass * ItemClass(const char *name)
void DoItemMonitor(TGo4Slot *slot)
Bool_t ConnectDabc(const char *nodename)
void RequestObjectStatus(const char *name, TGo4Slot *tgtslot)
TString FindItem(const char *objname)
Bool_t IsAnalysisItem(const char *name)
Bool_t IsClipboard() const
void MakeHttpList(TObjArray *arr)
void MakeHServerList(TObjArray *arr)
void OpenFile(const char *fname)
static bool CanDragItem(int cando)
void SetCalcSize(TGo4Slot *slot, Int_t size)
void CheckPictureMonitor(TGo4Slot *slot)
TGo4ObjectManager * fxOM
static void UpdateHistoListOfFunctions(TH1 *oldh, TH1 *newh)
JAM24: also preserve fit result functions contained in any TH1.
static void SetItemTimeDate(TGo4Slot *slot, const char *stime=nullptr, const char *sdate=nullptr)
Bool_t UpdateObjectInFile(const char *itemname, const char *fileslotname, const char *filepath)
Go4 condition class.
virtual Bool_t UpdateFrom(TGo4Condition *cond, Bool_t counts)
Copy values from cond to this.
virtual void SetChanged(Bool_t on=kTRUE)
Bool_t Connect(const char *nodename)
Bool_t IsFile() const
Bool_t UpdateObjectInFile(const char *filepath, TObject *obj)
ABC for all entries that can be kept in a dynamic list.
virtual void Reset()
Resets this entry to an initial status.
This class manages all export and import conversions of objects to/from different file formats like a...
void SetOutFileComment(const char *comment=nullptr)
void SetStartDir(const char *dir=nullptr)
void SetOutFile(const char *filename=nullptr)
void Export(TObject *ob, Go4Export_t format)
Conversion of object into selected file format in working dir.
void SetCurrentDir(const char *dir=nullptr)
TH1 * ImportHistogram(const char *filename, Go4Import_t format)
create imported histogram from file of given name
void SetHServConfig(const char *servername, Int_t portnumber, const char *basename, const char *userpass, const char *filter)
Bool_t RefreshNamesList() override
Bool_t isfolder()
Definition TGo4Iter.cxx:109
Int_t getsizeinfo()
Definition TGo4Iter.cxx:127
const char * getinfo()
Definition TGo4Iter.cxx:121
Bool_t next(Bool_t goesinto=kTRUE)
Definition TGo4Iter.cxx:44
const char * getname()
Definition TGo4Iter.cxx:115
const char * getfullname()
Definition TGo4Iter.cxx:151
Int_t getkindofitem()
Definition TGo4Iter.cxx:139
TGo4Slot * getslot() const
Definition TGo4Iter.cxx:166
const char * getclassname()
Definition TGo4Iter.cxx:145
Int_t getflag(const char *flagname)
Definition TGo4Iter.cxx:133
Int_t levelchange() const
Definition TGo4Iter.h:41
TGo4Slot * GetLink() const
static const char * Message(Int_t prio, const char *text,...) GO4_PRINTF2_ARGS
Display a message.
Definition TGo4Log.cxx:206
Bool_t AssignObject(TGo4Slot *slot, TObject *obj, Bool_t owner) override
Picture cconfiguration in Go4.
Definition TGo4Picture.h:40
Int_t GetNumObjNames() const
Int_t GetDivY() const
Definition TGo4Picture.h:57
Bool_t IsDivided() const
Definition TGo4Picture.h:58
const char * GetObjName(Int_t n) const
TGo4Picture * FindPic(Int_t posy, Int_t posx)
Int_t GetDivX() const
Definition TGo4Picture.h:56
virtual const char * GetContainedClassName() const
Definition TGo4Proxy.h:115
static TClass * GetClass(const char *classname, Bool_t load=kFALSE)
Definition TGo4Proxy.cxx:73
special base class for remote data servers like DABC, HTTP, hist server
virtual Bool_t IsConnected() const
virtual Bool_t IsGo4Analysis() const
virtual const char * GetServerName() const
virtual void RemoteTreeDraw(const char *treename, const char *varexp, const char *cutcond, const char *hname)
virtual Bool_t RequestObjectStatus(const char *objectname, TGo4Slot *tgtslot)
virtual Bool_t UpdateAnalysisObject(const char *objectname, TObject *obj)
virtual Bool_t DelayedRefreshNamesList(Int_t delay_sec)
virtual Int_t NumberOfWaitingProxyes()
TGo4Slot * GetParent() const
Definition TGo4Slot.h:58
TString GetFullName(TGo4Slot *toparent=nullptr)
Definition TGo4Slot.cxx:274
virtual TGo4ObjectManager * GetOM() const
Definition TGo4Slot.cxx:282
virtual void Update(Bool_t strong=kFALSE)
Definition TGo4Slot.cxx:361
Bool_t GetIntPar(const char *name, Int_t &value) const
Definition TGo4Slot.cxx:624
Bool_t IsParent(const TGo4Slot *slot) const
Definition TGo4Slot.cxx:178
TGo4Proxy * GetProxy() const
Definition TGo4Slot.h:93
void SetProxy(TGo4Proxy *cont)
Definition TGo4Slot.cxx:296
TGo4Slot * GetSlot(const char *name, Bool_t force=kFALSE)
Definition TGo4Slot.cxx:451
@ evObjUpdated
Definition TGo4Slot.h:49
@ evObjAssigned
Definition TGo4Slot.h:47
@ evSubslotUpdated
Definition TGo4Slot.h:50
Int_t NumChilds() const
Definition TGo4Slot.h:76
TGo4Slot * FindChild(const char *name) const
Definition TGo4Slot.cxx:245
void ForwardEvent(TGo4Slot *source, Int_t id, void *param=nullptr)
Definition TGo4Slot.cxx:565
static void ProduceFolderAndName(const char *fullname, TString &foldername, TString &objectname)
Definition TGo4Slot.cxx:646
virtual void ProduceFullName(TString &name, TGo4Slot *toparent=nullptr)
Definition TGo4Slot.cxx:264
Bool_t AssignObject(TObject *obj, Bool_t owner)
Definition TGo4Slot.cxx:344
Bool_t ShiftSlotBefore(TGo4Slot *slot, TGo4Slot *before)
Definition TGo4Slot.cxx:505
void DeleteChilds(const char *startedwith=nullptr)
Definition TGo4Slot.cxx:202
void SetPar(const char *name, const char *value)
Definition TGo4Slot.cxx:586
void RemovePar(const char *name)
Definition TGo4Slot.cxx:606
void SetIntPar(const char *name, Int_t value)
Definition TGo4Slot.cxx:617
TObject * GetAssignedObject()
Definition TGo4Slot.cxx:356
const char * GetPar(const char *name) const
Definition TGo4Slot.cxx:598
TGo4Slot * GetChild(Int_t n) const
Definition TGo4Slot.h:77
TGo4Slot * GetNext() const
Definition TGo4Slot.cxx:258