Message: Re: Compare surface roughness and travelling path of photons Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Idea Re: Compare surface roughness and travelling path of photons 

Forum: Processes Involving Optical Photons
Re: Question Compare surface roughness and travelling path of photons (Susanne Jungmann)
Date: 15 Sep, 2010
From: Randolph Moellenberg <Randolph Moellenberg>

A simple brute force way to reduce your photons would be, to just check in the Tracking Action if a particle has produced photon, and just kill the secondary tracks before they are processed with a defined probability. So e.g. if your have normally 1000 photons, you add the following code to your PostUserTrackingAction(const G4Track* theTrack) method:

G4TrackVector* secondaries = fpTrackingManager->GimmeSecondaries();
	if(secondaries)
	{
	    size_t nSeco = secondaries->size();
	    if(nSeco>0)
	    {
	      for(size_t i=0;i<nSeco;i++)
	      {
	    	  if((*secondaries)[i]->GetDefinition()->
                                       GetParticleName()=="opticalphoton")
                  {
                    if(G4UniformRand()<0.99)
	    		(*secondaries)[i]->SetTrackStatus(fStopAndKill);
                  }
              }
            }
        }

In this way you get on average only 10 photons
(you can also add a counter to your TrackAction class, so
 that you get exactly 10 photons).

I hope that this helps.

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 Question: Re: Compare surface roughness and travelling path of photons   (Susanne Jungmann - 15 Sep, 2010)
2 Feedback: Re: Compare surface roughness and travelling path of photons   (Gumplinger Peter - 15 Sep, 2010)
 Add Message Add Message
to: "Re: Compare surface roughness and travelling path of photons"

 Subscribe Subscribe

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