ROOT.NET

A set of wrappers for .NET around the popular ROOT data analysis package.

It allows you to write the following code in C#, for example (or similar in any .NET language) to fill a histogram:

using System;
using ROOTNET.Interface;

class Program
{
   
static void Main(string[] args)
    {

        NTFile f = new ROOTNET.NTFile("junk.root", "RECREATE");
        NTH1F h = new ROOTNET.NTH1F("hi", "dude", 100, 0.0, 10.0);

        for (int i = 0; i < 100; i++) {
            h.Fill(4.0);
        }
        f.Write();
        f.Close();

      NTFile f2 = new ROOTNET.NTFile("junk.root", "READ");
       
NTH1 h2 = (NTH1)f2.Get("hi");

        if (h2 != null)
        {
           
int count = (int)h2.GetBinContent(41);
           
Console.WriteLine(count);
        }
}

Usage

You need to download a matching version of ROOT and the wrappers, and then add them as references to your project. And you are ready to go!

Other Information

SourceForge.net Logo