Belle II Software development
misalignPhase2VXD.py
1#!/usr/bin/env python3
2
3
10
11from ROOT import Belle2
12
13import numpy as np
14
15numberOfLayer = 6
16numberOfLadders = [8, 12, 7, 10, 12, 16]
17numberOfSensors = [2, 2, 2, 3, 4, 5]
18numberOfParameters = 6
19payload = Belle2.VXDAlignment()
20
21"""
22-------------------------
23Misalignment of for Phase II
24-------------------------
25"""
26
27# 0.01 -> 100 um
28
29for i in range(1, 7):
30 for j in range(1, numberOfLadders[i - 1] + 1):
31 for h in range(1, numberOfParameters + 1):
32 payload.setGlobalParam(0.0, Belle2.VxdID(i, j, 0).getID(), h)
33 if j == 1 and h < 4:
34 number = np.random.normal(0.0, 0.01, 1)
35 payload.setGlobalParam(number, Belle2.VxdID(i, j, 0).getID(), h)
36
37 for k in range(1, numberOfSensors[i - 1] + 1):
38 for h in range(1, numberOfParameters + 1):
39 payload.setGlobalParam(0.0, Belle2.VxdID(i, j, k).getID(), h)
40 if h < 4:
41 number = np.random.normal(0.0, 0.01, 1)
42 payload.setGlobalParam(number, Belle2.VxdID(i, j, k).getID(), h)
43
44# 1 -> x; 2 -> y; 3 -> z
45
46# misalignment of Yang
47payload.setGlobalParam(np.random.normal(0.0, 0.01, 1), Belle2.VxdID(1, 0, 0, 1).getID(), 1)
48payload.setGlobalParam(np.random.normal(0.0, 0.01, 1), Belle2.VxdID(1, 0, 0, 1).getID(), 2)
49payload.setGlobalParam(np.random.normal(0.0, 0.01, 1), Belle2.VxdID(1, 0, 0, 1).getID(), 3)
50
51# misalignment of Ying
52payload.setGlobalParam(np.random.normal(0.0, 0.01, 1), Belle2.VxdID(1, 0, 0, 2).getID(), 1)
53payload.setGlobalParam(np.random.normal(0.0, 0.01, 1), Belle2.VxdID(1, 0, 0, 2).getID(), 2)
54payload.setGlobalParam(np.random.normal(0.0, 0.01, 1), Belle2.VxdID(1, 0, 0, 2).getID(), 3)
55
56# misalignment of Pat
57payload.setGlobalParam(np.random.normal(0.0, 0.01, 1), Belle2.VxdID(3, 0, 0, 1).getID(), 1)
58payload.setGlobalParam(np.random.normal(0.0, 0.01, 1), Belle2.VxdID(3, 0, 0, 1).getID(), 2)
59payload.setGlobalParam(np.random.normal(0.0, 0.01, 1), Belle2.VxdID(3, 0, 0, 1).getID(), 3)
60
61# misalignment of Mat
62payload.setGlobalParam(np.random.normal(0.0, 0.01, 1), Belle2.VxdID(3, 0, 0, 2).getID(), 1)
63payload.setGlobalParam(np.random.normal(0.0, 0.01, 1), Belle2.VxdID(3, 0, 0, 2).getID(), 2)
64payload.setGlobalParam(np.random.normal(0.0, 0.01, 1), Belle2.VxdID(3, 0, 0, 2).getID(), 3)
65
66Belle2.Database.Instance().storeData('VXDAlignment', payload, Belle2.IntervalOfValidity(0, 0, -1, -1))
A class that describes the interval of experiments/runs for which an object in the database is valid.
VXD alignment (and maybe some calibration) parameters.
Definition: VXDAlignment.h:19
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