Creating a new tree without 0's for no signal


_ROOT Version: 6.12.06
_Platform: ubuntu 17.04
_Compiler:GCC


I have a very basic tree from which I am trying to create a new tree with more detailed information with various conversions and derived quantities. In the original tree, if there is no signal registered for a particular detector, that branch is simpy not included in the given event. I would like to duplicate this behavior.

I have defined my new tree and the various branches and the new tree values are filled with each event, but if there is no signal the branch is filled with ‘0’ (my reset condition). This is leading to huge amounts of 0’s in the branches. I want to figure out a way to fill only the branches with real signals in a given event. Right now I just use

mytree->Fill()

One thought I had was that I specify within the fill command the branch name

if (mybranch!=0){
     mytree->Fill(mybranch)
}

but in looking at the source for Tree->Fill() I saw no indication that it supported this behavior. Thanks.

That’s not possible.

Yes i think you’re right. I think the original tree was cleverly structured to avoid filling branches with false 0’s. I’ll have to have a look and see if I can see how they did it. Thanks.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.