3 """Implements some extra utilities for doing KLM calibration with the CAF."""
7 from rawdata
import add_unpackers
8 from reconstruction
import add_cosmics_reconstruction, add_reconstruction, prepare_cdst_analysis
10 import modularAnalysis
as ma
13 def get_channel_status_pre_collector_path(entry_sequence=""):
16 entry_sequence (str): A single entry sequence e.g. '0:100' to help limit processed events.
19 basf2.Path: A reconstruction path to run before the collector. Used for raw cosmic input files.
21 main = basf2.create_path()
23 main.add_module(
'RootInput',
24 entrySequences=[entry_sequence])
27 add_unpackers(main, components=[
'KLM'])
32 def get_alignment_pre_collector_path_cosmic(entry_sequence=""):
35 entry_sequence (str): A single entry sequence e.g. '0:100' to help limit processed events.
38 basf2.Path: A reconstruction path to run before the collector. Used for raw cosmic input files.
40 main = basf2.create_path()
41 root_input = basf2.register_module(
43 branchNames=RAWDATA_OBJECTS + [
'EventMetaData'])
45 root_input.param(
'entrySequences', [entry_sequence])
46 main.add_module(root_input)
50 add_cosmics_reconstruction(main, pruneTracks=
False, add_muid_hits=
True,
56 basf2.set_module_parameters(main,
'Muid', MaxDt=1e9)
58 main.add_module(
'DAFRecoFitter',
59 pdgCodesToUseForFitting=[13],
62 main.add_module(
'SetupGenfitExtrapolation',
63 noiseBetheBloch=
False,
70 def get_alignment_pre_collector_path_physics(entry_sequence=""):
73 entry_sequence (str): A single entry sequence e.g. '0:100' to help limit processed events.
76 basf2.Path: A reconstruction path to run before the collector. Used for raw physics input files.
78 main = basf2.create_path()
79 root_input = basf2.register_module(
81 branchNames=RAWDATA_OBJECTS + [
'EventMetaData'])
83 root_input.param(
'entrySequences', [entry_sequence])
84 main.add_module(root_input)
88 add_reconstruction(main, pruneTracks=
False, add_muid_hits=
True)
93 basf2.set_module_parameters(main,
'Muid', MaxDt=1e9)
95 main.add_module(
'DAFRecoFitter', resortHits=
True)
97 main.add_module(
'SetupGenfitExtrapolation',
98 noiseBetheBloch=
False,
105 def get_strip_efficiency_pre_collector_path(entry_sequence="", raw_format=True):
108 entry_sequence (str): A single entry sequence e.g. '0:100' to help limit processed events.
109 raw_format (bool): True if cDST input files are in the raw+tracking format.
112 basf2.Path: A reconstruction path to run before the collector. Used for cDST input files.
114 main = basf2.create_path()
116 main.add_module(
'RootInput',
117 entrySequences=[entry_sequence])
119 prepare_cdst_analysis(main)
121 main.add_module(
'Gearbox')
122 main.add_module(
'Geometry')
125 ma.fillParticleList(
'mu+:klmStripEfficiency',
126 '[1 < p] and [p < 11] and [abs(d0) < 2] and [abs(z0) < 5]',