19import simulation
as sim
22import modularAnalysis
as ma
24from basf2
import conditions
as b2conditions
27def addSVDVariablesToStorageModule(path, storageType):
29 if (storageType ==
"ntuple"):
31 'SVDVariablesToStorage',
32 outputFileName=
"SVDVariables_ntuple.root",
33 containerName=
"SVDClusters",
34 particleListName=
"pi+:all",
37 "SVDClusterChargeNormTrkLength",
41 "SVDClusterTimeMinusEventT0",
47 "SVDSide"]).set_log_level(
49 elif (storageType ==
"histogram"):
50 path.add_module(
'SVDVariablesToStorage',
51 outputFileName=
"SVDVariables_histogram.root",
52 containerName=
"SVDClusters",
53 particleListName=
"pi+:all",
54 variablesToHistogram=[(
"SVDClusterCharge", 100, 0, 100e3),
55 (
"SVDClusterSNR", 50, 0, 50),
56 (
"SVDClusterSize", 10, 0, 10),
57 (
"SVDClusterTime", 100, -100, 100),
58 (
"SVDTrackPrime", 25, -1, 1),
59 (
"SVDResidual", 100, -1e5, 1e5),
60 (
"SVDLayer", 4, 3, 7),
61 (
"SVDLadder", 16, 1, 17),
62 (
"SVDSensor", 5, 1, 6),
64 ).set_log_level(b2.LogLevel.INFO)
67if __name__ ==
'__main__':
71 b2.set_log_level(b2.LogLevel.ERROR)
72 main = b2.create_path()
79 bkgFiles = glob.glob(
'/sw/belle2/bkg/*.root')
81 simulateJitter =
False
84 eventinfosetter = b2.register_module(
'EventInfoSetter')
85 eventinfosetter.param(
'expList', expList)
86 eventinfosetter.param(
'runList', [0])
87 eventinfosetter.param(
'evtNumList', [numEvents])
88 main.add_module(eventinfosetter)
90 main.add_module(
'EvtGenInput')
95 forceSetPXDDataReduction=
True,
96 usePXDDataReduction=ROIfinding,
97 simulateT0jitter=simulateJitter)
103 b2conditions.override_globaltags()
104 b2conditions.globaltags = [
"online"]
107 main.add_module(
'RootInput', branchNames=[
'RawPXDs',
'RawSVDs',
'RawCDCs'])
108 raw.add_unpackers(main, components=[
'PXD',
'SVD',
'CDC'])
111 trk.add_tracking_reconstruction(
113 mcTrackFinding=MCTracking,
114 trackFitHypotheses=[211],
115 append_full_grid_cdc_eventt0=
True,
116 skip_full_grid_cdc_eventt0_if_svd_time_present=
False)
122 ma.fillParticleLists(decayStringsWithCuts=[(
"pi+:all",
"")], path=main)
125 addSVDVariablesToStorageModule(main,
"ntuple")
128 main.add_module(
'RootOutput', branchNames=[
132 'ParticlesToTrackFitResults',
133 'RecoHitInformations',
134 'RecoHitInformationsToSVDClusters',
137 'SVDClustersToRecoTracks',
138 'SVDClustersToSVDTrueHits',
144 'TracksToRecoTracks',
148 main.add_module(
'Progress')
add_svd_create_recodigits(path, recocreatorName="SVDRecoDigitCreator", shaperDigitsName="")