TTree and Branch

Please read tips for efficient and successful posting and posting code

_ROOT Version: 6.22
_Platform: Centos7
Compiler: Not Provided

Hi, I’m a beginner and I need help.
I have a root file containing a tree and I’d like to extract only one branch (it’s an histogram) and then modify data in it to obtain another histogram with the new values.

Someone could help me?

Thanks in advance

Hi @Cellamare, thanks for asking in the ROOT forum! What language do you use for your code? Python or C++? I think the answer depends a bit on the language.

Also, the question is not completely clear to me. You say that you have a TTree with a branch of type histogram, but are you sure of that? Usually, the TTree has more fundamental column types and then you create histograms by iterating over the events and doing something with the data before filling the histograms, just like you describe. So what exactly is in your TTree? You can check that out with TTree::Print(). Can you please verify what types the branches are? If the branches are indeed of fundamental types, the answer will be easy.

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