Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
test_magnetic_field.py
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file test_magnetic_field.py
1 import pytest
2 
3 import acts
4 import acts.examples
5 
6 u = acts.UnitConstants
7 
8 
10  assert acts.NullBField()
11 
12 
14  with pytest.raises(TypeError):
15  acts.ConstantBField()
16  v = acts.Vector3(1, 2, 3)
17  cb = acts.ConstantBField(v)
18  assert cb
19 
20 
21 def test_solenoid(conf_const):
22  solenoid = conf_const(
23  acts.SolenoidBField,
24  radius=1200 * u.mm,
25  length=6000 * u.mm,
26  bMagCenter=2 * u.T,
27  nCoils=1194,
28  )
29 
30  field = acts.solenoidFieldMap(
31  rlim=(0, 1200 * u.mm),
32  zlim=(-5000 * u.mm, 5000 * u.mm),
33  nbins=(10, 10),
34  field=solenoid,
35  )
36 
37  assert isinstance(field, acts.examples.InterpolatedMagneticField2)