-
Notifications
You must be signed in to change notification settings - Fork 3
Usage: Histograms and Graphs
Andrey edited this page Apr 9, 2020
·
16 revisions
import org.jlab.jroot.ROOTFile
import org.jlab.groot.data.H1F
import org.jlab.groot.data.H2F
import org.jlab.groot.data.GraphErrors
def h1 = new H1F("h1","title h1",100,-3,3)
def h2 = new H2F("h2","title h2",100,-3,3,100,0,10)
def gr = new GraphErrors("gr")
// Fill the objects above
def ff = new ROOTFile('test0.root')
ff.addDataSet(h1)
ff.addDataSet(h2)
ff.addDataSet(gr)
ff.close()
The resulting ROOT file contains h1
, h2
and gr
objects
import org.jlab.jroot.ROOTFile
import org.jlab.groot.data.H1F
def h1 = new H1F("h1","title h1",100,-3,3)
def ff = new ROOTFile('test0.root')
ff.mkdir("/root/xyz")
ff.cd("/root/xyz")
ff.addDataSet(h1)
ff.close()
import org.jlab.jroot.ROOTFile
import org.jlab.groot.data.H1F
def h1 = new H1F("/root/test/h1","title h1",100,-3,3)
def ff = new ROOTFile('test0.root')
ff.addDataSet(h1)
ff.close()