void k()
{
TFile *f1 = TFile::Open("/home/lucas/Downloads/aasd/asd/a.root");
TTree *tr1 = (TTree *) f1->Get("a");
tr1->Draw("hist");
TFile *f2 = TFile::Open("/home/lucas/Downloads/aasd/asd/b.root");
TTree *tr2 = (TTree *) f2->Get("b");
tr2->Draw("hist same");
TFile *f3 = TFile::Open("/home/lucas/Downloads/aasd/asd/c.root");
TTree *tr3 = (TTree *) f3->Get("c");
tr3->Draw("hist same");
}
When i run this code, i got the following error lines:
#0 0x00007fadc6886dba in wait4 () from /usr/lib/x86_64-linux-gnu/libc.so.6
#1 0x00007fadc67f60e7 in ?? () from /usr/lib/x86_64-linux-gnu/libc.so.6
#2 0x00007fadc6eda0ee in TUnixSystem::StackTrace() () from /home/lucas/Downloads/root_v6.24.06.Linux-ubuntu20-x86_64-gcc9.3/root/lib/libCore.so.6.24
#3 0x00007fadc249a5a0 in cling::MultiplexInterpreterCallbacks::PrintStackTrace() () from /home/lucas/Downloads/root_v6.24.06.Linux-ubuntu20-x86_64-gcc9.3/root/lib/libCling.so
#4 0x00007fadc248dce2 in cling_runtime_internal_throwIfInvalidPointer () from /home/lucas/Downloads/root_v6.24.06.Linux-ubuntu20-x86_64-gcc9.3/root/lib/libCling.so
#5 0x00007fadacdee12d in ?? ()
#6 0x0000000000000016 in ?? ()
#7 0x0000559a00dd3300 in ?? ()
#8 0x00007fff278dd410 in ?? ()
#9 0x00007fff278ddb00 in ?? ()
#10 0x0000000000000000 in ?? ()
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_60:1:
/home/lucas/Downloads/aasd/asd/k.C:5:1: warning: null passed to a callee that requires a non-null argument [-Wnonnull]
Now, i can’t understand what does this error means. Is it a error in my code or something more complex, as for example, a problem in root installation?
To be more precise, i am trying to merge the three .root histograms above.