16from rawdata
import add_unpackers
17from reconstruction
import add_cosmics_reconstruction
19from caf.framework
import Calibration, Collection
20from caf.strategies
import SequentialRunByRun, SingleIOV, SequentialBoundaries
21from ROOT
import Belle2
22from ROOT.Belle2
import TOP
25def BS13d_calibration_local(inputFiles, look_back=28, globalTags=None, localDBs=None, sroot=False):
27 Returns calibration object for carrier shift calibration of BS13d
with local runs
28 (laser, single-pulse
or double-pulse).
29 :param inputFiles: A list of input files
30 :param look_back: look-back window setting (set it to 0 to use the one
from DB)
31 :param globalTags: a list of
global tags, highest priority first
32 :param localDBs: a list of local databases, highest priority first
33 :param sroot:
True if input files are
in sroot format,
False if in root format
37 main = basf2.create_path()
41 main.add_module(
'SeqRootInput')
43 main.add_module(
'RootInput')
44 main.add_module(
'TOPGeometryParInitializer')
45 main.add_module(
'TOPUnpacker')
46 main.add_module(
'TOPRawDigitConverter', lookBackWindows=look_back,
47 useAsicShiftCalibration=
False, useChannelT0Calibration=
False)
50 collector = basf2.register_module(
'TOPAsicShiftsBS13dCollector')
53 algorithm = TOP.TOPAsicShiftsBS13dAlgorithm()
54 algorithm.setWindowSize(0)
57 cal =
Calibration(name=
'TOP_BS13dCalibration', collector=collector,
58 algorithms=algorithm, input_files=inputFiles)
60 for globalTag
in reversed(globalTags):
61 cal.use_central_database(globalTag)
63 for localDB
in reversed(localDBs):
64 cal.use_local_database(localDB)
65 cal.pre_collector_path = main
66 cal.strategies = SequentialRunByRun
71def BS13d_calibration_rawdata(inputFiles, globalTags=None, localDBs=None):
73 Returns calibration object for carrier shift calibration of BS13d
with raw data.
74 :param inputFiles: A list of input files
in raw data format
75 :param globalTags: a list of
global tags, highest priority first
76 :param localDBs: a list of local databases, highest priority first
80 main = basf2.create_path()
83 main.add_module(
'RootInput')
84 main.add_module(
'TOPGeometryParInitializer')
85 main.add_module(
'TOPUnpacker')
86 main.add_module(
'TOPRawDigitConverter',
87 useAsicShiftCalibration=
False, useChannelT0Calibration=
False)
90 collector = basf2.register_module(
'TOPAsicShiftsBS13dCollector')
93 algorithm = TOP.TOPAsicShiftsBS13dAlgorithm()
96 cal =
Calibration(name=
'TOP_BS13dCalibration', collector=collector,
97 algorithms=algorithm, input_files=inputFiles)
99 for globalTag
in reversed(globalTags):
100 cal.use_central_database(globalTag)
102 for localDB
in reversed(localDBs):
103 cal.use_local_database(localDB)
104 cal.pre_collector_path = main
105 cal.strategies = SequentialRunByRun
110def BS13d_calibration_cdst(inputFiles, time_offset=0, globalTags=None, localDBs=None,
111 new_cdst_format=True):
113 Returns calibration object for carrier shift calibration of BS13d
with processed data.
114 :param inputFiles: A list of input files
in cdst data format
115 :param time_offset: time offset [ns]
116 :param globalTags: a list of
global tags, highest priority first
117 :param localDBs: a list of local databases, highest priority first
118 :param new_cdst_format:
True or False for new
or old cdst format, respectively
122 main = basf2.create_path()
125 main.add_module(
'RootInput')
127 main.add_module(
'Gearbox')
128 main.add_module(
'Geometry')
129 main.add_module(
'Ext')
130 main.add_module(
'TOPUnpacker')
131 main.add_module(
'TOPRawDigitConverter')
132 main.add_module(
'TOPChannelMasker')
133 main.add_module(
'TOPBunchFinder', autoRange=
True, useTimeSeed=
False, useFillPattern=
False, subtractRunningOffset=
False)
134 main.add_module(
'TOPTimeRecalibrator',
135 useAsicShiftCalibration=
False, useChannelT0Calibration=
True)
137 main.add_module(
'TOPGeometryParInitializer')
138 main.add_module(
'TOPTimeRecalibrator',
139 useAsicShiftCalibration=
False, useChannelT0Calibration=
True)
142 collector = basf2.register_module(
'TOPAsicShiftsBS13dCollector',
143 timeOffset=time_offset, requireRecBunch=
True)
146 algorithm = TOP.TOPAsicShiftsBS13dAlgorithm()
149 cal =
Calibration(name=
'TOP_BS13dCalibration', collector=collector,
150 algorithms=algorithm, input_files=inputFiles)
152 for globalTag
in reversed(globalTags):
153 cal.use_central_database(globalTag)
155 for localDB
in reversed(localDBs):
156 cal.use_local_database(localDB)
157 cal.pre_collector_path = main
158 cal.strategies = SequentialRunByRun
163def moduleT0_calibration_DeltaT(inputFiles, globalTags=None, localDBs=None,
164 new_cdst_format=True):
166 Returns calibration object for rough module T0 calibration
with method DeltaT
167 :param inputFiles: A list of input files
in cdst data format
168 :param globalTags: a list of
global tags, highest priority first
169 :param localDBs: a list of local databases, highest priority first
170 :param new_cdst_format:
True or False for new
or old cdst format, respectively
174 main = basf2.create_path()
177 main.add_module(
'RootInput')
179 main.add_module(
'Gearbox')
180 main.add_module(
'Geometry')
181 main.add_module(
'Ext')
182 main.add_module(
'TOPUnpacker')
183 main.add_module(
'TOPRawDigitConverter')
184 main.add_module(
'TOPChannelMasker')
185 main.add_module(
'TOPBunchFinder', autoRange=
True, useTimeSeed=
False, useFillPattern=
False, subtractRunningOffset=
False)
187 main.add_module(
'TOPGeometryParInitializer')
188 main.add_module(
'TOPTimeRecalibrator', subtractBunchTime=
False)
189 main.add_module(
'TOPChannelMasker')
190 main.add_module(
'TOPBunchFinder', usePIDLikelihoods=
True, autoRange=
True, useTimeSeed=
False, useFillPattern=
False,
191 subtractRunningOffset=
False)
194 collector = basf2.register_module(
'TOPModuleT0DeltaTCollector')
195 collector.param(
'granularity',
'run')
198 algorithm = TOP.TOPModuleT0DeltaTAlgorithm()
201 cal =
Calibration(name=
'TOP_moduleT0_rough', collector=collector,
202 algorithms=algorithm, input_files=inputFiles)
204 for globalTag
in reversed(globalTags):
205 cal.use_central_database(globalTag)
207 for localDB
in reversed(localDBs):
208 cal.use_local_database(localDB)
209 cal.pre_collector_path = main
210 cal.strategies = SequentialBoundaries
215def moduleT0_calibration_LL(inputFiles, sample='dimuon', globalTags=None, localDBs=None,
216 new_cdst_format=True):
218 Returns calibration object for final module T0 calibration
with method LL
219 :param inputFiles: A list of input files
in cdst data format
220 :param sample: data sample (
'dimuon' or 'bhabha')
221 :param globalTags: a list of
global tags, highest priority first
222 :param localDBs: a list of local databases, highest priority first
223 :param new_cdst_format:
True or False for new
or old cdst format, respectively
227 main = basf2.create_path()
230 main.add_module(
'RootInput')
232 main.add_module(
'Gearbox')
233 main.add_module(
'Geometry')
234 main.add_module(
'Ext')
235 main.add_module(
'TOPUnpacker')
236 main.add_module(
'TOPRawDigitConverter')
237 main.add_module(
'TOPChannelMasker')
238 main.add_module(
'TOPBunchFinder', autoRange=
True, useTimeSeed=
False, useFillPattern=
False, subtractRunningOffset=
False)
240 main.add_module(
'TOPGeometryParInitializer')
241 main.add_module(
'TOPTimeRecalibrator', subtractBunchTime=
False)
242 main.add_module(
'TOPChannelMasker')
243 main.add_module(
'TOPBunchFinder', usePIDLikelihoods=
True, autoRange=
True, useTimeSeed=
False, useFillPattern=
False,
244 subtractRunningOffset=
False)
247 collector = basf2.register_module(
'TOPModuleT0LLCollector')
248 collector.param(
'sample', sample)
249 collector.param(
'granularity',
'run')
252 algorithm = TOP.TOPModuleT0LLAlgorithm()
255 cal =
Calibration(name=
'TOP_moduleT0_final', collector=collector,
256 algorithms=algorithm, input_files=inputFiles)
258 for globalTag
in reversed(globalTags):
259 cal.use_central_database(globalTag)
261 for localDB
in reversed(localDBs):
262 cal.use_local_database(localDB)
263 cal.pre_collector_path = main
264 cal.strategies = SequentialBoundaries
269def moduleT0_calibration_cosmics(inputFiles, globalTags=None, localDBs=None,
270 data_format="raw", full_reco=True):
272 Returns calibration object for module T0 calibration
with cosmic data using DeltaT method.
273 Note: by default cdst
is processed
with merging incoming
and outcoming track segments of a cosmic particle,
274 but we need here separate track segments
in order to get ExtHits
in incoming
and outcoming module.
275 :param inputFiles: A list of input files
in cdst data format
276 :param globalTags: a list of
global tags, highest priority first
277 :param localDBs: a list of local databases, highest priority first
278 :param data_format:
"raw" for raw data
or "cdst" for the new cdst format
279 :param full_reco: on
True, run full cosmics reconstruction also
if data_format==
"cdst"
283 main = basf2.create_path()
286 if data_format ==
"cdst" and full_reco:
287 main.add_module(
'RootInput', branchNames=ALWAYS_SAVE_OBJECTS + RAWDATA_OBJECTS)
289 main.add_module(
'RootInput')
291 main.add_module(
'Gearbox')
292 main.add_module(
'Geometry')
293 if data_format ==
"raw" or full_reco:
295 add_cosmics_reconstruction(main, merge_tracks=
False, reconstruct_cdst=
True)
297 main.add_module(
'TOPUnpacker')
298 main.add_module(
'TOPRawDigitConverter')
300 main.add_module(
'Ext')
301 main.add_module(
'TOPChannelMasker')
302 main.add_module(
'TOPCosmicT0Finder', useIncomingTrack=
True, applyT0=
False)
303 main.add_module(
'TOPCosmicT0Finder', useIncomingTrack=
False, applyT0=
False)
306 collector = basf2.register_module(
'TOPModuleT0DeltaTCollector')
307 collector.param(
'granularity',
'run')
310 algorithm = TOP.TOPModuleT0DeltaTAlgorithm()
313 cal =
Calibration(name=
'TOP_moduleT0_cosmics', collector=collector,
314 algorithms=algorithm, input_files=inputFiles)
316 for globalTag
in reversed(globalTags):
317 cal.use_central_database(globalTag)
319 for localDB
in reversed(localDBs):
320 cal.use_local_database(localDB)
321 cal.pre_collector_path = main
322 cal.strategies = SingleIOV
327def commonT0_calibration_BF(inputFiles, globalTags=None, localDBs=None,
328 new_cdst_format=True):
330 Returns calibration object for common T0 calibration
with method BF
331 :param inputFiles: A list of input files
in cdst data format
332 :param globalTags: a list of
global tags, highest priority first
333 :param localDBs: a list of local databases, highest priority first
334 :param new_cdst_format:
True or False for new
or old cdst format, respectively
338 main = basf2.create_path()
341 main.add_module(
'RootInput')
343 main.add_module(
'Gearbox')
344 main.add_module(
'Geometry')
345 main.add_module(
'Ext')
346 main.add_module(
'TOPUnpacker')
347 main.add_module(
'TOPRawDigitConverter')
348 main.add_module(
'TOPChannelMasker')
349 main.add_module(
'TOPBunchFinder', autoRange=
True, useTimeSeed=
False, useFillPattern=
False, subtractRunningOffset=
False)
351 main.add_module(
'TOPGeometryParInitializer')
352 main.add_module(
'TOPTimeRecalibrator', subtractBunchTime=
False)
353 main.add_module(
'TOPChannelMasker')
354 main.add_module(
'TOPBunchFinder', usePIDLikelihoods=
True, autoRange=
True, useTimeSeed=
False, useFillPattern=
False,
355 subtractRunningOffset=
False)
358 collector = basf2.register_module(
'TOPCommonT0BFCollector')
361 algorithm = TOP.TOPCommonT0BFAlgorithm()
364 cal =
Calibration(name=
'TOP_commonT0Calibration', collector=collector,
365 algorithms=algorithm, input_files=inputFiles)
367 for globalTag
in reversed(globalTags):
368 cal.use_central_database(globalTag)
370 for localDB
in reversed(localDBs):
371 cal.use_local_database(localDB)
372 cal.pre_collector_path = main
373 cal.strategies = SequentialRunByRun
378def commonT0_calibration_LL(inputFiles, sample='dimuon', globalTags=None, localDBs=None,
379 new_cdst_format=True):
381 Returns calibration object for common T0 calibration
with method LL
382 :param inputFiles: A list of input files
in cdst data format
383 :param sample: data sample (
'dimuon' or 'bhabha')
384 :param globalTags: a list of
global tags, highest priority first
385 :param localDBs: a list of local databases, highest priority first
386 :param new_cdst_format:
True or False for new
or old cdst format, respectively
390 main = basf2.create_path()
393 main.add_module(
'RootInput')
395 main.add_module(
'Gearbox')
396 main.add_module(
'Geometry')
397 main.add_module(
'Ext')
398 main.add_module(
'TOPUnpacker')
399 main.add_module(
'TOPRawDigitConverter')
400 main.add_module(
'TOPChannelMasker')
401 main.add_module(
'TOPBunchFinder', autoRange=
True, useTimeSeed=
False, useFillPattern=
False, subtractRunningOffset=
False)
403 main.add_module(
'TOPGeometryParInitializer')
404 main.add_module(
'TOPTimeRecalibrator', subtractBunchTime=
False)
405 main.add_module(
'TOPChannelMasker')
406 main.add_module(
'TOPBunchFinder', usePIDLikelihoods=
True, autoRange=
True, useTimeSeed=
False, useFillPattern=
False,
407 subtractRunningOffset=
False)
410 collector = basf2.register_module(
'TOPCommonT0LLCollector')
411 collector.param(
'sample', sample)
414 algorithm = TOP.TOPCommonT0LLAlgorithm()
417 cal =
Calibration(name=
'TOP_commonT0Calibration', collector=collector,
418 algorithms=algorithm, input_files=inputFiles)
420 for globalTag
in reversed(globalTags):
421 cal.use_central_database(globalTag)
423 for localDB
in reversed(localDBs):
424 cal.use_local_database(localDB)
425 cal.pre_collector_path = main
426 cal.strategies = SequentialRunByRun
431def pulseHeight_calibration_laser(inputFiles, t_min=-50.0, t_max=0.0, look_back=28,
432 globalTags=None, localDBs=None, sroot=False):
434 Returns calibration object for calibration of pulse-height distributions
and
435 threshold efficiencies
with local laser runs.
436 :param inputFiles: A list of input files
437 :param t_min: lower edge of time window to select laser signal [ns]
438 :param t_max: upper edge of time window to select laser signal [ns]
439 :param look_back: look-back window setting (set it to 0 to use the one
from DB)
440 :param globalTags: a list of
global tags, highest priority first
441 :param localDBs: a list of local databases, highest priority first
442 :param sroot:
True if input files are
in sroot format,
False if in root format
446 main = basf2.create_path()
450 main.add_module(
'SeqRootInput')
452 main.add_module(
'RootInput')
453 main.add_module(
'TOPGeometryParInitializer')
454 main.add_module(
'TOPUnpacker')
455 main.add_module(
'TOPRawDigitConverter', lookBackWindows=look_back)
458 collector = basf2.register_module(
'TOPPulseHeightCollector')
459 collector.param(
'timeWindow', [t_min, t_max])
460 collector.param(
'granularity',
'all')
463 algorithm = TOP.TOPPulseHeightAlgorithm()
466 cal =
Calibration(name=
'TOP_pulseHeightCalibration', collector=collector,
467 algorithms=algorithm, input_files=inputFiles)
469 for globalTag
in reversed(globalTags):
470 cal.use_central_database(globalTag)
472 for localDB
in reversed(localDBs):
473 cal.use_local_database(localDB)
474 cal.pre_collector_path = main
475 cal.strategies = SingleIOV
480def pulseHeight_calibration_rawdata(inputFiles, globalTags=None, localDBs=None):
482 Returns calibration object for calibration of pulse-height distributions
and
483 threshold efficiencies
with raw data
484 :param inputFiles: A list of input files
in raw data format
485 :param globalTags: a list of
global tags, highest priority first
486 :param localDBs: a list of local databases, highest priority first
490 main = basf2.create_path()
493 main.add_module(
'RootInput')
494 main.add_module(
'TOPGeometryParInitializer')
495 main.add_module(
'TOPUnpacker')
496 main.add_module(
'TOPRawDigitConverter')
499 collector = basf2.register_module(
'TOPPulseHeightCollector')
500 collector.param(
'granularity',
'all')
503 algorithm = TOP.TOPPulseHeightAlgorithm()
506 cal =
Calibration(name=
'TOP_pulseHeightCalibration', collector=collector,
507 algorithms=algorithm, input_files=inputFiles)
509 for globalTag
in reversed(globalTags):
510 cal.use_central_database(globalTag)
512 for localDB
in reversed(localDBs):
513 cal.use_local_database(localDB)
514 cal.pre_collector_path = main
515 cal.strategies = SingleIOV
520def module_alignment(inputFiles, sample='dimuon', fixedParameters=None,
521 globalTags=None, localDBs=None, new_cdst_format=True,
524 Returns calibration object for alignment of TOP modules.
525 :param inputFiles: A list of input files
in cdst data format
526 :param sample: data sample (
'dimuon' or 'bhabha')
527 :fixedParameters: a list of parameters to be fixed (parameter names: basf2 -m TOPAlignmentCollector)
528 :param globalTags: a list of
global tags, highest priority first
529 :param localDBs: a list of local databases, highest priority first
530 :param new_cdst_format:
True or False for new
or old cdst format, respectively
531 :param backend_args: Dictionary of backend args
for the Collection object to use
537 for globalTag
in reversed(globalTags):
538 cal.use_central_database(globalTag)
540 for localDB
in reversed(localDBs):
541 cal.use_local_database(localDB)
542 cal.strategies = SingleIOV
545 for slot
in range(1, 17):
547 main = basf2.create_path()
550 main.add_module(
'RootInput')
552 main.add_module(
'Gearbox')
553 main.add_module(
'Geometry')
554 main.add_module(
'Ext')
555 main.add_module(
'TOPUnpacker')
556 main.add_module(
'TOPRawDigitConverter')
557 main.add_module(
'TOPChannelMasker')
558 main.add_module(
'TOPBunchFinder', autoRange=
True, useTimeSeed=
False, useFillPattern=
False,
559 subtractRunningOffset=
False)
561 main.add_module(
'TOPGeometryParInitializer')
562 main.add_module(
'TOPTimeRecalibrator', subtractBunchTime=
False)
563 main.add_module(
'TOPChannelMasker')
564 main.add_module(
'TOPBunchFinder', autoRange=
True, useTimeSeed=
False, useFillPattern=
False,
565 usePIDLikelihoods=
True, subtractRunningOffset=
False)
568 collector = basf2.register_module(
'TOPAlignmentCollector')
569 collector.param(
'sample', sample)
571 collector.param(
'parFixed', fixedParameters)
572 collector.param(
'targetModule', slot)
573 collector.param(
'granularity',
'all')
578 collection =
Collection(collector=collector, input_files=inputFiles,
579 pre_collector_path=main, max_collector_jobs=1)
581 for globalTag
in reversed(globalTags):
582 collection.use_central_database(globalTag)
584 for localDB
in reversed(localDBs):
585 collection.use_local_database(localDB)
587 collection.backend_args = backend_args
590 cal.add_collection(name=
'slot_' + f
'{slot:02d}', collection=collection)
593 algorithm = TOP.TOPAlignmentAlgorithm()
594 cal.algorithms = algorithm
599def channel_mask_calibration(inputFiles, globalTags=None, localDBs=None, unpack=True):
601 Returns calibration object for channel masking
602 :param inputFiles: A list of input files
in raw data
or cdst format
603 :param globalTags: a list of
global tags, highest priority first
604 :param localDBs: a list of local databases, highest priority first
605 :param unpack:
True if data unpacking
is required (i.e.
for raw data
or for new cdst format)
609 main = basf2.create_path()
612 main.add_module(
'RootInput')
613 main.add_module(
'TOPGeometryParInitializer')
615 main.add_module(
'TOPUnpacker')
616 main.add_module(
'TOPRawDigitConverter')
619 collector = basf2.register_module(
'TOPChannelMaskCollector')
622 algorithm = TOP.TOPChannelMaskAlgorithm()
625 cal =
Calibration(name=
'TOP_ChannelMaskCalibration', collector=collector,
626 algorithms=algorithm, input_files=inputFiles)
628 for globalTag
in reversed(globalTags):
629 cal.use_central_database(globalTag)
631 for localDB
in reversed(localDBs):
632 cal.use_local_database(localDB)
633 cal.pre_collector_path = main
634 cal.strategies = SequentialRunByRun
639def offset_calibration(inputFiles, globalTags=None, localDBs=None,
640 new_cdst_format=True):
642 Returns calibration object for the calibration of offsets
643 :param inputFiles: A list of input files
in cdst data format
644 :param globalTags: a list of
global tags, highest priority first
645 :param localDBs: a list of local databases, highest priority first
646 :param new_cdst_format:
True or False for new
or old cdst format, respectively
650 main = basf2.create_path()
653 main.add_module(
'RootInput')
655 main.add_module(
'Gearbox')
656 main.add_module(
'Geometry')
657 main.add_module(
'Ext')
658 main.add_module(
'TOPUnpacker')
659 main.add_module(
'TOPRawDigitConverter')
660 main.add_module(
'TOPChannelMasker')
661 main.add_module(
'TOPBunchFinder', autoRange=
True, useTimeSeed=
False, useFillPattern=
False, subtractRunningOffset=
False)
663 main.add_module(
'TOPGeometryParInitializer')
664 main.add_module(
'TOPTimeRecalibrator', subtractBunchTime=
False)
665 main.add_module(
'TOPChannelMasker')
666 main.add_module(
'TOPBunchFinder', usePIDLikelihoods=
True, autoRange=
True, useTimeSeed=
False, useFillPattern=
False,
667 subtractRunningOffset=
False)
670 collector = basf2.register_module(
'TOPOffsetCollector')
673 algorithms = [TOP.TOPEventT0OffsetAlgorithm(), TOP.TOPFillPatternOffsetAlgorithm()]
676 cal =
Calibration(name=
'TOP_offsetCalibration', collector=collector,
677 algorithms=algorithms, input_files=inputFiles)
679 for globalTag
in reversed(globalTags):
680 cal.use_central_database(globalTag)
682 for localDB
in reversed(localDBs):
683 cal.use_local_database(localDB)
684 cal.pre_collector_path = main
685 cal.strategies = SequentialRunByRun
690def photonYields_calibration(inputFiles, sample='dimuon', globalTags=None, localDBs=None):
692 Returns calibration object for photon pixel yields aimed
for PMT ageing studies
and for finding optically decoupled PMT
's :param inputFiles: A list of input files in cdst data format
693 :param sample: data sample (
'dimuon' or 'bhabha')
694 :param globalTags: a list of
global tags, highest priority first
695 :param localDBs: a list of local databases, highest priority first
699 main = basf2.create_path()
702 main.add_module(
'RootInput')
703 main.add_module(
'Gearbox')
704 main.add_module(
'Geometry')
705 main.add_module(
'Ext')
706 main.add_module(
'TOPUnpacker')
707 main.add_module(
'TOPRawDigitConverter')
708 main.add_module(
'TOPChannelMasker')
709 main.add_module(
'TOPBunchFinder')
710 if sample ==
'bhabha':
711 main.add_module(
'TOPPDFDebugger', pdgCodes=[11])
713 main.add_module(
'TOPPDFDebugger', pdgCodes=[13])
716 collector = basf2.register_module(
'TOPPhotonYieldsCollector')
717 collector.param(
'sample', sample)
718 collector.param(
'granularity',
'run')
721 algorithm = TOP.TOPPhotonYieldsAlgorithm()
724 cal =
Calibration(name=
'TOP_photonYields', collector=collector,
725 algorithms=algorithm, input_files=inputFiles)
727 for globalTag
in reversed(globalTags):
728 cal.use_central_database(globalTag)
730 for localDB
in reversed(localDBs):
731 cal.use_local_database(localDB)
732 cal.pre_collector_path = main
733 cal.strategies = SequentialBoundaries
738def calibration_validation(inputFiles, sample='dimuon', globalTags=None, localDBs=None, new_cdst_format=True):
740 Returns calibration object for calibration validation
741 :param inputFiles: A list of input files
in cdst data format
742 :param sample: data sample (
'dimuon' or 'bhabha')
743 :param globalTags: a list of
global tags, highest priority first
744 :param localDBs: a list of local databases, highest priority first
745 :param new_cdst_format:
True or False for new
or old cdst format, respectively
749 main = basf2.create_path()
752 main.add_module(
'RootInput')
754 main.add_module(
'Gearbox')
755 main.add_module(
'Geometry')
756 main.add_module(
'Ext')
757 main.add_module(
'TOPUnpacker')
758 main.add_module(
'TOPRawDigitConverter')
759 main.add_module(
'TOPChannelMasker')
760 main.add_module(
'TOPBunchFinder')
762 main.add_module(
'TOPGeometryParInitializer')
763 main.add_module(
'TOPTimeRecalibrator', subtractBunchTime=
False)
764 main.add_module(
'TOPChannelMasker')
765 main.add_module(
'TOPBunchFinder', usePIDLikelihoods=
True)
768 collector = basf2.register_module(
'TOPValidationCollector')
769 collector.param(
'sample', sample)
770 collector.param(
'granularity',
'run')
773 algorithm = TOP.TOPValidationAlgorithm()
776 cal =
Calibration(name=
'TOP_validation', collector=collector,
777 algorithms=algorithm, input_files=inputFiles)
779 for globalTag
in reversed(globalTags):
780 cal.use_central_database(globalTag)
782 for localDB
in reversed(localDBs):
783 cal.use_local_database(localDB)
784 cal.pre_collector_path = main
785 cal.strategies = SingleIOV