9"""Implements some extra utilities for doing KLM calibration with the CAF."""
13from rawdata
import add_unpackers
14from reconstruction
import add_cosmics_reconstruction, add_reconstruction, prepare_cdst_analysis
16import modularAnalysis
as ma
19def get_channel_status_pre_collector_path(entry_sequence=""):
22 entry_sequence (str): A single entry sequence e.g. '0:100' to help limit processed events.
25 basf2.Path: A reconstruction path to run before the collector. Used
for raw cosmic input files.
27 main = basf2.create_path()
29 main.add_module(
'RootInput',
30 entrySequences=[entry_sequence])
33 add_unpackers(main, components=[
'KLM'])
38def get_alignment_pre_collector_path_cosmic(entry_sequence=""):
41 entry_sequence (str): A single entry sequence e.g. '0:100' to help limit processed events.
44 basf2.Path: A reconstruction path to run before the collector. Used
for raw cosmic input files.
46 main = basf2.create_path()
47 root_input = basf2.register_module(
49 branchNames=RAWDATA_OBJECTS + [
'EventMetaData'])
51 root_input.param(
'entrySequences', [entry_sequence])
52 main.add_module(root_input)
56 add_cosmics_reconstruction(main, pruneTracks=
False, add_muid_hits=
True,
59 basf2.set_module_parameters(main,
'KLMReconstructor', EventT0Correction=
False)
64 basf2.set_module_parameters(main,
'Muid', MaxDt=1e9)
66 main.add_module(
'DAFRecoFitter',
67 pdgCodesToUseForFitting=[13],
70 main.add_module(
'SetupGenfitExtrapolation',
71 noiseBetheBloch=
False,
78def get_alignment_pre_collector_path_physics(entry_sequence=""):
81 entry_sequence (str): A single entry sequence e.g. '0:100' to help limit processed events.
84 basf2.Path: A reconstruction path to run before the collector. Used
for raw physics input files.
86 main = basf2.create_path()
87 root_input = basf2.register_module(
89 branchNames=RAWDATA_OBJECTS + [
'EventMetaData'])
91 root_input.param(
'entrySequences', [entry_sequence])
92 main.add_module(root_input)
96 add_reconstruction(main, pruneTracks=
False, add_muid_hits=
True)
98 basf2.set_module_parameters(main,
'KLMReconstructor', EventT0Correction=
False)
103 basf2.set_module_parameters(main,
'Muid', MaxDt=1e9)
105 main.add_module(
'DAFRecoFitter', resortHits=
False)
107 main.add_module(
'SetupGenfitExtrapolation',
108 noiseBetheBloch=
False,
115def get_strip_efficiency_pre_collector_path(
116 muon_list_name, entry_sequence="", raw_format=True, mc=False):
119 muon_list_name (str): Name of the muon ParticleList to be filled.
120 entry_sequence (str): A single entry sequence e.g. '0:100' to help limit processed events.
121 raw_format (bool):
True if cDST input files are
in the raw+tracking format.
124 basf2.Path: A reconstruction path to run before the collector. Used
for cDST input files.
126 main = basf2.create_path()
128 main.add_module(
'RootInput',
129 entrySequences=[entry_sequence])
131 prepare_cdst_analysis(main, mc=mc)
133 basf2.set_module_parameters(main,
'KLMReconstructor', EventT0Correction=
False)
135 main.add_module(
'Gearbox')
136 main.add_module(
'Geometry')
139 ma.fillParticleList(f
'mu+:{muon_list_name}',
140 '[1 < p] and [p < 11] and [abs(d0) < 2] and [abs(z0) < 5]',
146def get_time_pre_collector_path(muon_list_name, entry_sequence="",
147 raw_format=True, mc=False):
150 muon_list_name (str): Name of the muon ParticleList to be filled.
151 entry_sequence (str): A single entry sequence e.g. '0:100' to help limit processed events.
152 raw_format (bool):
True if cDST input files are
in the raw+tracking format.
155 basf2.Path: A reconstruction path to run before the collector. Used
for cDST input files.
157 main = basf2.create_path()
159 main.add_module(
'RootInput',
160 entrySequences=[entry_sequence])
162 prepare_cdst_analysis(main, mc=mc)
164 basf2.set_module_parameters(main,
'KLMReconstructor', EventT0Correction=
False)
167 basf2.set_module_parameters(main,
'Muid', MaxDt=1e9)
169 main.add_module(
'Gearbox')
170 main.add_module(
'Geometry')
173 ma.fillParticleList(f
'mu+:{muon_list_name}',
174 '[1 < p] and [p < 11] and [abs(d0) < 2] and [abs(z0) < 5]',