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