Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tree/dataframe/src/RDFSnapshotHelpers.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1035,7 +1035,7 @@ struct SnapshotOutputWriter {
{
if (!fBranchToBitmaskMapping.empty()) {
fFile->WriteObject(&fBranchToBitmaskMapping,
(std::string{"R_rdf_branchToBitmaskMapping_"} + fTree->GetName()).c_str());
(std::string{"R_rdf_column_to_bitmask_mapping_"} + fTree->GetName()).c_str());
}
if (fTree) {
// use AutoSave to flush TTree contents because TTree::Write writes in gDirectory, not in fDirectory
Expand Down
4 changes: 2 additions & 2 deletions tree/dataframe/src/RDataFrame.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1271,10 +1271,10 @@ dataset as a `std::uin64_t`. For every 64 columns, a new bitmask column is added

For each column that gets varied, the nominal and all variation columns are each assigned a bit to denote whether their
entries are valid. A mapping of column names to the corresponding bitmask is placed in the same file as the output
dataset, with a name that follows the pattern `"R_rdf_branchToBitmaskMapping_<NAME_OF_THE_DATASET>"`. It is of type
dataset, with a name that follows the pattern `"R_rdf_column_to_bitmask_mapping_<NAME_OF_THE_DATASET>"`. It is of type
`std::unordered_map<std::string, std::pair<std::string, unsigned int>>`, and maps a column name to the name of the
bitmask column and the index of the relevant bit. For example, in the same file as the dataset "Events" there would be
an object named `R_rdf_branchToBitmaskMapping_Events`. This object for example would describe a connection such as:
an object named `R_rdf_column_to_bitmask_mapping_Events`. This object for example would describe a connection such as:

~~~
muon_pt --> (R_rdf_mask_Events_0, 42)
Expand Down
2 changes: 1 addition & 1 deletion tree/dataframe/src/RTTreeDS.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ ROOT::Internal::RDF::RTTreeDS::CreateColumnReader(unsigned int /*slot*/, std::st
if (TDirectory *treeDir = treeReader->GetTree()->GetDirectory(); treeDir) {
using Map_t = std::unordered_map<std::string, std::pair<std::string, unsigned int>>;
const std::string bitmaskMapName =
std::string{"R_rdf_branchToBitmaskMapping_"} + treeReader->GetTree()->GetName();
std::string{"R_rdf_column_to_bitmask_mapping_"} + treeReader->GetTree()->GetName();
if (Map_t const *columnMaskMap = treeDir->Get<Map_t>(bitmaskMapName.c_str()); columnMaskMap) {
if (auto it = columnMaskMap->find(std::string(col)); it != columnMaskMap->end()) {
colReader = std::make_unique<RMaskedColumnReader>(*treeReader, std::move(colReader), it->second.first,
Expand Down
6 changes: 3 additions & 3 deletions tree/dataframe/test/dataframe_snapshotWithVariations.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ TEST(RDFVarySnapshot, Bitmask)
ASSERT_NE(branch, nullptr);

auto *branchToIndexMap = file.Get<std::unordered_map<std::string, std::pair<std::string, unsigned int>>>(
("R_rdf_branchToBitmaskMapping_" + treename).c_str());
("R_rdf_column_to_bitmask_mapping_" + treename).c_str());
ASSERT_NE(branchToIndexMap, nullptr);
for (const auto branchName : {"x", "y", "x__xVar_0", "x__xVar_1", "y__xVar_0", "y__xVar_0"}) {
ASSERT_NE(branchToIndexMap->find(branchName), branchToIndexMap->end());
Expand Down Expand Up @@ -339,8 +339,8 @@ TEST(RDFVarySnapshot, TwoVariationsInSameFile)
auto snap2 = rdf.Filter(cuts2, {"x", "y"}).Snapshot(treename2, filename, {"x", "y"}, options);

std::unique_ptr<TFile> file{TFile::Open(filename)};
EXPECT_NE(file->GetKey(("R_rdf_branchToBitmaskMapping_" + treename1).c_str()), nullptr);
EXPECT_NE(file->GetKey(("R_rdf_branchToBitmaskMapping_" + treename2).c_str()), nullptr);
EXPECT_NE(file->GetKey(("R_rdf_column_to_bitmask_mapping_" + treename1).c_str()), nullptr);
EXPECT_NE(file->GetKey(("R_rdf_column_to_bitmask_mapping_" + treename2).c_str()), nullptr);

// In Windows, an exception is thrown as expected, but it cannot be caught for the time being:
#if !defined(_MSC_VER) || defined(R__ENABLE_BROKEN_WIN_TESTS)
Expand Down
Loading