23#include "TGMimeTypes.h"
47 gROOT->GetListOfBrowsables()->Remove(topfold);
55 if (strcmp(source->GetName(),
"Go4Browser") == 0)
57 if (strcmp(source->GetName(),
"AnalLoginfo") == 0)
59 if (strcmp(source->GetName(),
"AnalRateMeter") == 0)
70 TIter iter(gROOT->GetListOfBrowsers());
72 while (
auto br =
dynamic_cast<TBrowser*
> (iter())) {
73 br->SetStatusText(str1, 0);
74 br->SetStatusText(str2, 1);
79 TTimer::SingleShot(blockdelay,
"TGo4RootBrowserProxy",
this,
"UnblockStatusOutput()");
91 const char *header =
nullptr;
94 header =
"Analysis running";
96 header =
"Analysis stopped";
101 res.Form(
"Rate = %6.4f Events = %d Time = %d Date = %s",
104 TMath::Nint(TMath::Floor(anal->
GetTime())),
107 res.Form(
"Rate = %d Events = %d Time = %d Date = %s",
108 TMath::Nint(TMath::Floor(anal->
GetRate())),
110 TMath::Nint(TMath::Floor(anal->
GetTime())),
113 Message(header, res.Data(), 0);
119 std::cout <<
"Loginfo = " << obj->GetName() << std::endl;
121 Message(
"Message",obj->GetName(), 5000);
135 topfold =
new TGo4BrowserItem(
nullptr,
nullptr,
"go4",
"Top go4 objects folder");
136 topfold->
SetTitle(
"Top Go4 folder");
141 gROOT->GetListOfBrowsables()->Add(topfold);
145 TGMimeTypes* mt = gClient->GetMimeTypeList();
146 mt->AddType(
"go4/logo",
"Go4Logo", img +
"go4logo2_big.png", img +
"go4logo2.png",
"->Draw()");
147 mt->AddType(
"go4/graph",
"TGraph", img +
"tgraph.png", img +
"tgraph.png",
"->Draw()");
148 mt->AddType(
"go4/multigraph",
"TMultiGraph", img +
"superimpose.png", img +
"superimpose.png",
"->Draw()");
149 mt->AddType(
"go4/picture",
"TGo4Picture", img +
"picture.png", img +
"picture.png",
"->Draw()");
150 mt->AddType(
"go4/param",
"TGo4Parameter", img +
"parameter.png", img +
"parameter.png",
"->Draw()");
151 mt->AddType(
"go4/fitter",
"TGo4Fitter", img +
"fitter.png", img +
"fitter.png",
"->Draw()");
152 mt->AddType(
"go4/wincond",
"TGo4WinCond", img +
"windcond.png", img +
"windcond.png",
"->Draw()");
153 mt->AddType(
"go4/polycond",
"TGo4PolyCond", img +
"polycond.png", img +
"polycond.png",
"->Draw()");
154 mt->AddType(
"go4/condarr",
"TGo4CondArray", img +
"windcondarray.png", img +
"windcondarray.png",
"->Draw()");
155 mt->AddType(
"go4/tentry",
"TGo4TreeHistogramEntry", img +
"dynentryx.png", img +
"dynentryx.png",
"->Draw()");
156 mt->AddType(
"go4/pentry",
"TGo4HistogramEntry", img +
"dynentryx.png", img +
"dynentryx.png",
"->Draw()");
157 mt->AddType(
"go4/hserv",
"TGo4HServProxy", img +
"histserv.png", img +
"histserv.png",
"->Draw()");
158 mt->AddType(
"go4/dabcserv",
"TGo4DabcProxy", img +
"dabc.png", img +
"dabc.png",
"->Draw()");
159 mt->AddType(
"go4/analysis",
"TGo4AnalysisProxy", img +
"analysiswin.png", img +
"analysiswin.png",
"->Draw()");
162 mt->AddType(
"go4/canvas",
"TCanvas", img +
"canvas.png", img +
"canvas.png",
"->Draw()");
163 mt->AddType(
"go4/tbranch",
"Go4-TreeBranch", img +
"branch_t.png", img +
"branch_t.png",
"->Draw()");
164 mt->AddType(
"go4/tleaf",
"Go4-TreeLeaf", img +
"leaf_t.png", img +
"leaf_t.png",
"->Draw()");
165 mt->AddType(
"go4/datamember",
"Go4-EventDataMember", img +
"eventitem.png", img +
"eventitem.png",
"->Draw()");
166 mt->AddType(
"go4/event",
"Go4-EventElement", img +
"eventobj.png", img +
"eventobj.png",
"->Draw()");
173 TObjArray testedClasses;
178 Bool_t res = iter.
next();
182 while (levelchange++ < 0) {
194 curitem = !curfold ? nullptr : curfold->
nextChild();
200 while (curitem && (strcmp(iter.
getname(), curitem->GetName()) != 0)) {
208 std::cerr <<
"************* ERROR in gui slots ****************** " << std::endl;
215 TClass *itemclass =
nullptr;
217 if (classname && !testedClasses.FindObject(classname)) {
218 itemclass = gROOT->GetClass(classname);
220 testedClasses.Add(
new TNamed(classname,
""));
234 TString iconname = classname;
236 iconname =
"Go4-TreeBranch";
238 iconname =
"Go4-TreeLeaf";
240 iconname =
"TGo4Parameter";
242 iconname =
"Go4-EventDataMember";
244 iconname =
"Go4-EventElement";
268 testedClasses.Delete();
273 TString cname =
"Canvas_";
275 TCanvas *c1 =
nullptr;
277 if (!title) c1 =
new TCanvas(cname, cname+
" title");
278 else c1 =
new TCanvas(cname, title);
286 if (!pad || !pic)
return;
293 for (Int_t posy = 0; posy < pic->
GetDivY(); posy++)
294 for (Int_t posx = 0; posx < pic->
GetDivX(); posx++) {
312 TObject *obj =
nullptr;
314 if (
fBrowser->DefineRelatedObject(picitemname, objname, drawname))
315 obj =
fBrowser->GetBrowserObject(drawname.Data(), 5000);
319 h1 =
dynamic_cast<TH1 *
>(obj);
323 if (obj->InheritsFrom(TGo4Condition::Class())) {
326 con->SetLineColor(2);
327 con->SetFillColor(2);
328 con->SetFillStyle(3444);
346 if (hname &&
fBrowser->DefineRelatedObject(itemname, hname, hitemname))
347 h1 =
dynamic_cast<TH1 *
>(
fBrowser->GetBrowserObject(hitemname.Data(), 5000));
351 TCanvas *c1 =
MakeCanvas(TString(
"Condition ") + con->GetName() +
" on histo " + h1->GetName());
355 con->SetLineColor(2);
356 con->SetFillColor(2);
357 con->SetFillStyle(3444);
367 Int_t cando =
fBrowser->ItemCanDo(itemname);
370 TClass *cl =
fBrowser->ItemClass(itemname);
371 if (!cl || !cl->InheritsFrom(TGo4Condition::Class()))
return;
374 TObject *obj =
fBrowser->GetBrowserObject(itemname, 5000);
377 if (obj->InheritsFrom(TGo4Condition::Class())) {
382 TPad *pad = (TPad *) gPad;
383 if (!pad) pad =
MakeCanvas(TString(
"Drawing of ") + obj->GetName());
386 if (obj->InheritsFrom(TGo4Picture::Class()))
const char * GetDateTime() const
Bool_t IsAnalysisRunning() const
ULong64_t GetCurrentCount() const
void SetIsFolder(Bool_t b)
TGo4BrowserItem * nextChild()
void SetTitle(const char *title="") override
void SetBrowser(TGo4BrowserProxy *br, TGo4RootBrowserProxy *br2)
void deleteChild(TGo4BrowserItem *item)
void SetItemClass(const char *name)
TGo4BrowserItem * GetParent() const
void SetIconName(const char *name)
TGo4BrowserItem * firstChild()
static void SetItemCanDo(TGo4Slot *slot, Int_t cando)
Int_t ItemKind(const char *name)
static const char * ItemInfo(TGo4Slot *slot)
static Int_t DefineItemProperties(Int_t kind, TClass *cl, TString &pixmap)
static bool CanDrawItem(int cando)
const char * ItemClassName(const char *name)
const char * GetLinkedHistogram() const
Access name of the associated histogram.
void Draw(Option_t *opt="") override
Draw this condition on current pad.
virtual void SetWorkHistogram(TH1 *histo)
Set reference to work histogram for statistics functions.
Bool_t next(Bool_t goesinto=kTRUE)
TGo4Slot * getslot() const
Int_t levelchange() const
static TString subGO4SYS(const char *subdir)
Return subdirectory in the GO4SYS.
Picture cconfiguration in Go4.
Int_t GetNumObjNames() const
Option_t * GetDrawOption() const override
void GetDrawAttributes(TObject *obj, Int_t index=UndefIndex) const
const char * GetObjName(Int_t n) const
TGo4Picture * FindPic(Int_t posy, Int_t posx)
void DrawCondition(const char *itemname, TGo4Condition *con)
TCanvas * MakeCanvas(const char *title=nullptr)
TGo4BrowserProxy * fBrowser
Bool_t ProcessEvent(TGo4Slot *slot, TGo4Slot *source, Int_t id, void *param) override
void SyncRootBrowserSlots()
void DrawPicture(const char *itemname, TGo4Picture *pic, TPad *pad)
void Message(const char *str1, const char *str2, Int_t blockdelay)
static Int_t fCanvasCounter
TGo4RootBrowserProxy(TGo4BrowserProxy *br=nullptr)
virtual ~TGo4RootBrowserProxy()
void UpdateLoginfo(TObject *obj)
void DrawItem(const char *itemname)
void UnblockStatusOutput()
void UpdateRatemeter(TObject *obj)
TObject * GetAssignedObject()