Hi,
I am processing a large amount of root files using
TTreeReader reader(&chain);
auto variable = std::make_unique<TTreeReaderValue<Float_t>>(reader, "variable");
while(reader.Next()){
std::cout<<**variable<<std::endl;
}
However, in some cases, I get segmentation violations in the form of
Error in <TBranch::GetBasket>: File: file.root at byte:0, branch:variable, entry:1125, badread=0, nerrors=1, basketnumber=139
I assume that these errors appear because in the pre-processing step something was not recorded properly. As I do not care about individual entries, I would like to ask if there is a way to simply skip these ‘bad’ entries. I already tried with
TTreeReader reader(&chain);
auto variable = std::make_unique<TTreeReaderValue<Float_t>>(reader, "variable");
while(reader.Next()){
if (reader.GetEntryStatus() != TTreeReader::kEntryValid) continue;
std::cout<<**variable<<std::endl;
}
But unfortunately this did not have any effect. Any help greatly appreciated!
ROOT Version: 6.26/04
Platform: linuxx8664
Compiler: gcc