-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RDataFrame misidentifies vector<XYZTVector> type of a friend tree with identical branch name to another friend tree #6944
Comments
The issue is also present in master. Simple C++ repro: #include "Math/Vector3D.h"
#include "Math/Vector4D.h"
#include "TChain.h"
#include "ROOT/RVec.hxx"
#include "ROOT/RDataFrame.hxx"
#include <vector>
#include <iostream>
using namespace ROOT::Math;
using namespace ROOT::VecOps;
int main()
{
ROOT::RDataFrame(1)
.Define("vec", [] { return XYZVector(10, 10, 10); })
.Snapshot<XYZVector>("Particle", "f1.root", {"vec"});
ROOT::RDataFrame(1)
.Define("vec", [] { return std::vector<XYZTVector>{XYZTVector(30, 30, 30, 30)}; })
.Snapshot("Vertex", "f3.root", {"vec"});
std::cout << ROOT::RDataFrame("Vertex", "f3.root").GetColumnType("vec") << std::endl;
TChain ch1("Particle");
ch1.Add("f1.root");
TChain ch3("Vertex");
ch3.Add("f3.root");
ch1.AddFriend(&ch3, "vertex");
std::cout << ROOT::RDataFrame(ch1).GetColumnType("vertex.vec") << std::endl;
return 0;
} This prints the wrong type (the type of the other Calling Work in progress. |
Fixed by #6965 |
Should be fixed in master, must backport |
@dudarboh could you please confirm that the problem is fixed in the nightlies? |
Hi @eguiraud, Thanks for your work! |
That's great to hear, I'll leave this open for a short while more as a reminder to add a backport for the 6.22 branch if that's ok! |
The issue is initially reported and discussed on the ROOT forum here
Describe the bug
RDataFrame has two tree friends.
Both tree friends have a branch with identical name.
Type of a branch in the 1st friend tree: XYZVector
Type of a branch in the 2nd friend tree: vector<XYZTVector>
1st friend tree is attached to RDataFrame before 2nd friend tree.
Access of 2nd friend tree branch results in error due to unexpected type of the branch assumed by RDataFrame as shown in the stand alone example bellow.
To Reproduce
Run this stand alone example:
which results in the error on 3rd print. Full output:
Expected behavior
Expected behavior that identical branch names don't interfere as they accessed with different tree aliases
cluster.vec
andvertex.vec
and should be distinguished with the following output:Setup
Additional context
df.GetColumnType("vertex.vec")
yields :df.GetColumnType("vertex.vec")
yields :The text was updated successfully, but these errors were encountered: