TFile

TFile

new TFile()

Interface to read objects from ROOT files

Source:

Use openFile to create instance of the class

Methods

getFileName()

Returns file name

Source:

(async) readDirectory(dir_name, cycleopt) → {Promise}

Read the directory content from a root file

Source:

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

Parameters:
Name Type Attributes Description
dir_name string

directory name

cycle number <optional>

directory cycle

Returns:
  • promise with read directory
Type
Promise

(async) readObject(obj_name, cycleopt) → {Promise}

Read any object from a root file

Source:

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

Example
let f = await openFile('https://root.cern/js/files/hsimple.root');
let obj = await f.readObject('hpxpy;1');
console.log(`Read object of type ${obj._typename}`);
Parameters:
Name Type Attributes 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:

promise with object read

Type
Promise