6 # include <TSelector.h> 14 # include <TObjArray.h> 58 Bool_t hasCmd = (cmd && cmd[0] !=
'\0');
60 lne.Form(
"gProof%s%s", (hasCmd ?
"->" :
""), (hasCmd ? cmd :
""));
62 return gROOT->ProcessLine(lne);
108 while ((obj = next()))
Register(obj);
123 if (&m ==
this)
return *
this;
129 while ((obj = next()))
Register(obj);
138 if (gROOT->IsBatch()) {
139 Warning(
"FastMonitor",
"Batch processing, no monitoring");
142 if (freq <= 0)
return;
146 gROOT->ProcessLine(Form(
"((FastMonitor*)%p)->SetName(" 147 "gProof->GetSessionTag())",
this));
148 Long_t ret =
ProofExec(Form(
"Connect(\"Feedback(TList *objs)\"," 149 " \"FastMonitor\",(void*)%p," 150 " \"Feedback(TList *objs)\")",
this));
152 Warning(
"FastMonitor",
"Failed to connect to Proof");
155 ProofExec(Form(
"SetParameter(\"PROOF_FeedbackPeriod\",%d)",
159 fTimer =
new TTimer(freq*1000);
160 fTimer->Connect(
"Timeout()",
"FastMonitor",
this,
"Handle()");
172 ProofExec(Form(
"Disconnect(\"Feedback(TList *objs)\"," 173 "(void*)%p,\"Feedback(TList* objs)\"",
this));
188 Register(descr->GetName(), descr->GetTitle(), descr->GetUniqueID(), proof);
199 const char*
title=
"",
204 n->SetUniqueID(flags);
207 ProofExec(Form(
"AddFeedback(\"%s\")", name));
234 Warning(
"Feedback",
"No list");
239 TVirtualPad* p =
fCanvas->cd(iPad);
243 Warning(
"Feedback",
"Object correspondig to pad %s (%d) not found",
285 if (gROOT->IsBatch()) {
286 Warning(
"FastMonitor",
"Batch processing, no monitoring");
301 if (nCol * nRow < nTotal) nCol++;
304 Info(
"FastMonitor",
"Create canvas with (%dx%d) [%d] pads",nCol,nRow,nTotal);
309 SetupDraw(i++, o->GetName(), o->GetTitle(), o->GetUniqueID());
331 TVirtualPad* p =
fCanvas->GetPad(i);
333 Warning(
"RegisterDraw",
"Not enough sub-pads (%d)", i);
340 p->SetTopMargin(0.01);
341 p->SetRightMargin(0.01);
342 p->SetName(Form(
"p_%s", name));
344 if (flags &
kLogx) p->SetLogx();
345 if (flags &
kLogy) p->SetLogy();
346 if (flags &
kLogz) p->SetLogz();
371 if (o->IsA()->InheritsFrom(TH1::Class())) {
372 TH1* h =
static_cast<TH1*
>(o);
373 TH1*
c =
static_cast<TH1*
>(h->Clone(Form(
"cpy_%s", h->GetName())));
380 if (nEvents <= 0)
return;
381 c->Scale(1./nEvents,
"width");
387 c->Draw(Form(
"%s %s",opt, (same ?
"same" :
"")));
388 c->SetBit(TObject::kCanDelete);
390 else if (o->IsA()->InheritsFrom(TGraph::Class())) {
392 TGraph*
c =
static_cast<TGraph*
>(g->Clone(Form(
"cpy_%s",g->GetName())));
394 c->Draw(Form(
"%s %s",opt, (same ?
"" :
"a")));
395 c->SetBit(TObject::kCanDelete);
399 else if (o->IsA()->InheritsFrom(TCollection::Class())) {
413 Printf(
"M: Is a generic object");
415 c->SetBit(TObject::kCanDelete);
429 TString t = Form(
"p_%s", name.Data());
430 while ((p =
fCanvas->GetPad(i))) {
431 if (t.EqualTo(p->GetName()))
return p;
449 if (path.Index(
"/") == kNPOS)
450 return l->FindObject(path);
452 Int_t nTokens = tokens->GetEntriesFast();
455 for (
Int_t i = 0; i < nTokens; i++) {
456 TObject* o = current->FindObject(tokens->At(i)->GetName());
458 if (i == nTokens - 1) {
462 if (!o->IsA()->InheritsFrom(TCollection::Class())) {
463 Warning(
"FindPadObject",
"Path object %s of %s is not a collection " 464 "but a %s", o->GetName(), path.Data(), o->ClassName());
static Long_t ProofExec(const char *cmd=0)
TObject * FindPadObject(const Char_t *padName, TCollection *l)
void Feedback(TList *objs)
FastMonitor & operator=(const FastMonitor &m)
void Connect(Int_t freq=-1)
Bool_t HandleTimer(TTimer *)
void SetupDraw(Int_t i, const char *name, const char *option, UInt_t flags=0)
Double_t nEvents
plot quality messages
const char * GetName() const
void Register(TObject *descr, Bool_t proof=true)
TVirtualPad * FindPad(const TString &name)
void Register(const char *name, const char *title="", UInt_t flags=0, Bool_t proof=true)
FastMonitor(const FastMonitor &m)
void SetName(const char *name)
void DrawObject(TObject *o, Option_t *opt, Bool_t scale, Bool_t nostats, Bool_t same=false)
FastMonitor(TSelector *s, const TString &name)