Move new if block to after TH1F histo pointer is assigned