22 parser = argparse.ArgumentParser(description=__doc__)
25 help=
"Input file (HTTPS public link or root:// URL)",
31 default=Path(__file__).with_name(
"muonback_smoke.root"),
32 help=
"Output skim file",
38 help=
"Number of entries to copy from the pythia8-Geant4 tree",
40 args = parser.parse_args()
42 src = ROOT.TFile.Open(args.source,
"READ")
43 tree = src.Get(
"pythia8-Geant4")
or src.Get(
"cbmsim")
45 raise SystemExit(
"Neither pythia8-Geant4 nor cbmsim tree found in source")
47 out = ROOT.TFile.Open(str(args.output),
"RECREATE")
48 skim = tree.CopyTree(
"",
"", args.entries, 0)
52 print(f
"Wrote {args.entries} entries to {args.output} ({args.output.stat().st_size} B)")