Time of first hit in a sensitive volume?

Hi everyone,

I am using the user-stepping class to score energy deposited for each volume. I also want to get the time at which the particle first entered that particular volume,

I think the way to go about is to check if the current step is the first step in that volume and return the time if true.
I think there is a set method in G4Step G4bool G4Step::IsFirstStepInVolume ( ) but I am confused as to how to specify the volume where we shall check if the current step is the first step in this volume or not(or not).
The relevant part of stepping action class

void steppingaction::UserSteppingAction (const G4Step* step){
    
    const detectorconstruction* detectorConstruction = static_cast<const detectorconstruction*>
        (G4RunManager::GetRunManager()->GetUserDetectorConstruction());
        
    G4LogicalVolume* fScoringVolume1 = detectorConstruction->GetScoringVolume1();
    G4LogicalVolume* fScoringVolume2 = detectorConstruction->GetScoringVolume2();
    
    G4LogicalVolume *volume = step->GetPreStepPoint()->GetTouchableHandle()
      ->GetVolume()->GetLogicalVolume();
    
    G4double edep= step->GetTotalEnergyDeposit();
   
    if (volume == fScoringVolume1)  fEventAction->AddEdep1(edep);
    
    if(volume == fScoringVolume2)  fEventAction->AddEdep2(edep);
}

Thanks a ton!!