32from basf2
import conditions
as b2conditions
36branches = [
'SVDShaperDigits',
'SVDRecoDigits',
'SVDClusters',
'EventT0',
'Tracks',
'RecoTracks']
38trk_outputFile =
"TrackFilterControlNtuples_" + localdb +
".root"
44if filename.rfind(
".root") != -1:
45 inputFileList.append(filename)
47 with open(filename)
as f:
48 inputFileList = [line.strip()
for line
in f]
50b2conditions.prepend_globaltag(
"online")
51b2conditions.prepend_globaltag(
"data_reprocessing_prompt")
52if '_CHECK' not in localdb:
53 b2conditions.prepend_globaltag(
'svd_NOCoGCorrections')
54 if os.path.isdir(localdb):
55 print(
'WARNING, you are using CoG corrections in ' + localdb +
' exiting')
58 b2conditions.testing_payloads = [str(localdb)]
60 localdb = localdb.split(
'_')
61 if not os.path.isdir(localdb[0]):
62 print(
'WARNING, the localDB ' + localdb[0] +
' containing the corrections is missing, exiting.')
65 b2conditions.testing_payloads = [str(localdb)]
67 if os.path.isdir(localdb):
68 print(
'WARNING, you are using CoG corrections in ' + localdb +
' exiting')
71 b2conditions.testing_payloads = [str(localdb)]
73main = b2.create_path()
75rootinput = b2.register_module(
'RootInput')
76rootinput.param(
'inputFileNames', inputFileList)
77rootinput.param(
'branchNames', branches)
78main.add_module(rootinput)
80main.add_module(
"Gearbox")
81main.add_module(
"Geometry", useDB=
True)
84trkFlt = b2.register_module(
'TrackFilter')
85trkFlt.param(
'outputFileName', trk_outputFile)
86trkFlt.param(
'outputINArrayName',
'SelectedTracks')
87trkFlt.param(
'outputOUTArrayName',
'ExcludedTracks')
88trkFlt.param(
'min_NumHitSVD', nSVD)
89trkFlt.param(
'min_NumHitCDC', nCDC)
90trkFlt.param(
'min_Pvalue', pVal)
94fil = b2.register_module(
'SVDShaperDigitsFromTracks')
95fil.param(
'outputINArrayName',
'SVDShaperDigitsFromTracks')
100for moda
in main.modules():
101 if moda.name() ==
'SVDCoGTimeEstimator':
102 moda.param(
"ShaperDigits",
'SVDShaperDigitsFromTracks')
103 moda.param(
"RecoDigits",
'SVDRecoDigitsFromTracks')
104 if moda.name() ==
'SVDSimpleClusterizer':
105 moda.param(
"Clusters",
'SVDClustersFromTracks')
106 moda.param(
"RecoDigits",
'SVDRecoDigitsFromTracks')
107 if moda.name() ==
'SVDSpacePointCreator':
108 moda.param(
"SVDClusters",
'SVDClustersFromTracks')
110calib = SVDCoGTimeCalibrationImporterModule()
111calib.set_localdb(localdb)
112calib.notApplyCorrectForCDCLatency(
False)
113main.add_module(calib)
116progress = b2.register_module(
'ProgressBar')
117main.add_module(progress)
def add_svd_reconstruction(path, isROIsimulation=False, createRecoDigits=False, applyMasking=False)