Belle II Software release-09-00-00
svdPerformanceTree.py
1#!/usr/bin/env python3
2
3
10
11
17
18import basf2 as b2
19# from basf2 import conditions as b2conditions
20import rawdata as raw
21import tracking as trk
22import simulation as sim
23import svd as svd
24import glob
25
26useSimulation = True
27
28# set this string to identify the output rootfiles
29tag = "_test"
30
31main = b2.create_path()
32
33b2.set_random_seed(1)
34
35if useSimulation:
36 # options for simulation:
37 expList = [1003]
38 numEvents = 2000
39 bkgFiles = glob.glob('/sw/belle2/bkg/*.root') # Phase3 background
40 bkgFiles = None # uncomment to remove background
41 simulateJitter = False
42 ROIfinding = False
43 MCTracking = False
44 eventinfosetter = b2.register_module('EventInfoSetter')
45 eventinfosetter.param('expList', expList)
46 eventinfosetter.param('runList', [0])
47 eventinfosetter.param('evtNumList', [numEvents])
48 main.add_module(eventinfosetter)
49 # main.add_module('EventInfoPrinter')
50 main.add_module('EvtGenInput')
51
52 sim.add_simulation(
53 main,
54 bkgfiles=bkgFiles,
55 forceSetPXDDataReduction=True,
56 usePXDDataReduction=ROIfinding,
57 simulateT0jitter=simulateJitter)
58else:
59 MCTracking = False
60
61 # setup database - if needed
62 # b2conditions.reset()
63 # b2conditions.override_globaltags()
64 # b2conditions.globaltags = ["online"]
65
66 # input root files
67 main.add_module('RootInput', branchNames=['RawPXDs', 'RawSVDs', 'RawCDCs'])
68 raw.add_unpackers(main, components=['PXD', 'SVD', 'CDC'])
69
70 # change ZS to 5 - if needed
71 # for moda in main.modules():
72 # if moda.name() == 'SVDUnpacker':
73 # moda.param("svdShaperDigitListName", "SVDShaperDigitsZS3")
74 # main.add_module("SVDZeroSuppressionEmulator",SNthreshold=5,ShaperDigits="SVDShaperDigitsZS3",ShaperDigitsIN="SVDShaperDigits")
75
76# now do reconstruction:
77trk.add_tracking_reconstruction(
78 main,
79 mcTrackFinding=MCTracking,
80 trackFitHypotheses=[211],
81 append_full_grid_cdc_eventt0=True,
82 skip_full_grid_cdc_eventt0_if_svd_time_present=False)
83
84# reconstruct strips
86
87# look at raw time - uncomment if needed
88b2.set_module_parameters(main, "SVDClusterizer", returnClusterRawTime=True)
89
90# fill TTrees
91main.add_module('SVDPerformanceTTree', outputFileName="SVDPerformanceTree"+str(tag)+".root")
92main.add_module('OverlapResiduals', ExpertLevel=True)
93
94main.add_module('Progress')
95
96b2.print_path(main)
97
98b2.process(main)
99
100print(b2.statistics)
def add_svd_create_recodigits(path, recocreatorName="SVDRecoDigitCreator", shaperDigitsName="")
Definition: __init__.py:118