Dynamically change track material in a process

I want to update track material during a process. I have made a new class inherited from G4ionIonisation.cc; in my new class I have AlongStepDoIt(). within AlongStepDoIt() I access track->GetMaterial() and track->GetUserInformation(). The track is actually passing through Gaseous Argon medium. Based on this flag ‘track->GetUserInformation()’, I want to update the material as Liquid Argon so that the ‘G4ionIonisation’ process consider the medium as liquid Ar to calculate track step length, energy loss etc.