Source definition for mono energy with angular divergance

Hello everyone,
i defined this source in my simulation:
/gps/particle proton
/gps/energy 15 MeV

/gps/pos/type Point
/gps/pos/centre 0 0 0 cm

/gps/direction 0 0 1

/gps/ang/type beam2d
/gps/ang/sigma_x 1 deg
/gps/ang/sigma_y 1 deg

But the direction of beam is -Z direction. i want to change the direction to +Z. so I changed 1 to -1, (/gps/direction 0 0 -1). but there is no change.
Is there a way to change the direction to +Z without using the rotation commands (/gps/ang/rot1 1 0 0, /gps/ang/rot2 0 -1 0)?

Hi @fateme262

For the direction other then what you mentioned. You can do one thing.
Please give a try if it works,

/gps/particle proton
/gps/energy 15 MeV
/gps/pos/centre 0 0 0 cm

#Direction 
/gps/pos/type iso     #isotropic and direction will be controlled by theta and phi
/gps/ang/mintheta 90 deg
/gps/ang/maxtheta 90 deg
/gps/ang/minphi 180 deg
/gps/ang/maxphi 180 deg

## I turn off the switch beam2D
/gps/ang/type beam2d
/gps/ang/sigma_x 1 deg
/gps/ang/sigma_y 1 deg

As you can see that Z is completely eliminated and direction is controlled by theta and phi.
Please run some simulations, based on theta phi combinations. The above is one of the example.

Regards
VRS

There is weird behavior when using Point in terms of orientation. I have avoided those headaches with just using a very small circle:

/gps/pos/type Plane
/gps/pos/shape Circle
/gps/pos/radius 1 mm

Dear Dr.Sharma,

Thank you for your solution.
the problem is here that i want to keep 1 deg angular divergence in X and Y direction. By defining the ```
/gps/ang/type beam2d
/gps/ang/sigma_x 1 deg
/gps/ang/sigma_y 1 deg
the direction of beam change to -Z?

Thank you for your suggestion.

the problem is here that i want to keep 1 deg angular divergence in X and Y direction. By defining the ```
/gps/ang/type beam2d
/gps/ang/sigma_x 1 deg
/gps/ang/sigma_y 1 deg

The direction change to -Z?

If you have difficulties with GPS, you can do this kind of things with simple ParticleGun.
see example extended/eventgenerator/particleGun/Readme : case 3

Thank you Michel for your response.

This example can be helpful. i will try it.

Best

@fateme262

Let’s first understand,
What is beam2d and when you say angular sigma_x and sigma_y 1deg, what does it mean ?
beam2d means particle has directions via theta and phi. which further you define 1deg deviation.
Remember: Theta is from 0 to 180 degree, whereas phi is from -180 to +180 , and is responsible for direction.

Right. Okay.

What is the bottom line we learn, choose wisely phi for direction add +/-0.5degree deviation, and do the same thing with theta.

Do not define again and again type. You need to eliminate

## Eliminate these lines or turn off
#/gps/ang/type beam2d
#/gps/ang/sigma_x 1 deg
#/gps/ang/sigma_y 1 deg

A better test case for your simulation is below,

TRY IT

#Your macro looks like this
/gps/particle proton
/gps/energy 15 MeV
/gps/pos/centre 0 0 0 cm

#Direction which is equal to beam2D
/gps/pos/type iso     #isotropic and direction will be controlled by theta and phi
/gps/ang/mintheta 89.5 deg
/gps/ang/maxtheta 90.5 deg
/gps/ang/minphi 179.5 deg   ###GIVES DIRECTION
/gps/ang/maxphi 180.5 deg  ###GIVES DIRECTION

Regards

Thank you for your explanation.
Just i have a question: sigma_x and sigma_y 1deg is half of cone. it means full cone is 2 deg. So by considering this, theta will define with +/-0.5 deg deviation or +/- 1 degree?

Regards