Message: Re: How to transport and stack secondaries first before transporting the primaries again Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Note Re: How to transport and stack secondaries first before transporting the primaries again  

Forum: Event and Track Management
Re: None How to transport and stack secondaries first before transporting the primaries again (Brent van der Heyden)
Re: None Re: How to transport and stack secondaries first before transporting the primaries again (Makoto Asai)
Date: May 01, 04:06
From: Brent van der Heyden <Brent van der Heyden>

Hey Makoto

Thank you very much for your reply.

I was using a Geant4 version 10.4, so commenting the G4_USESMARTSTACK option + G4 recompiling did the job. For my very specific application (electron bremsstrahlung), following code worked out:

YourUserSteppingAction::UserSteppingAction(const G4Step* theStep)
{
  const G4VProcess *process = theStep->GetPostStepPoint()->GetProcessDefinedStep();
  if (!process) {return;}

  if(theStep->GetNumberOfSecondariesInCurrentStep() > 0 && process->GetProcessName()=="eBrem" ) // secondaries are generated by electron Bremsstrahlung
  {
   G4Track * theTrack = theStep->GetTrack();
   theTrack->SetTrackStatus(fSuspend);
  }
}

Brent

 Add Message Add Message
to: "Re: How to transport and stack secondaries first before transporting the primaries again "

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]