DUNE-DAQ
DUNE Trigger and Data Acquisition software
Toggle main menu visibility
Loading...
Searching...
No Matches
dunedaq
sourcecode
detdataformats
scripts
DetID_binding_test.py
Go to the documentation of this file.
1
#!/usr/bin/env python3
2
3
import
sys
4
from
detdataformats
import
DetID
5
6
7
def
main
() -> int:
8
9
detid_default = DetID()
10
if
detid_default.subdetector != DetID.Subdetector.kUnknown:
11
print(
"DetID default subdetector value test failed"
)
12
return
1
13
else
:
14
print(
"DetID default subdetector value test passed"
)
15
16
detid = DetID(DetID.Subdetector.kVD_BernCRT)
17
18
if
detid.subdetector != DetID.Subdetector.kVD_BernCRT:
19
print(
"DetID constructor/readwrite field test failed"
)
20
return
1
21
else
:
22
print(
"DetID constructor/readwrite field test passed"
)
23
24
subdetector_name = DetID.subdetector_to_string(detid.subdetector)
25
if
subdetector_name !=
"VD_BernCRT"
:
26
print(f
"subdetector_to_string test failed, got: {subdetector_name}"
)
27
return
1
28
else
:
29
print(f
"subdetector_to_string test passed, got: {subdetector_name}"
)
30
31
parsed = DetID.string_to_subdetector(
"VD_GrenobleCRT"
)
32
if
parsed != DetID.Subdetector.kVD_GrenobleCRT:
33
print(
"string_to_subdetector test failed"
)
34
return
1
35
else
:
36
print(
"string_to_subdetector test passed"
)
37
38
print(
"\nAll DetID Python binding tests passed"
)
39
return
0
40
41
42
if
__name__ ==
"__main__"
:
43
sys.exit(
main
())
DetID_binding_test.main
int main()
Definition
DetID_binding_test.py:7
Generated on
for DUNE-DAQ by
1.17.0