Tool to generate merger trees from AHF catalogues