Belle II Software  release-06-02-00
printVXDAlignmentHalfShells.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 
11 
12 import sys
13 import ROOT
14 from ROOT import Belle2
15 if len(sys.argv) < 2:
16  sys.exit("No input .root file with VXDAlignment payload specified!")
17 
18 inputroot = sys.argv[1]
19 file = ROOT.TFile(inputroot, "OPEN")
20 vxd = file.Get("VXDAlignment_CORRECTIONS")
21 
22 errfile = ROOT.TFile(str(inputroot).replace('VXDAlignment_CORRECTIONS', 'VXDAlignment_ERRORS'), "OPEN")
23 errvxd = errfile.Get("VXDAlignment_ERRORS")
24 
25 ying = Belle2.VxdID(1, 0, 0, 1)
26 yang = Belle2.VxdID(1, 0, 0, 2)
27 pat = Belle2.VxdID(3, 0, 0, 1)
28 mat = Belle2.VxdID(3, 0, 0, 2)
29 
30 shells = [ying, yang, pat, mat]
31 shellnames = ['PXD Ying', 'PXD Yang', 'SVD Pat', 'SVD Mat']
32 
33 params = [1, 2, 3, 4, 5, 6]
34 paramnames = ['x', 'y', 'z', 'alpha', 'beta', 'gamma']
35 
36 for ishell, shell in enumerate(shells):
37  print('Half-shell: ', shellnames[ishell])
38  for ipar, param in enumerate(params):
39  print(paramnames[ipar], ' = ', vxd.get(shell.getID(), param), ' +/- ', errvxd.get(shell.getID(), param))
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:33