Added conditional statements for root and geant4