Warning in <TChain::CopyAddresses>: Could not find branch named

Dear experts,

Recently I was merging trees and saving only several branches like this:

ROOT::RDataFrame df{"NOMINAL", "./merge/*.root"};
df.Snapshot("t", "./test.root", {"jet_pt"});

however I got lots of warnings like this:

Warning in <TChain::CopyAddresses>: Could not find branch named 'jet_phi' in tree named 't'

jet_phi is a branch in the original NOMINAL tree, just like jet_pt.

In TTree source file I found something related:

// FIXME: The GetBranch() function is braindead and may
// not find the branch!
TBranch* br = tree->GetBranch(branch->GetName());
if (br) {
    br->SetAddress(addr);
    // The copy does not own any object allocated by SetAddress().
    if (br->InheritsFrom(TBranchElement::Class())) {
      ((TBranchElement*) br)->ResetDeleteObject();
    }
} else {
    Warning("CopyAddresses", "Could not find branch named '%s' in tree named '%s'", branch->GetName(), tree->GetName());
}

So should I worry about this warning? Thanks!

Best,
Kevin


ROOT Version: 6.18.00
Platform: OsX 10.14
Compiler: clang100


Hi,
You can safely ignore the comment in the source code :slight_smile:

You can also ignore the warning if you are not trying to write out pt_phi.

Is it possible that one of the trees in one of your files does not contain that branch?

Cheers,
Enrico

Hi Enrico,

Thank you for your reply! I checked my files manually and jet_phi is in every single file/tree.

I tried reproducing this issue with some smaller files but I didn’t succeed…

So I’ll take your advice, just ignore them and move on. Thank you!

Best,
Kevin

This might be (some form of) https://sft.its.cern.ch/jira/browse/ROOT-9487. Does the warning go away if you don’t use ROOT::EnableImplicitMT?

It would be useful if you could provide your file and a minimal reproducer of the issue. We don’t want, in general, print warnings that can be safely ignore – it might give users a bad habit… :smile:

Hi,

In my case the warnings are there even without using IMT.

The input files are the same as in

Unfortunately I’m afraid that I can’t make them public… I’m sorry. Do you mind me sharing it with you privately on cernbox? Thanks!

Best,
Kevin

Of course not! Thanks a lot! :smile:

I just did it. Please let me know if you don’t get the files. Thanks!

1 Like

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