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