Belle II Software  release-08-01-10
hotStripFinder.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 
11 import basf2 as b2
12 from basf2 import conditions as b2conditions
13 
14 
22 
23 # set here the correct exp and run number you like to process
24 exp = 8
25 run = 2265 # 2308 # 2265
26 useLauraAlg = True
27 searchbaseValue = -1 # default value, use all sensor strips
28 setLauraThreshold = 5
29 
30 runType = ""
31 myflag = ""
32 
33 if run == 2308:
34  runType = "cosmic"
35 elif run == 2265:
36  runType = "physics"
37 else:
38  print("Check the run number!!")
39 
40 if searchbaseValue != -1:
41  myflag = "searchBase" + str(searchbaseValue) + "_thr" + str(setLauraThreshold)
42 
43 # set this string to identify the output rootfiles
44 outputfile = "SVDHotStripFinderZS5_exp" + str(exp) + "run" + str(run) + "_V1_" + str(myflag) + ".root"
45 if useLauraAlg:
46  outputfile = "SVDHotStripFinderZS5_exp" + str(exp) + "run" + str(run) + "_V2_" + str(myflag) + ".root"
47 
48 b2conditions.prepend_globaltag("svd_onlySVDinGeoConfiguration")
49 b2conditions.prepend_globaltag("data_reprocessing_prompt")
50 b2conditions.prepend_globaltag("svd_basic")
51 
52 main = b2.create_path()
53 
54 b2.set_random_seed(1)
55 
56 main.add_module(
57  'RootInput',
58  # inputFileName="~/svd/BII-3221-svd-hot-strip-masking/buc6/r03844/all/cdst/sub00/cdst.physics.0007.03844.HLT*",
59  # luminosity run 2265, exp8, raw data
60  # cosmic run 2308, exp8, raw data
61  inputFileName="/ghi/fs01/belle2/bdata/Data/Raw/e000" + \
62  str(exp) + "/r0" + str(run) + "/sub00/" + str(runType) + ".000" + str(exp) + ".0" + str(run) + ".HLT*",
63  branchNames=['RawSVDs'])
64 
65 main.add_module('Gearbox')
66 main.add_module('Geometry')
67 
68 # svd reconstruction, excluding SP creator
69 main.add_module('SVDUnpacker', svdShaperDigitListName='SVDShaperDigits')
70 main.add_module(
71  'SVDZeroSuppressionEmulator',
72  SNthreshold=5,
73  ShaperDigits='SVDShaperDigits',
74  ShaperDigitsIN='SVDShaperDigitsZS5',
75  FADCmode=True)
76 
77 # default parameters
78 main.add_module('SVDHotStripFinder', ShaperDigits='SVDShaperDigitsZS5', outputFileName=outputfile, searchBase=searchbaseValue,
79  threshold=1, absOccThreshold=0.20, relOccPrec=setLauraThreshold, useHSFinderV1=not useLauraAlg)
80 
81 main.add_module('Progress')
82 
83 b2.print_path(main)
84 
85 b2.process(main)
86 
87 print(b2.statistics)