11"""Performs shape fit and compares emulator fit results with fit
12 results received from ShaperDSP module.
17from ROOT import Belle2
19env = Belle2.Environment.Instance()
24outputFileName = 'out.root'
25inputFile_list = sorted(glob.glob('/group/belle2/dataprod/Data/Raw/e0008/r03480/sub00/*.root'))
27# Override if "-i file.root" argument was sent to basf2.
28input_arg = env.getInputFilesOverride()
30 inputFile_list = [str(x) for x
in input_arg]
34output_arg = env.getOutputFileOverride()
35if len(output_arg) > 0:
36 outputFileName = output_arg
43 """Module that prints ShaperDSP emulator discrepancies
46 Uses ECLDigits, ECLDsps, ECLTrigs dataobjects
58 """Check for discrepancy between real ShaperDSP
59 data and shapeFitter function
from
60 ecl/utility/src/ECLDspUtilities.cc .
64 waveform = digit.getRelated(
'ECLDsps')
68 trig = digit.getRelated(
'ECLTrigs')
72 trigger_time = int(trig.getTimeTrig())
75 adc = waveform.getDspA()
76 cid = digit.getCellId()
78 time = digit.getTimeFit()
79 qual = digit.getQuality()
86 qual2 = result.quality
88 if amp != amp2
or time != time2
or qual != qual2:
90 print(f
'RealData: {cid:4} {amp:6} {time:6} {qual:6}')
91 print(f
'Emulator: {cid:4} {amp2:6} {time2:6} {qual2:6}')
93 print(f
'Event : {self.eventNumber} Trigger time: {trigger_time}')
94 print(f
'CellID: {cid} AmpData: {amp} TimeData: {time} QualityData: {qual}')
95 print(
' '.join([str(x)
for x
in adc]), end=
'')
101b2.set_log_level(b2.LogLevel.ERROR)
104mainPath = b2.create_path()
107if inputFile_list[0].endswith(
'sroot'):
108 mainPath.add_module(
'SeqRootInput',
110 inputFileNames=inputFile_list)
112 mainPath.add_module(
'RootInput',
114 inputFileNames=inputFile_list)
117mainPath.add_module(
'ECLUnpacker', storeTrigTime=
True)
123b2.use_database_chain()
124b2.use_central_database(
'data_reprocessing_prompt', b2.LogLevel.WARNING)
125b2.use_central_database(
'online', b2.LogLevel.WARNING)
126b2.use_local_database(
'localdb/database.txt')
129b2.conditions.override_globaltags()
132mainPath.add_module(
'Progress')
static ECLShapeFit shapeFitter(int cid, std::vector< int > adc, int ttrig, bool adjusted_timing=true)
Emulate shape fitting algorithm from ShaperDSP using algorithm from ecl/utility/src/ECLDspEmulator....
A (simplified) python wrapper for StoreArray.
digits
Store array of ECLDigits.