You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DPL: allow determining the origin from user provide input
In order to support embedding, we need allow the user to provide
a mapping between the desired origin and the level in the parent file
chain where the table should be found.
for (auto& [origin, level] : mContext.parentLevelToOrigin) {
471
+
if (origin == wantedOrigin) {
472
+
wantedLevel = level;
473
+
break;
474
+
}
475
+
}
476
+
477
+
// If this origin is mapped to a parent level deeper than current, skip directly without
478
+
// attempting to read from this level.
479
+
if (wantedLevel != -1 && mLevel < wantedLevel) {
480
+
if (!setFile(counter, wantedLevel, wantedOrigin)) {
481
+
t.deactivate();
482
+
returnfalse;
483
+
}
484
+
auto folderName = fmt::format("DF_{}", mfilenames[counter]->listOfTimeFrameNumbers[numTF]);
485
+
auto parentFile = getParentFile(counter, numTF, treename, wantedLevel, wantedOrigin);
486
+
if (parentFile == nullptr) {
487
+
auto rootFS = std::dynamic_pointer_cast<TFileFileSystem>(mCurrentFilesystem);
488
+
throwstd::runtime_error(fmt::format(R"(No parent file found for "{}" while looking for level {} in "{}")", treename, wantedLevel, rootFS->GetFile()->GetName()));
489
+
}
490
+
int parentNumTF = parentFile->findDFNumber(0, folderName);
491
+
if (parentNumTF == -1) {
492
+
auto parentRootFS = std::dynamic_pointer_cast<TFileFileSystem>(parentFile->mCurrentFilesystem);
493
+
throwstd::runtime_error(fmt::format(R"(DF {} listed in parent file map but not found in the corresponding file "{}")", folderName, parentRootFS->GetFile()->GetName()));
results.push_back(ConfigParamSpec{"aod-parent-access-level", VariantType::String, value, {"Allow parent file access up to specified level. Default: no (0)"}});
170
170
}
171
+
if (key == "aod-origin-level-mapping") {
172
+
results.push_back(ConfigParamSpec{"aod-origin-level-mapping", VariantType::String, value, {"Map origin to parent level for AOD reading. Syntax: ORIGIN:LEVEL[,ORIGIN2:LEVEL2,...]. E.g. \"DYN:1\"."}});
0 commit comments