20from basf2
import conditions
as b2conditions
23import simulation
as sim
27parser = argparse.ArgumentParser(description=__doc__)
28parser.add_argument(
"--fileDir", default=
"./",
29 help=
"Output File Dir")
30parser.add_argument(
"--fileTag", default=
"test",
31 help=
"Output File Tag")
32parser.add_argument(
"--isMC", action=
"store_true",
33 help=
"Use Simulation")
34parser.add_argument(
"--is3sample", action=
"store_true",
35 help=
"Emulate SVD 3 samples")
36parser.add_argument(
"--RootOutput", action=
"store_true",
37 help=
"Store svd clusters before reconstruction to root file")
38parser.add_argument(
"--noReco", action=
"store_true",
39 help=
"Do not perform the reconstruction")
40parser.add_argument(
"--test", action=
"store_true",
41 help=
"Test with small numbers of events")
42args = parser.parse_args()
43b2.B2INFO(f
"Steering file args = {args}")
45main = b2.create_path()
54 bkgFiles = glob.glob(
'/sw/belle2/bkg/*.root')
56 simulateJitter =
False
59 eventinfosetter = b2.register_module(
'EventInfoSetter')
60 eventinfosetter.param(
'expList', expList)
61 eventinfosetter.param(
'runList', [0])
62 eventinfosetter.param(
'evtNumList', [numEvents])
63 main.add_module(eventinfosetter)
64 main.add_module(
'EvtGenInput')
69 forceSetPXDDataReduction=
True,
70 usePXDDataReduction=ROIfinding,
71 simulateT0jitter=simulateJitter)
74 for m
in main.modules():
75 if m.name() ==
"SVDEventInfoSetter":
77 m.param(
"relativeShift", 7)
78 m.param(
"useDB",
False)
83 b2conditions.override_globaltags()
84 b2conditions.globaltags = [
"online"]
85 b2conditions.prepend_globaltag(
"data_reprocessing_prompt")
86 b2conditions.prepend_globaltag(
"patch_main_release-07")
91 main.add_module(
'RootInput', entrySequences=[
'0:100'])
93 main.add_module(
'RootInput')
95 main.add_module(
"Gearbox")
96 main.add_module(
'Geometry', useDB=
True)
98 raw.add_unpackers(main)
103 for moda
in main.modules():
104 if moda.name() ==
'SVDUnpacker':
105 moda.param(
"svdShaperDigitListName",
"SVDShaperDigits6Sample")
106 moda.param(
"SVDEventInfo",
"SVDEventInfo6Sample")
109 zsemulator = b2.register_module(
"SVD3SamplesEmulator")
110 zsemulator.param(
"outputSVDShaperDigits",
"SVDShaperDigits3SampleAll")
111 zsemulator.param(
"outputSVDEventInfo",
"SVDEventInfo")
112 zsemulator.param(
"chooseStartingSample",
False)
113 zsemulator.param(
"chooseRelativeShift",
True)
114 zsemulator.param(
"relativeShift", 7)
115 zsemulator.param(
"SVDShaperDigits",
"SVDShaperDigits6Sample")
116 zsemulator.param(
"SVDEventInfo",
"SVDEventInfo6Sample")
117 main.add_module(zsemulator)
119 zsonline = b2.register_module(
"SVDZeroSuppressionEmulator")
120 zsonline.param(
"ShaperDigits",
"SVDShaperDigits3SampleAll")
121 zsonline.param(
"ShaperDigitsIN",
"SVDShaperDigits")
122 main.add_module(zsonline)
127 main.add_module(
'SVDClusterizer')
131 trk.add_tracking_reconstruction(
133 mcTrackFinding=MCTracking,
134 append_full_grid_cdc_eventt0=
True,
135 trackFitHypotheses=[211],
136 skip_full_grid_cdc_eventt0_if_svd_time_present=
False)
141outputFileName = str(args.fileDir)+
"SVDEventT0PerformanceTTree"
143 outputFileName +=
"_MC"
145 outputFileName +=
"_emulated3sample"
148 recoFileName = outputFileName +
"_" + str(args.fileTag) +
".root"
149 main.add_module(
'SVDEventT0PerformanceTTree', outputFileName=recoFileName)
152 rootOutFileName = outputFileName +
"_RootOutput_" + str(args.fileTag) +
".root"
153 main.add_module(
'RootOutput',
154 outputFileName=rootOutFileName,
155 branchNames=[
'SVDClusters'])
157main.add_module(
'Progress')