Hello,
I have an ntuple from event-generation (combined ntuple), containing branches like:
NPar/I … number of particles in event
Type[NPar]/I … PDG of each particle
KFDauNt[NPar]/I … index to first daughter of a given particle
Now, I would like to see PDG codes of the first daughter of Z0 (PDG=23). So what I did was:
(The empty brackets are not neccessary, but better for understandability). But this draw command does not work correctly. Although I have only Z0->mumu decays in all the events, it draws somewhat arbitrary PDG codes. If I modify the draw condition by adding always-true condition like that:
then it works as expected - I see only abs(PDG)=13.
In both cases, the number of entries in the resulting histograms is equal to number of entries in the ntuple. So the first draw command scans through the correct number of items, but somewhat using wrong indices (haven’t figured out through what it scans finally). According to the description in TTree::Draw reference, I would expect that draw command would scan through the items like:
draw Type[KFDauNt[0]] only if Type[0]==23
draw Type[KFDauNt[1]] only if Type[1]==23
draw Type[KFDauNt[2]] only if Type[2]==23
...
draw Type[KFDauNt[NPar-1]] only if Type[NPar-1]==23
I.e. scanning synchronously through the free index. But obviously, this is true only if I use the KFDauNt[] in the condition of the Draw command (using it “standalone” in the Draw-argument does not help).
Does anyone has an idea, why the two draw commands work differently ? (And what ROOT really does in the first “wrong” case ?).
thanks for help,
Pavel