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