Message: Re: Infinite loop while generating Cerenkov photons Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: Infinite loop while generating Cerenkov photons 

Forum: Processes Involving Optical Photons
Re: Question Infinite loop while generating Cerenkov photons (Emanuele Leonardi)
Date: 06 Oct, 2017
From: Porosev Viacheslav <Porosev Viacheslav>

Hello all,

I had the similar problems with Cherenkov photons. My optical material properties are defined in the range of 300-1000 nm but I see that in a simulation the Cherenkov photons are produced in the rage of 240-1100 nm.. as a result, sometimes Geant4 is frozen. I solved this issue (in stupid way) by the killing of optical photons in ScackingAction:

G4ClassificationOfNewTrack
StackingAction::ClassifyNewTrack(const G4Track * aTrack)
{
  if(aTrack->GetDefinition()==G4OpticalPhoton::OpticalPhotonDefinition())
  { // particle is optical photon
    if(aTrack->GetParentID()>0)
    { // particle is secondary

         //Calculate wavelength
	  double wL = eV2nm(aTrack->GetDynamicParticle()->GetKineticEnergy() / CLHEP::eV);
	  if (wL <= 300 || wL>=1000.)
	  {
		  const_cast<G4Track*>(aTrack)->SetTrackStatus(fStopAndKill);
	  }
...
}

 Add Message Add Message
to: "Re: Infinite loop while generating Cerenkov photons"

 Subscribe Subscribe

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