SND@LHC Software
Loading...
Searching...
No Matches
test_shipGeoConfig.TestStringSingleConfig Class Reference
Inheritance diagram for test_shipGeoConfig.TestStringSingleConfig:
Collaboration diagram for test_shipGeoConfig.TestStringSingleConfig:

Public Member Functions

 setUp (self)
 
 test_len (self)
 
 test_key (self)
 
 test_value (self)
 
 tearDown (self)
 

Public Attributes

 key
 

Detailed Description

Definition at line 60 of file test_shipGeoConfig.py.

Member Function Documentation

◆ setUp()

test_shipGeoConfig.TestStringSingleConfig.setUp (   self)

Definition at line 61 of file test_shipGeoConfig.py.

61 def setUp(self):
62 self.key = "basic"
63 config = """
64import shipunit as u
65from ShipGeoConfig import AttrDict, ConfigRegistry
66
67with ConfigRegistry.register_config("basic") as c:
68 c.vetoStation = AttrDict(z=-2390.*u.cm)
69 c.TrackStation1 = AttrDict(z=1510.*u.cm)
70 c.TrackStation2 = AttrDict(z=1710.*u.cm)
71 c.TrackStation3 = AttrDict(z=2150.*u.cm)
72 c.TrackStation4 = AttrDict(z=2370.*u.cm)
73
74 c.z = c.TrackStation2.z + 0.5 * (c.TrackStation3.z - c.TrackStation2.z)
75
76 c.Bfield = AttrDict(z=c.z)
77 c.Bfield.max = 1.5*u.kilogauss # was 1.15 in EOI
78
79 # target absorber muon shield setup
80 c.decayVolume = AttrDict(z=0*u.cm)
81 c.decayVolume.length = 50*u.m
82
83 c.muShield = AttrDict(z=0*u.cm)
84 c.muShield.dZ1 = 2.5*u.m
85 c.muShield.dZ2 = 3.5*u.m
86 c.muShield.dZ3 = 3.0*u.m
87 c.muShield.dZ4 = 3.0*u.m
88 c.muShield.dZ5 = 2.5*u.m
89 c.muShield.dZ6 = 2.5*u.m
90 c.muShield.LE = 5*u.m
91"""
92 ConfigRegistry.loadpys(config)
93

◆ tearDown()

test_shipGeoConfig.TestStringSingleConfig.tearDown (   self)

Definition at line 103 of file test_shipGeoConfig.py.

103 def tearDown(self):
104 ConfigRegistry.clean()
105
106

◆ test_key()

test_shipGeoConfig.TestStringSingleConfig.test_key (   self)

Definition at line 97 of file test_shipGeoConfig.py.

97 def test_key(self):
98 assert self.key in ConfigRegistry.keys()
99

◆ test_len()

test_shipGeoConfig.TestStringSingleConfig.test_len (   self)

Definition at line 94 of file test_shipGeoConfig.py.

94 def test_len(self):
95 assert len(ConfigRegistry.keys()) == 1, list(ConfigRegistry.keys())
96

◆ test_value()

test_shipGeoConfig.TestStringSingleConfig.test_value (   self)

Definition at line 100 of file test_shipGeoConfig.py.

100 def test_value(self):
101 assert ConfigRegistry[self.key].Bfield.max == 1.5*u.kilogauss
102

Member Data Documentation

◆ key

test_shipGeoConfig.TestStringSingleConfig.key

Definition at line 62 of file test_shipGeoConfig.py.


The documentation for this class was generated from the following file: