DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
rawdatautils.unpack.utils.FragmentUnpacker Class Reference
Inheritance diagram for rawdatautils.unpack.utils.FragmentUnpacker:
[legend]
Collaboration diagram for rawdatautils.unpack.utils.FragmentUnpacker:
[legend]

Public Member Functions

 get_n_obj (self, frag)
 
 get_trg_data (self, in_data)
 
 get_det_data (self, in_data)
 
 get_frh_data (self, frag)
 
 get_all_data (self, in_data)
 
- Public Member Functions inherited from rawdatautils.unpack.utils.Unpacker
 __init__ (self, index=None)
 

Static Public Attributes

bool is_fragment_unpacker = True
 
bool is_detector_unpacker = False
 
bool is_trigger_unpacker = False
 
- Static Public Attributes inherited from rawdatautils.unpack.utils.Unpacker
bool is_fragment_unpacker = False
 
bool is_detector_unpacker = False
 
bool is_trigger_unpacker = False
 

Additional Inherited Members

- Public Attributes inherited from rawdatautils.unpack.utils.Unpacker
 index = index
 

Detailed Description

Definition at line 86 of file utils.py.

Member Function Documentation

◆ get_all_data()

rawdatautils.unpack.utils.FragmentUnpacker.get_all_data ( self,
in_data )

Reimplemented from rawdatautils.unpack.utils.Unpacker.

Definition at line 117 of file utils.py.

117 def get_all_data(self,in_data):
118 #in_data = fragment
119
120 data_dict = { "frh": self.get_frh_data(in_data) }
121
122 #if no data, nothing to unpack further
123 if in_data.get_data_size()==0:
124 return data_dict
125
126 type_string = f'{detdataformats.DetID.Subdetector(in_data.get_detector_id()).name}_{in_data.get_fragment_type().name}'
127
128 if(self.is_trigger_unpacker):
129 trgh, trgd = self.get_trg_data(in_data)
130 if trgh is not None: data_dict[f"trgh_{type_string}"] = trgh
131 if trgd[0] is not None: data_dict[f"trgd_{type_string}"] = trgd[0]
132 if trgd[1] is not None: data_dict[f"trgd_{type_string}_inputs"] = trgd[1]
133
134 if(self.is_detector_unpacker):
135 daqh, deth, detd, detw = self.get_det_data(in_data)
136 if daqh is not None: data_dict["daqh"] = daqh
137 if deth is not None: data_dict[f"deth_{type_string}"] = deth
138 if detd is not None: data_dict[f"detd_{type_string}"] = detd
139 if detw is not None: data_dict[f"detw_{type_string}"] = detw
140
141 return data_dict
142

◆ get_det_data()

rawdatautils.unpack.utils.FragmentUnpacker.get_det_data ( self,
in_data )

Reimplemented in rawdatautils.unpack.utils.DetectorFragmentUnpacker.

Definition at line 99 of file utils.py.

99 def get_det_data(self,in_data):
100 return None, None, None, None
101

◆ get_frh_data()

rawdatautils.unpack.utils.FragmentUnpacker.get_frh_data ( self,
frag )

Definition at line 102 of file utils.py.

102 def get_frh_data(self,frag):
103 frh = frag.get_header()
104 return [ FragmentHeaderData(run=frh.run_number,
105 trigger=frh.trigger_number,
106 sequence=frh.sequence_number,
107 src_id=frh.element_id.id,
108 trigger_timestamp_dts=frh.trigger_timestamp,
109 window_begin_dts=frh.window_begin,
110 window_end_dts=frh.window_end,
111 det_id=frh.detector_id,
112 error_bits=frh.error_bits,
113 fragment_type=frh.fragment_type,
114 total_size_bytes=frh.size,
115 data_size_bytes=frag.get_data_size()) ]
116

◆ get_n_obj()

◆ get_trg_data()

rawdatautils.unpack.utils.FragmentUnpacker.get_trg_data ( self,
in_data )

Reimplemented in rawdatautils.unpack.utils.TriggerDataUnpacker.

Definition at line 96 of file utils.py.

96 def get_trg_data(self,in_data):
97 return None, None
98

Member Data Documentation

◆ is_detector_unpacker

rawdatautils.unpack.utils.FragmentUnpacker.is_detector_unpacker = False
static

Definition at line 90 of file utils.py.

◆ is_fragment_unpacker

bool rawdatautils.unpack.utils.FragmentUnpacker.is_fragment_unpacker = True
static

Definition at line 88 of file utils.py.

◆ is_trigger_unpacker

rawdatautils.unpack.utils.FragmentUnpacker.is_trigger_unpacker = False
static

Definition at line 91 of file utils.py.


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