614 def __processFile(self):
616 for name
in {PoolOpts.TTreeNames.DataHeader, PoolOpts.RNTupleNames.DataHeader}:
617 dhKey = self.poolFile.FindKey( name )
619 obj = self.poolFile.
Get( name )
620 if isinstance(obj, self.ROOT.TTree):
621 nEntries = obj.GetEntries()
623 nEntries = self.ROOT.Experimental.RNTupleReader.Open(obj).GetNEntries()
625 raise NotImplementedError(f
"Keys of type {type(obj)!r} not supported")
632 for k
in self.poolFile.GetListOfKeys():
633 keyname = k.GetName()
634 obj = self.poolFile.
Get( keyname )
635 if isinstance(obj, self.ROOT.TTree):
636 containerName = obj.GetName()
637 nEntries = obj.GetEntries()
640 reader = self.ROOT.Experimental.RNTupleReader.Open(obj)
641 containerName = reader.GetDescriptor().GetName()
642 nEntries = reader.GetNEntries()
645 raise NotImplementedError(f
"Keys of type {type(obj)!r} not supported")
646 if containerName
not in containers:
648 containers.append(containerName)
650 if keyname.startswith(PoolOpts.POOL_HEADER)
and not keyname.endswith(
'Form'):
651 self.dataHeaderA[PoolOpts.augmentationName(keyname)] = \
652 PoolRecord(
"DataHeader", 0, 0, 0,
656 keys.sort (key =
lambda x: x.GetName())
661 obj = self.poolFile.
Get( k.GetName() )
662 if isinstance(obj, self.ROOT.TTree):
665 inspector = self.ROOT.Experimental.RNTupleInspector.Create(obj)
666 name = inspector.GetDescriptor().GetName()
668 if PoolOpts.isDataHeader(name):
669 contName =
"DataHeader"
670 if isinstance(obj, self.ROOT.TTree):
671 memSize = obj.GetTotBytes() / Units.kb
672 diskSize = obj.GetZipBytes() / Units.kb
675 memSizeNoZip = memSize
676 nEntries = obj.GetEntries()
680 br.GetName()
for br
in obj.GetListOfBranches()
681 if br.GetName().
count(
"DataHeader_p") > 0
683 if len(dhBranchNames) == 1:
684 dhBranch = obj.GetBranch(dhBranchNames[0])
685 typeName = dhBranch.GetClassName()
686 if not typeName
and (leaf := dhBranch.GetListOfLeaves().At(0)):
687 typeName = leaf.GetTypeName()
690 PoolRecord( contName, 0., 0., 0.,
693 typeName = typeName ),
697 poolRecord = PoolRecord(contName, memSize, diskSize, memSizeNoZip,
701 self.dataHeader = poolRecord
703 diskSize = inspector.GetCompressedSize() / Units.kb
704 memSize = inspector.GetUncompressedSize() / Units.kb
708 memSizeNoZip = memSize
709 nEntries = inspector.GetDescriptor().GetNEntries()
710 poolRecord = PoolRecord(contName, memSize, diskSize, memSizeNoZip,
713 self.dataHeader = poolRecord
714 elif PoolOpts.isData(name):
715 if isinstance(obj, self.ROOT.TTree):
716 if not hasattr(obj,
'GetListOfBranches'):
718 branches = obj.GetListOfBranches()
720 if name
in (PoolOpts.EVENT_DATA, PoolOpts.META_DATA):
722 for branch
in branches:
728 poolRecord.augName = PoolOpts.augmentationName(name)
729 self.augNames.
add(poolRecord.augName)
730 self.data += [ poolRecord ]
732 descriptor = inspector.GetDescriptor()
734 if name
in {PoolOpts.RNTupleNames.EventData, PoolOpts.RNTupleNames.MetaData}:
736 fieldZeroId = descriptor.GetFieldZeroId()
737 for fieldDescriptor
in descriptor.GetFieldIterable(fieldZeroId):
738 fieldId = fieldDescriptor.GetId()
739 fieldTreeInspector = inspector.GetFieldTreeInspector(fieldId)
740 diskSize = fieldTreeInspector.GetCompressedSize() / Units.kb
741 memSize = fieldTreeInspector.GetUncompressedSize() / Units.kb
742 typeName = fieldDescriptor.GetTypeName()
743 fieldName = fieldDescriptor.GetFieldName()
744 poolRecord = PoolRecord(fieldName, memSize, diskSize, memSize,
745 descriptor.GetNEntries(),
748 poolRecord.augName = PoolOpts.augmentationName(name)
749 self.augNames.
add(poolRecord.augName)
750 self.data += [ poolRecord ]