Belle II Software  release-08-01-10
misalignPhase2VXD.py
1 #!/usr/bin/env python3
2 
3 
10 
11 from ROOT import Belle2
12 
13 import numpy as np
14 
15 numberOfLayer = 6
16 numberOfLadders = [8, 12, 7, 10, 12, 16]
17 numberOfSensors = [2, 2, 2, 3, 4, 5]
18 numberOfParameters = 6
19 payload = Belle2.VXDAlignment()
20 
21 """
22 -------------------------
23 Misalignment of for Phase II
24 -------------------------
25 """
26 
27 # 0.01 -> 100 um
28 
29 for 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
47 payload.setGlobalParam(np.random.normal(0.0, 0.01, 1), Belle2.VxdID(1, 0, 0, 1).getID(), 1)
48 payload.setGlobalParam(np.random.normal(0.0, 0.01, 1), Belle2.VxdID(1, 0, 0, 1).getID(), 2)
49 payload.setGlobalParam(np.random.normal(0.0, 0.01, 1), Belle2.VxdID(1, 0, 0, 1).getID(), 3)
50 
51 # misalignment of Ying
52 payload.setGlobalParam(np.random.normal(0.0, 0.01, 1), Belle2.VxdID(1, 0, 0, 2).getID(), 1)
53 payload.setGlobalParam(np.random.normal(0.0, 0.01, 1), Belle2.VxdID(1, 0, 0, 2).getID(), 2)
54 payload.setGlobalParam(np.random.normal(0.0, 0.01, 1), Belle2.VxdID(1, 0, 0, 2).getID(), 3)
55 
56 # misalignment of Pat
57 payload.setGlobalParam(np.random.normal(0.0, 0.01, 1), Belle2.VxdID(3, 0, 0, 1).getID(), 1)
58 payload.setGlobalParam(np.random.normal(0.0, 0.01, 1), Belle2.VxdID(3, 0, 0, 1).getID(), 2)
59 payload.setGlobalParam(np.random.normal(0.0, 0.01, 1), Belle2.VxdID(3, 0, 0, 1).getID(), 3)
60 
61 # misalignment of Mat
62 payload.setGlobalParam(np.random.normal(0.0, 0.01, 1), Belle2.VxdID(3, 0, 0, 2).getID(), 1)
63 payload.setGlobalParam(np.random.normal(0.0, 0.01, 1), Belle2.VxdID(3, 0, 0, 2).getID(), 2)
64 payload.setGlobalParam(np.random.normal(0.0, 0.01, 1), Belle2.VxdID(3, 0, 0, 2).getID(), 3)
65 
66 Belle2.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
int getID(const std::vector< double > &breaks, double t)
get id of the time point t
Definition: calibTools.h:60