20 from rawdata
import add_unpackers
21 from svd
import add_svd_reconstruction
22 from ROOT
import Belle2
27 print(
"usage: basf2", argvs[0],
"expNo runNo globalTag [outputFolder]")
30 expNo =
'e' +
'{:0=4d}'.format(int(argvs[1]))
31 runNo =
'r' +
'{:0=5d}'.format(int(argvs[2]))
35 indir =
'/hsm/belle2/bdata/Data/Raw/' + expNo +
'/' + runNo +
'/sub00'
36 files = sorted(glob.glob(indir +
'/*.root'))
38 basf2.B2ERROR(
'No files found in ' + indir)
44 outputFile = outdir +
'/beamBkgHitRates-' + expNo +
'-' + runNo +
'.root'
48 ''' select events according to given trigger types '''
51 ''' event processing '''
55 if not trg_summary.isValid():
56 basf2.B2ERROR(
'No TRGSummary available - event ignored')
59 for trgType
in trigTypes:
60 if trg_summary.getTimType() == trgType:
66 basf2.conditions.prepend_globaltag(global_tag)
69 main = basf2.create_path()
70 emptypath = basf2.create_path()
73 main.add_module(
'RootInput', inputFileNames=files)
76 main.add_module(
'Gearbox')
79 main.add_module(
'Geometry')
82 main.add_module(
'TRGGDLUnpacker')
83 main.add_module(
'TRGGDLSummary')
86 main.add_module(
'Progress')
89 if len(trigTypes) > 0:
91 main.add_module(selector)
92 selector.if_false(emptypath)
95 add_unpackers(path=main,
96 components=[
'PXD',
'SVD',
'CDC',
'ECL',
'TOP',
'ARICH',
'KLM'])
99 main.add_module(
'ARICHFillHits')
100 main.add_module(
'TOPChannelMasker')
101 main.add_module(
'ActivatePXDGainCalibrator')
102 main.add_module(
'PXDClusterizer')
103 add_svd_reconstruction(main, applyMasking=
True)
105 'SVDZeroSuppressionEmulator',
107 ShaperDigits=
'SVDShaperDigitsUnmasked',
108 ShaperDigitsIN=
'SVDShaperDigitsZS5')
109 main.add_module(
'TFCDC_WireHitPreparer',
110 wirePosition=
'aligned',
111 flightTimeEstimation=
'outwards',
112 filter=
'cuts_from_DB')
116 'BeamBkgHitRateMonitor',
117 outputFileName=outputFile,
119 svdShaperDigitsName=
'SVDShaperDigitsZS5',
120 cdcTimeWindowLowerEdgeSmallCell=4720,
121 cdcTimeWindowUpperEdgeSmallCell=5020,
122 cdcTimeWindowLowerEdgeNormalCell=4720,
123 cdcTimeWindowUpperEdgeNormalCell=5020)
129 print(basf2.statistics)
a (simplified) python wrapper for StoreObjPtr.