Belle II Software development
CreateMisalignmentModule Class Reference
Inheritance diagram for CreateMisalignmentModule:

Public Member Functions

 __init__ (self, global_deformations=None, random_misalignments=None, iov=Belle2.IntervalOfValidity(0, 0, -1, -1))
 
 initialize (self)
 

Public Attributes

 global_deformations = global_deformations
 systematic deformations
 
list random_misalignments = random_misalignments
 random misalignments
 
 iov = iov
 interval of validity for the generated payload
 

Detailed Description

 Module to create misalignment (first reads real sensor positions, then applies misalignment and returns DB payload)
    TODO: random misalignment not finished...

Definition at line 185 of file misalignment.py.

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self,
global_deformations = None,
random_misalignments = None,
iov = Belle2.IntervalOfValidity(0, 0, -1, -1) )
 Constructor with with input misalignment 

Definition at line 190 of file misalignment.py.

190 def __init__(self, global_deformations=None, random_misalignments=None, iov=Belle2.IntervalOfValidity(0, 0, -1, -1)):
191 """ Constructor with with input misalignment """
192
193
194 self.global_deformations = global_deformations
195
196 self.random_misalignments = random_misalignments
197
198 self.iov = iov
199
200 super().__init__()
201

Member Function Documentation

◆ initialize()

initialize ( self)
 module initialize - read geometry, apply misalignment, create and store payloads 

Definition at line 202 of file misalignment.py.

202 def initialize(self):
203 """ module initialize - read geometry, apply misalignment, create and store payloads """
204
205 alignment = Belle2.VXDAlignment()
206 txt = open('generated_misalignment.txt', 'w')
207 txt.write('layer ladder sensor x_orig y_orig z_orig x y z u v w\n')
208
209 for sensor in Belle2.VXD.GeoCache.getInstance().getListOfSensors():
210 info = Belle2.VXD.GeoCache.getInstance().get(sensor)
211 global_pos = info.pointToGlobal(ROOT.TVector3(0., 0., 0.))
212
213 delta = ROOT.TVector3(0., 0., 0.)
214
215 global_deformations = self.global_deformations
216 if global_deformations is not None:
217 if not isinstance(global_deformations, list):
218 global_deformations = [global_deformations]
219 self.global_deformations = global_deformations
220
221 for deformation in global_deformations:
222 delta += deformation(global_pos)
223
224 if sensor == Belle2.VxdID(1, 1, 1):
225 delta = ROOT.TVector3(0., 0., 0.)
226
227 new_global_pos = global_pos + delta
228 new_local_pos = info.pointToLocal(new_global_pos)
229
230 if self.random_misalignments is not None:
231 if not isinstance(self.random_misalignments, list):
232 self.random_misalignments = [self.random_misalignments]
233
234 for random in self.random_misalignments:
235 pass
236
237 for i in range(0, 3):
238 if abs(new_local_pos[i]) < 1.e-14:
239 new_local_pos[i] = 0.
240
241 alignment.set(sensor.getID(), i + 1, new_local_pos[i])
242
243 # helper = GlobalDeformation(0.)
244
245 # global_pos = helper._xyz_to_rphiz(global_pos)
246 # new_global_pos = helper._xyz_to_rphiz(new_global_pos)
247
248 txt.write(
249 '{} {} {} {} {} {} {} {} {} {} {} {}\n'.format(
250 str(sensor.getLayerNumber()),
251 str(sensor.getLadderNumber()),
252 str(sensor.getSensorNumber()),
253 str(global_pos[0]),
254 str(global_pos[1]),
255 str(global_pos[2]),
256 str(new_global_pos[0]),
257 str(new_global_pos[1]),
258 str(new_global_pos[2]),
259 str(new_local_pos[0]),
260 str(new_local_pos[1]),
261 str(new_local_pos[2])
262 ))
263
264 txt.close()
265
266 Belle2.Database.Instance().storeData('VXDAlignment', alignment, self.iov)
267 txt.close()
VXD alignment (and maybe some calibration) parameters.
static GeoCache & getInstance()
Return a reference to the singleton instance.
Definition GeoCache.cc:214
Class to uniquely identify a any structure of the PXD and SVD.
Definition VxdID.h:32
static Database & Instance()
Instance of a singleton Database.
Definition Database.cc:41

Member Data Documentation

◆ global_deformations

global_deformations = global_deformations

systematic deformations

Definition at line 194 of file misalignment.py.

◆ iov

iov = iov

interval of validity for the generated payload

Definition at line 198 of file misalignment.py.

◆ random_misalignments

random_misalignments = random_misalignments

random misalignments

Definition at line 196 of file misalignment.py.


The documentation for this class was generated from the following file: