Is therea way to create a hemispherical source?

Hello,

I am trying to do a simulation to create the detector response of a TImepix3 based detector. I define the sensor and the ASIC in Allpix directly. The rest is a large complex object, which I import as a passive object from a gdml file. I need to simulate particles coming from every direction - almost. From every direction is easy with a spherical source. However, the shielding is strong enough to block radiation from one side, so I would only need to simulate a 2pi sky instead of 4pi. It would save me simulation time and resources. In Geant4 you can do that by creating another object made of vacuum that overlaps half of the spherical source and then use the following command for the particle generator:
/gps/pos/confine name_of_the object_in_the_geometry
This way the source is restricted to whatever is not covered by the dummy object. However, Allpix seems to ignore that. It recognizes the object and construct it, if you get the name of the Allpix geometry module right. But the source will not be confined. The source is created via macro file containing the standard Geant4 commands, that work just fine. I tried:

  • Putting the confining dummy object in the gdml then call the confine command as above in the macro file
  • Same again changing the material from vacuum to air, because Allpix gave a warning that the material is the same as the world material and will be ignored in the simulation
  • Creating another passive volume in the conf file, where I define the sensor and import the gdml file, so the confining object is created by Allpix directly and not imported from gdml.

Allpix runs without complaining in all 3 scenarios and even confirms the confine command, but the particles are still coming from all directions. There is no confining to any hemisphere.

Any ideas how a hemispheric source can be achieved in Allpix?

Thank you!

Stefan

Hi,you can use .mac file in **DepositionGeant4**module, this file can define the three azimuths of the spherical coordinate system,by using following command:
/gps/ang/type iso
/gps/ang/mintheta 0 deg
/gps/ang/maxtheta 3 deg
/gps/ang/minphi 0 deg
/gps/ang/maxphi 180 deg

Hope it can help you

Hi solomen,

these settings only affect the angle from the starting position of the particle. If the source is a sphere, as in my case, particles would still be generated over the whole sphere, just with restricted directions they can shoot at. What I need is something that restricts the starting position to only half the sphere. Sorry if that was not clear.

Hi @StefanGohl ,

I don’t have experience with the confine command in Geant4. The actual objects passed on to Geant4 go with the names *_log and *_phys, as you can see here. Maybe this would work?

Cheers
Paul

Hi @pschutze ,

Yes, you need to use the *_phys name for Allpix to recognize the object, it will spit out an error or at least a warning without it. The object is recognized, but it does not confine the source. I guess, it does not know what to do with the confine command, maybe? It doesn’t complain about the command, but it seemingly does nothing.

Cheers

Stefan

I see. Would you be able to send me your configuration and mac file, or at least excerpts of it? Then I could have a closer look at this issue.

I don’t have the code anymore to reproduce the issue. So, I don’t think sending you my config and mac is useful. Sorry, should have thought of that. You only need some dummy object that covers a portion of your source, a passive geometry with material defined as vacuum. The mac file can look like this:

/gps/particle e-

/gps/pos/type Surface
/gps/pos/shape Sphere
/gps/pos/centre 0. 0. 0. cm
/gps/pos/radius 10. cm

/gps/pos/confine name_of_the_physical_volume

/gps/ene/type Mono

/gps/ene/mono 5 MeV

I hope, that is enough info to reproduce this issue.

Cheers

Stefan