I believe that this is an error in calculating the 2D histogram. You should loop over bin from 1 to and including hists->GetNbinsX(). This should suppress the underflows. I corrected the averaging below.
TH2F *Average(std::vector<TH1F*> hists) {
TH2F *hAvg = new TH2F("hAvg","Avg",3000,0,3000,300,0,300);
for (size_t i=0;i < hists.size(); ++i) {
for (int bin = 1; bin <= hists[i]->GetNbinsX(); ++bin) {
int resultBin = hAvg->FindBin(bin, hists[i]->GetBinContent(bin));
int binContent = hAvg->GetBinContent(resultBin) + 1;
hAvg->SetBinContent(resultBin,binContent);
}
}
return hAvg;
}