Skip to content
This repository was archived by the owner on Jun 21, 2022. It is now read-only.
This repository was archived by the owner on Jun 21, 2022. It is now read-only.

Include Allpix² data types/ custom data types #485

@flome

Description

@flome

Dear all,
we are currently starting to work with Allpix², a silicon detector simulation framework based on Geant4 which is really great. It outputs natively data into root files (which is nice, so we can use uproot) but uses custom data types (which is not nice, because uproot cannot de-serialize them correctly...)

If I want to read an entry from a branch of choice, this is the result:

import uproot
f = uproot.open("sim_output.root")

print(f['MCParticle/detector1'])
>>>  <TBranchElement b'detector1' at 0x7f8b748c4090>

print( f['MCParticle/detector1'].interpretation )
>>> asgenobj(STLVector(Pointer(allpix_3a3a_MCParticle)))

print( f['MCParticle/detector1']._streamer._fTypeName )
>>> b'vector<allpix::MCParticle*>'

print(f['MCParticle/detector1'].array()[0][0])
>>> <Undefined (failed to read 'allpix::MCParticle' version 6) at 0x7f8b73a15950>

resulting in the array containing only entries of class "undefined". Thing is, I really prefer using uproot than PyROOT or whatsoever. Is there anything I can do about it?

Thanks a lot for your awesome project!
Best regards!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions