Can anyone please guide me to how can open the example 4a root file?

root [0] root -l B4.root
ROOT_prompt_0:1:7: error: use of undeclared identifier ‘l’
root -l B4.root
^
root [1] root -l B4.root
ROOT_prompt_1:1:7: error: use of undeclared identifier ‘l’
root -l B4.root
^
root [2] .ls
root [3] f.ls()
input_line_11:2:3: error: use of undeclared identifier ‘f’
(f.ls())
^
Error in : Error evaluating expression (f.ls())
Execution of your code was aborted.
root [4]

Dear @Ratilal_Meher ,

Thanks for writing on the forum. I suggest you take a look at our manual, specifically here, which explains that you have to open the ROOT prompt from the command line, not use the root command when you are already inside the prompt.

Cheers,
Vincenzo

$ root -l B4.root
root[0] _file0->ls()

or:

$ root
root[0] auto f = new TFile("B4.root")
root[1] f->ls()

or (if you only want to see the contain of the file):

$ rootls B4.root
1 Like