248 using dunedaq::detdataformats::wib::WIBFrame;
249 using dunedaq::detdataformats::wib::WIBHeader;
253 std::deque<std::string> det_types
256 for (
const auto & det : det_types)
258 if (det !=
"TPC")
continue;
261 std::deque<std::string> apaNames
264 std::cout <<
"Size of apaNames: " << apaNames.size() <<
std::endl;
265 std::cout <<
"apaNames[apano]: " << apaNames[apano-1] <<
std::endl;
269 std::deque<std::string> linkNames
271 for (
const auto &
t : linkNames)
273 hid_t dataset = H5Dopen(linkGroup,
t.data(), H5P_DEFAULT);
274 hsize_t ds_size = H5Dget_storage_size(dataset);
275 if (ds_size <=
sizeof(FragmentHeader))
continue;
277 std::vector<char> ds_data(ds_size);
278 H5Dread(dataset, H5T_STD_I8LE, H5S_ALL, H5S_ALL, H5P_DEFAULT,
283 Fragment frag(&ds_data[0], Fragment::BufferAdoptionMode::kReadOnlyMode);
284 size_t n_frames = (ds_size -
sizeof(FragmentHeader))/
sizeof(WIBFrame);
285 std::vector<raw::RawDigit::ADCvector_t> adc_vectors(256);
286 uint32_t slot = 0, fiber = 0;
287 for (
size_t i = 0; i < n_frames; ++i)
289 auto frame =
reinterpret_cast<WIBFrame*
>(
static_cast<uint8_t*
>(frag.get_data()) + i*
sizeof(WIBFrame));
290 for (
size_t j = 0; j < adc_vectors.size(); ++j)
292 adc_vectors[j].push_back(frame->get_channel(j));
297 slot = frame->get_wib_header()->slot_no;
298 fiber = frame->get_wib_header()->fiber_no;
302 for (
size_t iChan = 0; iChan < 256; ++iChan)
308 if (offline_chan < 0)
continue;
309 if (offline_chan > maxchan)
continue;
311 timestamps.push_back(rd_ts);
313 float median = 0., sigma = 0.;
317 raw_digits.push_back(rd);
Collection of charge vs time digitized from a single readout channel.
std::vector< short > ADCvector_t
Type representing a (compressed) vector of ADC counts.
std::list< std::string > getMidLevelGroupNames(hid_t grp)
void getMedianSigma(const raw::RawDigit::ADCvector_t &v_adc, float &median, float &sigma)
void SetPedestal(float ped, float sigma=1.)
Set pedestal and its RMS (the latter is 0 by default)
int getOfflChanFromSlotFiberChan(int slot, int fiber, int chan)
hid_t getGroupFromPath(HDFFileInfoPtr &hdfFileInfoPtr, const std::string &path)
double median(sqlite3 *db, std::string const &table_name, std::string const &column_name)
QTextStream & endl(QTextStream &s)