Skip to content

Commit

Permalink
print RNTuple info before reading
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardmgruber committed Jul 8, 2021
1 parent f15e800 commit 5359499
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions examples/hep_dimuon_analysis_cms/hep_dimuon_analysis_cms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,14 @@ auto buildRNTupleFileModel(const std::string& path)
};

auto ntuple = ROOT::Experimental::RNTupleReader::Open(ROOT::Experimental::RNTupleModel::Create(), "NTuple", path);
try
{
ntuple->PrintInfo(ROOT::Experimental::ENTupleInfo::kStorageDetails);
}
catch (const std::exception& e)
{
fmt::print("PrintInfo error: {}", e.what());
}
auto viewMuon = ntuple->GetViewCollection("nMuon");
auto viewCharge = viewMuon.GetView<std::int32_t>("nMuon.Muon_charge");
auto viewPt = viewMuon.GetView<float>("nMuon.Muon_pt");
Expand Down

0 comments on commit 5359499

Please sign in to comment.