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

Public Member Functions

 __init__ (self)
 
 event (self)
 

Public Attributes

 sensors = dict()
 dictionary to map the displacements for each sensor
 

Detailed Description

 Module to create misalignment (first reads real sensor positions, then applies misalignment and creates a xml file
  suited for creating a DB payload). The DB payload itself is created by using the Geometry module by setting the
  createPayloads to True.

Definition at line 78 of file CreateSensorDisplacements.py.

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self)
 Init 

Definition at line 84 of file CreateSensorDisplacements.py.

84 def __init__(self):
85 ''' Init '''
86
87
88 self.sensors = dict()
89
90 super().__init__()
91

Member Function Documentation

◆ event()

event ( self)
 event function 

Definition at line 92 of file CreateSensorDisplacements.py.

92 def event(self):
93 ''' event function '''
94 maxDiff = 0.0
95
96 for sensor in Belle2.VXD.GeoCache.getInstance().getListOfSensors():
97
98 info = Belle2.VXD.GeoCache.getInstance().get(sensor)
99
100 center = ROOT.TVector3(0., 0., 0.)
101
102 centerN = info.pointToGlobal(center, False)
103 centerA = info.pointToGlobal(center, True)
104
105 centerDiff = centerA - centerN
106
107 centerDiff = info.vectorToLocal(centerDiff, reco=False)
108
109 # it is easy to run without alignment (e.g. specifying wrong IOV or tag) try to catch that by
110 # checking that the displacementa are not 0
111 if (maxDiff < centerDiff.R()):
112 maxDiff = centerDiff.R()
113
114 # for now do not use rotations for sensors
115 phi = 0
116 psi = 0
117 theta = 0
118
119 self.sensors[f"{sensor.getLayerNumber()}.{sensor.getLadderNumber()}.{sensor.getSensorNumber()}"] = [
120 centerDiff.X(), centerDiff.Y(), centerDiff.Z(), phi, theta, psi]
121
122 if (maxDiff < 1e-9):
123 basf2.B2ERROR(f"Max occured displacements are smaller then 1e-9! Are you sure alignments constants \
124 are loaded correctly? max={maxDiff} cm")
125
126
127# reading displacements from the DB into a dictionary
static GeoCache & getInstance()
Return a reference to the singleton instance.
Definition GeoCache.cc:214

Member Data Documentation

◆ sensors

sensors = dict()

dictionary to map the displacements for each sensor

Definition at line 88 of file CreateSensorDisplacements.py.


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