nab
July 6, 2017, 2:13pm
1
Dear Developers,
I am trying to plot 4th column of “inputs.lhco” file and when i run “input.c” file i get following error
"Error in : unexpected character or eof found "
Kindly help me in solving this issue.
Thanks.
Regards,
Nab
nab.zip (1.1 MB)
Some lines in your “inputs.lhco” file have 3 numbers while another lines have 11 and your “input.c” macro is not able to deal with it (it expects 5 numbers per line).
nab
July 6, 2017, 2:22pm
3
I have done it with 11 numbers per line but it is giving same error.
nab
July 6, 2017, 2:24pm
4
Yes some lines are having just 3 numbers and others having 11. How to deal with this kind of file?
In order to understand what this data file contains and how to read it, you need to talk to the author of this file.
couet
July 6, 2017, 3:00pm
6
Assuming:
you are on Linux
you want to skip lines starting with 0 (line with 3 numbers only ).
Then the following macro will do the job:
{
gSystem->Exec("cat inputs.lhco | sed -e 's/^ 0/# 0/' > inputs.lhco2");
TNtuple t("t","test","h:a:b:c:m:v6:v7:v8:v9:v10:v11");
t.ReadFile("inputs.lhco2");
TCanvas *c1 = new TCanvas("c1","c1",600,400);
TFile *mfile = new TFile ("input2.4.root","RECREATE");
t.Write("t");
t.Draw("a");
}
nab
July 6, 2017, 3:51pm
7
Thank you so much for your time. This is working now.
Cheers,
Nab
system
Closed
July 20, 2017, 3:52pm
8
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.