14 from ROOT
import Belle2
16 from geometry
import check_components
18 from svd
import add_svd_reconstruction
19 from pxd
import add_pxd_reconstruction
21 from rawdata
import add_unpackers
25 from tracking
import (
26 add_mc_tracking_reconstruction,
27 add_tracking_reconstruction,
28 add_prefilter_tracking_reconstruction,
29 add_postfilter_tracking_reconstruction,
30 add_cr_tracking_reconstruction,
37 add_filter_software_trigger,
38 add_skim_software_trigger
44 CDST_TRACKING_OBJECTS = (
45 'EventLevelTrackingInfo',
52 'SVDShaperDigitsFromTracks',
53 'PXDClustersFromTracks',
72 def default_event_abort(module, condition, error_flag):
73 """Default event abort outside of HLT: Ignore the error flag and just stop
74 processing by giving an empty path"""
76 module.if_value(condition, p, basf2.AfterConditionPath.END)
79 def add_reconstruction(path, components=None, pruneTracks=True, add_trigger_calculation=True, skipGeometryAdding=False,
80 trackFitHypotheses=None, addClusterExpertModules=True,
81 use_second_cdc_hits=False, add_muid_hits=False, reconstruct_cdst=None,
82 event_abort=default_event_abort, use_random_numbers_for_hlt_prescale=True):
84 This function adds the standard reconstruction modules to a path.
85 Consists of clustering, tracking and the PID modules essentially in this structure:
87 | :func:`add_reconstruction()`
88 | ├── :func:`add_prefilter_reconstruction()`
89 | │ ├── :func:`add_prefilter_pretracking_reconstruction()` : Clustering
90 | │ ├── ``add_prefilter_tracking_reconstruction()`` : Tracking essential for HLT filter calculation
91 | │ └── :func:`add_prefilter_posttracking_reconstruction()` : PID and clustering
92 | └── :func:`add_postfilter_reconstruction()`
93 | └── ``add_postfilter_tracking_reconstruction()`` : Rest of the tracking
95 plus the modules to calculate the software trigger cuts.
97 :param path: Add the modules to this path.
98 :param components: list of geometry components to include reconstruction for, or None for all components.
99 :param pruneTracks: Delete all hits except the first and last of the tracks after the V0Finder modules.
100 :param skipGeometryAdding: Advances flag: The tracking modules need the geometry module and will add it,
101 if it is not already present in the path. In a setup with multiple (conditional) paths however, it can not
102 determine, if the geometry is already loaded. This flag can be used to just turn off the geometry adding at
103 all (but you will have to add it on your own then).
104 :param trackFitHypotheses: Change the additional fitted track fit hypotheses. If no argument is given,
105 the fitted hypotheses are pion, muon and proton, i.e. [211, 321, 2212].
106 :param addClusterExpertModules: Add the cluster expert modules in the KLM and ECL. Turn this off to reduce
108 :param use_second_cdc_hits: If true, the second hit information will be used in the CDC track finding.
109 :param add_muid_hits: Add the found KLM hits to the RecoTrack. Make sure to refit the track afterwards.
110 :param add_trigger_calculation: add the software trigger modules for monitoring (do not make any cut)
111 :param reconstruct_cdst: None for mdst, 'rawFormat' to reconstruct cdsts in rawFormat, 'fullFormat' for the
112 full (old) format. This parameter is needed when reconstructing cdsts, otherwise the
113 required PXD objects won't be added.
114 :param event_abort: A function to abort event processing at the given point. Should take three arguments: a module,
115 the condition and the error_flag to be set if these events are kept. If run on HLT this will not abort the event
116 but just remove all data except for the event information.
117 :param use_random_numbers_for_hlt_prescale: If True, the HLT filter prescales are applied using randomly
118 generated numbers, otherwise are applied using an internal counter.
121 add_prefilter_reconstruction(path,
122 components=components,
123 add_modules_for_trigger_calculation=add_trigger_calculation,
124 skipGeometryAdding=skipGeometryAdding,
125 trackFitHypotheses=trackFitHypotheses,
126 use_second_cdc_hits=use_second_cdc_hits,
127 add_muid_hits=add_muid_hits,
128 reconstruct_cdst=reconstruct_cdst,
129 addClusterExpertModules=addClusterExpertModules,
131 event_abort=event_abort,
132 use_random_numbers_for_hlt_prescale=use_random_numbers_for_hlt_prescale)
135 if add_trigger_calculation
and (
not components
or (
"CDC" in components
and "ECL" in components
and "KLM" in components)):
136 add_filter_software_trigger(path,
137 use_random_numbers_for_prescale=use_random_numbers_for_hlt_prescale)
139 add_postfilter_reconstruction(path,
140 pruneTracks=pruneTracks,
141 components=components)
144 if add_trigger_calculation
and (
not components
or (
"CDC" in components
and "ECL" in components
and "KLM" in components)):
145 add_skim_software_trigger(path)
148 def add_prefilter_reconstruction(path, components=None, add_modules_for_trigger_calculation=True,
149 skipGeometryAdding=False, trackFitHypotheses=None, use_second_cdc_hits=False,
150 add_muid_hits=False, reconstruct_cdst=None, addClusterExpertModules=True,
151 pruneTracks=True, event_abort=default_event_abort,
152 use_random_numbers_for_hlt_prescale=True):
154 This function adds only the reconstruction modules required to calculate HLT filter decision to a path.
155 Consists of essential tracking and the functionality provided by :func:`add_prefilter_posttracking_reconstruction()`.
157 :param path: Add the modules to this path.
158 :param components: list of geometry components to include reconstruction for, or None for all components.
159 :param skipGeometryAdding: Advances flag: The tracking modules need the geometry module and will add it,
160 if it is not already present in the path. In a setup with multiple (conditional) paths however, it can not
161 determine, if the geometry is already loaded. This flag can be used to just turn off the geometry adding at
162 all (but you will have to add it on your own then).
163 :param trackFitHypotheses: Change the additional fitted track fit hypotheses. If no argument is given,
164 the fitted hypotheses are pion, muon and proton, i.e. [211, 321, 2212].
165 :param use_second_cdc_hits: If true, the second hit information will be used in the CDC track finding.
166 :param add_muid_hits: Add the found KLM hits to the RecoTrack. Make sure to refit the track afterwards.
167 :param add_modules_for_trigger_calculation: add the modules necessary for computing the software trigger decision
168 during later stages (do not make any cut), relevant only when reconstruct_cdst is not None.
169 :param reconstruct_cdst: None for mdst, 'rawFormat' to reconstruct cdsts in rawFormat, 'fullFormat' for the
170 full (old) format. This parameter is needed when reconstructing cdsts, otherwise the
171 required PXD objects won't be added.
172 :param event_abort: A function to abort event processing at the given point. Should take three arguments: a module,
173 the condition and the error_flag to be set if these events are kept. If run on HLT this will not abort the event
174 but just remove all data except for the event information.
175 :param use_random_numbers_for_hlt_prescale: If True, the HLT filter prescales are applied using randomly
176 generated numbers, otherwise are applied using an internal counter.
177 :param addClusterExpertModules: Add the cluster expert modules in the KLM and ECL. Turn this off to
178 reduce execution time.
179 :param pruneTracks: Delete all hits except the first and last of the tracks (it must be set to False if the
180 post-filter reconstruction is also run).
184 check_components(components)
187 doom = path.add_module(
"EventsOfDoomBuster")
188 event_abort(doom,
">=1", Belle2.EventMetaData.c_ReconstructionAbort)
189 path.add_module(
'StatisticsSummary').set_name(
'Sum_EventsofDoomBuster')
192 add_prefilter_pretracking_reconstruction(path,
193 components=components)
196 add_prefilter_tracking_reconstruction(path,
197 components=components,
198 mcTrackFinding=
False,
199 skipGeometryAdding=skipGeometryAdding,
200 trackFitHypotheses=trackFitHypotheses,
201 use_second_cdc_hits=use_second_cdc_hits)
204 path.add_module(
'StatisticsSummary').set_name(
'Sum_Prefilter_Tracking')
211 if reconstruct_cdst ==
'rawFormat':
213 if not components
or (
'PXD' in components):
214 path.add_module(
"PXDClustersFromTracks")
215 if not components
or (
'SVD' in components):
216 path.add_module(
"SVDShaperDigitsFromTracks")
219 if add_modules_for_trigger_calculation
and (
not components
or (
220 "CDC" in components
and "ECL" in components
and "KLM" in components)):
221 add_prefilter_posttracking_reconstruction(path,
222 components=components,
223 pruneTracks=pruneTracks,
224 add_muid_hits=add_muid_hits,
225 addClusterExpertModules=addClusterExpertModules)
229 add_dedx_modules(path)
231 add_prune_tracks(path, components=components)
237 elif reconstruct_cdst ==
'fullFormat':
239 if not components
or (
'PXD' in components):
240 path.add_module(
"PXDClustersFromTracks")
241 if not components
or (
'SVD' in components):
242 path.add_module(
"SVDShaperDigitsFromTracks")
245 add_prefilter_posttracking_reconstruction(path,
246 components=components,
247 pruneTracks=pruneTracks,
248 add_muid_hits=add_muid_hits,
249 addClusterExpertModules=addClusterExpertModules)
256 add_prefilter_posttracking_reconstruction(path,
257 components=components,
258 pruneTracks=pruneTracks,
259 add_muid_hits=add_muid_hits,
260 addClusterExpertModules=addClusterExpertModules)
263 def add_postfilter_reconstruction(path, components=None, pruneTracks=False):
265 This function adds the reconstruction modules not required to calculate HLT filter decision to a path.
267 :param path: Add the modules to this path.
268 :param components: list of geometry components to include reconstruction for, or None for all components.
269 :param pruneTracks: Delete all hits expect the first and the last from the found tracks.
273 add_postfilter_tracking_reconstruction(path, components=components, pruneTracks=pruneTracks)
275 path.add_module(
'StatisticsSummary').set_name(
'Sum_Postfilter_Reconstruction')
278 def add_cosmics_reconstruction(
282 skipGeometryAdding=False,
283 eventTimingExtraction=True,
284 addClusterExpertModules=True,
286 use_second_cdc_hits=False,
288 reconstruct_cdst=False,
291 This function adds the standard reconstruction modules for cosmic data to a path.
292 Consists of tracking and the functionality provided by :func:`add_prefilter_posttracking_reconstruction()`,
293 plus the modules to calculate the software trigger cuts.
295 :param path: Add the modules to this path.
296 :param components: list of geometry components to include reconstruction for, or None for all components.
297 :param pruneTracks: Delete all hits except the first and last of the tracks after the dEdX modules.
298 :param skipGeometryAdding: Advances flag: The tracking modules need the geometry module and will add it,
299 if it is not already present in the path. In a setup with multiple (conditional) paths however, it can not
300 determine, if the geometry is already loaded. This flag can be used to just turn off the geometry adding at
301 all (but you will have to add it on your own then).
303 :param eventTimingExtraction: extract the event time
304 :param addClusterExpertModules: Add the cluster expert modules in the KLM and ECL. Turn this off to reduce
307 :param merge_tracks: The upper and lower half of the tracks should be merged together in one track
308 :param use_second_cdc_hits: If true, the second hit information will be used in the CDC track finding.
310 :param add_muid_hits: Add the found KLM hits to the RecoTrack. Make sure to refit the track afterwards.
312 :param reconstruct_cdst: run only the minimal reconstruction needed to produce the cdsts (raw+tracking+dE/dx)
313 :param posttracking: run reconstruction for outer detectors.
317 check_components(components)
320 add_prefilter_pretracking_reconstruction(path,
321 components=components)
324 add_cr_tracking_reconstruction(path,
325 components=components,
327 skip_geometry_adding=skipGeometryAdding,
328 event_time_extraction=eventTimingExtraction,
329 merge_tracks=merge_tracks,
330 use_second_cdc_hits=use_second_cdc_hits)
333 path.add_module(
'StatisticsSummary').set_name(
'Sum_Tracking')
337 if not components
or (
'PXD' in components):
338 path.add_module(
"PXDClustersFromTracks")
339 if not components
or (
'SVD' in components):
340 path.add_module(
"SVDShaperDigitsFromTracks")
342 add_dedx_modules(path)
343 add_prune_tracks(path, components=components)
347 add_prefilter_posttracking_reconstruction(path,
348 components=components,
349 pruneTracks=pruneTracks,
350 addClusterExpertModules=addClusterExpertModules,
351 add_muid_hits=add_muid_hits,
355 def add_mc_reconstruction(path, components=None, pruneTracks=True, addClusterExpertModules=True,
356 use_second_cdc_hits=False, add_muid_hits=False):
358 This function adds the standard reconstruction modules with MC tracking
361 @param components list of geometry components to include reconstruction for, or None for all components.
362 @param use_second_cdc_hits: If true, the second hit information will be used in the CDC track finding.
363 :param add_muid_hits: Add the found KLM hits to the RecoTrack. Make sure to refit the track afterwards.
367 add_prefilter_pretracking_reconstruction(path,
368 components=components)
371 add_mc_tracking_reconstruction(path,
372 components=components,
374 use_second_cdc_hits=use_second_cdc_hits)
377 path.add_module(
'StatisticsSummary').set_name(
'Sum_MC_Tracking')
380 add_prefilter_posttracking_reconstruction(path,
381 components=components,
382 pruneTracks=pruneTracks,
383 add_muid_hits=add_muid_hits,
384 addClusterExpertModules=addClusterExpertModules)
387 def add_prefilter_pretracking_reconstruction(path, components=None):
389 This function adds the standard reconstruction modules BEFORE tracking
392 :param path: The path to add the modules to.
393 :param components: list of geometry components to include reconstruction for, or None for all components.
396 add_ecl_modules(path, components)
399 path.add_module(
'StatisticsSummary').set_name(
'Sum_Clustering')
402 def add_prefilter_posttracking_reconstruction(path, components=None, pruneTracks=True, addClusterExpertModules=True,
403 add_muid_hits=False, cosmics=False, for_cdst_analysis=False,
404 add_eventt0_combiner_for_cdst=False):
406 This function adds the standard reconstruction modules after tracking
409 :param path: The path to add the modules to.
410 :param components: list of geometry components to include reconstruction for, or None for all components.
411 :param pruneTracks: Delete all hits except the first and last after the post-tracking modules.
412 :param addClusterExpertModules: Add the cluster expert modules in the KLM and ECL. Turn this off to reduce
414 :param add_muid_hits: Add the found KLM hits to the RecoTrack. Make sure to refit the track afterwards.
415 :param cosmics: if True, steer TOP for cosmic reconstruction.
416 :param for_cdst_analysis: if True, dEdx, EventT0 and PruneTracks modules are not added to the path.
417 This is only needed by prepare_cdst_analysis().
418 :param add_eventt0_combiner_for_cdst: if True, the EventT0Combiner module is added to the path even if
419 for_cdst_analysis is False. This is useful for validation purposes for avoiding to run the full
420 add_reconstruction(). Note that, with the default settings (for_cdst_analysis=False and
421 add_eventt0_combiner_for_cdst=False), the EventT0Combiner module is added to the path.
425 if not for_cdst_analysis:
426 add_dedx_modules(path, components)
428 add_ext_module(path, components)
430 add_top_modules(path, components, cosmics=cosmics)
432 add_arich_modules(path, components)
437 if not for_cdst_analysis
or add_eventt0_combiner_for_cdst:
438 path.add_module(
"EventT0Combiner")
441 if not for_cdst_analysis:
442 path.add_module(
"OnlineEventT0Creator")
444 add_ecl_finalizer_module(path, components)
446 add_ecl_mc_matcher_module(path, components)
448 add_klm_modules(path, components)
450 add_klm_mc_matcher_module(path, components)
452 add_muid_module(path, add_hits_to_reco_track=add_muid_hits, components=components)
454 add_ecl_track_cluster_modules(path, components)
456 add_ecl_cluster_properties_modules(path, components)
458 add_ecl_chargedpid_module(path, components)
460 add_pid_module(path, components)
462 if addClusterExpertModules:
464 add_cluster_expert_modules(path, components)
466 add_ecl_track_brem_finder(path, components)
470 if not for_cdst_analysis:
472 add_prune_tracks(path, components)
474 path.add_module(
'StatisticsSummary').set_name(
'Sum_Posttracking_Reconstruction')
480 filename='mdst.root',
481 additionalBranches=[],
482 dataDescription=None,
485 This function adds the MDST output modules to a path, saving only objects defined as part of the MDST data format.
487 @param path Path to add modules to
488 @param mc Save Monte Carlo quantities? (MCParticles and corresponding relations)
489 @param filename Output file name.
490 @param additionalBranches Additional objects/arrays of event durability to save
491 @param dataDescription Additional key->value pairs to be added as data description
492 fields to the output FileMetaData
501 filename='cdst.root',
502 additionalBranches=[],
503 dataDescription=None,
505 ignoreInputModulesCheck=False
508 This function adds the `RootOutput` module to a path with the settings needed to produce a cDST output.
510 @param path Path to add modules to.
511 @param mc Save Monte Carlo quantities? (MCParticles and corresponding relations)
512 @param filename Output file name.
513 @param additionalBranches Additional objects/arrays of event durability to save
514 @param dataDescription Additional key->value pairs to be added as data description
515 fields to the output FileMetaData
516 @param rawFormat Saves the cDST file in the raw+tracking format if mc=False, otherwise saves the cDST file
517 in the digits+tracking format.
518 @param ignoreInputModulesCheck If True, do not enforce check on missing PXD modules in the input path.
519 Needed when a conditional path is passed as input.
523 persistentBranches = [
'FileMetaData']
526 branches += list(CDST_TRACKING_OBJECTS)
528 branches += ALWAYS_SAVE_OBJECTS + RAWDATA_OBJECTS
530 branches += list(DIGITS_OBJECTS) + [
531 'EventLevelTriggerTimeInfo',
532 'SoftwareTriggerResult',
534 if not ignoreInputModulesCheck
and "PXDClustersFromTracks" not in [module.name()
for module
in path.modules()]:
535 basf2.B2ERROR(
"PXDClustersFromTracks is required in CDST output but its module is not found in the input path!")
537 if not additionalBranches:
538 basf2.B2WARNING(
'You are calling add_cdst_output() using rawFormat=False and requiring no additional branches. '
539 'This is equivalent to calling add_mdst_output().')
540 branches += list(mdst.MDST_OBJECTS)
542 if dataDescription
is None:
544 dataDescription.setdefault(
"dataLevel",
"cdst")
547 branches += [
'MCParticles']
548 persistentBranches += [
'BackgroundInfo']
550 branches += additionalBranches
552 return path.add_module(
"RootOutput", outputFileName=filename, branchNames=branches,
553 branchNamesPersistent=persistentBranches, additionalDataDescription=dataDescription)
556 def add_arich_modules(path, components=None):
558 Add the ARICH reconstruction to the path.
560 :param path: The path to add the modules to.
561 :param components: The components to use or None to use all standard components.
563 if components
is None or 'ARICH' in components:
564 path.add_module(
'ARICHFillHits')
565 path.add_module(
'ARICHReconstructor',
569 def add_top_modules(path, components=None, cosmics=False):
571 Add the TOP reconstruction to the path.
573 :param path: The path to add the modules to.
574 :param components: The components to use or None to use all standard components.
575 :param cosmics: if True, steer TOP for cosmic reconstruction
577 if components
is None or 'TOP' in components:
578 path.add_module(
'TOPChannelMasker')
580 path.add_module(
'TOPCosmicT0Finder')
582 path.add_module(
'TOPBunchFinder')
583 path.add_module(
'TOPReconstructor')
586 def add_cluster_expert_modules(path, components=None):
588 Add the KLMExpert and ClusterMatcher modules to the path.
590 :param path: The path to add the modules to.
591 :param components: The components to use or None to use all standard components.
593 if components
is None or (
'KLM' in components
and 'ECL' in components):
594 path.add_module(
'KLMExpert')
595 path.add_module(
'ClusterMatcher')
598 def add_pid_module(path, components=None):
600 Add the PID modules to the path.
602 :param path: The path to add the modules to.
603 :param components: The components to use or None to use all standard components.
605 if components
is None or 'SVD' in components
or 'CDC' in components:
606 path.add_module(
'MdstPID')
609 def add_klm_modules(path, components=None):
611 Add the KLM reconstruction modules to the path.
613 :param path: The path to add the modules to.
614 :param components: The components to use or None to use all standard components.
616 if components
is None or 'KLM' in components:
617 path.add_module(
'KLMReconstructor')
618 path.add_module(
'KLMClustersReconstructor')
621 def add_klm_mc_matcher_module(path, components=None):
623 Add the KLM mc matcher module to the path.
625 :param path: The path to add the modules to.
626 :param components: The components to use or None to use all standard components.
628 if components
is None or 'KLM' in components:
629 path.add_module(
'MCMatcherKLMClusters')
632 def add_muid_module(path, add_hits_to_reco_track=False, components=None):
634 Add the MuID module to the path.
636 :param path: The path to add the modules to.
637 :param add_hits_to_reco_track: Add the found KLM hits also to the RecoTrack. Make sure to refit the track afterwards.
638 :param components: The components to use or None to use all standard components.
641 if components
is None or (
'CDC' in components
and 'ECL' in components
and 'KLM' in components):
642 path.add_module(
'Muid',
643 addHitsToRecoTrack=add_hits_to_reco_track)
644 if components
is not None and 'CDC' in components:
645 if (
'ECL' not in components
and 'KLM' in components):
646 basf2.B2WARNING(
'You added KLM to the components list but not ECL: the module Muid, that is necessary '
647 'for correct muonID computation, will not be added to your reconstruction path. '
648 'Make sure that this is fine for your purposes, otherwise please include also ECL.')
649 if (
'ECL' in components
and 'KLM' not in components):
650 basf2.B2WARNING(
'You added ECL to the components list but not KLM: the module Muid, that is necessary '
651 'for correct ECLCluster-Track matching, will not be added to your reconstruction path. '
652 ' Make sure that this is fine for your purposes, otherwise please include also KLM.')
655 def add_ecl_modules(path, components=None):
657 Add the ECL reconstruction modules to the path.
659 :param path: The path to add the modules to.
660 :param components: The components to use or None to use all standard components.
662 if components
is None or 'ECL' in components:
663 path.add_module(
'ECLWaveformFit')
664 path.add_module(
'ECLDigitCalibrator')
665 path.add_module(
'ECLEventT0')
666 path.add_module(
'ECLCRFinder')
667 path.add_module(
'ECLLocalMaximumFinder')
668 path.add_module(
'ECLSplitterN1')
669 path.add_module(
'ECLSplitterN2')
670 path.add_module(
'ECLShowerCorrector')
671 path.add_module(
'ECLShowerCalibrator')
672 path.add_module(
'ECLShowerShape')
673 path.add_module(
'ECLClusterPSD')
674 path.add_module(
'ECLCovarianceMatrix')
678 def add_ecl_finalizer_module(path, components=None):
680 Add the ECL finalizer module to the path.
682 :param path: The path to add the modules to.
683 :param components: The components to use or None to use all standard components.
686 if components
is None or 'ECL' in components:
687 path.add_module(
'ECLFinalizer')
690 def add_ecl_track_cluster_modules(path, components=None):
692 Add the ECL track cluster matching module to the path.
694 :param path: The path to add the modules to.
695 :param components: The components to use or None to use all standard components.
697 if components
is None or (
'ECL' in components
and (
'PXD' in components
or 'SVD' in components
or 'CDC' in components)):
698 path.add_module(
'ECLTrackClusterMatching')
701 def add_ecl_cluster_properties_modules(path, components=None):
703 Add the ECL cluster properties module to the path.
705 :param path: The path to add the modules to.
706 :param components: The components to use or None to use all standard components.
708 if components
is None or (
'ECL' in components
and (
'PXD' in components
or 'SVD' in components
or 'CDC' in components)):
709 path.add_module(
'ECLClusterProperties')
712 def add_ecl_track_brem_finder(path, components=None):
714 Add the bremsstrahlung finding module to the path.
716 :param path: The path to add the modules to.
717 :param components: The components to use or None to use all standard components.
719 if components
is None or (
'ECL' in components
and (
'PXD' in components
or 'SVD' in components)):
720 path.add_module(
'ECLTrackBremFinder')
723 def add_ecl_chargedpid_module(path, components=None):
725 Add the ECL charged PID module to the path.
727 :param path: The path to add the modules to.
728 :param components: The components to use or None to use all standard components.
730 if components
is None or 'ECL' in components:
731 path.add_module(
'ECLChargedPID')
734 def add_ecl_mc_matcher_module(path, components=None):
736 Add the ECL MC matcher module to the path.
738 :param path: The path to add the modules to.
739 :param components: The components to use or None to use all standard components.
741 if components
is None or 'ECL' in components:
742 path.add_module(
'MCMatcherECLClusters')
745 def add_ext_module(path, components=None):
747 Add the extrapolation module to the path.
749 :param path: The path to add the modules to.
750 :param components: The components to use or None to use all standard components.
752 if components
is None or 'CDC' in components:
753 path.add_module(
'Ext')
756 def add_dedx_modules(path, components=None):
758 Add the dE/dX reconstruction modules to the path.
760 :param path: The path to add the modules to.
761 :param components: The components to use or None to use all standard components.
764 if components
is None or 'CDC' in components:
765 path.add_module(
'CDCDedxPID')
768 if components
is None or 'SVD' in components:
769 path.add_module(
'VXDDedxPID')
772 def prepare_cdst_analysis(path, components=None, mc=False, add_eventt0_combiner=False):
774 Adds to a (analysis) path all the modules needed to analyse a cDST file in the raw+tracking format
775 for collisions/cosmics data or in the digits+tracking format for MC data.
777 :param path: The path to add the modules to.
778 :param components: The components to use or None to use all standard components.
779 :param mc: Are we running over MC data or not? If so, do not run the unpackers.
780 :param add_eventt0_combiner: If True, it adds the EventT0Combiner module when the post-tracking
781 reconstruction is run. This must NOT be used during the calibration, but it may be necessary
782 for validation purposes or for the user analyses.
788 components=components)
790 check_components(components)
791 path.add_module(
'Gearbox')
792 path.add_module(
'Geometry')
795 add_prefilter_pretracking_reconstruction(path,
796 components=components)
799 if components
is None or 'SVD' in components:
800 add_svd_reconstruction(path)
801 if components
is None or 'PXD' in components:
802 add_pxd_reconstruction(path)
805 path.add_module(
'SetupGenfitExtrapolation',
806 energyLossBrems=
False,
810 add_prefilter_posttracking_reconstruction(path,
811 components=components,
812 for_cdst_analysis=
True,
813 add_eventt0_combiner_for_cdst=add_eventt0_combiner)
816 def prepare_user_cdst_analysis(path, components=None, mc=False):
818 Adds to a (analysis) path all the modules needed to analyse a cDST file in the raw+tracking format
819 for collisions/cosmics data or in the digits+tracking format for MC data.
820 Differently from prepare_cdst_analysis(), this function add the EventT0Combiner module to the path,
821 which makes this function suitable for all the users and not only for the calibration expertes.
822 Note that the EventT0Combiner module is necessary for applying the proper EventT0 correction to
825 :param path: The path to add the modules to.
826 :param components: The components to use or None to use all standard components.
827 :param mc: Are we running over MC data or not? If so, do not run the unpackers.
829 prepare_cdst_analysis(path=path, components=components, mc=mc, add_eventt0_combiner=
True)
def add_mdst_output(path, mc=True, filename='mdst.root', additionalBranches=[], dataDescription=None)