|Message: Re: Arbitrary Position Distribution With G4GeneralParticleSource||Not Logged In (login)|
Click on the Forum title, e.g. on the "Forums by Category" page, to read a sequence of postings to the Forum and its threads all in one page. If you are only interested in one thread or the thread following a specific posting, click the thread or the posting, which takes you to a smaller page, which contains only the part you are interested in and may be easier to navigate.
Messages are "chained" if there are only replies at the first level, i.e. 1/1.html, 1/1/1.html etc. In case of "chained" messages the message number is replaced by the icon and there is no indentation.
Inline: Display the subject line only or also the text of the posting(s); for the choice "All" the "Outline" choices are switched off.
|1||0||1||no text / full text of posting|
|2||1||All||text for level 1 only / text for All postings|
Outline: Choose the depth of the posting thread, successive toggle controls provide increasing detail.
|1||2||1||2 levels / 1 level (original posting)|
|2||3||2||3 levels / 2 levels|
|3||3||All||3 levels / all levels (all postings)|
Dear Anders, Your source has a beautiful pattern ! ;) I second Andrew's suggestion for you to write your own PrimaryGeneratorAction class. Your pattern looks too advanced for GPS. You will have to implement the GeneratePrimaries method, which is called at the beginning of each event. Here you can use the G4ParticleGun utility, specifying emission point and time, and particle characteristics. The actual things to be created are vertices + particles coming from each of these vertices. The vertices have to be given the the G4Event in argument. G4ParticleGun is a utility for that, as GPS is. One thing is that you are able to get a 2D display of the source: does it come from an analytic pattern, or an other simulation tool, etc. ? The idea would be to exploit this (display, or analytical form, whatever) as 2D input + intensity to sample your distribution. Cheers, Marc On 04/21/2015 04:55 PM, email@example.com wrote: > *** Discussion title: Event and Track Management > > Hi, > > I have a particle source that I'd like to implement using the > G4GeneralParticleSource class. I have managed to get the energy and > angular distributions right. The problem is the particle position. The > source is shaped like a disc, but the emission probability is not > uniform across that disc (see attached). Is there any way to bias the > position accordingly? Looking at the code, the position is generated by > drawing two random numbers (x and y) and then making sure that the > corresponding position is within the radius of the disc. The x and y > values can be biased separately, but this is not enough to construct an > arbitrary 2D pattern. > > If I were to employ a G4ParticleGun instead, I could get the desired > behavior by using my 2D distribution to generate the position at random > in the GeneratePrimaries function. This does not seem to work for > G4GeneralParticleSource. Unless I use one of the predefined shapes, it > defaults to emitting particles from the origin. > > Is there any way to make G4GeneralParticleSource generate positions from > an arbitrary 2D distribution? > > // Anders > > Attachment: > http://hypernews.slac.stanford.edu/HyperNews/geant4/get/AUX/2015/04/21/07.48-99458-intensityProfile.png > > ------------------------------------------------------------- > Visit this GEANT4 at hypernews.slac.stanford.edu message (to reply or unsubscribe) at: > http://hypernews.slac.stanford.edu/HyperNews/geant4/get/eventtrackmanage/1246.html
|Inline Depth:||Outline Depth:||Add message:|