Print histogram in ascii file in ROOT 6


_ROOT Version:6.12
_Platform:F27
_Compiler:gcc version 7.3.1


I am using this command 'root[0] histogram->Print(“all”); > histo.dat` to print the contents of a histogram in an ascii file but I get the following error

root [3] hXS_Pu240_EXP_A->Print("all"); > Pu240_A_1000bpd.dat
ROOT_prompt_3:1:32: error: expected expression
hXS_Pu240_EXP_A->Print("all"); > Pu240_A_1000bpd.dat
                               ^
ROOT_prompt_3:1:34: error: use of undeclared identifier 'Pu240_A_1000bpd'
hXS_Pu240_EXP_A->Print("all"); > Pu240_A_1000bpd.dat

Note that the exact same command could be executed without any problem in root5.

Any idea why it’s not working now?

Thank a lot for your answer!
I tried using

hXS_Pu240_EXP_A; >TEST.dat

But I got

ROOT_prompt_6:1:18: error: expected expression
hXS_Pu240_EXP_A; > TEST.dat
                 ^
ROOT_prompt_6:1:20: error: use of undeclared identifier 'TEST'
hXS_Pu240_EXP_A; > TEST.dat

So I am missing something. Any idea?

ROOT Forum -> Search -> “ROOT 6 redirect”

They way to do it was the following

root [0] .> file.dat
histogram->Print("all")
.>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.