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