Re: USERDUMP Help

From: Vadim Talanov (Vadim.Talanov@cern.ch)
Date: Wed May 16 2007 - 17:47:20 CEST

  • Next message: Stefan Roesler: "Re: Problem with deuton converter"

    Dear Adolf,

    I'll take a risk to participate in answering on your questions (hoping that the
    real experts will correct my naive explanations) because a) what your are asking
    about is an everyday practice in the machine background calculations at the LHC,
    when the particle tracks are recorded somewhere and then this 'source file' is
    used for the off-line analysis, b) I hope to use this opportunity to learn about
    the 'official' techniques for such exercises...

    Adolf Nordin wrote:
    > 1. Can USERDUMP be used to create a “phase space file”?

    Yes. The insertion of the 'USERDUMP' card in the FLUKA input with WHAT(1)>=
    100.0 (pp.208,310 of the FLUKA yellow report) will activate a call to the MGDRAW
    routine, the template of which you have in the collection of the FLUKA user
    subroutines.

    I believe that there is a wise way to get a nice 'default' output of the
    information on the particle transport (a way which I personally have never used)
    but with a little coding it is rather easy to get a custom one - see below.

    > 2. If so, how is the
    > position where the USERDUMP file must be created defined because I can't find
    > anything about it in the manual (I might have missed it)?

    I use WHAT(3) = 2.0 to activate the BXDRAW entry of MGDRAW which is sufficient
    for my purposes. And at the first call to MGDRAW the 'source file' is opened for
    writing of course (it can be opened in USRINI and closed in USROUT as well).

    At the BXDRAW entry you have the MREG and NEWREG values for the FLUKA geometry
    regions from and where to the particle track goes that should be enough to
    record the particle into the 'source' at the desired location.

    > Using USERDUMP, as
    > far as I understand, all particles in all directions will be dumped into the
    > file and I would like only particles going into a certain direction to be
    > dumped into the file.

    Inside the MGDRAW you can have an access to all FLUKA commons and variables (if
    you need some COMMON which is not included in the template - just include it
    yourself, I did this with (CASLIM) in the previous versions).

    But most probably all you will need is already in (TRACKR), for example
    "Cx,y,ztrck = direction cosines of the current particle" which together with the
    [X,Y,Z]SCO coordinates of the particle track crossing at the boundary in BXDRAW
    should solve the case you give above.

    And then for a 'good' particle just do a write of Jtrack, Ltrack, Etrack, Xsco,
    Ysco, Zsco, Cxtrck, Cytrck, Cztrck (e.g.) somewhere.

    3. If this USERDUMP file has been generated, how does
    > one use it in other simulations as the source input?

    You surely can do this (with another bit of the hand-made coding) through the
    SOURCE routine which is activated by the SOURCE card (pp.197,314), reading your
      particles from the pre-recorded 'source'.

    A helpful idea may be to 'tag' each recorded particle with the number of the
    current beam particle (Ncase from (CASLIM) if I am correct). Then you could load
    at once into the FLUKA stack all the particles produced in the same history
    (beware about the comment on the stack size in SOURCE) and thus preserve the
    normalization.

    Although: the normalization _IS_ an issue - since not every primary particle can
    give a secondary which will fall into your 'source' (this depends on your
    selection criteria and on the conditions of the simulation of course) - you have
    to take a note to how many primaries the 'source' corresponds (unless you are
    using the biased initial distribution and the weights <> 1.0), to get the
    absolute values for the final estimates.

    PS: Late note but - hope this was complementary to what Chris Theis has already
    written,

    PPS: Very late note - and (hope) to the answer of Stefan too,

    Kind regards, Vadim


  • Next message: Stefan Roesler: "Re: Problem with deuton converter"

    This archive was generated by hypermail 2.1.6 : Wed May 16 2007 - 18:01:59 CEST