23 """Uses the SVDDQMDose module and makes a rootfile with the histos."""
28 from basf2
import conditions
29 from rawdata
import add_unpackers
30 from svd
import add_svd_reconstruction
35 def prepend_to_filename(file_path, prefix):
36 dn, bn = os.path.dirname(file_path), os.path.basename(file_path)
37 return os.path.join(dn, f
"{prefix}{bn}")
40 parser = argparse.ArgumentParser(description=__doc__)
41 parser.add_argument(
"files", metavar=
"FILE", nargs=
"+",
42 help=
"The input rootfile(s) with the RAW data.")
43 parser.add_argument(
"-o",
"--out-file", default=
"SVDDQM.root",
44 help=
'The output rootfile. Default "SVDDQM.root".')
45 parser.add_argument(
"--no-trg-filter", action=
"store_true",
46 help=
"Take all events instead of TTYP_POIS only.")
47 parser.add_argument(
"--exec-time", action=
"store_true",
48 help=
"Also record execution time statistics.")
49 args = parser.parse_args()
51 conditions.override_globaltags()
52 conditions.globaltags = [
'svd_onlySVDinGeoConfiguration',
'online',
53 'Reco_master_patch_rel5']
55 main = b2.create_path()
58 main.add_module(
"RootInput", inputFileNames=args.files)
61 main.add_module(
"HistoManager", histoFileName=args.out_file)
64 main.add_module(
'Gearbox')
65 main.add_module(
'Geometry')
66 if args.no_trg_filter:
67 add_unpackers(main, components=[
'SVD'])
69 add_unpackers(main, components=[
'SVD',
'TRG'])
71 "SVDZeroSuppressionEmulator", SNthreshold=5,
72 ShaperDigits=
'SVDShaperDigits', ShaperDigitsIN=
'SVDShaperDigitsZS5',
75 add_svd_reconstruction(main)
78 params = {
'trgTypes': []}
if args.no_trg_filter
else {}
79 add_svd_dqm_dose(main,
"SVDShaperDigitsZS5", **params)
82 main.add_module(
'SVDDQMInjection', ShaperDigits=
'SVDShaperDigitsZS5')
86 main.add_module(SVDExtraEventStatisticsModule(
87 prepend_to_filename(args.out_file,
"stats_")))
90 main.add_module(
"ProgressBar")