Class: TTree

JSROOT. TTree

new JSROOT.TTree()

JSROOT methods for ROOT TTree class

TTree only can be read from the existing ROOT file, there is no possibility to create and fill tree

Example
JSROOT.openFile("https://root.cern/js/files/hsimple.root")
      .then(file => file.readObject("ntuple;1"))
      .then(tree => JSROOT.draw("drawing", tree, "px:py::pz>5"));

Methods

staticJSROOT.TTree.Draw(args){Promise}

JSROOT implementation of TTree::Draw

Name Type Description
args object | string

different setting or simply draw expression

Name Type Default Description
expr string

draw expression

cut string optional

cut expression (also can be part of 'expr' after '::')

drawopt string optional

draw options for result histogram

firstentry number 0 optional

first entry to process

numentries number optional

number of entries to process, all by default

branch object optional

TBranch object from TTree itself for the direct drawing

progress function optional

function called during histogram accumulation with argument { obj: draw_object, opt: draw_options }

Returns:
Type Description
Promise with object like { obj: draw_object, opt: draw_options }

staticJSROOT.TTree.FindBranch(name){Object}

Search branch with specified name

Name Type Description
name string

name of the branch

Returns:
Type Description
Object found branch

staticJSROOT.TTree.GetBranch(){Object}

Get branch with specified id

All sub-branches checked as well

Returns:
Type Description
Object branch

staticJSROOT.TTree.GetNumBranches(){number}

Returns number of branches in the TTree

Checks also sub-branches in the branches

Returns:
Type Description
number number of branches

staticJSROOT.TTree.Process(selector, args){Promise}

Process selector

Name Type Description
selector object

instance of JSROOT.TSelector class

args object optional

different arguments

Name Type Description
firstentry number optional

first entry to process, 0 when not specified

numentries number optional

number of entries to process, all when not specified

Returns:
Type Description
Promise with TSelector instance