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.Belle2
import TOP
24def BS13d_calibration_local(inputFiles, look_back=28, globalTags=None, localDBs=None, sroot=False):
26 Returns calibration object for carrier shift calibration of BS13d
with local runs
27 (laser, single-pulse
or double-pulse).
28 :param inputFiles: A list of input files
29 :param look_back: look-back window setting (set it to 0 to use the one
from DB)
30 :param globalTags: a list of
global tags, highest priority first
31 :param localDBs: a list of local databases, highest priority first
32 :param sroot:
True if input files are
in sroot format,
False if in root format
36 main = basf2.create_path()
40 main.add_module(
'SeqRootInput')
42 main.add_module(
'RootInput')
43 main.add_module(
'TOPGeometryParInitializer')
44 main.add_module(
'TOPUnpacker')
45 main.add_module(
'TOPRawDigitConverter', lookBackWindows=look_back,
46 useAsicShiftCalibration=
False, useChannelT0Calibration=
False)
49 collector = basf2.register_module(
'TOPAsicShiftsBS13dCollector')
52 algorithm = TOP.TOPAsicShiftsBS13dAlgorithm()
53 algorithm.setWindowSize(0)
56 cal =
Calibration(name=
'TOP_BS13dCalibration', collector=collector,
57 algorithms=algorithm, input_files=inputFiles)
59 for globalTag
in reversed(globalTags):
60 cal.use_central_database(globalTag)
62 for localDB
in reversed(localDBs):
63 cal.use_local_database(localDB)
64 cal.pre_collector_path = main
65 cal.strategies = SequentialRunByRun
70def BS13d_calibration_rawdata(inputFiles, globalTags=None, localDBs=None):
72 Returns calibration object for carrier shift calibration of BS13d
with raw data.
73 :param inputFiles: A list of input files
in raw data format
74 :param globalTags: a list of
global tags, highest priority first
75 :param localDBs: a list of local databases, highest priority first
79 main = basf2.create_path()
82 main.add_module(
'RootInput')
83 main.add_module(
'TOPGeometryParInitializer')
84 main.add_module(
'TOPUnpacker')
85 main.add_module(
'TOPRawDigitConverter',
86 useAsicShiftCalibration=
False, useChannelT0Calibration=
False)
89 collector = basf2.register_module(
'TOPAsicShiftsBS13dCollector')
92 algorithm = TOP.TOPAsicShiftsBS13dAlgorithm()
95 cal =
Calibration(name=
'TOP_BS13dCalibration', collector=collector,
96 algorithms=algorithm, input_files=inputFiles)
98 for globalTag
in reversed(globalTags):
99 cal.use_central_database(globalTag)
101 for localDB
in reversed(localDBs):
102 cal.use_local_database(localDB)
103 cal.pre_collector_path = main
104 cal.strategies = SequentialRunByRun
109def BS13d_calibration_cdst(inputFiles, time_offset=0, globalTags=None, localDBs=None,
110 new_cdst_format=True):
112 Returns calibration object for carrier shift calibration of BS13d
with processed data.
113 :param inputFiles: A list of input files
in cdst data format
114 :param time_offset: time offset [ns]
115 :param globalTags: a list of
global tags, highest priority first
116 :param localDBs: a list of local databases, highest priority first
117 :param new_cdst_format:
True or False for new
or old cdst format, respectively
121 main = basf2.create_path()
124 main.add_module(
'RootInput')
126 main.add_module(
'Gearbox')
127 main.add_module(
'Geometry')
128 main.add_module(
'Ext')
129 main.add_module(
'TOPUnpacker')
130 main.add_module(
'TOPRawDigitConverter')
131 main.add_module(
'TOPChannelMasker')
132 main.add_module(
'TOPBunchFinder', autoRange=
True, useTimeSeed=
False, useFillPattern=
False, subtractRunningOffset=
False)
133 main.add_module(
'TOPTimeRecalibrator',
134 useAsicShiftCalibration=
False, useChannelT0Calibration=
True)
136 main.add_module(
'TOPGeometryParInitializer')
137 main.add_module(
'TOPTimeRecalibrator',
138 useAsicShiftCalibration=
False, useChannelT0Calibration=
True)
141 collector = basf2.register_module(
'TOPAsicShiftsBS13dCollector',
142 timeOffset=time_offset, requireRecBunch=
True)
145 algorithm = TOP.TOPAsicShiftsBS13dAlgorithm()
148 cal =
Calibration(name=
'TOP_BS13dCalibration', collector=collector,
149 algorithms=algorithm, input_files=inputFiles)
151 for globalTag
in reversed(globalTags):
152 cal.use_central_database(globalTag)
154 for localDB
in reversed(localDBs):
155 cal.use_local_database(localDB)
156 cal.pre_collector_path = main
157 cal.strategies = SequentialRunByRun
162def moduleT0_calibration_DeltaT(inputFiles, globalTags=None, localDBs=None,
163 new_cdst_format=True):
165 Returns calibration object for rough module T0 calibration
with method DeltaT
166 :param inputFiles: A list of input files
in cdst data format
167 :param globalTags: a list of
global tags, highest priority first
168 :param localDBs: a list of local databases, highest priority first
169 :param new_cdst_format:
True or False for new
or old cdst format, respectively
173 main = basf2.create_path()
176 main.add_module(
'RootInput')
178 main.add_module(
'Gearbox')
179 main.add_module(
'Geometry')
180 main.add_module(
'Ext')
181 main.add_module(
'TOPUnpacker')
182 main.add_module(
'TOPRawDigitConverter')
183 main.add_module(
'TOPChannelMasker')
184 main.add_module(
'TOPBunchFinder', autoRange=
True, useTimeSeed=
False, useFillPattern=
False, subtractRunningOffset=
False)
186 main.add_module(
'TOPGeometryParInitializer')
187 main.add_module(
'TOPTimeRecalibrator', subtractBunchTime=
False)
188 main.add_module(
'TOPChannelMasker')
189 main.add_module(
'TOPBunchFinder', usePIDLikelihoods=
True, autoRange=
True, useTimeSeed=
False, useFillPattern=
False,
190 subtractRunningOffset=
False)
193 collector = basf2.register_module(
'TOPModuleT0DeltaTCollector')
194 collector.param(
'granularity',
'run')
197 algorithm = TOP.TOPModuleT0DeltaTAlgorithm()
200 cal =
Calibration(name=
'TOP_moduleT0_rough', collector=collector,
201 algorithms=algorithm, input_files=inputFiles)
203 for globalTag
in reversed(globalTags):
204 cal.use_central_database(globalTag)
206 for localDB
in reversed(localDBs):
207 cal.use_local_database(localDB)
208 cal.pre_collector_path = main
209 cal.strategies = SequentialBoundaries
214def moduleT0_calibration_LL(inputFiles, sample='dimuon', globalTags=None, localDBs=None,
215 new_cdst_format=True):
217 Returns calibration object for final module T0 calibration
with method LL
218 :param inputFiles: A list of input files
in cdst data format
219 :param sample: data sample (
'dimuon' or 'bhabha')
220 :param globalTags: a list of
global tags, highest priority first
221 :param localDBs: a list of local databases, highest priority first
222 :param new_cdst_format:
True or False for new
or old cdst format, respectively
226 main = basf2.create_path()
229 main.add_module(
'RootInput')
231 main.add_module(
'Gearbox')
232 main.add_module(
'Geometry')
233 main.add_module(
'Ext')
234 main.add_module(
'TOPUnpacker')
235 main.add_module(
'TOPRawDigitConverter')
236 main.add_module(
'TOPChannelMasker')
237 main.add_module(
'TOPBunchFinder', autoRange=
True, useTimeSeed=
False, useFillPattern=
False, subtractRunningOffset=
False)
239 main.add_module(
'TOPGeometryParInitializer')
240 main.add_module(
'TOPTimeRecalibrator', subtractBunchTime=
False)
241 main.add_module(
'TOPChannelMasker')
242 main.add_module(
'TOPBunchFinder', usePIDLikelihoods=
True, autoRange=
True, useTimeSeed=
False, useFillPattern=
False,
243 subtractRunningOffset=
False)
246 collector = basf2.register_module(
'TOPModuleT0LLCollector')
247 collector.param(
'sample', sample)
248 collector.param(
'granularity',
'run')
251 algorithm = TOP.TOPModuleT0LLAlgorithm()
254 cal =
Calibration(name=
'TOP_moduleT0_final', collector=collector,
255 algorithms=algorithm, input_files=inputFiles)
257 for globalTag
in reversed(globalTags):
258 cal.use_central_database(globalTag)
260 for localDB
in reversed(localDBs):
261 cal.use_local_database(localDB)
262 cal.pre_collector_path = main
263 cal.strategies = SequentialBoundaries
268def moduleT0_calibration_cosmics(inputFiles, globalTags=None, localDBs=None,
269 data_format="raw", full_reco=True):
271 Returns calibration object for module T0 calibration
with cosmic data using DeltaT method.
272 Note: by default cdst
is processed
with merging incoming
and outcoming track segments of a cosmic particle,
273 but we need here separate track segments
in order to get ExtHits
in incoming
and outcoming module.
274 :param inputFiles: A list of input files
in cdst data format
275 :param globalTags: a list of
global tags, highest priority first
276 :param localDBs: a list of local databases, highest priority first
277 :param data_format:
"raw" for raw data
or "cdst" for the new cdst format
278 :param full_reco: on
True, run full cosmics reconstruction also
if data_format==
"cdst"
282 main = basf2.create_path()
285 if data_format ==
"cdst" and full_reco:
286 main.add_module(
'RootInput', branchNames=ALWAYS_SAVE_OBJECTS + RAWDATA_OBJECTS)
288 main.add_module(
'RootInput')
290 main.add_module(
'Gearbox')
291 main.add_module(
'Geometry')
292 if data_format ==
"raw" or full_reco:
294 add_cosmics_reconstruction(main, merge_tracks=
False, reconstruct_cdst=
True)
296 main.add_module(
'TOPUnpacker')
297 main.add_module(
'TOPRawDigitConverter')
299 main.add_module(
'Ext')
300 main.add_module(
'TOPChannelMasker')
301 main.add_module(
'TOPCosmicT0Finder', useIncomingTrack=
True, applyT0=
False)
302 main.add_module(
'TOPCosmicT0Finder', useIncomingTrack=
False, applyT0=
False)
305 collector = basf2.register_module(
'TOPModuleT0DeltaTCollector')
306 collector.param(
'granularity',
'run')
309 algorithm = TOP.TOPModuleT0DeltaTAlgorithm()
312 cal =
Calibration(name=
'TOP_moduleT0_cosmics', collector=collector,
313 algorithms=algorithm, input_files=inputFiles)
315 for globalTag
in reversed(globalTags):
316 cal.use_central_database(globalTag)
318 for localDB
in reversed(localDBs):
319 cal.use_local_database(localDB)
320 cal.pre_collector_path = main
321 cal.strategies = SingleIOV
326def commonT0_calibration_BF(inputFiles, globalTags=None, localDBs=None,
327 new_cdst_format=True):
329 Returns calibration object for common T0 calibration
with method BF
330 :param inputFiles: A list of input files
in cdst data format
331 :param globalTags: a list of
global tags, highest priority first
332 :param localDBs: a list of local databases, highest priority first
333 :param new_cdst_format:
True or False for new
or old cdst format, respectively
337 main = basf2.create_path()
340 main.add_module(
'RootInput')
342 main.add_module(
'Gearbox')
343 main.add_module(
'Geometry')
344 main.add_module(
'Ext')
345 main.add_module(
'TOPUnpacker')
346 main.add_module(
'TOPRawDigitConverter')
347 main.add_module(
'TOPChannelMasker')
348 main.add_module(
'TOPBunchFinder', autoRange=
True, useTimeSeed=
False, useFillPattern=
False, subtractRunningOffset=
False)
350 main.add_module(
'TOPGeometryParInitializer')
351 main.add_module(
'TOPTimeRecalibrator', subtractBunchTime=
False)
352 main.add_module(
'TOPChannelMasker')
353 main.add_module(
'TOPBunchFinder', usePIDLikelihoods=
True, autoRange=
True, useTimeSeed=
False, useFillPattern=
False,
354 subtractRunningOffset=
False)
357 collector = basf2.register_module(
'TOPCommonT0BFCollector')
360 algorithm = TOP.TOPCommonT0BFAlgorithm()
363 cal =
Calibration(name=
'TOP_commonT0Calibration', collector=collector,
364 algorithms=algorithm, input_files=inputFiles)
366 for globalTag
in reversed(globalTags):
367 cal.use_central_database(globalTag)
369 for localDB
in reversed(localDBs):
370 cal.use_local_database(localDB)
371 cal.pre_collector_path = main
372 cal.strategies = SequentialRunByRun
377def commonT0_calibration_LL(inputFiles, sample='dimuon', globalTags=None, localDBs=None,
378 new_cdst_format=True):
380 Returns calibration object for common T0 calibration
with method LL
381 :param inputFiles: A list of input files
in cdst data format
382 :param sample: data sample (
'dimuon' or 'bhabha')
383 :param globalTags: a list of
global tags, highest priority first
384 :param localDBs: a list of local databases, highest priority first
385 :param new_cdst_format:
True or False for new
or old cdst format, respectively
389 main = basf2.create_path()
392 main.add_module(
'RootInput')
394 main.add_module(
'Gearbox')
395 main.add_module(
'Geometry')
396 main.add_module(
'Ext')
397 main.add_module(
'TOPUnpacker')
398 main.add_module(
'TOPRawDigitConverter')
399 main.add_module(
'TOPChannelMasker')
400 main.add_module(
'TOPBunchFinder', autoRange=
True, useTimeSeed=
False, useFillPattern=
False, subtractRunningOffset=
False)
402 main.add_module(
'TOPGeometryParInitializer')
403 main.add_module(
'TOPTimeRecalibrator', subtractBunchTime=
False)
404 main.add_module(
'TOPChannelMasker')
405 main.add_module(
'TOPBunchFinder', usePIDLikelihoods=
True, autoRange=
True, useTimeSeed=
False, useFillPattern=
False,
406 subtractRunningOffset=
False)
409 collector = basf2.register_module(
'TOPCommonT0LLCollector')
410 collector.param(
'sample', sample)
413 algorithm = TOP.TOPCommonT0LLAlgorithm()
416 cal =
Calibration(name=
'TOP_commonT0Calibration', collector=collector,
417 algorithms=algorithm, input_files=inputFiles)
419 for globalTag
in reversed(globalTags):
420 cal.use_central_database(globalTag)
422 for localDB
in reversed(localDBs):
423 cal.use_local_database(localDB)
424 cal.pre_collector_path = main
425 cal.strategies = SequentialRunByRun
430def pulseHeight_calibration_laser(inputFiles, t_min=-50.0, t_max=0.0, look_back=28,
431 globalTags=None, localDBs=None, sroot=False):
433 Returns calibration object for calibration of pulse-height distributions
and
434 threshold efficiencies
with local laser runs.
435 :param inputFiles: A list of input files
436 :param t_min: lower edge of time window to select laser signal [ns]
437 :param t_max: upper edge of time window to select laser signal [ns]
438 :param look_back: look-back window setting (set it to 0 to use the one
from DB)
439 :param globalTags: a list of
global tags, highest priority first
440 :param localDBs: a list of local databases, highest priority first
441 :param sroot:
True if input files are
in sroot format,
False if in root format
445 main = basf2.create_path()
449 main.add_module(
'SeqRootInput')
451 main.add_module(
'RootInput')
452 main.add_module(
'TOPGeometryParInitializer')
453 main.add_module(
'TOPUnpacker')
454 main.add_module(
'TOPRawDigitConverter', lookBackWindows=look_back)
457 collector = basf2.register_module(
'TOPPulseHeightCollector')
458 collector.param(
'timeWindow', [t_min, t_max])
459 collector.param(
'granularity',
'all')
462 algorithm = TOP.TOPPulseHeightAlgorithm()
465 cal =
Calibration(name=
'TOP_pulseHeightCalibration', collector=collector,
466 algorithms=algorithm, input_files=inputFiles)
468 for globalTag
in reversed(globalTags):
469 cal.use_central_database(globalTag)
471 for localDB
in reversed(localDBs):
472 cal.use_local_database(localDB)
473 cal.pre_collector_path = main
474 cal.strategies = SingleIOV
479def pulseHeight_calibration_rawdata(inputFiles, globalTags=None, localDBs=None):
481 Returns calibration object for calibration of pulse-height distributions
and
482 threshold efficiencies
with raw data
483 :param inputFiles: A list of input files
in raw data format
484 :param globalTags: a list of
global tags, highest priority first
485 :param localDBs: a list of local databases, highest priority first
489 main = basf2.create_path()
492 main.add_module(
'RootInput')
493 main.add_module(
'TOPGeometryParInitializer')
494 main.add_module(
'TOPUnpacker')
495 main.add_module(
'TOPRawDigitConverter')
498 collector = basf2.register_module(
'TOPPulseHeightCollector')
499 collector.param(
'granularity',
'all')
502 algorithm = TOP.TOPPulseHeightAlgorithm()
505 cal =
Calibration(name=
'TOP_pulseHeightCalibration', collector=collector,
506 algorithms=algorithm, input_files=inputFiles)
508 for globalTag
in reversed(globalTags):
509 cal.use_central_database(globalTag)
511 for localDB
in reversed(localDBs):
512 cal.use_local_database(localDB)
513 cal.pre_collector_path = main
514 cal.strategies = SingleIOV
519def module_alignment(inputFiles, sample='dimuon', fixedParameters=None,
520 globalTags=None, localDBs=None, new_cdst_format=True,
523 Returns calibration object for alignment of TOP modules.
524 :param inputFiles: A list of input files
in cdst data format
525 :param sample: data sample (
'dimuon' or 'bhabha')
526 :fixedParameters: a list of parameters to be fixed (parameter names: basf2 -m TOPAlignmentCollector)
527 :param globalTags: a list of
global tags, highest priority first
528 :param localDBs: a list of local databases, highest priority first
529 :param new_cdst_format:
True or False for new
or old cdst format, respectively
530 :param backend_args: Dictionary of backend args
for the Collection object to use
536 for globalTag
in reversed(globalTags):
537 cal.use_central_database(globalTag)
539 for localDB
in reversed(localDBs):
540 cal.use_local_database(localDB)
541 cal.strategies = SingleIOV
544 for slot
in range(1, 17):
546 main = basf2.create_path()
549 main.add_module(
'RootInput')
551 main.add_module(
'Gearbox')
552 main.add_module(
'Geometry')
553 main.add_module(
'Ext')
554 main.add_module(
'TOPUnpacker')
555 main.add_module(
'TOPRawDigitConverter')
556 main.add_module(
'TOPChannelMasker')
557 main.add_module(
'TOPBunchFinder', autoRange=
True, useTimeSeed=
False, useFillPattern=
False,
558 subtractRunningOffset=
False)
560 main.add_module(
'TOPGeometryParInitializer')
561 main.add_module(
'TOPTimeRecalibrator', subtractBunchTime=
False)
562 main.add_module(
'TOPChannelMasker')
563 main.add_module(
'TOPBunchFinder', autoRange=
True, useTimeSeed=
False, useFillPattern=
False,
564 usePIDLikelihoods=
True, subtractRunningOffset=
False)
567 collector = basf2.register_module(
'TOPAlignmentCollector')
568 collector.param(
'sample', sample)
570 collector.param(
'parFixed', fixedParameters)
571 collector.param(
'targetModule', slot)
572 collector.param(
'granularity',
'all')
577 collection =
Collection(collector=collector, input_files=inputFiles,
578 pre_collector_path=main, max_collector_jobs=1)
580 for globalTag
in reversed(globalTags):
581 collection.use_central_database(globalTag)
583 for localDB
in reversed(localDBs):
584 collection.use_local_database(localDB)
586 collection.backend_args = backend_args
589 cal.add_collection(name=
'slot_' + f
'{slot:02d}', collection=collection)
592 algorithm = TOP.TOPAlignmentAlgorithm()
593 cal.algorithms = algorithm
598def channel_mask_calibration(inputFiles, globalTags=None, localDBs=None, unpack=True):
600 Returns calibration object for channel masking
601 :param inputFiles: A list of input files
in raw data
or cdst format
602 :param globalTags: a list of
global tags, highest priority first
603 :param localDBs: a list of local databases, highest priority first
604 :param unpack:
True if data unpacking
is required (i.e.
for raw data
or for new cdst format)
608 main = basf2.create_path()
611 main.add_module(
'RootInput')
612 main.add_module(
'TOPGeometryParInitializer')
614 main.add_module(
'TOPUnpacker')
615 main.add_module(
'TOPRawDigitConverter')
618 collector = basf2.register_module(
'TOPChannelMaskCollector')
621 algorithm = TOP.TOPChannelMaskAlgorithm()
624 cal =
Calibration(name=
'TOP_ChannelMaskCalibration', collector=collector,
625 algorithms=algorithm, input_files=inputFiles)
627 for globalTag
in reversed(globalTags):
628 cal.use_central_database(globalTag)
630 for localDB
in reversed(localDBs):
631 cal.use_local_database(localDB)
632 cal.pre_collector_path = main
633 cal.strategies = SequentialRunByRun
638def offset_calibration(inputFiles, globalTags=None, localDBs=None,
639 new_cdst_format=True):
641 Returns calibration object for the calibration of offsets
642 :param inputFiles: A list of input files
in cdst data format
643 :param globalTags: a list of
global tags, highest priority first
644 :param localDBs: a list of local databases, highest priority first
645 :param new_cdst_format:
True or False for new
or old cdst format, respectively
649 main = basf2.create_path()
652 main.add_module(
'RootInput')
654 main.add_module(
'Gearbox')
655 main.add_module(
'Geometry')
656 main.add_module(
'Ext')
657 main.add_module(
'TOPUnpacker')
658 main.add_module(
'TOPRawDigitConverter')
659 main.add_module(
'TOPChannelMasker')
660 main.add_module(
'TOPBunchFinder', autoRange=
True, useTimeSeed=
False, useFillPattern=
False, subtractRunningOffset=
False)
662 main.add_module(
'TOPGeometryParInitializer')
663 main.add_module(
'TOPTimeRecalibrator', subtractBunchTime=
False)
664 main.add_module(
'TOPChannelMasker')
665 main.add_module(
'TOPBunchFinder', usePIDLikelihoods=
True, autoRange=
True, useTimeSeed=
False, useFillPattern=
False,
666 subtractRunningOffset=
False)
669 collector = basf2.register_module(
'TOPOffsetCollector')
672 algorithms = [TOP.TOPEventT0OffsetAlgorithm(), TOP.TOPFillPatternOffsetAlgorithm()]
675 cal =
Calibration(name=
'TOP_offsetCalibration', collector=collector,
676 algorithms=algorithms, input_files=inputFiles)
678 for globalTag
in reversed(globalTags):
679 cal.use_central_database(globalTag)
681 for localDB
in reversed(localDBs):
682 cal.use_local_database(localDB)
683 cal.pre_collector_path = main
684 cal.strategies = SequentialRunByRun
689def photonYields_calibration(inputFiles, sample='dimuon', globalTags=None, localDBs=None):
691 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
692 :param sample: data sample (
'dimuon' or 'bhabha')
693 :param globalTags: a list of
global tags, highest priority first
694 :param localDBs: a list of local databases, highest priority first
698 main = basf2.create_path()
701 main.add_module(
'RootInput')
702 main.add_module(
'Gearbox')
703 main.add_module(
'Geometry')
704 main.add_module(
'Ext')
705 main.add_module(
'TOPUnpacker')
706 main.add_module(
'TOPRawDigitConverter')
707 main.add_module(
'TOPChannelMasker')
708 main.add_module(
'TOPBunchFinder')
709 if sample ==
'bhabha':
710 main.add_module(
'TOPPDFDebugger', pdgCodes=[11])
712 main.add_module(
'TOPPDFDebugger', pdgCodes=[13])
715 collector = basf2.register_module(
'TOPPhotonYieldsCollector')
716 collector.param(
'sample', sample)
717 collector.param(
'granularity',
'run')
720 algorithm = TOP.TOPPhotonYieldsAlgorithm()
723 cal =
Calibration(name=
'TOP_photonYields', collector=collector,
724 algorithms=algorithm, input_files=inputFiles)
726 for globalTag
in reversed(globalTags):
727 cal.use_central_database(globalTag)
729 for localDB
in reversed(localDBs):
730 cal.use_local_database(localDB)
731 cal.pre_collector_path = main
732 cal.strategies = SequentialBoundaries
737def calibration_validation(inputFiles, sample='dimuon', globalTags=None, localDBs=None, new_cdst_format=True):
739 Returns calibration object for calibration validation
740 :param inputFiles: A list of input files
in cdst data format
741 :param sample: data sample (
'dimuon' or 'bhabha')
742 :param globalTags: a list of
global tags, highest priority first
743 :param localDBs: a list of local databases, highest priority first
744 :param new_cdst_format:
True or False for new
or old cdst format, respectively
748 main = basf2.create_path()
751 main.add_module(
'RootInput')
753 main.add_module(
'Gearbox')
754 main.add_module(
'Geometry')
755 main.add_module(
'Ext')
756 main.add_module(
'TOPUnpacker')
757 main.add_module(
'TOPRawDigitConverter')
758 main.add_module(
'TOPChannelMasker')
759 main.add_module(
'TOPBunchFinder')
761 main.add_module(
'TOPGeometryParInitializer')
762 main.add_module(
'TOPTimeRecalibrator', subtractBunchTime=
False)
763 main.add_module(
'TOPChannelMasker')
764 main.add_module(
'TOPBunchFinder', usePIDLikelihoods=
True)
767 collector = basf2.register_module(
'TOPValidationCollector')
768 collector.param(
'sample', sample)
769 collector.param(
'granularity',
'run')
772 algorithm = TOP.TOPValidationAlgorithm()
775 cal =
Calibration(name=
'TOP_validation', collector=collector,
776 algorithms=algorithm, input_files=inputFiles)
778 for globalTag
in reversed(globalTags):
779 cal.use_central_database(globalTag)
781 for localDB
in reversed(localDBs):
782 cal.use_local_database(localDB)
783 cal.pre_collector_path = main
784 cal.strategies = SingleIOV