Back Midas Rome Roody Rootana
  Root Display GUI, Page 7 of 7  Not logged in ELOG logo
ID Date Author Topic Subjectup
  106   19 Dec 2005 Konstantin OlchanskiReleaseroody directory reorganization and Makefile changes
> 2) the files have been shuffled around

Joe, is there any particular reason why the roody executable is not placed into a
"bin" directory? Just curious. (As one could argue both way: .../bin/roody is more
consistant with MIDAS; .../bin/roody creates a junk directory with only one file
in it).

K.O.
  154   19 Mar 2021 Alexey KalininBug Reportroody failed to start
roody failed to start with -P flag
running rootana analyzer with -P argument
commenting RecursiveRemove in TNetDirectory(.cxx .h) (rootana)  helps.
Any other suggestions?
Alexey.
  155   26 Mar 2021 Alexey KalininBug Reportroody failed to start
Also, 
Mine TDirectory fOnlineHistDir (rootana online ) has more then 1000 histograms 
with difficult hierarchy. Starting roody -P (TNEtDirectory support) takes 30-60 
seconds, when jsroot THttpServer ready to go in a moment.
> roody failed to start with -P flag
> running rootana analyzer with -P argument
> commenting RecursiveRemove in TNetDirectory(.cxx .h) (rootana)  helps.
> Any other suggestions?
> Alexey.
  144   19 Oct 2010 Konstantin OlchanskiInforoody good on macos 10.6.4
For the record, ROODY svn rev 236 builds and runs on MacOS 10.6.4 with ROOT 5.26.00c. K.O.
  105   13 Dec 2005 Joe ChumaBug Fixroody graphics pad problems fixed
Problems with deciding which graphics pad to choose for drawing have been fixed.
 Now the group pads (created by choosing draw group from the group context menu)
and the zoom pad (created by choosing zoom option from the pad context menu) are
treated distinctly from the canvases titled "canvasN" for N=0,1,2,...  Also, a
user supplied zone setting will be displayed in the zones menu, and can be
chosen again later.  Problems with the cvs file locks have been repaired (by
P.Amaudruz).
  119   07 Jun 2006 Joe ChumaBug Fixroody online fixes
Roody has been modified so the resetting of individual histograms should now work. This involved a check for "//" at beginning of path to histogram and remove if it is there.

Also, the properties of the refresh button have been changed. It is enabled when there is a socket connection, and if the refresh rate = 0, button says "refresh now", but if the refresh rate > 0, button toggles refresh on/off (with appropriate labeling).
  120   22 Jun 2006 Joe ChumaBug Fixroody refresh button fix (again)
The refresh button was in the wrong state the first time the user set the refresh rate for online histograms.
  143   19 Oct 2010 Konstantin OlchanskiBug Fixroody update
And you thought that roody was dead? Well, here is an update - implement "reopen" for ROOT files, add 
"reopen" button to main menu, fix duplicated histogram names after "reopen" (at the cost of losing display 
of histogram titles in the tree view).
K.O.
  145   19 Oct 2010 Konstantin OlchanskiBug Fixroody update, fix open of
> And you thought that roody was dead? Well, here is an update - implement "reopen" for ROOT files, add 
> "reopen" button to main menu, fix duplicated histogram names after "reopen" (at the cost of losing display 
> of histogram titles in the tree view).
> K.O.

Forgot to mention the main reason of this update: when looking at ROOT files, ROODY could not open any subdirectories because of some name 
changes inside ROOT. Now fixed.

ROODY svn rev 236
svn checkout https://ladd00.triumf.ca/svn/roody/trunk roody
K.O.
  29   20 Dec 2003 Konstantin silence message "No Loaded Online Histograms"
I commited a change to TTriumfFileGUI.cxx to silence the message "No Loaded
Online Histograms". K.O.
  150   24 May 2012 Konstantin OlchanskiForumtest
test of Roody forum email notification. K.O.
  20   29 Jul 2003 Konstantin test midas experiment
I revived the test midas experiment on midtis06. We can start using it to
develop the online connection to the root gui. Here are the instructions
on running things:
 - login to midtis06
 - set ROOTSYS to /send/home/olchansk/daq/root
 - cd /send/home/olchansk/daq/root
 - ./start_daq (four xterm windows should open:
   1) mhttpd (on port 8080). Point a web browser to http://midtis06:8080
   2) odbedit
   3) a front end
   4) an analyzer)
 - run ~olchansk/daq/midas/linux/bin/rmidas
   enter "midtis06" in the "hostname" box.
   five histogram names should appear in the list on the left: CADC00
through 03 and ADCSUM. Click on the names to see the histograms.
 - start a run (from a web browser, or enter "start" in odbedit)
 - the frontend window should count 100 events/sec.
 - click on the rmidas "update" button, the counts should increment.
This is all done by vanilla ROOT and MIDAS.

The ROOT code to access the MIDAS histograms is in
~olchansk/daq/midas/src/rmidas.c, functions:
 - ConnectServer()
 - GetHistoList()
 - GetHisto()
 - ClearHisto()

K.O.
  130   16 Nov 2007 John M O'DonnellBug Fixuint32_t or UInt_t
I just downloaded and compiled the latest tarball.

line 98 of DataSourceTNetFolder.h complained about unit32_t.  While I could have
added an include to make this work, I instead changed it to use the ROOT type
UInt_t.

Perhaps this change should be included in the distribution
Attachment 1: DataSourceTNetFolder.h
//
// DataSourceTNetFolder.h
//
// $Id$
//

#include "DataSourceBase.h"

#include "TSocket.h"
#include "TFolder.h"

class DataSourceTNetFolder: public DataSourceBase
{
 private:
  TSocket *fSocket;

 public:
  DataSourceTNetFolder(TSocket* socket) // ctor
    {
      fName = socket->GetName();
      fName += ":";
      char buf[256];
      sprintf(buf, "%d", socket->GetPort());
      fName += buf;
      fSocket = socket;
    }

  ~DataSourceTNetFolder() // dtor
    {
      fSocket = NULL;
    }

  void Close()
    {
      fSocket->Close();
    }

  void Reopen()
    {
      std::string host = fSocket->GetName();
      int         port = fSocket->GetPort();
      fSocket->Close();
      delete fSocket;
      fSocket = new TSocket(host.c_str(), port);
    }

  static TObjArray* ListRemoteObjects(TSocket* sock, const char* foldername)
    {
      size_t p = 0;
      
      {
	std::string str = "GetPointer ";
	str += foldername;
	if (!sock->Send(str.c_str()))
	  return NULL;
	
	TMessage *m = NULL;
	if (!sock->Recv(m))
	  return NULL;
	
	if (!m)
	  return NULL;
	
	*m >> p;
	delete m;
	m = NULL;
      }

      if (!sock->Send("GetListOfFolders"))
	return NULL;

      TMessage m(kMESS_ANY);
      m.Reset();
      m << p;

      if (!sock->Send(m))
	return NULL;

      TMessage *mr = 0;
      if (!sock->Recv(mr))
	return NULL;

      TObjArray *list = NULL;

      if (mr)
	{
	  list = (TObjArray *) mr->ReadObjectAny(mr->GetClass());
	}
      
      delete mr;
      return list;
    }

  static TObject* ReadRemoteObject(TSocket* sock, const char* foldername, const char* objname)
    {
      printf("ReadRemoteObject %s from folder %s\n", objname, foldername);

      UInt_t p = 0;
      
      {
	std::string str = "GetPointer ";
	str += foldername;
	if (!sock->Send(str.c_str()))
	  return NULL;
	
	TMessage *m = NULL;
	if (!sock->Recv(m))
	  return NULL;
	
	if (!m)
	  return NULL;
	
	*m >> p;
	delete m;
	m = NULL;
      }

      printf("Folder %s pointer %d\n", foldername, (int)p);

      {
	std::string str = "FindObject ";
	str += objname;
	if (!sock->Send(str.c_str()))
	  return NULL;

	TMessage m(kMESS_ANY);
	m.Reset();
	m << p;
	if (!sock->Send(m))
	  return NULL;

	TMessage *mr = 0;

	if (!sock->Recv(mr))
	  return NULL;

	TObject *obj = NULL;

	if (mr)
	  {
	    bool adddir = TH1::AddDirectoryStatus();
	    TH1::AddDirectory(false);

	    obj = (TObject*)mr->ReadObjectAny(0);

	    TH1::AddDirectory(adddir);
	  }
	
	delete mr;
	return obj;
      }
    }

  static void ExecuteRemoteCommand(TSocket* socket, const char *line)
    {
      if (!socket->IsValid())
	return;
      
      // The line is executed by the CINT of the server
      socket->Send("Execute");
      socket->Send(line);
    }

  void EnumerateTFolder(ObjectList* list, TFolder* f, ObjectPath path)
  {
    TIterator   *iterator = f->GetListOfFolders()->MakeIterator();
    while (1)
      {
	TNamed *obj = (TNamed*)iterator->Next();
	if (obj == NULL)
	  break;

	const char* classname = obj->ClassName();
	const char* name      = obj->GetName();

	if (strcmp(classname,"TFolder") == 0)
	  {
	    TFolder* f = (TFolder*)obj;
	    ObjectPath p = path;
	    p.push_back(name);
	    EnumerateTFolder(list, f, p);
	  }
	//else if (strcmp(classname,"TDirectory") == 0)
	//  {
	//    TDirectory* d = (TDirectory*)obj;
	//    ObjectPath p = path;
	//    p.push_back(name);
	//    EnumerateTDirectory(list, d, p);
	//  }
	else
	  {
	    ObjectPath p = path;
	    std::string s;
	    s += name;
	    //s += "(";
	    //s += classname;
	    //s += ")";
	    p.push_back(s);
	    list->push_back(p);
	  }
      }
  }

  TFolder* ReadFolder(const char* foldername, ObjectPath path, const char* name)
    {
      TObject* obj = ReadRemoteObject(fSocket, foldername, name);
      if (!obj)
	return NULL;

      if (obj->InheritsFrom(TFolder::Class()))
	return (TFolder*)obj;

      ObjectPath p = path;
      p.push_back(name);

      return NULL;
    }

  void Enumerate(ObjectList* list, const char* foldername, ObjectPath path)
  {
    TCollection *contents = ListRemoteObjects(fSocket, foldername);
    if (!contents)
      return;
    TIterator   *iterator = contents->MakeIterator();
    while (1)
      {
	TNamed *obj = (TNamed*)iterator->Next();
	if (obj == NULL)
	  break;

	const char* classname = obj->ClassName();
	const char* name      = obj->GetName();

	if (strcmp(classname,"TObjString") == 0)
	  {
	    TObject* xobj = ReadRemoteObject(fSocket, foldername, name);
	    if (!xobj)
	      continue;
	    
	    if (xobj->InheritsFrom(TFolder::Class()))
	      {
		TFolder *fff = (TFolder*)xobj;
		ObjectPath p = path;
		p.push_back(name);
		EnumerateTFolder(list, fff, p);
		continue;
	      }
	  }

	ObjectPath p = path;
	std::string s;
	s += name;
	//s += "(";
	//s += classname;
	//s += ")";
	p.push_back(s);
	list->push_back(p);
      }
  }

  ObjectList GetList()
  {
    ObjectList list;
    ObjectPath path;
    path.push_back(fName);
    char *topfolder = "histos";
    path.push_back(topfolder);
    Enumerate(&list, topfolder, path);
    return list;
  }

  TObject* GetObject(const ObjectPath& path)
    {
      //gDirectory->pwd();
      //gDirectory->ls();
      
      const char *name = path.back().c_str();
      printf("Get object %s from %s\n", name, fName.c_str());

      const char *foldername = path[path.size()-2].c_str();

      TObject* obj = ReadRemoteObject(fSocket, foldername, name);

      return obj;
    }

  void ResetAll()
  {
    printf("ResetAll %s\n", fName.c_str());

    ExecuteRemoteCommand(fSocket, "gAnalyzer->ResetAllHistos()");
  }

  void ResetObject(const ObjectPath& path)
  {
    printf("ResetObject %s\n", path.toString().c_str());

    std::string name = path.back();

    std::string s;
... 17 more lines ...
  131   16 Nov 2007 Konstantin OlchanskiBug Fixuint32_t or UInt_t
> I just downloaded and compiled the latest tarball.
> 
> line 98 of DataSourceTNetFolder.h complained about unit32_t.  While I could have
> added an include to make this work, I instead changed it to use the ROOT type
> UInt_t.

Uint_t is technically incorrect. The data returned from the socket connection is a
32-bit pointer to an object in the remote process (how do they come up with
communication protocols like this?!?). The type "Uint_t" is not defined to be of any
particular size and is not necessarily big enough to hold a 32-bit unsigned integer.

According to the "C99" standard, the correct C data type for 32-bit unsigned
integers is uint32_t, defined in "#include <stdint.h>", e.g. see
http://www.oreillynet.com/pub/a/network/2003/10/07/michael_barr.html

I have now added the missing "#include <stdint.h>" statement to
DataSourceTNetFolder.h, commited as revision 230.

I am puzzled why the code compiled without this include statement, possibly on my
SL4.3 machine with ROOT v5.16.00, some ROOT or system header file included it for
me. I am curious what system you use where this code failed to compile?

K.O.
  132   19 Nov 2007 John M O'DonnellBug Fixuint32_t or UInt_t
I'm using Redhat workstation with:
  gcc version 3.3.3 20040412 (Red Hat Linux 3.3.3-7)
  ROOT version 5.16/00

it is unlikely that UInt_t will ever be too small.  If it is too small, then ROOT will
break!  It is clearly intended to be 32 bits long.  From Rtypes.h:

#ifdef R__INT16
typedef long           Int_t;       //Signed integer 4 bytes
typedef unsigned long  UInt_t;      //Unsigned integer 4 bytes
#else
typedef int            Int_t;       //Signed integer 4 bytes (int)
typedef unsigned int   UInt_t;      //Unsigned integer 4 bytes (unsigned int)
#endif

Of course, stdint.h is defined in a standard.  However ROOT doesn't really try to follow
the standard (CINT compiles a language similar to C++, but not exactly C++), and indeed
the file stdint.h is not explicitly included in any of $ROOTSYS/include/*.h.

John.

> > I just downloaded and compiled the latest tarball.
> > 
> > line 98 of DataSourceTNetFolder.h complained about unit32_t.  While I could have
> > added an include to make this work, I instead changed it to use the ROOT type
> > UInt_t.
> 
> Uint_t is technically incorrect. The data returned from the socket connection is a
> 32-bit pointer to an object in the remote process (how do they come up with
> communication protocols like this?!?). The type "Uint_t" is not defined to be of any
> particular size and is not necessarily big enough to hold a 32-bit unsigned integer.
> 
> According to the "C99" standard, the correct C data type for 32-bit unsigned
> integers is uint32_t, defined in "#include <stdint.h>", e.g. see
> http://www.oreillynet.com/pub/a/network/2003/10/07/michael_barr.html
> 
> I have now added the missing "#include <stdint.h>" statement to
> DataSourceTNetFolder.h, commited as revision 230.
> 
> I am puzzled why the code compiled without this include statement, possibly on my
> SL4.3 machine with ROOT v5.16.00, some ROOT or system header file included it for
> me. I am curious what system you use where this code failed to compile?
> 
> K.O.
  35   16 Jan 2004 Joe x-axis zoom with online histograms
If you zoom in on the x-axis for an online histogram, the zoom now remains
in effect when the histogram is refreshed.  Also, the check mark in the
refresh drop-down menu now stays with the proper value.  Y-axis zooming is
also implemented, but commented out for now, since not sure if this is a
good idea for 1D histograms.
  85   26 Jan 2005 Joe ChumaBug Fixzooming in on a multiframe canvas
A "ZoomOption" has been added to the context menu produced by right clicking 
anywhere on a histogram frame.  This opens up a new canvas, titled "Zoom
Canvas", containing a copy of the histogram in the original frame.
ELOG V3.1.4-2e1708b5