19import simulation
as sim
22import modularAnalysis
as ma
24from basf2
import conditions
as b2conditions
27def addSVDVariablesToStorageModule(path, storageType):
29 if (storageType ==
"ntuple"):
30 path.add_module(
'SVDVariablesToStorage',
31 outputFileName=
"SVDVariables_ntuple.root",
32 containerName=
"SVDClusters",
33 particleListName=
"pi+:all",
34 variablesToNtuple=[
"SVDClusterCharge",
"SVDClusterSNR",
"SVDClusterSize",
"SVDClusterTime",
35 "SVDTrackPrime",
"SVDResidual",
"SVDLayer",
"SVDLadder",
"SVDSensor",
"SVDSide"]
36 ).set_log_level(b2.LogLevel.INFO)
37 elif (storageType ==
"histogram"):
38 path.add_module(
'SVDVariablesToStorage',
39 outputFileName=
"SVDVariables_histogram.root",
40 containerName=
"SVDClusters",
41 particleListName=
"pi+:all",
42 variablesToHistogram=[(
"SVDClusterCharge", 100, 0, 100e3),
43 (
"SVDClusterSNR", 50, 0, 50),
44 (
"SVDClusterSize", 10, 0, 10),
45 (
"SVDClusterTime", 100, -100, 100),
46 (
"SVDTrackPrime", 25, -1, 1),
47 (
"SVDResidual", 100, -1e5, 1e5),
48 (
"SVDLayer", 4, 3, 7),
49 (
"SVDLadder", 16, 1, 17),
50 (
"SVDSensor", 5, 1, 6),
52 ).set_log_level(b2.LogLevel.INFO)
55if __name__ ==
'__main__':
59 b2.set_log_level(b2.LogLevel.ERROR)
60 main = b2.create_path()
67 bkgFiles = glob.glob(
'/sw/belle2/bkg/*.root')
69 simulateJitter =
False
72 eventinfosetter = b2.register_module(
'EventInfoSetter')
73 eventinfosetter.param(
'expList', expList)
74 eventinfosetter.param(
'runList', [0])
75 eventinfosetter.param(
'evtNumList', [numEvents])
76 main.add_module(eventinfosetter)
78 main.add_module(
'EvtGenInput')
83 forceSetPXDDataReduction=
True,
84 usePXDDataReduction=ROIfinding,
85 simulateT0jitter=simulateJitter)
91 b2conditions.override_globaltags()
92 b2conditions.globaltags = [
"online"]
95 main.add_module(
'RootInput', branchNames=[
'RawPXDs',
'RawSVDs',
'RawCDCs'])
96 raw.add_unpackers(main, components=[
'PXD',
'SVD',
'CDC'])
99 trk.add_tracking_reconstruction(
101 mcTrackFinding=MCTracking,
102 trackFitHypotheses=[211],
103 append_full_grid_cdc_eventt0=
True,
104 skip_full_grid_cdc_eventt0_if_svd_time_present=
False)
110 ma.fillParticleLists(decayStringsWithCuts=[(
"pi+:all",
"")], path=main)
113 addSVDVariablesToStorageModule(main,
"ntuple")
116 main.add_module(
'RootOutput', branchNames=[
120 'ParticlesToTrackFitResults',
121 'RecoHitInformations',
122 'RecoHitInformationsToSVDClusters',
125 'SVDClustersToRecoTracks',
126 'SVDClustersToSVDTrueHits',
132 'TracksToRecoTracks',
136 main.add_module(
'Progress')
add_svd_create_recodigits(path, recocreatorName="SVDRecoDigitCreator", shaperDigitsName="")