21 from basf2
import conditions
as b2conditions
23 import tracking
as trk
24 import simulation
as sim
28 parser = argparse.ArgumentParser(description=__doc__)
29 parser.add_argument(
"--fileDir", default=
"./",
30 help=
"Output File Dir")
31 parser.add_argument(
"--fileTag", default=
"test",
32 help=
"Output File Tag")
33 parser.add_argument(
"--isMC", action=
"store_true",
34 help=
"Use Simulation")
35 parser.add_argument(
"--is3sample", action=
"store_true",
36 help=
"Emulate SVD 3 samples")
37 parser.add_argument(
"--RootOutput", action=
"store_true",
38 help=
"Store svd clusters before reconstruction to root file")
39 parser.add_argument(
"--noReco", action=
"store_true",
40 help=
"Do not perform the reconstruction")
41 parser.add_argument(
"--test", action=
"store_true",
42 help=
"Test with small numbers of events")
43 args = parser.parse_args()
44 b2.B2INFO(f
"Steering file args = {args}")
46 main = b2.create_path()
55 bkgFiles = glob.glob(
'/sw/belle2/bkg/*.root')
57 simulateJitter =
False
60 eventinfosetter = b2.register_module(
'EventInfoSetter')
61 eventinfosetter.param(
'expList', expList)
62 eventinfosetter.param(
'runList', [0])
63 eventinfosetter.param(
'evtNumList', [numEvents])
64 main.add_module(eventinfosetter)
65 main.add_module(
'EvtGenInput')
70 forceSetPXDDataReduction=
True,
71 usePXDDataReduction=ROIfinding,
72 simulateT0jitter=simulateJitter)
75 for m
in main.modules():
76 if m.name() ==
"SVDEventInfoSetter":
78 m.param(
"relativeShift", 7)
79 m.param(
"useDB",
False)
84 b2conditions.override_globaltags()
85 b2conditions.globaltags = [
"online"]
86 b2conditions.prepend_globaltag(
"data_reprocessing_prompt")
87 b2conditions.prepend_globaltag(
"patch_main_release-07")
92 main.add_module(
'RootInput', entrySequences=[
'0:100'])
94 main.add_module(
'RootInput')
96 main.add_module(
"Gearbox")
97 main.add_module(
'Geometry', useDB=
True)
99 raw.add_unpackers(main)
104 for moda
in main.modules():
105 if moda.name() ==
'SVDUnpacker':
106 moda.param(
"svdShaperDigitListName",
"SVDShaperDigits6Sample")
107 moda.param(
"SVDEventInfo",
"SVDEventInfo6Sample")
110 zsemulator = b2.register_module(
"SVD3SamplesEmulator")
111 zsemulator.param(
"outputSVDShaperDigits",
"SVDShaperDigits3SampleAll")
112 zsemulator.param(
"outputSVDEventInfo",
"SVDEventInfo")
113 zsemulator.param(
"chooseStartingSample",
False)
114 zsemulator.param(
"chooseRelativeShift",
True)
115 zsemulator.param(
"relativeShift", 7)
116 zsemulator.param(
"SVDShaperDigits",
"SVDShaperDigits6Sample")
117 zsemulator.param(
"SVDEventInfo",
"SVDEventInfo6Sample")
118 main.add_module(zsemulator)
120 zsonline = b2.register_module(
"SVDZeroSuppressionEmulator")
121 zsonline.param(
"ShaperDigits",
"SVDShaperDigits3SampleAll")
122 zsonline.param(
"ShaperDigitsIN",
"SVDShaperDigits")
123 main.add_module(zsonline)
128 main.add_module(
'SVDClusterizer')
132 trk.add_tracking_reconstruction(
134 mcTrackFinding=MCTracking,
135 append_full_grid_cdc_eventt0=
True,
136 trackFitHypotheses=[211])
141 outputFileName = 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'])
157 main.add_module(
'Progress')