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

Public Member Functions

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

Public Attributes

 global_deformations
 systematic deformations
 
 random_misalignments
 random misalignments
 
 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__()

def __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()

def 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 if self.global_deformations is not None:
216 if not isinstance(self.global_deformations, list):
217 self.global_deformations = [self.global_deformations]
218
219 for deformation in self.global_deformations:
220 delta += deformation(global_pos)
221
222 if sensor == Belle2.VxdID(1, 1, 1):
223 delta = ROOT.TVector3(0., 0., 0.)
224
225 new_global_pos = global_pos + delta
226 new_local_pos = info.pointToLocal(new_global_pos)
227
228 if self.random_misalignments is not None:
229 if not isinstance(self.random_misalignments, list):
230 self.random_misalignments = [self.random_misalignments]
231
232 for random in self.random_misalignments:
233 pass
234
235 for i in range(0, 3):
236 if abs(new_local_pos[i]) < 1.e-14:
237 new_local_pos[i] = 0.
238
239 alignment.set(sensor.getID(), i + 1, new_local_pos[i])
240
241 # helper = GlobalDeformation(0.)
242
243 # global_pos = helper._xyz_to_rphiz(global_pos)
244 # new_global_pos = helper._xyz_to_rphiz(new_global_pos)
245
246 txt.write(
247 '{} {} {} {} {} {} {} {} {} {} {} {}\n'.format(
248 str(sensor.getLayerNumber()),
249 str(sensor.getLadderNumber()),
250 str(sensor.getSensorNumber()),
251 str(global_pos[0]),
252 str(global_pos[1]),
253 str(global_pos[2]),
254 str(new_global_pos[0]),
255 str(new_global_pos[1]),
256 str(new_global_pos[2]),
257 str(new_local_pos[0]),
258 str(new_local_pos[1]),
259 str(new_local_pos[2])
260 ))
261
262 txt.close()
263
264 Belle2.Database.Instance().storeData('VXDAlignment', alignment, self.iov)
265 txt.close()
VXD alignment (and maybe some calibration) parameters.
Definition: VXDAlignment.h:19
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:33
static Database & Instance()
Instance of a singleton Database.
Definition: Database.cc:42

Member Data Documentation

◆ global_deformations

global_deformations

systematic deformations

Definition at line 194 of file misalignment.py.

◆ iov

iov

interval of validity for the generated payload

Definition at line 198 of file misalignment.py.

◆ 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: