I have a ntuple (NanoAOD type) of 5 M events. From that using a macro, I am creating some histograms. The macro runs without error. But when I open the histogram from the output file it shows the below error.
(TBrowser &) Name: Browser Title: ROOT Object Browser
root [1] (TFile *) 0x557617909000
Warning in <TCanvas::ResizePad>: Inf/NaN propagated to the pad. Check drawn objects.
Warning in <TCanvas::ResizePad>: Canvas_1 height changed from 0 to 10
Warning in <TCanvas::ResizePad>: Inf/NaN propagated to the pad. Check drawn objects.
Warning in <TCanvas::ResizePad>: Canvas_1 height changed from 0 to 10
The plot is attached , how actually it looks after opening the file. I am also attaching the macro.
Also, I have noticed that when I run the macro for 10000 events it works fine. The ntuple also can be opened using bare root. Please suggest something that can solve the problem.
You use “UInt_t” variables to keep the variable sizes of some arrays. @pcanal There is / was a requirement that leaves keeping such sizes must be “Int_t” (i.e., “32 bit signed integers”).
However, it is also possible that accessing such trees via a TTreeReader based interface would be free from this “limitation” (but see also this old post).
After changing UInt_t to Int_t, I am getting this error :
Error in <TTree::SetBranchAddress>: The pointer type given "Int_t" (3) does not correspond to the type needed "UInt_t" (13) by the branch: nGenPart
Error in <TTree::SetBranchAddress>: The pointer type given "Int_t" (3) does not correspond to the type needed "UInt_t" (13) by the branch: nGenJet
Error in <TTree::SetBranchAddress>: The pointer type given "Int_t" (3) does not correspond to the type needed "UInt_t" (13) by the branch: nGenDressedLepton
No. of events processed : 1
*** Break *** segmentation violation
===========================================================
There was a crash.
This is the entire stack trace of all threads:
===========================================================
gdb.printing.register_pretty_printer(gdb.current_objfile(),
gdb.printing.register_pretty_printer(gdb.current_objfile(),
#0 0x00007f71acc3f46c in waitpid () from /lib64/libc.so.6
#1 0x00007f71acbbcf62 in do_system () from /lib64/libc.so.6
#2 0x00007f71ad720e8c in TUnixSystem::StackTrace() () from /usr/lib64/root/libCore.so.6.22
#3 0x00007f71ad72391a in TUnixSystem::DispatchSignals(ESignals) () from /usr/lib64/root/libCore.so.6.22
#4 <signal handler called>
#5 0x00007f71adde22b5 in ?? ()
#6 0x0000000000000000 in ?? ()
===========================================================
The lines below might hint at the cause of the crash.
You may get help by asking at the ROOT forum https://root.cern.ch/forum
Only if you are really convinced it is a bug in ROOT then please submit a
report at https://root.cern.ch/bugs Please post the ENTIRE stack trace
from above as an attachment in addition to anything else
that might help us fixing this issue.
===========================================================
#5 0x00007f71adde22b5 in ?? ()
#6 0x0000000000000000 in ?? ()
===========================================================
Root >
Do you mean the sample ? Then I guess it is not possible. The sample has been produced from a specific script and it automatically assigns which one will be treated as UInt_t or Int_t. If I reproduce the sample again it will be automatically assigned that particular branch as UInt_t again.
I have modified the code to use TTreeReader but unfortunately, I am getting the same error.
The modified code is attached : ZJets_Analyzer.C (8.4 KB)
@pcanal I am not much comfortable with TTreeReader. Please suggest, if I have done anything terrible in the code or the problem is of a different source.