But I do not get anything instead an error and a warning
Error in <HandleInterpreterException>: Trying to dereference null pointer or trying to call routine taking non-null arguments.
Execution of your code was aborted.
In file included from input_line_10:1:
warning: null passed to a callee that requires a non-null argument [-Wnonnull]
clust_chip_0->Draw();
^~~~~~~~~~~~
Hi,
since your histogram seem does not exist, can you try in the interactive session to check what is the output
of f->Get("clust_Chip_0") .
Because if the output is nullptr the next error is perfectly fine and the problem could be in how the histogram has been saved in the file.
[quote=“Wile_E_Coyote, post:3, topic:38006”]
TH1F *clust_chip_0; gDirectory->GetObject(“clust_Chip_0”, clust_chip_0);
[/quote]Thanks for the suggestion
I have tried it and I got same response.
ht.root file is attached for inspectionht.root (37.4 KB)
You have an extra space character in the beginning of all histrogram names, e.g. " clust_Chip_0" (you’d better fix the procedure which creates all these histograms).
Hi,
Thanks for pointing out the mistake and I have fixed it.
Now I can read the histogram and its values but still not able to draw.
the " ```
clust_chip_0->Draw();
gives an empty canvas