2 from pathlib
import Path
10 def RootBFieldWrite(bField, fileName, treeName="solenoid", level=acts.logging.VERBOSE):
11 cfg = acts.examples.RootBFieldWriter.Config()
13 cfg.gridType = acts.examples.RootBFieldWriter.GridType.rz
14 cfg.fileName =
str(fileName)
15 cfg.treeName = treeName
16 acts.examples.RootBFieldWriter.run(cfg, level)
21 cfg = acts.examples.CsvBFieldWriter.ConfigRzGrid()
23 cfg.fileName =
str(fileName)
24 acts.examples.CsvBFieldWriter.runRzGrid(cfg, level)
29 solenoid = acts.SolenoidBField(
30 radius=1200 * u.mm, length=6000 * u.mm, bMagCenter=2 * u.T, nCoils=1194
32 field = acts.solenoidFieldMap(
33 rlim=(0, 1200 * u.mm),
34 zlim=(-5000 * u.mm, 5000 * u.mm),
39 print(
"Solenoid ready")
44 for i
in range(rewrites):
45 print(f
"Now read back {cfg.fileName}")
47 field2 = acts.examples.MagneticFieldMapRz(cfg.fileName, tree=
"solenoid")
55 if "__main__" == __name__: