Belle II Software development
create_fieldmap.py
1#!/usr/bin/env python3
2
3
10
11
15
16import os
17import math
18from basf2 import Path, process
19import subprocess
20
21commit = subprocess.check_output(["git", f"--git-dir={os.environ['BELLE2_LOCAL_DIR']}/.git",
22 "rev-parse", "--short", "HEAD"]).decode().strip()
23
24path = Path()
25path.add_module("EventInfoSetter")
26path.add_module("CreateFieldMap", **{
27 # Filename for the histograms
28 'filename': f'FieldMap-{commit}.root',
29 # type of the scan: along xy, zx or zy
30 "type": "zx",
31 # number of steps along the first coordinate, in the case of a zx scan this
32 # would be z
33 "nU": 1600,
34 # start of the first coordinate in cm
35 "minU": -350,
36 # end of the first coordinate in cm
37 "maxU": 450,
38 # number of steps along the second coordinate, in the case of a zx scan
39 # this would be x
40 "nV": 1600,
41 # start of the second coordinate in cm
42 "minV": -400,
43 # end of the second coordinate in cm
44 "maxV": 400,
45 # rotation the plane for the scan around the global z axis: a value of
46 # pi/2 will convert a zx in a zy scan
47 "phi": math.pi / 4,
48 # offset of the plane with respect to the global origin
49 "wOffset": 0,
50 # number of steps in phi for zr scan
51 "nPhi": 720,
52 # if true here store all sampled points in a TTree
53 "saveAllPoints": False,
54})
55process(path)