33 from basf2
import conditions
as b2conditions
36 filename = sys.argv[2]
37 branches = [
'SVDShaperDigits',
'SVDRecoDigits',
'SVDClusters',
'EventT0',
'Tracks',
'RecoTracks']
39 trk_outputFile =
"TrackFilterControlNtuples_" + localdb +
".root"
45 if filename.rfind(
".root") != -1:
46 inputFileList.append(filename)
48 with open(filename,
'r')
as f:
49 inputFileList = [line.strip()
for line
in f]
51 b2conditions.prepend_globaltag(
"online")
52 b2conditions.prepend_globaltag(
"data_reprocessing_prompt")
53 if '_CHECK' not in localdb:
54 b2conditions.prepend_globaltag(
'svd_NOCoGCorrections')
55 if os.path.isdir(localdb):
56 print(
'WARNING, you are using CoG corrections in ' + localdb +
' exiting')
59 b2conditions.testing_payloads = [str(localdb)]
61 localdb = localdb.split(
'_')
62 if not os.path.isdir(localdb[0]):
63 print(
'WARNING, the localDB ' + localdb[0] +
' containing the corrections is missing, exiting.')
66 b2conditions.testing_payloads = [str(localdb)]
68 if os.path.isdir(localdb):
69 print(
'WARNING, you are using CoG corrections in ' + localdb +
' exiting')
72 b2conditions.testing_payloads = [str(localdb)]
74 main = b2.create_path()
76 rootinput = b2.register_module(
'RootInput')
77 rootinput.param(
'inputFileNames', inputFileList)
78 rootinput.param(
'branchNames', branches)
79 main.add_module(rootinput)
81 main.add_module(
"Gearbox")
82 main.add_module(
"Geometry", useDB=
True)
85 trkFlt = b2.register_module(
'TrackFilter')
86 trkFlt.param(
'outputFileName', trk_outputFile)
87 trkFlt.param(
'outputINArrayName',
'SelectedTracks')
88 trkFlt.param(
'outputOUTArrayName',
'ExcludedTracks')
89 trkFlt.param(
'min_NumHitSVD', nSVD)
90 trkFlt.param(
'min_NumHitCDC', nCDC)
91 trkFlt.param(
'min_Pvalue', pVal)
95 fil = b2.register_module(
'SVDShaperDigitsFromTracks')
96 fil.param(
'outputINArrayName',
'SVDShaperDigitsFromTracks')
101 for moda
in main.modules():
102 if moda.name() ==
'SVDCoGTimeEstimator':
103 moda.param(
"ShaperDigits",
'SVDShaperDigitsFromTracks')
104 moda.param(
"RecoDigits",
'SVDRecoDigitsFromTracks')
105 if moda.name() ==
'SVDSimpleClusterizer':
106 moda.param(
"Clusters",
'SVDClustersFromTracks')
107 moda.param(
"RecoDigits",
'SVDRecoDigitsFromTracks')
108 if moda.name() ==
'SVDSpacePointCreator':
109 moda.param(
"SVDClusters",
'SVDClustersFromTracks')
111 calib = SVDCoGTimeCalibrationImporterModule()
112 calib.set_localdb(localdb)
113 calib.notApplyCorrectForCDCLatency(
False)
114 main.add_module(calib)
117 progress = b2.register_module(
'ProgressBar')
118 main.add_module(progress)
def add_svd_reconstruction(path, isROIsimulation=False, createRecoDigits=False, applyMasking=False)