Skip to content
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

[PyROOT] cppyy.ll.cast() does not understand the type of a branch (invocation through GetBranchAttr) #15996

Open
1 task done
Nowakus opened this issue Jul 5, 2024 · 1 comment
Assignees
Labels
bug experiment Affects an experiment / reported by its software & computimng experts in:Python Interface
Milestone

Comments

@Nowakus
Copy link
Contributor

Nowakus commented Jul 5, 2024

Check duplicate issues.

  • Checked for duplicates

Description

The new cppyy produces an error when we try to call GetBranchAttr on one of our DataVector branches.

Reproducer

Reproducer using only the ATLAS environment, no files necessary:

export ATLAS_LOCAL_ROOT_BASE=/cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase 
source $ATLAS_LOCAL_ROOT_BASE/user/atlasLocalSetup.sh
asetup main--dev4LCG,latest,Athena
python
    import ROOT, cppyy.ll
    ROOT.TClass.GetClass('DataVector<xAOD::PixelCluster_v1>').HasDictionary()
True
    cppyy.ll.cast['DataVector<xAOD::PixelCluster_v1>'](0)
TypeError: Could not find "cppyy_cast<DataVector<xAOD::PixelCluster_v1>>" (set cppyy.set_debug() for C++ errors):
  Failed to instantiate "cppyy_cast<DataVector<xAOD::PixelCluster_v1>>(int)"

but using a typedef to the DataVector works (note the real type of the returned object):

    cppyy.ll.cast['xAOD::PixelClusterContainer_v1>'](0)
<cppyy.gbl.DataVector<xAOD::PixelCluster_v1> object at 0x11cbd2c0>

and after the previous call autoloaded some libraries, the real type starts to work as well:

    cppyy.ll.cast['DataVector<xAOD::PixelCluster_v1>'](0)
<cppyy.gbl.DataVector<xAOD::PixelCluster_v1> object at 0x1f542770>

ROOT version

6.32+, possibly since 6.30

Installation method

SFT dev nightlies

Operating system

alma9

Additional context

No response

@Nowakus Nowakus added the bug label Jul 5, 2024
@elmsheus elmsheus added the experiment Affects an experiment / reported by its software & computimng experts label Jul 5, 2024
@guitargeek guitargeek changed the title cppyy.ll.cast() does not understand the type of a branch (invocation through GetBranchAttr) [PyROOT] cppyy.ll.cast() does not understand the type of a branch (invocation through GetBranchAttr) Jul 24, 2024
@guitargeek guitargeek added this to the 6.32.04 milestone Jul 29, 2024
@amete
Copy link

amete commented Nov 11, 2024

Hi @guitargeek, has there been any progress on this? Many thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug experiment Affects an experiment / reported by its software & computimng experts in:Python Interface
Projects
None yet
Development

No branches or pull requests

5 participants