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