DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
dunedaq::hdf5libs Namespace Reference

Namespaces

namespace  python
 

Classes

struct  HDF5FileLayoutParameters
 
struct  HDF5PathParameters
 
class  HDF5SourceIDHandler
 

Functions

std::vector< std::string > get_files_matching_pattern (const std::string &path, const std::string &pattern)
 
std::vector< std::string > delete_files_matching_pattern (const std::string &path, const std::string &pattern)
 
uint64_t encode_geoid (int det_id, int crate_id, int slot_id, int stream_id)
 
HDF5SourceIDHandler::source_id_geo_id_map_t create_srcid_geoid_map ()
 

Variables

constexpr uint32_t MAX_FILELAYOUT_VERSION = 4294967295
 

Function Documentation

◆ create_srcid_geoid_map()

HDF5SourceIDHandler::source_id_geo_id_map_t dunedaq::hdf5libs::create_srcid_geoid_map ( )

Definition at line 61 of file HDF5TestUtils.hpp.

62{
64
67
68 sid.id = 0;
69 map[sid].push_back(encode_geoid(3, 1, 0, 0));
70
71 sid.id = 1;
72 map[sid].push_back(encode_geoid(3, 1, 0, 1));
73
74 sid.id = 3;
75 map[sid].push_back(encode_geoid(3, 1, 1, 0));
76
77 sid.id = 4;
78 map[sid].push_back(encode_geoid(3, 1, 1, 1));
79
80 sid.id = 4;
81 map[sid].push_back(encode_geoid(2, 1, 0, 0));
82
83 sid.id = 5;
84 map[sid].push_back(encode_geoid(2, 1, 0, 1));
85
86 sid.id = 6;
87 map[sid].push_back(encode_geoid(2, 1, 1, 0));
88
89 sid.id = 7;
90 map[sid].push_back(encode_geoid(2, 1, 1, 1));
91
92 return map;
93}
std::map< daqdataformats::SourceID, std::vector< uint64_t > > source_id_geo_id_map_t
uint64_t encode_geoid(int det_id, int crate_id, int slot_id, int stream_id)
SourceID is a generalized representation of the source of a piece of data in the DAQ....
Definition SourceID.hpp:32
Subsystem subsystem
The general subsystem of the source of the data.
Definition SourceID.hpp:69
ID_t id
Unique identifier of the source of the data.
Definition SourceID.hpp:74

◆ delete_files_matching_pattern()

std::vector< std::string > dunedaq::hdf5libs::delete_files_matching_pattern ( const std::string & path,
const std::string & pattern )

Definition at line 39 of file HDF5TestUtils.hpp.

40{
41 std::regex regex_search_pattern(pattern);
42 std::vector<std::string> file_list;
43 for (const auto& entry : std::filesystem::directory_iterator(path)) {
44 if (std::regex_match(entry.path().filename().string(), regex_search_pattern)) {
45 if (std::filesystem::remove(entry.path())) {
46 file_list.push_back(entry.path());
47 }
48 }
49 }
50 return file_list;
51}

◆ encode_geoid()

uint64_t dunedaq::hdf5libs::encode_geoid ( int det_id,
int crate_id,
int slot_id,
int stream_id )

Definition at line 54 of file HDF5TestUtils.hpp.

55{
56 return (static_cast<uint64_t>(stream_id) << 48) | (static_cast<uint64_t>(slot_id) << 32) |
57 (static_cast<uint64_t>(crate_id) << 16) | det_id;
58}

◆ get_files_matching_pattern()

std::vector< std::string > dunedaq::hdf5libs::get_files_matching_pattern ( const std::string & path,
const std::string & pattern )

Definition at line 26 of file HDF5TestUtils.hpp.

27{
28 std::regex regex_search_pattern(pattern);
29 std::vector<std::string> file_list;
30 for (const auto& entry : std::filesystem::directory_iterator(path)) {
31 if (std::regex_match(entry.path().filename().string(), regex_search_pattern)) {
32 file_list.push_back(entry.path());
33 }
34 }
35 return file_list;
36}

Variable Documentation

◆ MAX_FILELAYOUT_VERSION

uint32_t dunedaq::hdf5libs::MAX_FILELAYOUT_VERSION = 4294967295
constexpr

Definition at line 25 of file HDF5RawDataFile.cpp.