# RDataFrame multi file with class branch bug report

**URL:** <https://root-forum.cern.ch/t/rdataframe-multi-file-with-class-branch-bug-report/45156>\
**Category:** ROOT\
**Tags:** bug, rdataframe\
**Created:** [May 31, 2021, 10:51am UTC](https://root-forum.cern.ch/t/rdataframe-multi-file-with-class-branch-bug-report/45156 "2021-05-31T10:51:17Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![cxwx1](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/cxwx1/32/22433_2.png) [@cxwx1](https://root-forum.cern.ch/u/cxwx1)\
**Post date:** [May 31, 2021, 10:51am UTC](https://root-forum.cern.ch/t/rdataframe-multi-file-with-class-branch-bug-report/45156/1 "2021-05-31T10:51:17Z")

</div>

* * *

\_ROOT Version: 6.22.08 - 6.24.00  
\_Platform: test on mac os Big Sur. and ubuntu 18.04  
\_Compiler: conda version, complier by oneself

* * *

Hi all:

if I have a class with two members. I could not saving one of the member using RDataFrame correctly with multi input files.

My code is belowing  
[tmp2.cpp](https://root-forum.cern.ch/uploads/short-url/xuUdrVsKUwWDPJvpxp5qsMhc5yU.cpp) (1.1 KB)

I cannot save part of struct correctly.

the out put was

1.0  
0.0 \<= the second file output error.

However  
If I use `aData.Snapshot("t1","o1.root"};` to save all the struct instead of part of it `aData.Snapshot("t1","o1.root","x"}` It’s fine.

could anyone tell me the reason?

---

<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:** [May 31, 2021, 11:20am UTC](https://root-forum.cern.ch/t/rdataframe-multi-file-with-class-branch-bug-report/45156/2 "2021-05-31T11:20:20Z")

</div>

Hi @cxwx1 ,  
I ran `tmp2.cpp` as `root tmp2.cpp` after uncommenting `aData.Snapshot("t1", "o1.root");`, and it prints

```auto
1
1

```

for me. This is with ROOT master compiled from source and with v6.24 installed via conda.  
Can you reproduce the issue e.g. on LXPLUS?

Cheers,  
Enrico

EDIT:  
ah no I misread, the one that does not work is `aData.Snapshot("t1","o1.root","x"}`. I can reproduce it, work in progress

EDIT 2:  
just to double-check, you also see the following warning in the broken case?

```auto
Warning in <TChain::CopyAddresses>: Could not find branch named 'xy' in tree named 't1'

```

---

<div class="post-metadata">

**Author:** ![cxwx1](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/cxwx1/32/22433_2.png) [@cxwx1](https://root-forum.cern.ch/u/cxwx1)\
**Post date:** [May 31, 2021, 12:05pm UTC](https://root-forum.cern.ch/t/rdataframe-multi-file-with-class-branch-bug-report/45156/3 "2021-05-31T12:05:06Z")

</div>

below line is also seen by me.

```auto
Warning in <TChain::CopyAddresses>: Could not find branch named 'xy' in tree named 't1'
1
6.94107e-310

```

It seems the second file I cannot find the branch correctly

---

<div class="post-metadata">

**Author:** ![cxwx1](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/cxwx1/32/22433_2.png) [@cxwx1](https://root-forum.cern.ch/u/cxwx1)\
**Post date:** [May 31, 2021, 12:44pm UTC](https://root-forum.cern.ch/t/rdataframe-multi-file-with-class-branch-bug-report/45156/4 "2021-05-31T12:44:23Z")

</div>

and if I comment

```auto
// ClassDef(xy_t,1);

```

problem solved. So I thought it’s rootling problem

---

<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:** [May 31, 2021, 4:34pm UTC](https://root-forum.cern.ch/t/rdataframe-multi-file-with-class-branch-bug-report/45156/5 "2021-05-31T16:34:32Z")

</div>

I’m still not sure what’s causing the problem exactly, but this is now [TChain::AddClone failing for sub-branches of branch of type with ClassDef · Issue #8295 · root-project/root · GitHub](https://github.com/root-project/root/issues/8295) , with a non-RDF reproducer.

Work in progress 🙂

---

<div class="post-metadata">

**Author:** ![cxwx1](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/cxwx1/32/22433_2.png) [@cxwx1](https://root-forum.cern.ch/u/cxwx1)\
**Post date:** [June 1, 2021, 3:48am UTC](https://root-forum.cern.ch/t/rdataframe-multi-file-with-class-branch-bug-report/45156/6 "2021-06-01T03:48:35Z")

</div>

OK, let’s move the issus to github  
cheers

---

<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:** [June 11, 2021, 7:54am UTC](https://root-forum.cern.ch/t/rdataframe-multi-file-with-class-branch-bug-report/45156/7 "2021-06-11T07:54:47Z")

</div>

This is fixed in current master (future v6.26) and in the v6.24 patches branch (upcoming 6.24/02 release).

---

<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:** [June 25, 2021, 7:55am UTC](https://root-forum.cern.ch/t/rdataframe-multi-file-with-class-branch-bug-report/45156/8 "2021-06-25T07:55:30Z")

</div>

Closed on June 25, 2021, 7:55am UTC

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