63 logging.info(f
"Using input file {infile}")
65 current_file = ROOT.TFile(infile)
66 md =
read_metadata(infile, mode=
"full", unique_tag_info_values=
False)
70 md[infile][key][
"numberOfEvents"]
71 for key, value
in md[infile].
items()
72 if isinstance(value, dict)
and "numberOfEvents" in value
77 dataHeaderTree = current_file.Get(PoolOpts.TTreeNames.DataHeader)
78 if isinstance(dataHeaderTree, ROOT.TTree):
79 nevts_dh = dataHeaderTree.GetEntriesFast()
82 current_file.GetListOfKeys().Contains(PoolOpts.RNTupleNames.DataHeader)
83 and ROOT.gROOT.GetVersionInt() < 63100
86 "ROOT ver. 6.31/01 or greater needed to read RNTuple files"
88 dataHeaderRNT = current_file.Get(PoolOpts.RNTupleNames.DataHeader)
90 nevts_dh = ROOT.Experimental.RNTupleReader.Open(dataHeaderRNT).GetNEntries()
94 if not (md[infile][
"nentries"] == nevts_esi == nevts_dh):
96 "Number of events from EventStreamInfo inconsistent with number of entries in DataHeader"
100 tag_info = md[infile][
"/TagInfo"]
101 if "project_name" in tag_info
and isinstance(tag_info[
"project_name"], list):
102 if "IS_SIMULATION" in tag_info[
"project_name"]
and any(
103 [item
for item
in tag_info[
"project_name"]
if item.startswith(
"data")]
105 logging.error(
"/TagInfo contains values reserved for both MC and data")
111 for item
in tag_info[
"project_name"]
112 if item.startswith(
"data")
117 logging.error(
"/TagInfo contains values from different data taking periods")
120 "data_year" in tag_info
121 and isinstance(tag_info[
"data_year"], list)
122 and len(
set(tag_info[
"data_year"])) > 1
124 logging.error(
"/TagInfo contains values from different data taking periods")