Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swap stp and ch{} in the otput table names #250

Open
gipert opened this issue Feb 1, 2025 · 1 comment · May be fixed by #269
Open

Swap stp and ch{} in the otput table names #250

gipert opened this issue Feb 1, 2025 · 1 comment · May be fixed by #269
Assignees
Labels
output Output Schemes

Comments

@gipert
Copy link
Member

gipert commented Feb 1, 2025

I realized that in the LEGEND data we have ch00000/raw while remage writes stp/ch00000. I like the second option more because then stp can be an LGDO.Struct, but it's better to keep consistency.

@gipert gipert added the output Output Schemes label Feb 1, 2025
@ManuelHu
Copy link
Collaborator

ManuelHu commented Feb 3, 2025

It would need to be chnaged here (for LH5 output only):

remage/src/RMGConvertLH5.cc

Lines 204 to 220 in 401c56e

std::string column_tmp = column + "__tmp";
det_group.moveLink(column, column_tmp);
if (det_group.nameExists(column_tmp + "/pages")) {
det_group.moveLink(column_tmp + "/pages", lgdo_name);
} else {
// create a new empty dataset, as we have none.
auto col_idx = std::distance(names_parts.begin(),
std::find(names_parts.begin(), names_parts.end(), column));
LH5Log(RMGLog::warning, ntuple_log_prefix, "column ", lgdo_name,
" - no data, creating with type ", forms_parts[col_idx]);
hsize_t dset_dataspace_dim[1] = {0};
H5::DataSpace dset_dataspace(1, dset_dataspace_dim);
auto dset_dtype = FormToHDFDataType(forms_parts[col_idx]);
det_group.createDataSet(lgdo_name, *dset_dtype, dset_dataspace);
}
det_group.unlink(column_tmp);

and here:

remage/src/RMGConvertLH5.cc

Lines 292 to 296 in 401c56e

// make the root HDF5 group an LH5 struct.
if (!ntuples_group.attrExists("datatype")) {
SetStringAttribute(ntuples_group, "datatype",
"struct{" + fmt::format("{}", fmt::join(ntuples, ",")) + "}");
}

this would actually be slightly simpler than the current output. I.e. we would just have to rename {det}/pages to {det}/stp and skip all that __tmp name code.

@gipert gipert changed the title Put stp at the end of output table names Swap stp and ch{} in the otput table names Feb 13, 2025
@ManuelHu ManuelHu linked a pull request Feb 14, 2025 that will close this issue
@gipert gipert self-assigned this Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
output Output Schemes
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants