Biasing of incident beam/source

Hello everyone,

I created a cone-beam using an X-ray spectra. Based on the current experimental settings, the size of the cone-beam is larger at the target hitting position. Here I am using particlegun’s SetParcleMomentumDirection class. The hitting surface of the target is rectangle. So, most of the beam passes through lab-air without hitting the target.

I can not change the experimental setting or lower the size of cone-beam at the hitting position. I want to kill the beam that passes without hitting the target to reduce the simulation time. Or I want to bias the incident beam, if bias is the correct word to use here. I wonder, how can I do it or is there is any document/tutorial online that explains this?

Thank you!

Simple question first – how far away is the target from your source? If the distance is large compared to the size of the target, then you could just throw a straight (parallel) beam and illuminate your target uniformly. The rest of the “actual” beam is irrelevant (but see below).

Detailed question – do you need to worry about beam scattering in air onto your target, or beam scattering off other parts of your experimental setup? If so, you should add those components to your geometry and Geant4 can handle those effects.

If you don’t need to worry about those effects, you can even put your source position close to the target and shoot the uniform beam that way. You can also reduce unnecessary tracking time by making your world volume only a little larger than your target – leave space in front of the target for your source position, but don’t worry about clearances on the sides or the back.

Hi @mkelsey, thanks for the reply. The distance between target and source is currently ~10 cm, size of hitting target is ~1.5cm1.5cm10cm (facing area of 1.5cm*10cm towards source). I can not illuminate target uniformly as I am also evaluating the dose deposited in the target by varying the distance between cone-beam source and target 10cm±5cm. The simulation is taking a lot of time because of the sensitivity (as expected lower sensitivity), it need to illuminate (~100) billions of X-ray. I can not change the experimental setting, and I want to reduce the simulation time by not tracking those X-rays which are not hitting the target.

Ah, I see your problem. I think what you may have to do is compute the minimum cone angle (maybe even a rectangular “cone”) to illuminate your target at various distances.

If you are using your own PrimaryGenerator, then you could include code where you take your randomly generated direction, and test geometrically whether it intersects the target; throw again if it doesn’t.

Is it possible to bias a radioactive source by defining a particular solid angle? I am able to generate mono-energetic beam in a particular solid angle .

you could do importance sampling, using for example the bounding box of your target in a parallel world.
Gamma entering the box are multiplied by a factor, gamma leaving are killed randomly with a survival rate of 1/factor. You still need a significant number of particles to evenly distribute the incident radiation onto the target, though…

There are examples: geant4/examples/extended/biasing/B03 at v11.1.0 · Geant4/geant4 · GitHub

Thanks @mkelsey and @weller for the helpful information. I checked the biasing example (biasing/B03) and now I am trying to include similar approach of biasing in my code.