Belle II Software  release-08-01-10
utils.py
1 #!/usr/bin/env python3
2 
3 
10 
11 
13  """ Class to generate data for AlignmentGenerator module
14  Can be used to train VXD misalignment by storing wrong alignment
15  and trying to reach nominal values (zeros)
16  """
17 
18  def __init__(self):
19  """ Constructor """
20 
21  self.alignmentalignment = []
22 
23  def get_name(self):
24  """ get object name """
25  return self.name
26 
27  def get_data(self):
28  """ get alignment data """
29  return self.alignmentalignment
30 
31  def align_sensors(self, vxdid, param_id, distribution, value):
32  """ align sensors by VxdID pattern """
33  self.alignmentalignment.append(str(vxdid + ',' + str(param_id) + ',' + distribution + ',' + str(value)))
34 
35  def gen_u_gaus(self, vxdid, value):
36  """ generate u coordinate shift for VxdID mask with gausian distribution of given width """
37  self.align_sensorsalign_sensors(vxdid, 1, 'gaus', value)
38 
39  def gen_v_gaus(self, vxdid, value):
40  """ generate v coordinate shift for VxdID mask with gausian distribution of given width """
41  self.align_sensorsalign_sensors(vxdid, 2, 'gaus', value)
42 
43  def gen_w_gaus(self, vxdid, value):
44  """ generate w coordinate shift for VxdID mask with gausian distribution of given width """
45  self.align_sensorsalign_sensors(vxdid, 3, 'gaus', value)
46 
47  def gen_alpha_gaus(self, vxdid, value):
48  """ generate alpha rotation for VxdID mask with gausian distribution of given width """
49  self.align_sensorsalign_sensors(vxdid, 4, 'gaus', value)
50 
51  def gen_beta_gaus(self, vxdid, value):
52  """ generate beta rotation for VxdID mask with gausian distribution of given width """
53  self.align_sensorsalign_sensors(vxdid, 5, 'gaus', value)
54 
55  def gen_gamma_gaus(self, vxdid, value):
56  """ generate gamma rotation coordinate shift for VxdID mask with gausian distribution of given width """
57  self.align_sensorsalign_sensors(vxdid, 6, 'gaus', value)
58 
59  def gen_u_uniform(self, vxdid, value):
60  """ generate u coordinate shift for VxdID mask with uniform distribution of given width """
61  self.align_sensorsalign_sensors(vxdid, 1, 'gaus', value)
62 
63  def gen_v_uniform(self, vxdid, value):
64  """ generate v coordinate shift for VxdID mask with uniform distribution of given width """
65  self.align_sensorsalign_sensors(vxdid, 2, 'gaus', value)
66 
67  def gen_w_uniform(self, vxdid, value):
68  """ generate w coordinate shift for VxdID mask with uniform distribution of given width """
69  self.align_sensorsalign_sensors(vxdid, 3, 'gaus', value)
70 
71  def gen_alpha_uniform(self, vxdid, value):
72  """ generate alpha rotation for VxdID mask with uniform distribution of given width """
73  self.align_sensorsalign_sensors(vxdid, 4, 'gaus', value)
74 
75  def gen_beta_uniform(self, vxdid, value):
76  """ generate beta rotation for VxdID mask with uniform distribution of given width """
77  self.align_sensorsalign_sensors(vxdid, 5, 'gaus', value)
78 
79  def gen_gamma_uniform(self, vxdid, value):
80  """ generate gamma rotation coordinate shift for VxdID mask with uniform distribution of given width """
81  self.align_sensorsalign_sensors(vxdid, 6, 'gaus', value)
82 
83  def set_u(self, vxdid, value):
84  """ set u coordinate shift for VxdID """
85  self.align_sensorsalign_sensors(vxdid, 1, 'fix', value)
86 
87  def set_v(self, vxdid, value):
88  """ set v coordinate shift for VxdID """
89  self.align_sensorsalign_sensors(vxdid, 2, 'fix', value)
90 
91  def set_w(self, vxdid, value):
92  """ set w coordinate shift for VxdID """
93  self.align_sensorsalign_sensors(vxdid, 3, 'fix', value)
94 
95  def set_alpha(self, vxdid, value):
96  """ set alpha angle for VxdID mask """
97  self.align_sensorsalign_sensors(vxdid, 4, 'fix', value)
98 
99  def set_beta(self, vxdid, value):
100  """ set beta angle for VxdID mask """
101  self.align_sensorsalign_sensors(vxdid, 5, 'fix', value)
102 
103  def set_gamma(self, vxdid, value):
104  """ set gamma angle for VxdID mask """
105  self.align_sensorsalign_sensors(vxdid, 6, 'fix', value)
106 
107  def set_all(self, vxdid, value):
108  """ Set all shifts/rotation to given value (usually 0.) for VxdID mask """
109  self.set_uset_u(vxdid, value)
110  self.set_vset_v(vxdid, value)
111  self.set_wset_w(vxdid, value)
112  self.set_alphaset_alpha(vxdid, value)
113  self.set_betaset_beta(vxdid, value)
114  self.set_gammaset_gamma(vxdid, value)
basf2 (Belle II Analysis Software Framework) # Author: The Belle II Collaboration # # See git log for...
Definition: utils.py:12
def set_gamma(self, vxdid, value)
Definition: utils.py:103
def gen_u_uniform(self, vxdid, value)
Definition: utils.py:59
def gen_alpha_uniform(self, vxdid, value)
Definition: utils.py:71
def gen_alpha_gaus(self, vxdid, value)
Definition: utils.py:47
def gen_w_gaus(self, vxdid, value)
Definition: utils.py:43
def set_v(self, vxdid, value)
Definition: utils.py:87
def gen_gamma_gaus(self, vxdid, value)
Definition: utils.py:55
def gen_beta_gaus(self, vxdid, value)
Definition: utils.py:51
def align_sensors(self, vxdid, param_id, distribution, value)
Definition: utils.py:31
alignment
alignment data = list of VxdID mask, param id, generation distribution and value
Definition: utils.py:21
def gen_v_uniform(self, vxdid, value)
Definition: utils.py:63
def gen_gamma_uniform(self, vxdid, value)
Definition: utils.py:79
def gen_v_gaus(self, vxdid, value)
Definition: utils.py:39
def set_all(self, vxdid, value)
Definition: utils.py:107
def set_w(self, vxdid, value)
Definition: utils.py:91
def set_u(self, vxdid, value)
Definition: utils.py:83
def gen_w_uniform(self, vxdid, value)
Definition: utils.py:67
def set_beta(self, vxdid, value)
Definition: utils.py:99
def gen_u_gaus(self, vxdid, value)
Definition: utils.py:35
def set_alpha(self, vxdid, value)
Definition: utils.py:95
def gen_beta_uniform(self, vxdid, value)
Definition: utils.py:75