I am wondering if this is due to a coding error or internal error.
I am just trying to get the bin content of a histogram which I loaded from a root file. It works just fine in the interactive window. However, not while I am trying to compile a macro.
==========================================
=============== STACKTRACE ===============
==========================================
================ Thread 0 ================
0x13fd5ae ??
0x13fd041 ??
libCling!cling::runtime::internal::EvaluateDynamicExpression()
libCling!cling::runtime::internal::EvaluateDynamicExpression()
libCling!cling::runtime::internal::EvaluateDynamicExpression()
libCling!cling::runtime::internal::setValueWithAlloc()
libCling!TCling::GetTopLevelMacroName()
libCling!TCling::ProcessLine()
libCore!TApplication::ProcessLine()
libRint!TRint::ProcessLineNr()
libRint!TRint::HandleTermInput()
libCore!TWinNTSystem::DispatchOneEvent()
libCore!TSystem::InnerLoop()
libCore!TApplication::Run()
libRint!TRint::Run()
root!??
root!??
KERNEL32!BaseThreadInitThunk()
ntdll!RtlGetAppContainerNamedObjectPath()
ntdll!RtlGetAppContainerNamedObjectPath()
================ Thread 1 ================
ntdll!ZwWaitForWorkViaWorkerFactory()
KERNEL32!BaseThreadInitThunk()
ntdll!RtlGetAppContainerNamedObjectPath()
ntdll!RtlGetAppContainerNamedObjectPath()
================ Thread 2 ================
ntdll!ZwWaitForWorkViaWorkerFactory()
KERNEL32!BaseThreadInitThunk()
ntdll!RtlGetAppContainerNamedObjectPath()
ntdll!RtlGetAppContainerNamedObjectPath()
================ Thread 3 ================
ntdll!ZwWaitForWorkViaWorkerFactory()
KERNEL32!BaseThreadInitThunk()
ntdll!RtlGetAppContainerNamedObjectPath()
ntdll!RtlGetAppContainerNamedObjectPath()
================ Thread 4 ================
ntdll!ZwDelayExecution()
KERNELBASE!Sleep()
libCore!TWinNTSystem::TimerThread()
KERNEL32!BaseThreadInitThunk()
ntdll!RtlGetAppContainerNamedObjectPath()
ntdll!RtlGetAppContainerNamedObjectPath()
================ Thread 5 ================
win32u!NtUserGetMessage()
libCore!TWinNTSystem::FreeDirectory()
KERNEL32!BaseThreadInitThunk()
ntdll!RtlGetAppContainerNamedObjectPath()
ntdll!RtlGetAppContainerNamedObjectPath()
==========================================
============= END STACKTRACE =============
==========================================
The macro I was trying to run is:
void PlotUglovFits(void)
{
printf("Check one\n");
TFile *fin = new TFile("../data/data/exp/plots.root");
if (fin == NULL)
{
printf("Failed to open file. . .\n");
exit(-1);
}
printf("Check two\n");
TH1D *h_DLDL; ///< Spin 2 contribution
TH1D *h_DTDL; ///< Spin 0 contribution
TH1D *h_total; ///< sum of previous two
printf("Check three\n");
h_DLDL = (TH1D*)fin->Get("D^{*+}LD^{*-}L");
h_DTDL = (TH1D*)fin->Get("D^{*+}TD^{*_}L");
printf("Check four\n");
int entries = h_DLDL->GetEntries();
double const xmin = h_DLDL->GetXaxis()->GetXmin();
double const xmax = h_DLDL->GetXaxis()->GetXmax();
printf("Check five\n");
h_total = new TH1D("h_total","blank",entries,xmin,xmax);
printf("Check six\n");
for (int i = 1; i < entries + 1; i++)
{
double dldl = h_DLDL->GetBinContent(i);
double dtdl = h_DTDL->GetBinContent(i);
printf("i = %d; \t dldl = %lf; \t dtdl = %lf\n",i,dldl,dtdl);
h_total->SetBinContent(i,dldl+dtdl);
}
printf("Check seven\n");
TCanvas *c = new TCanvas("c","Spin contributions",X0,Y0,Width*1.30,Height);
h_DLDL->Draw();
h_DTDL->Draw("same");
h_total->Draw("same");
printf("Check eight\n");
}
The error message I get is
This text will be hidden
_ROOT Version:6.16
_Platform:Windows
_Compiler:Cling?