[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ROOT/gnuplot



Hi all,

On Thu, 2006-06-08 at 23:48 +0200, Yannick patois wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> AS: Note new email address.
> 
> Hi,
> 
> Ricky Egeland wrote:
> > I am responding to a thread I found on google which was active nearly a
> > year ago about ROOT (root.cern.ch) as a replacement for gnuplot.
> > http://lists.debian.org/debian-science/2005/09/msg00024.html
> > You had mentioned you were interested in this project.
> > I have a need to for a program that outputs ROOT plots but takes data
> > from stdin and command line arguments (a la gnuplot).  I started this
> > project but then decided to see if any work has already been done on
> > this idea.  Can you say if it has?  Thank you.
> 
> As far as I know, nothing has been done, but as I have been busy on
> other subject at that time, I lost track of that subject. That's why I
> forward it on the debian-science list where this discussion occurred.
> 
> I'm still interested to contribute to such a project.

Hmm, writing a GNUPlot-like front-end for ROOT, is about the sillyst
thing I've heard in a long time.   Sure, you could do some thing like 

  int RGNUPlot() 
  {
    do {
      std::string str; 
      std::cin >> str;
      
      if (str == "plot")        ret = handle_plot();
      else if (str == "splot")  ret = handle_splot();
      ...
      else if (str == "quit")   handle_quit();
      else {
        std::cerr << "Unknown command: " << str << std::endl;
        return 1;
      }
    } while (ret >= 0);
  }
   
and then call that from the event loop of ROOT (or something like
that).  

However, ROOT already has a (much more) powerful command line interface
that does all this for you.  For example 

   TNtuple nt("X:Y:EX:EY");
   nt.ReadFile("data.dat", 0);
   nt.Draw("X","Y");
   TF1 f("f", "[0] * (1-exp(-[1]*x))");
   nt.Fit(&f);

Sure, it's a little longer than 

  plot 'data.dat' 1:2
  f(x) = a * (1 - exp(-b * x))
  fit f(x) 'data.dat' using 1:2 via a,b
  plot 'data.dat' using 1:2, f(x)

but convenience functions, scripts, GUIs, what-not, can easily be added
to ROOT.  Forbie my bad GNUPlot code - It's been a while since I used
it :-) 

If you'd prefer to use Python or Ruby for the interface, you can do that
too. 

In essence, I think you'd be wasting your time pursuing a GNUPlot-like
interface to ROOT.  Time much better spent learning C++ (or teaching
others the basics of C++), writing a GUI, or do scientific work :-)

Bad news is, that ROOT didn't make it to the `experimental' dist just
yet, because of license (sigh!) problem in obscure places in the code.
I'll update the Wiki soon, and any contributions are welcome.   For
example, does any one know of a DFSG-free RSA implementation? 

Yours,

-- 
 ___  |  Christian Holm Christensen 
  |_| |  -------------------------------------------------------------
    | |  Address: Sankt Hansgade 23, 1. th.  Phone:  (+45) 35 35 96 91
     _|           DK-2200 Copenhagen N       Cell:   (+45) 24 61 85 91
    _|            Denmark                    Office: (+45) 353  25 404
 ____|   Email:   cholm@nbi.dk               Web:    www.nbi.dk/~cholm
 | |



Reply to: