10 parser = argparse.ArgumentParser(
11 description=
"Validate AOD Output from FPGATrackSim."
15 help=
"Path to the input ROOT file"
17 args = parser.parse_args()
19 input_root_file = args.input_root_file
20 rootFile = ROOT.TFile.Open(input_root_file)
21 if not rootFile
or rootFile.IsZombie():
22 print(f
"Error: Could not open file {input_root_file}")
26 'xAODPixelClustersFromFPGACluster',
27 'xAODStripClustersFromFPGACluster'
29 tree = rootFile.Get(
"CollectionTree")
33 cppyy.ll.cast[
"xAOD::PixelClusterContainer_v1"](0)
35 for branch
in clustersToCheck:
36 averageClustersPerEvent = np.mean([getattr(evt, branch).
size()
for evt
in tree])
37 if np.isclose(averageClustersPerEvent, 0):
38 raise ValueError(f
"no recorded clusters in {branch}")
40 print(f
"there are on average {averageClustersPerEvent} clusters per event in {branch}")
42 averageNumberOfTracksPerEvent = np.mean([evt.FPGATrackParticles.size()
for evt
in tree])
43 if np.isclose(averageNumberOfTracksPerEvent, 0):
44 raise ValueError(
"no recorded tracks in FPGATrackparticles")
46 print(f
"there are on average {averageNumberOfTracksPerEvent} tracks per event in FPGATrackparticles")
48 if __name__ ==
"__main__":