Skip to content

StreamerElement retrieved from file has incorrect element name for (some) arrays. #8033

@pcanal

Description

@pcanal

This was first reported at: https://cdcvs.fnal.gov/redmine/issues/25615
with the error:

    Fatal Root Error: TBranchElement::InitializeOffsets
    Could not find the real data member 'fOutputNames' when constructing the branch '4anab::MVADescriptions_emtrkmichelid_emtrkmichel_Reco1.obj' [Likely an internal error, please report to the developers].
    ROOT severity: 6000

during the creation of a branch.

With a class like:

class mystrarray {
public:
  string         fDataTag;        ///< offset=  0 type=300 ,stl=365, ctype=365, Tag of the reco data products (art::InputTag format)
  string         fOutputInstance; ///< offset= 32 type=300 ,stl=365, ctype=365, Instance name of the feature vector collection
  string         fOutputNames[4]; ///<   offset= 64 type=320 ,stl=365, ctype=365, Feature vector entries names/meaning

  static short Class_Version() { return 10; }
};

creating any split branch containing this kind of object (or collection there of) will work fine.

But if a file containing the StreamerInfo for mystrarray version 10 before loading the library containing its dictionary then the StreamerInfo from the file (since it has the same checksum has the one that would come from the dictionary info) is used.

However, instead of

root [1] TClass::GetClass("mystrarray")->GetStreamerInfo()->GetElement(2)->GetFullName()
(const char *) "fOutputNames[4]"

it produces:

root [1] TClass::GetClass("mystrarray")->GetStreamerInfo()->GetElement(2)->GetFullName()
(const char *) "fOutputNames"

Which does not match the expectation of TBranchElement::InitializeOffsets.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions