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