TTimeStamp and TBranchElement status

Hi rooters,
I have a TTree with two variables TTimeStamp saved as two different TBranchElement.
Opening the TTree in the TBrowser it seems that each TTimeStamp variable has nested in itself its own private variables (fSec and fNanoSec) and its methods.
I set the status of all the branches to false with the following command:

TTree::SetBranchStatus("*",0)

and then I activated only one of the TTimeStamp branches with the command:

TTree::SetBranchStatus("TimeStampCPU",1) 

but I found out that the nested pieces were not activated together with the “mother”.
I also tried to activate the nested private variable by hand but I have no idea how to access them.
I tried with

TTree::SetBranchStatus("TimeStampCPU.fSec",1) 

and

TTree::SetBranchStatus("TimeStampCPU/fSec",1) 

but I always get the error of unknown branch.
Do you know if there is a way to treat the TTimeStamp object as a unique branch?
Or how to access the private variables of this object?
Or in general how to solve my problem of course.

Many thanks in advance.


Please read tips for efficient and successful posting and posting code

ROOT Version: 6.08/06
Platform: Debian 3.16.43-2+deb8u5 (2017-09-19) x86_64
Compiler: gcc 4.9.2


The syntax you might be looking for is

TTree::SetBranchStatus("TimeStampCPU*",1);

To store the object as a single branch is selected at the time the branch is creating during the writing:

tree->Branch("TimeStampCPU.", &object, 32000, 0 /* splitlevel */);

how to access the private variables of this object?

What do you mean? The TBrowser, TTree::Draw and RDataFrame will allow you to access the data member.

Or in general how to solve my problem of course.

What is the overall problem you are trying to resolve (i.e. why do you call SetBranchStatus in the first place? Maybe you don’t need to )

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