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