Hi everybody,
I am a newbie here so please excuse me for the banality of my issue.
I have some histograms stored in 2 root files (here attached), and I wrote this very simple macro to plot them in the same canvas
{
TFile f1("L21M500.root");
f1.ls();
f1.cd("d_L21M500;1");
gDirectory->ls();
TH1D *h1=(TH1D*) f1.Get("histo_PTe1");
TFile f2("tt_0PU.root");
f2.ls();
f2.cd("d_tt4p;1");
gDirectory->ls();
TH1D *h2=(TH1D*) f2.Get("PT_e1");
h1->SetLineColor(kRed);
h2->SetLineColor(kGreen);
h1->Draw("l");
h2->Draw("same");
gPad->BuildLegend();
}
Anyway, when running the macro I got some errors:
[/usr/local/Cellar/root/6.10.08/lib/root/libCling.so] cling_runtime_internal_throwIfInvalidPointer (no debug info)
[<unknown binary>] (no debug info)
[<unknown binary>] (no debug info)
[/usr/local/Cellar/root/6.10.08/lib/root/libCling.so] cling::IncrementalExecutor::runStaticInitializersOnce(cling::Transaction const&) (no debug info)
[/usr/local/Cellar/root/6.10.08/lib/root/libCling.so] cling::Interpreter::executeTransaction(cling::Transaction&) (no debug info)
[/usr/local/Cellar/root/6.10.08/lib/root/libCling.so] cling::IncrementalParser::commitTransaction(llvm::PointerIntPair<cling::Transaction*, 2u, cling::IncrementalParser::EParseResult, llvm::PointerLikeTypeTraits<cling::Transaction*>, llvm::PointerIntPairInfo<cling::Transaction*, 2u, llvm::PointerLikeTypeTraits<cling::Transaction*> > >&, bool) (no debug info)
[/usr/local/Cellar/root/6.10.08/lib/root/libCling.so] cling::IncrementalParser::Compile(llvm::StringRef, cling::CompilationOptions const&) (no debug info)
[/usr/local/Cellar/root/6.10.08/lib/root/libCling.so] cling::Interpreter::EvaluateInternal(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, cling::CompilationOptions, cling::Value*, cling::Transaction**, unsigned long) (no debug info)
[/usr/local/Cellar/root/6.10.08/lib/root/libCling.so] cling::Interpreter::process(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, cling::Value*, cling::Transaction**, bool) (no debug info)
[/usr/local/Cellar/root/6.10.08/lib/root/libCling.so] cling::MetaProcessor::readInputFromFile(llvm::StringRef, cling::Value*, unsigned long, bool) (no debug info)
[/usr/local/Cellar/root/6.10.08/lib/root/libCling.so] TCling::ProcessLine(char const*, TInterpreter::EErrorCode*) (no debug info)
[/usr/local/Cellar/root/6.10.08/lib/root/libCling.so] TCling::ProcessLineSynch(char const*, TInterpreter::EErrorCode*) (no debug info)
[/usr/local/Cellar/root/6.10.08/lib/root/libCore.so] TApplication::ExecuteFile(char const*, int*, bool) (no debug info)
[/usr/local/Cellar/root/6.10.08/lib/root/libRint.so] TRint::ProcessLineNr(char const*, char const*, int*) (no debug info)
[/usr/local/Cellar/root/6.10.08/lib/root/libRint.so] TRint::Run(bool) (no debug info)
[/usr/local/Cellar/root/6.10.08/bin/root.exe] main (no debug info)
[/usr/lib/system/libdyld.dylib] start (no debug info)
libc++abi.dylib: terminating with uncaught exception of type cling::InvalidDerefException: Trying to dereference null pointer or trying to call routine taking non-null arguments
I add that even if I use ROOT 6.10/08 I got the same with other versions in lxplus.
Can anyone please help me to fix this problem?
Thanks a lot.
Best,
Elvin
tt_0PU.root (21.9 KB)
L21M500.root (18.2 KB)