File tree 3 files changed +29
-3
lines changed
3 files changed +29
-3
lines changed Original file line number Diff line number Diff line change 43
43
CDTS_AFTER_37201_DTYPE ,
44
44
CDTS_BEFORE_37201_DTYPE ,
45
45
SWAT_DTYPE ,
46
+ SWAT_DTYPE_2024 ,
46
47
DRAGON_COUNTERS_DTYPE ,
47
48
TIB_DTYPE ,
48
49
parse_tib_10MHz_counter ,
@@ -592,8 +593,15 @@ def fill_lst_from_ctar1(self, zfits_event):
592
593
593
594
# if SWAT data are there
594
595
if evt .extdevices_presence & 4 :
595
- # unpack SWAT data
596
- swat = debug .swat_data .view (SWAT_DTYPE )[0 ]
596
+ # unpack SWAT data, new, larger dtype introduced in 2024
597
+ if len (debug .swat_data ) == 56 :
598
+ swat = debug .swat_data .view (SWAT_DTYPE_2024 )[0 ]
599
+ evt .swat_event_request_bunch_id = swat ["event_request_bunch_id" ]
600
+ evt .swat_bunch_id = swat ["bunch_id" ]
601
+ else :
602
+ # older dtype user before 2024-11-25
603
+ swat = debug .swat_data .view (SWAT_DTYPE )[0 ]
604
+
597
605
evt .swat_assigned_event_id = swat ["assigned_event_id" ]
598
606
evt .swat_trigger_id = swat ["trigger_id" ]
599
607
evt .swat_trigger_type = swat ["trigger_type" ]
Original file line number Diff line number Diff line change 64
64
], align = True ).newbyteorder ('<' )
65
65
66
66
67
+ SWAT_DTYPE_2024 = np .dtype ([
68
+ ("assigned_event_id" , np .uint64 ),
69
+ ("event_request_bunch_id" , np .uint64 ),
70
+ ("trigger_id" , np .uint64 ),
71
+ ("bunch_id" , np .uint64 ),
72
+ ("trigger_type" , np .uint8 ),
73
+ ("trigger_time_s" , np .uint32 ),
74
+ ("trigger_time_qns" , np .uint32 ),
75
+ ("readout_requested" , np .bool_ ),
76
+ ("data_available" , np .bool_ ),
77
+ ("hardware_stereo_trigger_mask" , np .uint16 ),
78
+ ("negative_flag" , np .bool_ ),
79
+ ], align = True ).newbyteorder ('<' )
80
+
81
+
67
82
def parse_tib_10MHz_counter (counter ):
68
83
"""
69
84
Convert the tib 10MHz counter to uint32
Original file line number Diff line number Diff line change @@ -89,8 +89,11 @@ class LSTEventContainer(Container):
89
89
ucts_num_in_bunch = Field (- 1 , "UCTS num in bunch (for debugging)" )
90
90
ucts_cdts_version = Field (- 1 , "UCTS CDTS version" )
91
91
92
- swat_assigned_event_id = Field (np .uint32 (0 ), "SWAT assigned event id" )
92
+ swat_assigned_event_id = Field (np .uint64 (0 ), "SWAT assigned event id" )
93
+ swat_event_request_bunch_id = Field (np .uint64 (0 ), "SWAT event request bunch id" )
94
+ swat_trigger_request_id = Field (np .uint64 (0 ), "SWAT trigger request bunch id" )
93
95
swat_trigger_id = Field (np .uint64 (0 ), "SWAT trigger id" )
96
+ swat_bunch_id = Field (np .uint64 (0 ), "SWAT bunch id" )
94
97
swat_trigger_type = Field (np .uint8 (0 ), "SWAT trigger type" )
95
98
swat_trigger_time_s = Field (np .uint32 (0 ), "SWAT trigger_time_s" )
96
99
swat_trigger_time_qns = Field (np .uint32 (0 ), "SWAT trigger_time_qns" )
You can’t perform that action at this time.
0 commit comments