Belle II Software  release-08-01-10
klm_alignment.py
1 #!/usr/bin/env python3
2 
3 
10 
11 """Custom calibration strategy for KLM alignment."""
12 
13 from caf.strategies import SequentialRunByRun
14 from caf.utils import IoV
15 
16 
17 class KLMAlignment(SequentialRunByRun):
18  """
19  Custom stragery for KLM alignment. Based on SequentialRunByRun strategy,
20  but requires custom experiment-dependent settings.
21  """
22 
24  usable_params = {
25  "has_experiment_settings": bool, # Used in SequentialRunByRun.
26  "iov_coverage": IoV, # Used in SequentialRunByRun.
27  "millepede_entries": int,
28  "millepede_entries_exp7": int,
29  "step_size": int # Used in SequentialRunByRun.
30  }
31 
32 
33  allowed_granularities = ["run"]
34 
35  def __init__(self, algorithm):
36  """
37  """
38  super().__init__(algorithm)
39 
40  self.millepede_entriesmillepede_entries = 0
41 
42  self.millepede_entries_exp7millepede_entries_exp7 = 0
43 
44  def apply_experiment_settings(self, algorithm, experiment):
45  """
46  Apply experiment-dependent settings.
47  """
48  if "millepede_entries" in self.algorithm.params:
49  self.millepede_entriesmillepede_entries = self.algorithm.params["millepede_entries"]
50 
51  if "millepede_entries_exp7" in self.algorithm.params:
52  self.millepede_entries_exp7millepede_entries_exp7 = self.algorithm.params["millepede_entries_exp7"]
53  if experiment == 7:
54  algorithm.setMinEntries(self.millepede_entries_exp7millepede_entries_exp7)
55  else:
56  algorithm.setMinEntries(self.millepede_entriesmillepede_entries)
def apply_experiment_settings(self, algorithm, experiment)
millepede_entries_exp7
Number of Millepede entries for experiment 7.
millepede_entries
Number of Millepede entries.
def __init__(self, algorithm)