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 May 17, 2021
1 parent 68cd8a4 commit 1e46ed5
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 1e46ed5

Please sign in to comment.