Class: TFile

JSROOT. TFile

new JSROOT.TFile()

Interface to read objects from ROOT files

Use JSROOT.openFile to create instance of the class

Methods

getFileName()

Returns file name

readDirectory(dir_name, cycle){Promise}

Read the directory content from a root file

If directory was already read - return previously read object Same functionality as JSROOT.TFile.readObject

Name Type Description
dir_name string

directory name

cycle number optional

directory cycle

Returns:
Type Description
Promise
  • promise with read directory

readObject(obj_name, cycle){Promise}

Read any object from a root file

One could specify cycle number in the object name or as separate argument

Name Type Description
obj_name string

name of object, may include cycle number like "hpxpy;1"

cycle number optional

cycle number, also can be included in obj_name

Returns:
Type Description
Promise promise with object read
Example
JSROOT.openFile("https://root.cern/js/files/hsimple.root")
        .then(f => f.readObject("hpxpy;1"))
        .then(obj => console.log(`Read object of type ${obj._typename}`));