141 from PyUtils
import PoolFile
145 msg.debug(
'Checking directory %s ...', directory.GetName())
147 listOfKeys=directory.GetListOfKeys()
149 msg.debug(
'Checking %s keys ... ', listOfKeys.GetEntries())
151 for key
in listOfKeys:
153 msg.debug(
'Looking at key %s ...', key.GetName())
154 msg.debug(
'Key is of class %s.', key.GetClassName())
156 the_object=directory.Get(key.GetName())
158 msg.warning(
"Can't get object of key %s.", key.GetName())
161 if requireTree
and not isinstance(the_object, TTree):
162 msg.warning(
"Object of key %s is not of class TTree!", key.GetName())
165 if isinstance(the_object,TTree):
167 msg.debug(
'Checking tree %s ...', the_object.GetName())
170 if PoolFile.PoolOpts.TTreeNames.EventData == the_object.GetName():
171 nentries = the_object.GetEntries()
172 msg.debug(f
' contains {nentries} events')
173 elif PoolFile.PoolOpts.TTreeNames.MetaData == the_object.GetName():
175 msg.debug(
' contains MetaData')
177 if the_type==
'event':
180 elif the_type==
'basket':
184 msg.debug(
'Tree %s looks ok.', the_object.GetName())
186 if isinstance(the_object,RNTuple):
188 msg.debug(
'Checking ntuple of key %s ...', key.GetName())
191 reader=RNTupleReader.Open(the_object)
192 except Exception
as err:
193 msg.warning(
'Could not open ntuple %s: %s', the_object, err)
197 if PoolFile.PoolOpts.RNTupleNames.EventData == reader.GetDescriptor().GetName():
198 nentries = reader.GetNEntries()
199 msg.debug(f
' contains {nentries} events')
200 elif PoolFile.PoolOpts.RNTupleNames.MetaData == reader.GetDescriptor().GetName():
202 msg.debug(
' contains MetaData')
204 if the_type==
'event':
207 elif the_type==
'basket':
211 msg.debug(
'NTuple of key %s looks ok.', key.GetName())
213 if isinstance(the_object, TDirectory):
214 if checkDirectory(the_object, the_type, requireTree, depth + 1)==1:
218 if depth == 0
and hasMetadata
and checkNEvents(directory.GetName(), nentries)==1:
221 msg.debug(
'Directory %s looks ok.', directory.GetName())