-
Notifications
You must be signed in to change notification settings - Fork 64
Unable to read nested branches #510
Comments
If you have the ability to rewrite this file, try increasing the splitLevel on the branch. I think it might be something around In this TTree: >>> import uproot4
>>> tree = uproot4.open("issue510.root:EDepSimEvents")
>>> tree.show()
name | typename | interpretation
---------------------+----------------------+-----------------------------------
Event | TG4Event | AsObjects(Model_TG4Event)
Event/TObject | unknown | None
Event/TObject/fUniqu | uint32_t | AsDtype('>u4')
Event/TObject/fBits | uint32_t | AsDtype('>u4')
Event/RunId | int32_t | AsDtype('>i4')
Event/EventId | int32_t | AsDtype('>i4')
Event/Primaries | std::vector<TG4Prima | AsObjects(AsVector(True, Model_TG4
Event/Primaries/Prim | uint32_t[] | AsJagged(AsDtype('>u4'))
Event/Primaries/Prim | uint32_t[] | AsJagged(AsDtype('>u4'))
Event/Primaries/Prim | std::vector<TG4Prima | AsObjects(AsVector(True, Model_TG4
Event/Primaries/Prim | std::vector<TG4Prima | AsObjects(AsVector(True, Model_TG4
Event/Primaries/Prim | TLorentzVector | AsStridedObjects(Model_TLorentzVec
Event/Primaries/Prim | std::string | AsStrings(header_bytes=6)
Event/Primaries/Prim | std::string | AsStrings(header_bytes=6)
Event/Primaries/Prim | std::string | AsStrings(header_bytes=6)
Event/Primaries/Prim | int32_t[] | AsJagged(AsDtype('>i4'))
Event/Primaries/Prim | float[] | AsJagged(AsDtype('>f4'))
Event/Primaries/Prim | float[] | AsJagged(AsDtype('>f4'))
Event/Primaries/Prim | float[] | AsJagged(AsDtype('>f4'))
Event/Primaries/Prim | float[] | AsJagged(AsDtype('>f4'))
Event/Trajectories | std::vector<TG4Traje | AsObjects(AsVector(True, Model_TG4
Event/Trajectories/T | uint32_t[] | AsJagged(AsDtype('>u4'))
Event/Trajectories/T | uint32_t[] | AsJagged(AsDtype('>u4'))
Event/Trajectories/T | std::vector<TG4Traje | AsJagged(AsStridedObjects(Model_TG
Event/Trajectories/T | int32_t[] | AsJagged(AsDtype('>i4'))
Event/Trajectories/T | int32_t[] | AsJagged(AsDtype('>i4'))
Event/Trajectories/T | std::string | AsStrings(header_bytes=6)
Event/Trajectories/T | int32_t[] | AsJagged(AsDtype('>i4'))
Event/Trajectories/T | TLorentzVector | AsStridedObjects(Model_TLorentzVec
Event/SegmentDetecto | std::map<std::string | AsObjects(AsMap(True, AsString(Tru the >>> tree["Event/Trajectories/Trajectories.Points"].show()
name | typename | interpretation
---------------------+----------------------+-----------------------------------
Trajectories.Points | std::vector<TG4Traje | AsJagged(AsStridedObjects(Model_TG It consists of a vector of >>> tree["Event/Trajectories/Trajectories.Points"].typename
'std::vector<TG4TrajectoryPoint>' and the >>> tree.file.streamer_named("TG4TrajectoryPoint").show()
TG4TrajectoryPoint (v1): TObject (v1)
Position: TLorentzVector (TStreamerObject)
Momentum: TVector3 (TStreamerObject)
Process: int (TStreamerBasicType)
Subprocess: int (TStreamerBasicType) It consists of nothing but As for why it doesn't work out of the box, I'm confused by the number of headers that this object has when unsplit. |
Thank you for the suggestion. @mastbaum (the original author of the file) provided me with a copy of the file, this time with |
As it turns out, the error above is because I was unaware of ROOT's "memberwise splitting," and (if I said anything to the contrary above), it has nothing to do with Boost serialization. This same error came up in 6 different issues, so further discussion on it will be consolidated into scikit-hep/uproot5#38. (This comment is a form message I'm writing on all 6 issues.) As of PR scikit-hep/uproot5#87, we can now detect such cases, so at least we'll raise a |
I have a weird issue with a ROOT file with this structure:
I am able to access e.g.
Primaries.Position
, but I can't accessTrajectories.Points.Position
Why is that, am I doing something wrong? And is there a way to fix this? I uploaded a test file here.
Thank you!
The text was updated successfully, but these errors were encountered: