12 """Performs shape fit and compares emulator fit results with fit
13 results received from ShaperDSP module.
18 from ROOT
import Belle2
25 outputFileName =
'out.root'
26 inputFile_list = sorted(glob.glob(
'/group/belle2/dataprod/Data/Raw/e0008/r03480/sub00/*.root'))
29 input_arg = env.getInputFilesOverride()
30 if len(input_arg) > 0:
31 inputFile_list = [str(x)
for x
in input_arg]
35 output_arg = env.getOutputFileOverride()
36 if len(output_arg) > 0:
37 outputFileName = output_arg
44 """Module that prints ShaperDSP emulator discrepancies
47 Uses ECLDigits, ECLDsps, ECLTrigs dataobjects
59 """Check for discrepancy between real ShaperDSP
60 data and shapeFitter function from
61 ecl/utility/src/ECLDspUtilities.cc .
64 for digit
in self.
digitsdigits:
65 waveform = digit.getRelated(
'ECLDsps')
69 trig = digit.getRelated(
'ECLTrigs')
73 trigger_time = int(trig.getTimeTrig())
76 adc = waveform.getDspA()
77 cid = digit.getCellId()
79 time = digit.getTimeFit()
80 qual = digit.getQuality()
87 qual2 = result.quality
89 if amp != amp2
or time != time2
or qual != qual2:
91 print(
'RealData: %4d %6d %6d %6d' % (cid, amp, time, qual))
92 print(
'Emulator: %4d %6d %6d %6d' % (cid, amp2, time2, qual2))
94 print(
'Event : %d Trigger time: %d' % (self.evtn, trigger_time))
95 print(
'CellID: %d AmpData: %d TimeData: %d QualityData: %d' % (cid, amp, time, qual))
96 print(
' '.join([str(x)
for x
in adc]), end=
'')
102 b2.set_log_level(b2.LogLevel.ERROR)
105 mainPath = b2.create_path()
108 if inputFile_list[0].endswith(
'sroot'):
109 mainPath.add_module(
'SeqRootInput',
111 inputFileNames=inputFile_list)
113 mainPath.add_module(
'RootInput',
115 inputFileNames=inputFile_list)
118 mainPath.add_module(
'ECLUnpacker', storeTrigTime=
True)
124 b2.use_database_chain()
125 b2.use_central_database(
'data_reprocessing_prompt', b2.LogLevel.WARNING)
126 b2.use_central_database(
'online', b2.LogLevel.WARNING)
127 b2.use_local_database(
'localdb/database.txt')
130 b2.conditions.override_globaltags()
133 mainPath.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....
static Environment & Instance()
Static method to get a reference to the Environment instance.
A (simplified) python wrapper for StoreArray.
digits
Store array of ECLDigits.