diff --git a/tutorials/dataframe/df007_snapshot.C b/tutorials/dataframe/df007_snapshot.C index e66e1d3a85f12c7a339386d87b116d6a041570a3..f4729c92f4bec1f968485999226a0f8f1350d23d 100644 --- a/tutorials/dataframe/df007_snapshot.C +++ b/tutorials/dataframe/df007_snapshot.C @@ -60,8 +60,7 @@ int df007_snapshot() // Open the new file and list the columns of the tree TFile f1(outFileName); - TTree *t; - f1.GetObject(treeName, t); + auto t = f1.Get<TTree>(treeName); std::cout << "These are the columns b1, b1_square and b2_vector:" << std::endl; for (auto branch : *t->GetListOfBranches()) { std::cout << "Branch: " << branch->GetName() << std::endl; @@ -75,7 +74,7 @@ int df007_snapshot() // Open the new file and list the columns of the tree TFile f2(outFileNameAllColumns); - f2.GetObject(treeName, t); + t = f2.Get<TTree>(treeName); std::cout << "These are all the columns available to this tdf:" << std::endl; for (auto branch : *t->GetListOfBranches()) { std::cout << "Branch: " << branch->GetName() << std::endl; diff --git a/tutorials/multicore/imt001_parBranchProcessing.C b/tutorials/multicore/imt001_parBranchProcessing.C index 312d9307bc97f7a2f794aa46663616714df6427a..8f87ac425c7354f3deca818e0f4139e27ddff454 100644 --- a/tutorials/multicore/imt001_parBranchProcessing.C +++ b/tutorials/multicore/imt001_parBranchProcessing.C @@ -23,8 +23,7 @@ int imt001_parBranchProcessing() auto file = TFile::Open("http://root.cern.ch/files/h1/dstarmb.root"); // Get the tree - TTree *tree = nullptr; - file->GetObject<TTree>("h42", tree); + auto tree = file->Get<TTree>("h42"); const auto nEntries = tree->GetEntries(); diff --git a/tutorials/multicore/mp103_processSelector.C b/tutorials/multicore/mp103_processSelector.C index 525dc1f08d9c786800cca763a64186f5dc4dadd4..97e51b59be2bc4835faaec87a688e2a0a14f5d30 100644 --- a/tutorials/multicore/mp103_processSelector.C +++ b/tutorials/multicore/mp103_processSelector.C @@ -42,8 +42,7 @@ int mp103_processSelector() // #define __reproduce_davix #if defined(__reproduce_davix) auto fp = std::make_unique<TTree>(TFile::Open(file0)); - TTree *tree; - fp->GetObject("h42", tree); + auto tree = fp->Get<TTree>("h42"); #endif ROOT::TTreeProcessorMP pool(3); diff --git a/tutorials/multicore/mt102_readNtuplesFillHistosAndFit.C b/tutorials/multicore/mt102_readNtuplesFillHistosAndFit.C index 14781f9a2f4b31d016e22320934b3592244c138d..043a3f5197370c167e6d6394c350ebd509adc363 100644 --- a/tutorials/multicore/mt102_readNtuplesFillHistosAndFit.C +++ b/tutorials/multicore/mt102_readNtuplesFillHistosAndFit.C @@ -46,8 +46,7 @@ Int_t mt102_readNtuplesFillHistosAndFit() // We define our work item auto workItem = [&histograms](UInt_t workerID) { TFile f(Form("mt101_multiCore_%u.root", workerID)); - TNtuple *ntuple = nullptr; - f.GetObject("multiCore", ntuple); + auto ntuple = f.Get<TNtuple>("multiCore"); auto &histo = histograms.at(workerID); for (auto index : ROOT::TSeqL(ntuple->GetEntriesFast())) { ntuple->GetEntry(index);