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

**URL:** <https://root-forum.cern.ch/t/warning-in-tchain-copyaddresses-could-not-find-branch-named/35055>\
**Category:** ROOT\
**Tags:** rdataframe\
**Created:** [July 8, 2019, 6:57pm UTC](https://root-forum.cern.ch/t/warning-in-tchain-copyaddresses-could-not-find-branch-named/35055 "2019-07-08T18:57:54Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kevin1](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/k/a9adbd/32.png) [@Kevin1](https://root-forum.cern.ch/u/Kevin1)\
**Post date:** [July 8, 2019, 6:57pm UTC](https://root-forum.cern.ch/t/warning-in-tchain-copyaddresses-could-not-find-branch-named/35055/1 "2019-07-08T18:57:54Z")

</div>

Dear experts,

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

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

```

however I got lots of warnings like this:

```auto
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:

```auto
// 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

* * *

---

<div class="post-metadata">

**Author:** ![eguiraud](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/eguiraud/32/32217_2.png) [@eguiraud](https://root-forum.cern.ch/u/eguiraud)\
**Post date:** [July 8, 2019, 7:51pm UTC](https://root-forum.cern.ch/t/warning-in-tchain-copyaddresses-could-not-find-branch-named/35055/2 "2019-07-08T19:51:18Z")

</div>

Hi,  
You can safely ignore the comment in the source code 🙂

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

---

<div class="post-metadata">

**Author:** ![Kevin1](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/k/a9adbd/32.png) [@Kevin1](https://root-forum.cern.ch/u/Kevin1)\
**Post date:** [July 8, 2019, 7:57pm UTC](https://root-forum.cern.ch/t/warning-in-tchain-copyaddresses-could-not-find-branch-named/35055/3 "2019-07-08T19:57:46Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![eguiraud](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/eguiraud/32/32217_2.png) [@eguiraud](https://root-forum.cern.ch/u/eguiraud)\
**Post date:** [July 8, 2019, 8:29pm UTC](https://root-forum.cern.ch/t/warning-in-tchain-copyaddresses-could-not-find-branch-named/35055/4 "2019-07-08T20:29:18Z")

</div>

This might be (some form of) [https://sft.its.cern.ch/jira/browse/ROOT-9487](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… 😄

---

<div class="post-metadata">

**Author:** ![Kevin1](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/k/a9adbd/32.png) [@Kevin1](https://root-forum.cern.ch/u/Kevin1)\
**Post date:** [July 8, 2019, 10:12pm UTC](https://root-forum.cern.ch/t/warning-in-tchain-copyaddresses-could-not-find-branch-named/35055/5 "2019-07-08T22:12:10Z")

</div>

Hi,

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

The input files are the same as in

> [@RDataFrame entry loss when using multi-thread in version 6.18.00](https://root-forum.cern.ch/t/rdataframe-entry-loss-when-using-multi-thread-in-version-6-18-00/35056):
>
> Dear experts, Recently I’m moving to the new version 6.18.00 and noticed something strange that didn’t exist in 6.16.00. ROOT::EnableImplicitMT(); ROOT::RDataFrame df{"NOMINAL", "./merge/3.root"}; df.Snapshot("t", "./test.root", {"jet\_pt"}); The number of entries in the new test.root file is different from that in the original 3.root file. This only happens in the version 6.18.00 (not in 6.16.00) when the Implicit MT is turned on, and not for all the files. Actually this file dependence seems…

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

---

<div class="post-metadata">

**Author:** ![eguiraud](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/eguiraud/32/32217_2.png) [@eguiraud](https://root-forum.cern.ch/u/eguiraud)\
**Post date:** [July 8, 2019, 10:14pm UTC](https://root-forum.cern.ch/t/warning-in-tchain-copyaddresses-could-not-find-branch-named/35055/6 "2019-07-08T22:14:26Z")

</div>

> [@Kevin1](#):
>
> Do you mind me sharing it with you privately on cernbox?

Of course not! Thanks a lot! 😄

---

<div class="post-metadata">

**Author:** ![Kevin1](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/k/a9adbd/32.png) [@Kevin1](https://root-forum.cern.ch/u/Kevin1)\
**Post date:** [July 8, 2019, 10:20pm UTC](https://root-forum.cern.ch/t/warning-in-tchain-copyaddresses-could-not-find-branch-named/35055/7 "2019-07-08T22:20:37Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [July 22, 2019, 10:25pm UTC](https://root-forum.cern.ch/t/warning-in-tchain-copyaddresses-could-not-find-branch-named/35055/8 "2019-07-22T22:25:15Z")

</div>

Closed on July 22, 2019, 10:25pm UTC

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