I have a root files with a tree name “track” and with a branch “indexmc”. Inside the branch there are some leaf variables (pdgid, motheridx). I am getting crash every time I try to draw them with the following macro. Could you please have a look into it and suggest me a solutions. https://drive.google.com/drive/folders/1qmHjrNP3kzS4hDwODkfIRjnfW7u3PkwM?usp=sharing
Thanks
Please fill also the fields below. Note that root -b -q will tell you this info, and starting from 6.28/06 upwards, you can call .forum bug from the ROOT prompt to pre-populate a topic.
ROOT Version: Not Provided Platform: Not Provided Compiler: Not Provided
Firstly, the root file name in your macro is not the one you shared. Anyway, if I correct it (to 3097_anasig_mc_002.root), I don’t get a crash, the macro finishes and I get:
pdgid, motheridx, etc are not “leaf variables inside the indexmc branch”; all of them are leaves (you can also see this on a TBrowser) and in fact pdgid and motheridx are vectors/arrays with size, at any given event, given by the value of indexmc at that event.
You can search this forum for posts about ways to read arrays or vectors from trees, or check out several ideas here: