Linear Collider Forum



Home » Software Tools » Marlin et al » DDG4 particle gun (make isotropic particle gun flat in cos(theta), rather than in theta?)
DDG4 particle gun [message #2381] Mon, 29 February 2016 22:19 Go to next message
jeans
Messages: 22
Registered: November 2012
Hello,

The isotropic particle gun in DDG4 results in a distribution uniform in theta, while a truly isotropic distribution should be uniform in cos(theta). Flat-in-theta gives a too-large number of events in the forward region. If one is an FCAL expert, the current definition is of course favourable, but for more general studies, a truly isotropic distribution would be more convenient!

(This same behaviour was also present in the Mokka particle gun.)

Would it be possible to change the definition of isotropic (in DD4hep/DDG4/src/Geant4IsotropeGenerator.cpp ), or to add the option of using the "correct" definition?

Cheers,
Daniel.
Re: DDG4 particle gun [message #2382 is a reply to message #2381] Tue, 01 March 2016 01:35 Go to previous messageGo to next message
gaede
Messages: 233
Registered: January 2004
Location: DESY, Hamburg
Hi Daniel,

we are already aware of the problem and it should be fixed soon.

Cheers, Frank.

[Updated on: Tue, 01 March 2016 01:36]

Re: DDG4 particle gun [message #2383 is a reply to message #2382] Tue, 01 March 2016 22:54 Go to previous messageGo to next message
jeans
Messages: 22
Registered: November 2012
Dear Frank,

Great!

I have another gun-related request:

The ability to smear the gun direction in a limited range of polar and azimuthal angles was a useful feature in Mokka, which seems not to be implemented in ddsim.

For example, I am now testing the new simulation model hit maps, and would like to able to focus my simulation on a limited zone of the detector, but I cannot work out a way to do this with ddsim.

Cheers,
Daniel.
Re: DDG4 particle gun [message #2384 is a reply to message #2381] Wed, 02 March 2016 01:15 Go to previous messageGo to next message
gaede
Messages: 233
Registered: January 2004
Location: DESY, Hamburg
Hi Daniel,

we'll have to see if we can provide the old Mokka Gun functionality on a short timescale.

In the mean time, you could simply write your own "particle gun" using a python script that creates an LCIO file with MCParticles.

Have a look at
$lcgeo_DIR/example/lcio_particle_gun.py


this currently writes out single muons at a fixed theta, but adding any other distribution should be straight forward.

Cheers, Frank.
Re: DDG4 particle gun [message #2385 is a reply to message #2383] Wed, 02 March 2016 02:48 Go to previous messageGo to next message
sailer
Messages: 34
Registered: February 2009
Hi Daniel,

I just added phiMin/Max thetaMinMax steering to ddsim, so if you have an lcgeo HEAD (don't forget make install) you could use these options:

ddsim --enableGun --runType batch -N 4 --compactFile CLIC/compact/CLIC_o2_v04/CLIC_o2_v04.xml --gun.thetaMin 80*deg --gun.thetaMax 85*deg --gun.phiMin 0.0 --gun.phiMax 1*rad


If you cannot update:

Create a macroFile e.g., limit.mac, with these options

/ddg4/Gun/PhiMin 0*deg
/ddg4/Gun/PhiMax 90*deg
/ddg4/Gun/ThetaMin 85*deg
/ddg4/Gun/ThetaMax 90*deg
/ddg4/Gun/isotrop True

isotrop is Mandatory.

And the run (note the runType run) like this for example

ddsim --enableGun --runType run -N 10 --compactFile CLIC/compact/CLIC_o2_v04/CLIC_o2_v04.xml --macroFile limit.mac

Cheers,
Andre
Re: DDG4 particle gun [message #2386 is a reply to message #2385] Wed, 02 March 2016 20:57 Go to previous messageGo to next message
jeans
Messages: 22
Registered: November 2012
Thanks André, just what I need!
Re: DDG4 particle gun [message #2387 is a reply to message #2386] Wed, 16 March 2016 00:49 Go to previous messageGo to next message
jeans
Messages: 22
Registered: November 2012
Hello again ddsim experts,

sorry to resurrect this subject...

With my CALICE hat on, I'd like to point out that the Gaussian smearing of gun position and direction (which is available in Mokka) is a very useful feature for the simulation of test beams, and would be welcome feature in ddsim.

(I know that we can achieve this in a 2-step process as suggested by Frank, but direct functionality would make our lives easier!)

Thanks,
Daniel.

Re: DDG4 particle gun [message #2388 is a reply to message #2387] Wed, 16 March 2016 01:21 Go to previous messageGo to next message
sailer
Messages: 34
Registered: February 2009
Hi Daniel,

For about a week now the geant4 particle gun and general particle source can be used inside dd4hep/ddsim.

It needs the head version of lcgeo and dd4hep (or the HEAD from a week ago...)

And then one can run with

ddsim --enableG4GPS --macroFile gps.mac --compactFile
path/To/CompactFile.xml -O events.slcio

There is an example gps.mac file in lcgeo/example
which produces a square source.
There is also a gun.mac in lcgeo/example.
But the geant4 macros from mokka should work more or less directly.

This should give you all the freedom you seek, right?

Cheers,
Andre
Re: DDG4 particle gun [message #2389 is a reply to message #2388] Wed, 16 March 2016 01:45 Go to previous message
jeans
Messages: 22
Registered: November 2012
Hi Andre,

After a quick look, I think that this will give us (more than enough) flexibility to define beam profiles.

Thanks for anticipating my request!
Daniel.
Previous Topic:freehep.org website missing and svn server down?
Next Topic:iLCSoft release v01-17-09
Goto Forum:
  

[ PDF ]

Current Time: Sun Sep 22 11:51:30 Pacific Daylight Time 2019
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.1.
Copyright ©2001-2010 FUDforum Bulletin Board Software