16 #include "Riostream.h"
27 #include "TGMimeTypes.h"
38 #if ROOT_VERSION_CODE <= ROOT_VERSION(5,17,4)
39 #include "TRootBrowser.h"
40 #include "TGStatusBar.h"
56 gROOT->GetListOfBrowsables()->Remove(topfold);
65 if (strcmp(source->GetName(),
"Go4Browser")==0)
67 if (strcmp(source->GetName(),
"AnalLoginfo")==0)
69 if (strcmp(source->GetName(),
"AnalRateMeter")==0)
83 TIter iter(gROOT->GetListOfBrowsers());
86 while ((br = dynamic_cast<TBrowser*> (iter())) !=0 ) {
88 #if ROOT_VERSION_CODE > ROOT_VERSION(5,17,4)
89 br->SetStatusText(str1, 0);
90 br->SetStatusText(str2, 1);
92 TRootBrowser* imp =
dynamic_cast<TRootBrowser*
> (br->GetBrowserImp());
95 imp->ShowStatusBar(kTRUE);
97 TGStatusBar* status = imp->GetStatusBar();
99 status->SetText(str1, 0);
100 status->SetText(str2, 1);
107 TTimer::SingleShot(blockdelay,
"TGo4RootBrowserProxy",
this,
"UnblockStatusOutput()");
119 const char* header = 0;
122 header =
"Analysis running";
124 header =
"Analysis stopped";
129 res.Form(
"Rate = %6.4f Events = %d Time = %d Date = %s",
132 TMath::Nint(TMath::Floor(anal->
GetTime())),
135 res.Form(
"Rate = %d Events = %d Time = %d Date = %s",
136 TMath::Nint(TMath::Floor(anal->
GetRate())),
138 TMath::Nint(TMath::Floor(anal->
GetTime())),
141 Message(header, res.Data(), 0);
147 std::cout <<
"Loginfo = " << obj->GetName() << std::endl;
149 Message(
"Message",obj->GetName(), 5000);
164 topfold->
SetTitle(
"Top Go4 folder");
169 gROOT->GetListOfBrowsables()->Add(topfold);
173 TGMimeTypes* mt = gClient->GetMimeTypeList();
174 mt->AddType(
"go4/logo",
"Go4Logo", img +
"go4logo2_big.png", img +
"go4logo2.png",
"->Draw()");
175 mt->AddType(
"go4/graph",
"TGraph", img +
"tgraph.png", img +
"tgraph.png",
"->Draw()");
176 mt->AddType(
"go4/multigraph",
"TMultiGraph", img +
"superimpose.png", img +
"superimpose.png",
"->Draw()");
177 mt->AddType(
"go4/picture",
"TGo4Picture", img +
"picture.png", img +
"picture.png",
"->Draw()");
178 mt->AddType(
"go4/param",
"TGo4Parameter", img +
"parameter.png", img +
"parameter.png",
"->Draw()");
179 mt->AddType(
"go4/fitter",
"TGo4Fitter", img +
"fitter.png", img +
"fitter.png",
"->Draw()");
180 mt->AddType(
"go4/wincond",
"TGo4WinCond", img +
"windcond.png", img +
"windcond.png",
"->Draw()");
181 mt->AddType(
"go4/polycond",
"TGo4PolyCond", img +
"polycond.png", img +
"polycond.png",
"->Draw()");
182 mt->AddType(
"go4/condarr",
"TGo4CondArray", img +
"windcondarray.png", img +
"windcondarray.png",
"->Draw()");
183 mt->AddType(
"go4/tentry",
"TGo4TreeHistogramEntry", img +
"dynentryx.png", img +
"dynentryx.png",
"->Draw()");
184 mt->AddType(
"go4/pentry",
"TGo4HistogramEntry", img +
"dynentryx.png", img +
"dynentryx.png",
"->Draw()");
185 mt->AddType(
"go4/hserv",
"TGo4HServProxy", img +
"histserv.png", img +
"histserv.png",
"->Draw()");
186 mt->AddType(
"go4/dabcserv",
"TGo4DabcProxy", img +
"dabc.png", img +
"dabc.png",
"->Draw()");
187 mt->AddType(
"go4/analysis",
"TGo4AnalysisProxy", img +
"analysiswin.png", img +
"analysiswin.png",
"->Draw()");
190 mt->AddType(
"go4/canvas",
"TCanvas", img +
"canvas.png", img +
"canvas.png",
"->Draw()");
191 mt->AddType(
"go4/tbranch",
"Go4-TreeBranch", img +
"branch_t.png", img +
"branch_t.png",
"->Draw()");
192 mt->AddType(
"go4/tleaf",
"Go4-TreeLeaf", img +
"leaf_t.png", img +
"leaf_t.png",
"->Draw()");
193 mt->AddType(
"go4/datamember",
"Go4-EventDataMember", img +
"eventitem.png", img +
"eventitem.png",
"->Draw()");
194 mt->AddType(
"go4/event",
"Go4-EventElement", img +
"eventobj.png", img +
"eventobj.png",
"->Draw()");
201 TObjArray testedClasses;
206 Bool_t res = iter.
next();
209 Int_t levelchange = iter.levelchange();
210 while (levelchange++<0) {
218 if (curfold==0)
break;
222 curitem = curfold==0 ? 0 : curfold->
nextChild();
228 while ((curitem!=0) && (strcmp(iter.getname(), curitem->GetName())!=0)) {
236 std::cerr <<
"************* ERROR in gui slots ****************** " << std::endl;
243 TClass* itemclass = 0;
245 if ((classname!=0) && (testedClasses.FindObject(classname)==0)) {
246 itemclass = gROOT->GetClass(classname);
248 testedClasses.Add(
new TNamed(classname,
""));
256 curitem =
new TGo4BrowserItem(curfold, previtem, iter.getname(), classname);
262 TString iconname = classname;
264 iconname =
"Go4-TreeBranch";
267 iconname =
"Go4-TreeLeaf";
270 iconname =
"TGo4Parameter";
273 iconname =
"Go4-EventDataMember";
276 iconname =
"Go4-EventElement";
280 if (iter.isfolder()) {
305 TString cname =
"Canvas_";
309 if (title==0) c1 =
new TCanvas(cname, cname+
" title");
310 else c1 =
new TCanvas(cname, title);
318 if ((pad==0) || (pic==0))
return;
325 for(Int_t posy=0; posy<pic->
GetDivY(); posy++)
326 for(Int_t posx=0; posx<pic->
GetDivX(); posx++) {
348 if (obj==0)
continue;
351 h1 =
dynamic_cast<TH1*
>(obj);
355 if (obj->InheritsFrom(TGo4Condition::Class())) {
358 con->SetLineColor(2);
359 con->SetFillColor(2);
360 con->SetFillStyle(3444);
371 if ((con==0) || (
fBrowser==0))
return;
384 TCanvas* c1 =
MakeCanvas(TString(
"Condition ") + con->GetName() +
" on histo " + h1->GetName());
388 con->SetLineColor(2);
389 con->SetFillColor(2);
390 con->SetFillStyle(3444);
398 if ((itemname==0) || (
fBrowser==0))
return;
404 if ((cl==0) || !cl->InheritsFrom(TGo4Condition::Class()))
return;
411 if (obj->InheritsFrom(TGo4Condition::Class())) {
416 TPad* pad = (TPad*) gPad;
417 if (pad==0) pad =
MakeCanvas(TString(
"Drawing of ") + obj->GetName());
420 if (obj->InheritsFrom(TGo4Picture::Class()))
void deleteChild(TGo4BrowserItem *item)
void Message(const char *str1, const char *str2, Int_t blockdelay)
TGo4BrowserItem * GetParent() const
static Int_t fCanvasCounter
virtual void SetTitle(const char *title="")
TObject * GetBrowserObject(const char *name, Int_t update=0)
Int_t ItemKind(const char *name)
static bool CanDrawItem(int cando)
virtual Option_t * GetDrawOption()
const char * GetObjName(Int_t n)
Int_t ItemCanDo(const char *name)
void UpdateRatemeter(TObject *obj)
void SetItemClass(const char *name)
TClass * ItemClass(const char *name)
Bool_t IsAnalysisRunning()
void UnblockStatusOutput()
TGo4RootBrowserProxy(TGo4BrowserProxy *br=0)
virtual void Draw(Option_t *opt="")
static const char * ItemInfo(TGo4Slot *slot)
TObject * GetAssignedObject()
ULong64_t GetCurrentCount() const
void SyncRootBrowserSlots()
virtual void Delete(Option_t *option="")
const char * ItemClassName(const char *name)
virtual ~TGo4RootBrowserProxy()
Bool_t DefineRelatedObject(const char *itemname, const char *objectname, TString &objectitem, Int_t mask=3)
void DrawCondition(const char *itemname, TGo4Condition *con)
void SetIsFolder(Bool_t b)
TGo4Picture * FindPic(Int_t posy, Int_t posx)
TGo4BrowserProxy * fBrowser
TCanvas * MakeCanvas(const char *title=0)
const char * GetDateTime() const
TGo4BrowserItem * nextChild()
void DrawItem(const char *itemname)
static void SetItemCanDo(TGo4Slot *slot, Int_t cando)
TGo4Slot * BrowserTopSlot()
static TString subGO4SYS(const char *subdir)
void GetDrawAttributes(TObject *obj, Int_t index=UndefIndex)
void SetWorkHistogram(TH1 *histo)
void SetIconName(const char *name)
virtual Bool_t ProcessEvent(TGo4Slot *slot, TGo4Slot *source, Int_t id, void *param)
const char * GetLinkedHistogram()
void SetBrowser(TGo4BrowserProxy *br, TGo4RootBrowserProxy *br2)
void UpdateLoginfo(TObject *obj)
void DrawPicture(const char *itemname, TGo4Picture *pic, TPad *pad)
static Int_t DefineItemProperties(Int_t kind, TClass *cl, TString &pixmap)
Bool_t next(Bool_t goesinto=kTRUE)
TGo4BrowserItem * firstChild()