modified to use genreflex instead of rootcint
added exception for missing factory