11 """Implements some extra utilities for doing KLM calibration with the CAF."""
15 from rawdata
import add_unpackers
16 from reconstruction
import add_cosmics_reconstruction, add_reconstruction, prepare_cdst_analysis
18 import modularAnalysis
as ma
21 def get_channel_status_pre_collector_path(entry_sequence=""):
24 entry_sequence (str): A single entry sequence e.g. '0:100' to help limit processed events.
27 basf2.Path: A reconstruction path to run before the collector. Used for raw cosmic input files.
29 main = basf2.create_path()
31 main.add_module(
'RootInput',
32 entrySequences=[entry_sequence])
35 add_unpackers(main, components=[
'KLM'])
40 def get_alignment_pre_collector_path_cosmic(entry_sequence=""):
43 entry_sequence (str): A single entry sequence e.g. '0:100' to help limit processed events.
46 basf2.Path: A reconstruction path to run before the collector. Used for raw cosmic input files.
48 main = basf2.create_path()
49 root_input = basf2.register_module(
51 branchNames=RAWDATA_OBJECTS + [
'EventMetaData'])
53 root_input.param(
'entrySequences', [entry_sequence])
54 main.add_module(root_input)
58 add_cosmics_reconstruction(main, pruneTracks=
False, add_muid_hits=
True,
61 basf2.set_module_parameters(main,
'KLMReconstructor', EventT0Correction=
False)
66 basf2.set_module_parameters(main,
'Muid', MaxDt=1e9)
68 main.add_module(
'DAFRecoFitter',
69 pdgCodesToUseForFitting=[13],
72 main.add_module(
'SetupGenfitExtrapolation',
73 noiseBetheBloch=
False,
80 def get_alignment_pre_collector_path_physics(entry_sequence=""):
83 entry_sequence (str): A single entry sequence e.g. '0:100' to help limit processed events.
86 basf2.Path: A reconstruction path to run before the collector. Used for raw physics input files.
88 main = basf2.create_path()
89 root_input = basf2.register_module(
91 branchNames=RAWDATA_OBJECTS + [
'EventMetaData'])
93 root_input.param(
'entrySequences', [entry_sequence])
94 main.add_module(root_input)
98 add_reconstruction(main, pruneTracks=
False, add_muid_hits=
True)
100 basf2.set_module_parameters(main,
'KLMReconstructor', EventT0Correction=
False)
105 basf2.set_module_parameters(main,
'Muid', MaxDt=1e9)
107 main.add_module(
'DAFRecoFitter', resortHits=
True)
109 main.add_module(
'SetupGenfitExtrapolation',
110 noiseBetheBloch=
False,
117 def get_strip_efficiency_pre_collector_path(
118 muon_list_name, entry_sequence="", raw_format=True, mc=False):
121 muon_list_name (str): Name of the muon ParticleList to be filled.
122 entry_sequence (str): A single entry sequence e.g. '0:100' to help limit processed events.
123 raw_format (bool): True if cDST input files are in the raw+tracking format.
126 basf2.Path: A reconstruction path to run before the collector. Used for cDST input files.
128 main = basf2.create_path()
130 main.add_module(
'RootInput',
131 entrySequences=[entry_sequence])
133 prepare_cdst_analysis(main, mc=mc)
135 basf2.set_module_parameters(main,
'KLMReconstructor', EventT0Correction=
False)
137 main.add_module(
'Gearbox')
138 main.add_module(
'Geometry')
141 ma.fillParticleList(f
'mu+:{muon_list_name}',
142 '[1 < p] and [p < 11] and [abs(d0) < 2] and [abs(z0) < 5]',
148 def get_time_pre_collector_path(muon_list_name, entry_sequence="",
149 raw_format=True, mc=False):
152 muon_list_name (str): Name of the muon ParticleList to be filled.
153 entry_sequence (str): A single entry sequence e.g. '0:100' to help limit processed events.
154 raw_format (bool): True if cDST input files are in the raw+tracking format.
157 basf2.Path: A reconstruction path to run before the collector. Used for cDST input files.
159 main = basf2.create_path()
161 main.add_module(
'RootInput',
162 entrySequences=[entry_sequence])
164 prepare_cdst_analysis(main, mc=mc)
166 basf2.set_module_parameters(main,
'KLMReconstructor', EventT0Correction=
False)
169 basf2.set_module_parameters(main,
'Muid', MaxDt=1e9)
171 main.add_module(
'Gearbox')
172 main.add_module(
'Geometry')
175 ma.fillParticleList(f
'mu+:{muon_list_name}',
176 '[1 < p] and [p < 11] and [abs(d0) < 2] and [abs(z0) < 5]',