Hi,
I’m looking at the TTreeReader tutorial at https://root.cern.ch/7-using-ttreereader, specifically at this excerpt:
TTreeReader reader("MyTree", file);
TTreeReaderArray<float> raMuonPt(reader, "muons.fPt");
while (reader.Next()) {
for (int iMuon = 0, nMuons = raMuonPt.GetSize(); iMuon < nMuons; ++iMuon)
hist->Fill(raMuonPt[iMuon]);
}
My question is: is there a way to delete some raMuonPt
element, similarly to what std::vector::erase
would do? What I’d like to do is to introduce another loop over muon pTs before the current one, check e.g. if muon pT > 1 MeV, and if not, to just get rid of this value altogether. Note I don’t want to do it via a continue
statement - I want to have raMuonPt.GetSize()
decreased, too. Is it possible?
Thanks!
ROOT Version: 6.14/04