Your macro will work with ROOT 5 only. With ROOT 6 you meet the problem: Calling custom classes in ROOT 6