Re: [fluka-discuss]: Rull equal zero in mgdraw

From: Alessandro Calamida <alex.calamida2_at_tiscalinet.it>
Date: Wed, 22 Jan 2020 10:20:42 +0100

Dear Paola,

Thamks for the answer. I tried to do as you advided, however, I found
others trouble.

First of all seems that the alpha particle only deposit their energy one
time inside the detecting regions that it is in silicon. Only the first
term of the DTRACK vector is not zero. This happens even when the energy
lost by the particle is not the whole energy of the particle (In my case
it is around 2.5 MeV). Moreover the ETRACK of the particle seems to
remain equal to 3.7 GeV for each event. This occurs also when I change
the energy of the alpha particle.

Maybe I am still mistaking something but I do not understand what.

I attach a copy of the mgdraw routine and of the input file if you want
to check it.

Best regards and thank you for your time, Alessandro Calamida.

Il 19/01/2020 17:01, Paola Sala ha scritto:
> Dear Alessandro,
> apologies for the delay.
>
> When the material is Silicon, alpha particles are tracked inside it, they
> loose enegy along the track until they stop.
> This energy deposition alongthe track is available in the "main" entry of
> mgdraw, in the DTRACK vector (common trackr). Then, when the particle is
> stopped the "stopping" event is passed to the ENDRAW entry, but at this
> point there is no more energy to deposit. (see the lecture and example in
> the Fluka advanced course).
> Note that the treatment of "below thresholdd" particles is different for
> Electroamagnetic and hadronic: hadrons are ranged out, electrons/photons
> are stopped on spot and energy is released there (and scored in ENDRAW)
>
> So: to get all the energy, use BOTH the mgdraw main entry AND the ENDRAW
> entry.
> Hope this hepls
> Paola
>> Dear FLUKA experts,
>>
>> I am curretly using the mdgraw routines to make correlated measurement
>> between alpha and neutrons.
>>
>> The routine works checking if the neutron is passed in a certain
>> regions, then it checks if in the specular region it is present an alpha
>> particle. To have a double check I score, both the number of times the
>> alpha and the neutrons are correlated and the deposited energy in the
>> region of the alpha particle detector. I exectute this when I have the
>> trigger coddition and without it.
>>
>> When the region of the alpha detector is set on BLACKHOLE I have no
>> problem. The routine records the energy deposited (The RULL variable is
>> not zero). If I switch it to SILICON or any other materials, then the
>> energy deposited is zero (The RULL variable is now zero). However, using
>> the DETECT card I see that the energy depositated by the alphas inside
>> it is not zero.
>>
>> Why this happen?
>>
>> I attach the mdgraw routine and the input file.
>>
>> Best regards and thank you for your time, Alessandro Calamida.
>>
>>
>> --------------33E366D0532E5EACA7681DBC
>> Content-Type: text/plain; charset=UTF-8;
>> name="mgdraw.f"
>> Content-Transfer-Encoding: 7bit
>> Content-Disposition: attachment;
>> filename="mgdraw.f"
>>
>> *$ CREATE MGDRAW.FOR
>> *COPY MGDRAW
>> * *
>> *=== mgdraw ===========================================================*
>> * *
>> SUBROUTINE MGDRAW ( ICODE, MREG )
>>
>> INCLUDE '(DBLPRC)'
>> INCLUDE '(DIMPAR)'
>> INCLUDE '(IOUNIT)'
>> *
>> *----------------------------------------------------------------------*
>> * *
>> * Copyright (C) 1990-2013 by Alfredo Ferrari *
>> * All Rights Reserved. *
>> * *
>> * *
>> * MaGnetic field trajectory DRAWing: actually this entry manages *
>> * all trajectory dumping for *
>> * drawing *
>> * *
>> * Created on 01 March 1990 by Alfredo Ferrari *
>> * INFN - Milan *
>> * Last change 12-Nov-13 by Alfredo Ferrari *
>> * INFN - Milan *
>> * *
>> *----------------------------------------------------------------------*
>> *
>> INCLUDE '(CASLIM)'
>> INCLUDE '(COMPUT)'
>> INCLUDE '(SOURCM)'
>> INCLUDE '(FHEAVY)'
>> INCLUDE '(FLKSTK)'
>> INCLUDE '(GENSTK)'
>> INCLUDE '(MGDDCM)'
>> INCLUDE '(PAPROP)'
>> INCLUDE '(QUEMGD)'
>> INCLUDE '(SUMCOU)'
>> INCLUDE '(TRACKR)'
>> *
>> DIMENSION DTQUEN ( MXTRCK, MAXQMG )
>>
>> LOGICAL LALP, LNEU
>> *
>> CHARACTER*20 FILNAM
>> LOGICAL LFCOPE
>> SAVE LFCOPE
>> DATA LFCOPE / .FALSE. /
>> *
>> *----------------------------------------------------------------------*
>> * *
>> * Icode = 1: call from Kaskad *
>> * Icode = 2: call from Emfsco *
>> * Icode = 3: call from Kasneu *
>> * Icode = 4: call from Kashea *
>> * Icode = 5: call from Kasoph *
>> * *
>> *----------------------------------------------------------------------*
>> * *
>> IF ( .NOT. LFCOPE ) THEN
>> LFCOPE = .TRUE.
>> IF ( KOMPUT .EQ. 2 ) THEN
>> FILNAM = '/'//CFDRAW(1:8)//' DUMP A'
>> ELSE
>> FILNAM = CFDRAW
>> END IF
>> OPEN ( UNIT = IODRAW, FILE = FILNAM, STATUS = 'NEW', FORM =
>> & 'FORMATTED' )
>> END IF
>> * WRITE (IODRAW) NTRACK, MTRACK, JTRACK, SNGL (ETRACK),
>> * & SNGL (WTRACK)
>> * WRITE (IODRAW) ( SNGL (XTRACK (I)), SNGL (YTRACK (I)),
>> * & SNGL (ZTRACK (I)), I = 0, NTRACK ),
>> * & ( SNGL (DTRACK (I)), I = 1, MTRACK ),
>> * & SNGL (CTRACK)
>> * +-------------------------------------------------------------------*
>> * | Quenching is activated
>> IF ( LQEMGD ) THEN
>> IF ( MTRACK .GT. 0 ) THEN
>> RULLL = ZERZER
>> CALL QUENMG ( ICODE, MREG, RULLL, DTQUEN )
>> * WRITE (IODRAW) ( ( SNGL (DTQUEN (I,JBK)), I = 1, MTRACK ),
>> * & JBK = 1, NQEMGD )
>> END IF
>> END IF
>> * | End of quenching
>> * +-------------------------------------------------------------------*
>> RETURN
>> *
>> *======================================================================*
>> * *
>> * Boundary-(X)crossing DRAWing: *
>> * *
>> * Icode = 1x: call from Kaskad *
>> * 19: boundary crossing *
>> * Icode = 2x: call from Emfsco *
>> * 29: boundary crossing *
>> * Icode = 3x: call from Kasneu *
>> * 39: boundary crossing *
>> * Icode = 4x: call from Kashea *
>> * 49: boundary crossing *
>> * Icode = 5x: call from Kasoph *
>> * 59: boundary crossing *
>> * *
>> *======================================================================*
>> * *
>> ENTRY BXDRAW ( ICODE, MREG, NEWREG, XSCO, YSCO, ZSCO )
>>
>> IF ( NEWREG .EQ. IRGDET2 .AND. JTRACK .EQ. 8) THEN
>>
>> LNEU = .TRUE.
>> !write(IODRAW,*)"Neutrone rivelato.",JTRACK
>>
>> ENDIF
>>
>> RETURN
>> *
>> *======================================================================*
>> * *
>> * Event End DRAWing: *
>> * *
>> *======================================================================*
>> * *
>> ENTRY EEDRAW ( ICODE )
>>
>> IF (LALP .AND. LNEU) THEN
>>
>> NCORTRIG=NCORTRIG+1
>> write(IODRAW,*)"Neutron and Alpha Correlated."
>> write(IODRAW,*)"NCORTRIG=",NCORTRIG
>> NCOR=1
>>
>> ENDIF
>>
>> RETURN
>> *
>> *======================================================================*
>> * *
>> * ENergy deposition DRAWing: *
>> * *
>> * Icode = 1x: call from Kaskad *
>> * 10: elastic interaction recoil *
>> * 11: inelastic interaction recoil *
>> * 12: stopping particle *
>> * 13: pseudo-neutron deposition *
>> * 14: escape *
>> * 15: time kill *
>> * Icode = 2x: call from Emfsco *
>> * 20: local energy deposition (i.e. photoelectric) *
>> * 21: below threshold, iarg=1 *
>> * 22: below threshold, iarg=2 *
>> * 23: escape *
>> * 24: time kill *
>> * Icode = 3x: call from Kasneu *
>> * 30: target recoil *
>> * 31: below threshold *
>> * 32: escape *
>> * 33: time kill *
>> * Icode = 4x: call from Kashea *
>> * 40: escape *
>> * 41: time kill *
>> * 42: delta ray stack overflow *
>> * Icode = 5x: call from Kasoph *
>> * 50: optical photon absorption *
>> * 51: escape *
>> * 52: time kill *
>> * *
>> *======================================================================*
>> * *
>> ENTRY ENDRAW ( ICODE, MREG, RULL, XSCO, YSCO, ZSCO )
>> IF ( .NOT. LFCOPE ) THEN
>> LFCOPE = .TRUE.
>> IF ( KOMPUT .EQ. 2 ) THEN
>> FILNAM = '/'//CFDRAW(1:8)//' DUMP A'
>> ELSE
>> FILNAM = CFDRAW
>> END IF
>> OPEN ( UNIT = IODRAW, FILE = FILNAM, STATUS = 'NEW', FORM =
>> & 'FORMATTED' )
>> END IF
>>
>> IF ( MREG .EQ. IRGDET1 .AND. JTRACK .EQ. -6) THEN
>>
>> LALP=.TRUE.
>> ENDEP=RULL+ENDEP
>>
>> write(IODRAW,*)"E on alpha detector=",ENDEP
>> write(IODRAW,*)"NALP=",NALP
>>
>> IF(NCOR .EQ. 1) THEN
>>
>> ENDEPTRIG=RULL+ENDEPTRIG
>> write(IODRAW,*)"E on alpha detector when is correlated
>> &to the neutron=",
>> &ENDEPTRIG
>> NCOR=ZERZER
>>
>> ENDIF
>>
>> ENDIF
>>
>> * WRITE (IODRAW) 0, ICODE, JTRACK, SNGL (ETRACK), SNGL (WTRACK)
>> * WRITE (IODRAW) SNGL (XSCO), SNGL (YSCO), SNGL (ZSCO), SNGL (RULL)
>> * +-------------------------------------------------------------------*
>> * | Quenching is activated : calculate quenching factor
>> * | and store quenched energy in DTQUEN(1, jbk)
>> IF ( LQEMGD ) THEN
>> RULLL = RULL
>> CALL QUENMG ( ICODE, MREG, RULLL, DTQUEN )
>> * WRITE (IODRAW) ( SNGL (DTQUEN(1, JBK)), JBK = 1, NQEMGD )
>> END IF
>> * | end quenching
>> * +-------------------------------------------------------------------*
>> RETURN
>> *
>> *======================================================================*
>> * *
>> * SOurce particle DRAWing: *
>> * *
>> *======================================================================*
>> *
>> ENTRY SODRAW
>> IF ( .NOT. LFCOPE ) THEN
>> LFCOPE = .TRUE.
>> IF ( KOMPUT .EQ. 2 ) THEN
>> FILNAM = '/'//CFDRAW(1:8)//' DUMP A'
>> ELSE
>> FILNAM = CFDRAW
>> END IF
>> OPEN ( UNIT = IODRAW, FILE = FILNAM, STATUS = 'NEW', FORM =
>> & 'FORMATTED' )
>> END IF
>> * WRITE (IODRAW) -NCASE, NPFLKA, NSTMAX, SNGL (TKESUM),
>> * & SNGL (WEIPRI)
>> * +-------------------------------------------------------------------*
>> * | (Radioactive) isotope: it works only for 1 source particle on
>> * | the stack for the time being
>> IF ( ILOFLK (NPFLKA) .GE. 100000 .AND. LRADDC (NPFLKA) ) THEN
>> IARES = MOD ( ILOFLK (NPFLKA), 100000 ) / 100
>> IZRES = MOD ( ILOFLK (NPFLKA), 10000000 ) / 100000
>> IISRES = ILOFLK (NPFLKA) / 10000000
>> IONID = ILOFLK (NPFLKA)
>> * WRITE (IODRAW) ( IONID,SNGL(-TKEFLK(I)),
>> * & SNGL (WTFLK(I)), SNGL (XFLK (I)),
>> * & SNGL (YFLK (I)), SNGL (ZFLK (I)),
>> * & SNGL (TXFLK(I)), SNGL (TYFLK(I)),
>> * & SNGL (TZFLK(I)), I = 1, NPFLKA )
>> * |
>> * +-------------------------------------------------------------------*
>> * | Patch for heavy ions: it works only for 1 source particle on
>> * | the stack for the time being
>> ELSE IF ( ABS (ILOFLK (NPFLKA)) .GE. 10000 ) THEN
>> IONID = ILOFLK (NPFLKA)
>> CALL DCDION ( IONID )
>> * WRITE (IODRAW) ( IONID,SNGL(TKEFLK(I)+AMNHEA(-IONID)),
>> * & SNGL (WTFLK(I)), SNGL (XFLK (I)),
>> * & SNGL (YFLK (I)), SNGL (ZFLK (I)),
>> * & SNGL (TXFLK(I)), SNGL (TYFLK(I)),
>> * & SNGL (TZFLK(I)), I = 1, NPFLKA )
>> * |
>> * +-------------------------------------------------------------------*
>> * | Patch for heavy ions: ???
>> ELSE IF ( ILOFLK (NPFLKA) .LT. -6 ) THEN
>> * WRITE (IODRAW) ( IONID,SNGL(TKEFLK(I)+AMNHEA(-ILOFLK(NPFLKA))),
>> * & SNGL (WTFLK(I)), SNGL (XFLK (I)),
>> * & SNGL (YFLK (I)), SNGL (ZFLK (I)),
>> * & SNGL (TXFLK(I)), SNGL (TYFLK(I)),
>> * & SNGL (TZFLK(I)), I = 1, NPFLKA )
>> * |
>> * +-------------------------------------------------------------------*
>> * |
>> ELSE
>> * WRITE (IODRAW) ( ILOFLK(I), SNGL (TKEFLK(I)+AM(ILOFLK(I))),
>> * & SNGL (WTFLK(I)), SNGL (XFLK (I)),
>> * & SNGL (YFLK (I)), SNGL (ZFLK (I)),
>> * & SNGL (TXFLK(I)), SNGL (TYFLK(I)),
>> * & SNGL (TZFLK(I)), I = 1, NPFLKA )
>> END IF
>> * |
>> * +-------------------------------------------------------------------*
>>
>> ******initialise our variables at each event
>>
>> LALP = .FALSE.
>> LNEU = .FALSE.
>>
>> ***** initialization of detectors regions at first event
>> IF ( NCASE .EQ. 1 ) THEN
>> ENDEP=ZERZER
>> ENDEPTRIG=ZERZER
>> NCOR=ZERZER
>> NCORTRIG=ZERZER
>> NALP=ZERZER
>> CALL GEON2R( "DETECTOR", IRGDET1, IERR1 )
>> CALL GEON2R( "DETNEU ", IRGDET2, IERR2 )
>> IF ( IERR1 .NE. 0 .OR. IERR2 .NE. 0) THEN
>> WRITE (LUNOUT, *) 'One of the detectors regions not found'
>> CALL FLABRT ('mgdraw','no detec')
>> ELSE
>> WRITE (LUNOUT, *) 'Detector region alphas', IRGDET1,
>> &'Detector region neutrons', IRGDET2
>> END IF
>> END IF
>>
>> RETURN
>> *
>> *======================================================================*
>> * *
>> * USer dependent DRAWing: *
>> * *
>> * Icode = 10x: call from Kaskad *
>> * 100: elastic interaction secondaries *
>> * 101: inelastic interaction secondaries *
>> * 102: particle decay secondaries *
>> * 103: delta ray generation secondaries *
>> * 104: pair production secondaries *
>> * 105: bremsstrahlung secondaries *
>> * 110: radioactive decay products *
>> * Icode = 20x: call from Emfsco *
>> * 208: bremsstrahlung secondaries *
>> * 210: Moller secondaries *
>> * 212: Bhabha secondaries *
>> * 214: in-flight annihilation secondaries *
>> * 215: annihilation at rest secondaries *
>> * 217: pair production secondaries *
>> * 219: Compton scattering secondaries *
>> * 221: photoelectric secondaries *
>> * 225: Rayleigh scattering secondaries *
>> * 237: mu pair production secondaries *
>> * Icode = 30x: call from Kasneu *
>> * 300: interaction secondaries *
>> * Icode = 40x: call from Kashea *
>> * 400: delta ray generation secondaries *
>> * For all interactions secondaries are put on GENSTK common (kp=1,np) *
>> * but for KASHEA delta ray generation where only the secondary elec- *
>> * tron is present and stacked on FLKSTK common for kp=npflka *
>> * *
>> *======================================================================*
>> *
>> ENTRY USDRAW ( ICODE, MREG, XSCO, YSCO, ZSCO )
>> IF ( .NOT. LFCOPE ) THEN
>> LFCOPE = .TRUE.
>> IF ( KOMPUT .EQ. 2 ) THEN
>> FILNAM = '/'//CFDRAW(1:8)//' DUMP A'
>> ELSE
>> FILNAM = CFDRAW
>> END IF
>> OPEN ( UNIT = IODRAW, FILE = FILNAM, STATUS = 'NEW', FORM =
>> & 'FORMATTED' )
>> END IF
>> * No output by default:
>> RETURN
>> *=== End of subrutine Mgdraw ==========================================*
>> END
>>
>>
>> --------------33E366D0532E5EACA7681DBC
>> Content-Type: text/plain; charset=UTF-8;
>> name="Mgdraw_Test.inp"
>> Content-Transfer-Encoding: 7bit
>> Content-Disposition: attachment;
>> filename="Mgdraw_Test.inp"
>>
>> TITLE
>>
>> * Set the defaults for precision simulations
>> DEFAULTS
>> PRECISIO
>> * Define the beam characteristics
>> BEAM -0.003
>> 4-HELIUM
>> * Define the beam position
>> BEAMPOS
>> NEGATIVE
>> * WHASOU(1)=deuteron beam energy
>> * WHASOU(2)=Tritium/Titanium or Deterium/Titanium atomic ratio
>> * WHASOU(3)=target thickness
>> * WHASOU(4)= x coordinate
>> * WHASOU(5)= y coordinate
>> * WHASOU(6)= z coordinate
>> * WHASOU(7)=deuteron beam width
>> * WHASOU(8)=flag, 1 for D-T reaction, 2 for D-D solid reaction
>> * WHASOU(9)=starting cell
>> * WHASOU(10)=flag, 0 for neutron, 1 for positive ions (alpha or helium-3)
>> * WHASOU(11)=flag, 0 for single particle simulation, 1 for dual one. If DT
>> neutron and alpha and if DD neutron and helium-3
>> *SOURCE 0.26 1.4 10. 0.0 -0.3001 0.0
>> *SOURCE 0.5 1. 1. 0.0 1. &
>> GEOBEGIN
>> COMBNAME
>> 0 0
>> * Black body
>> SPH blkbody 0.0 0.0 0.0 100000.
>> * Void sphere
>> SPH void 0.0 0.0 0.0 10000.
>> * Woorking zone
>> RPP box -100. 100. -100. 100. -100. 100.
>> * Alpha detector
>> RPP detector -10. 10. -10. 10. -50. -30.
>> * Neutron detector
>> RPP detneu -10. 10. -10. 10. 30. 50.
>> END
>> * Black hole
>> BLKBODY 5 +blkbody -void
>> * Void sphere
>> VOID 5 +void -box
>> * Working zone
>> BOX 5 +box -detneu -detector
>> DETECTOR 5 +detector
>> DETNEU 5 +detneu
>> END
>> GEOEND
>> * ..+....1....+....2....+....3....+....4....+....5....+....6....+....7..
>> ASSIGNMA BLCKHOLE BLKBODY
>> ASSIGNMA VACUUM VOID
>> ASSIGNMA VACUUM BOX
>> ASSIGNMA SILICON DETECTOR
>> ASSIGNMA BLCKHOLE DETNEU
>> DETECT 0.00001 0.005
>> DETECTOREnAlpDep
>> DETECT &
>> USRBIN 10. 4-HELIUM -21. 60. 60.
>> 60.MonAlp
>> USRBIN -60. -60. -60. 240. 240. 240. &
>> USRBDX 1. 4-HELIUM -22. DETECTOR BOX
>> 400.FlueAlp
>> USRBDX 0.005 0.00001 100. &
>> USERDUMP 100. 99. 0.0 1.
>> CoherOut
>> * Set the random number seed
>> RANDOMIZ 1. 5489.
>> * Set the number of primary histories to be simulated in the run
>> START 1000000.
>> STOP
>>
>> --------------33E366D0532E5EACA7681DBC--
>>
>>
>>
>>
>> __________________________________________________________________________
>> You can manage unsubscription from this mailing list at
>> https://www.fluka.org/fluka.php?id=acc_info
>>
>
> Paola Sala
> INFN Milano
> tel. Milano +39-0250317374
> tel. CERN +41-227679148
>
>
>
>
> __________________________________________________________________________
> You can manage unsubscription from this mailing list at
https://www.fluka.org/fluka.php?id=acc_info
>

--------------52BF1110142CFFB071BB72C3
Content-Type: text/plain; charset=UTF-8;
 name="Mgdraw_Test.inp"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="Mgdraw_Test.inp"

TITLE

* Set the defaults for precision simulations
DEFAULTS
PRECISIO
* Define the beam characteristics
BEAM -0.01
4-HELIUM
* Define the beam position
BEAMPOS
NEGATIVE
* WHASOU(1)=deuteron beam energy
* WHASOU(2)=Tritium/Titanium or Deterium/Titanium atomic ratio
* WHASOU(3)=target thickness
* WHASOU(4)= x coordinate
* WHASOU(5)= y coordinate
* WHASOU(6)= z coordinate
* WHASOU(7)=deuteron beam width
* WHASOU(8)=flag, 1 for D-T reaction, 2 for D-D solid reaction
* WHASOU(9)=starting cell
* WHASOU(10)=flag, 0 for neutron, 1 for positive ions (alpha or helium-3)
* WHASOU(11)=flag, 0 for single particle simulation, 1 for dual one. If DT
neutron and alpha and if DD neutron and helium-3
*SOURCE 0.26 1.4 10. 0.0 -0.3001 0.0
*SOURCE 0.5 1. 1. 0.0 1. &
GEOBEGIN
COMBNAME
    0 0
* Black body
SPH blkbody 0.0 0.0 0.0 100000.
* Void sphere
SPH void 0.0 0.0 0.0 10000.
* Woorking zone
RPP box -1000. 1000. -1000. 1000. -1000. 1000.
* Alpha detector
RPP detector -10. 10. -10. 10. -20. -10.
* Neutron detector
RPP detneu -10. 10. -10. 10. 10. 11.
END
* Black hole
BLKBODY 5 +blkbody -void
* Void sphere
VOID 5 +void -box
* Working zone
BOX 5 +box -detneu -detector
DETECTOR 5 +detector
DETNEU 5 +detneu
END
GEOEND
* ..+....1....+....2....+....3....+....4....+....5....+....6....+....7..
ASSIGNMA BLCKHOLE BLKBODY
ASSIGNMA VACUUM VOID
ASSIGNMA VACUUM BOX
ASSIGNMA SILICON DETECTOR
ASSIGNMA BLCKHOLE DETNEU
*DETECT 1E-04 5E-03
DETECTOREnAlpDep
*DETECT &
*USRBIN 10. 4-HELIUM -21. 60. 60. 60.MonAlp
*USRBIN -60. -60. -60. 240. 240. 240. &
*USRBDX 1. 4-HELIUM -22. DETECTOR BOX
400.FlueAlp
*USRBDX 0.005 0.00001 100. &
*USRTRACK 1. 4-HELIUM -23. DETECTOR 400.
100.TrackAlp
*USRTRACK 0.005 0.0001 &
USERDUMP 100. 99. 0.0 1.
CoherOut
* Set the random number seed
RANDOMIZ 1. 5465.
* Set the number of primary histories to be simulated in the run
START 1000.
STOP

--------------52BF1110142CFFB071BB72C3
Content-Type: text/plain; charset=UTF-8;
 name="mgdraw.f"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="mgdraw.f"

*$ CREATE MGDRAW.FOR
*COPY MGDRAW
* *
*=== mgdraw ===========================================================*
* *
      SUBROUTINE MGDRAW ( ICODE, MREG )

      INCLUDE '(DBLPRC)'
      INCLUDE '(DIMPAR)'
      INCLUDE '(IOUNIT)'
*
*----------------------------------------------------------------------*
* *
* Copyright (C) 1990-2013 by Alfredo Ferrari *
* All Rights Reserved. *
* *
* *
* MaGnetic field trajectory DRAWing: actually this entry manages *
* all trajectory dumping for *
* drawing *
* *
* Created on 01 March 1990 by Alfredo Ferrari *
* INFN - Milan *
* Last change 12-Nov-13 by Alfredo Ferrari *
* INFN - Milan *
* *
*----------------------------------------------------------------------*
*
      INCLUDE '(CASLIM)'
      INCLUDE '(COMPUT)'
      INCLUDE '(SOURCM)'
      INCLUDE '(FHEAVY)'
      INCLUDE '(FLKSTK)'
      INCLUDE '(GENSTK)'
      INCLUDE '(MGDDCM)'
      INCLUDE '(PAPROP)'
      INCLUDE '(QUEMGD)'
      INCLUDE '(SUMCOU)'
      INCLUDE '(TRACKR)'
*
      DIMENSION DTQUEN ( MXTRCK, MAXQMG )

      LOGICAL LALP, LNEU
*
      CHARACTER*20 FILNAM
      LOGICAL LFCOPE
      SAVE LFCOPE
      DATA LFCOPE / .FALSE. /
*
*----------------------------------------------------------------------*
* *
* Icode = 1: call from Kaskad *
* Icode = 2: call from Emfsco *
* Icode = 3: call from Kasneu *
* Icode = 4: call from Kashea *
* Icode = 5: call from Kasoph *
* *
*----------------------------------------------------------------------*
* *
      IF ( .NOT. LFCOPE ) THEN
         LFCOPE = .TRUE.
         IF ( KOMPUT .EQ. 2 ) THEN
            FILNAM = '/'//CFDRAW(1:8)//' DUMP A'
         ELSE
            FILNAM = CFDRAW
         END IF
         OPEN ( UNIT = IODRAW, FILE = FILNAM, STATUS = 'NEW', FORM =
     & 'FORMATTED' )
      END IF
* WRITE (IODRAW) NTRACK, MTRACK, JTRACK, SNGL (ETRACK),
* & SNGL (WTRACK)
* WRITE (IODRAW) ( SNGL (XTRACK (I)), SNGL (YTRACK (I)),
* & SNGL (ZTRACK (I)), I = 0, NTRACK ),
* & ( SNGL (DTRACK (I)), I = 1, MTRACK ),
* & SNGL (CTRACK)
* +-------------------------------------------------------------------*
* | Quenching is activated
      IF ( LQEMGD ) THEN
         IF ( MTRACK .GT. 0 ) THEN
            RULLL = ZERZER
            CALL QUENMG ( ICODE, MREG, RULLL, DTQUEN )
* WRITE (IODRAW) ( ( SNGL (DTQUEN (I,JBK)), I = 1, MTRACK ),
* & JBK = 1, NQEMGD )
         END IF
      END IF
* | End of quenching
* +-------------------------------------------------------------------*

      IF(MREG .EQ. IRGDET1 .AND. JTRACK .EQ. -6) THEN

      write(IODRAW,*)"E of Alpha particle=",DTRACK(1),"MTRACK=",MTRACK
      write(IODRAW,*)"ETRACK=",ETRACK

      ENDIF

      RETURN
*
*======================================================================*
* *
* Boundary-(X)crossing DRAWing: *
* *
* Icode = 1x: call from Kaskad *
* 19: boundary crossing *
* Icode = 2x: call from Emfsco *
* 29: boundary crossing *
* Icode = 3x: call from Kasneu *
* 39: boundary crossing *
* Icode = 4x: call from Kashea *
* 49: boundary crossing *
* Icode = 5x: call from Kasoph *
* 59: boundary crossing *
* *
*======================================================================*
* *
      ENTRY BXDRAW ( ICODE, MREG, NEWREG, XSCO, YSCO, ZSCO )

      IF ( NEWREG .EQ. IRGDET2 .AND. JTRACK .EQ. 8) THEN

        LNEU = .TRUE.
        !write(IODRAW,*)"Neutrone rivelato.",JTRACK

      ENDIF

      RETURN
*
*======================================================================*
* *
* Event End DRAWing: *
* *
*======================================================================*
* *
      ENTRY EEDRAW ( ICODE )

      IF (LALP .AND. LNEU) THEN

      NCORTRIG=NCORTRIG+1
      write(IODRAW,*)"Neutron and Alpha Correlated."
      write(IODRAW,*)"NCORTRIG=",NCORTRIG
      NCOR=1

      ENDIF

      RETURN
*
*======================================================================*
* *
* ENergy deposition DRAWing: *
* *
* Icode = 1x: call from Kaskad *
* 10: elastic interaction recoil *
* 11: inelastic interaction recoil *
* 12: stopping particle *
* 13: pseudo-neutron deposition *
* 14: escape *
* 15: time kill *
* Icode = 2x: call from Emfsco *
* 20: local energy deposition (i.e. photoelectric) *
* 21: below threshold, iarg=1 *
* 22: below threshold, iarg=2 *
* 23: escape *
* 24: time kill *
* Icode = 3x: call from Kasneu *
* 30: target recoil *
* 31: below threshold *
* 32: escape *
* 33: time kill *
* Icode = 4x: call from Kashea *
* 40: escape *
* 41: time kill *
* 42: delta ray stack overflow *
* Icode = 5x: call from Kasoph *
* 50: optical photon absorption *
* 51: escape *
* 52: time kill *
* *
*======================================================================*
* *
      ENTRY ENDRAW ( ICODE, MREG, RULL, XSCO, YSCO, ZSCO )
      IF ( .NOT. LFCOPE ) THEN
         LFCOPE = .TRUE.
         IF ( KOMPUT .EQ. 2 ) THEN
            FILNAM = '/'//CFDRAW(1:8)//' DUMP A'
         ELSE
            FILNAM = CFDRAW
         END IF
         OPEN ( UNIT = IODRAW, FILE = FILNAM, STATUS = 'NEW', FORM =
     & 'FORMATTED' )
      END IF

      GO TO 700

      IF ( MREG .EQ. IRGDET1 .AND. JTRACK .EQ. -6) THEN

        LALP=.TRUE.
        ENDEP=RULL+ENDEP
        NALP=NALP+1

        write(IODRAW,*)"E on alpha detector=",ENDEP
        write(IODRAW,*)"NALP=",NALP

        IF(NCOR .EQ. 1) THEN

          ENDEPTRIG=RULL+ENDEPTRIG
          write(IODRAW,*)"E on alpha detector when is correlated
     &to the neutron=",
     &ENDEPTRIG
      NCOR=ZERZER

        ENDIF

      ENDIF

  700 CONTINUE

* WRITE (IODRAW) 0, ICODE, JTRACK, SNGL (ETRACK), SNGL (WTRACK)
* WRITE (IODRAW) SNGL (XSCO), SNGL (YSCO), SNGL (ZSCO), SNGL (RULL)
* +-------------------------------------------------------------------*
* | Quenching is activated : calculate quenching factor
* | and store quenched energy in DTQUEN(1, jbk)
      IF ( LQEMGD ) THEN
         RULLL = RULL
         CALL QUENMG ( ICODE, MREG, RULLL, DTQUEN )
* WRITE (IODRAW) ( SNGL (DTQUEN(1, JBK)), JBK = 1, NQEMGD )
      END IF
* | end quenching
* +-------------------------------------------------------------------*
      RETURN
*
*======================================================================*
* *
* SOurce particle DRAWing: *
* *
*======================================================================*
*
      ENTRY SODRAW
      IF ( .NOT. LFCOPE ) THEN
         LFCOPE = .TRUE.
         IF ( KOMPUT .EQ. 2 ) THEN
            FILNAM = '/'//CFDRAW(1:8)//' DUMP A'
         ELSE
            FILNAM = CFDRAW
         END IF
         OPEN ( UNIT = IODRAW, FILE = FILNAM, STATUS = 'NEW', FORM =
     & 'FORMATTED' )
      END IF
* WRITE (IODRAW) -NCASE, NPFLKA, NSTMAX, SNGL (TKESUM),
* & SNGL (WEIPRI)
* +-------------------------------------------------------------------*
* | (Radioactive) isotope: it works only for 1 source particle on
* | the stack for the time being
      IF ( ILOFLK (NPFLKA) .GE. 100000 .AND. LRADDC (NPFLKA) ) THEN
         IARES = MOD ( ILOFLK (NPFLKA), 100000 ) / 100
         IZRES = MOD ( ILOFLK (NPFLKA), 10000000 ) / 100000
         IISRES = ILOFLK (NPFLKA) / 10000000
         IONID = ILOFLK (NPFLKA)
* WRITE (IODRAW) ( IONID,SNGL(-TKEFLK(I)),
* & SNGL (WTFLK(I)), SNGL (XFLK (I)),
* & SNGL (YFLK (I)), SNGL (ZFLK (I)),
* & SNGL (TXFLK(I)), SNGL (TYFLK(I)),
* & SNGL (TZFLK(I)), I = 1, NPFLKA )
* |
* +-------------------------------------------------------------------*
* | Patch for heavy ions: it works only for 1 source particle on
* | the stack for the time being
      ELSE IF ( ABS (ILOFLK (NPFLKA)) .GE. 10000 ) THEN
         IONID = ILOFLK (NPFLKA)
         CALL DCDION ( IONID )
* WRITE (IODRAW) ( IONID,SNGL(TKEFLK(I)+AMNHEA(-IONID)),
* & SNGL (WTFLK(I)), SNGL (XFLK (I)),
* & SNGL (YFLK (I)), SNGL (ZFLK (I)),
* & SNGL (TXFLK(I)), SNGL (TYFLK(I)),
* & SNGL (TZFLK(I)), I = 1, NPFLKA )
* |
* +-------------------------------------------------------------------*
* | Patch for heavy ions: ???
      ELSE IF ( ILOFLK (NPFLKA) .LT. -6 ) THEN
* WRITE (IODRAW) ( IONID,SNGL(TKEFLK(I)+AMNHEA(-ILOFLK(NPFLKA))),
* & SNGL (WTFLK(I)), SNGL (XFLK (I)),
* & SNGL (YFLK (I)), SNGL (ZFLK (I)),
* & SNGL (TXFLK(I)), SNGL (TYFLK(I)),
* & SNGL (TZFLK(I)), I = 1, NPFLKA )
* |
* +-------------------------------------------------------------------*
* |
      ELSE
* WRITE (IODRAW) ( ILOFLK(I), SNGL (TKEFLK(I)+AM(ILOFLK(I))),
* & SNGL (WTFLK(I)), SNGL (XFLK (I)),
* & SNGL (YFLK (I)), SNGL (ZFLK (I)),
* & SNGL (TXFLK(I)), SNGL (TYFLK(I)),
* & SNGL (TZFLK(I)), I = 1, NPFLKA )
      END IF
* |
* +-------------------------------------------------------------------*

******initialise our variables at each event

      LALP = .FALSE.
      LNEU = .FALSE.

***** initialization of detectors regions at first event
      IF ( NCASE .EQ. 1 ) THEN
         ENDEP=ZERZER
         ENDEPTRIG=ZERZER
         NCOR=ZERZER
         NCORTRIG=ZERZER
         NALP=ZERZER
         CALL GEON2R( "DETECTOR", IRGDET1, IERR1 )
         CALL GEON2R( "DETNEU ", IRGDET2, IERR2 )
         IF ( IERR1 .NE. 0 .OR. IERR2 .NE. 0) THEN
            WRITE (LUNOUT, *) 'One of the detectors regions not found'
            CALL FLABRT ('mgdraw','no detec')
         ELSE
            WRITE (LUNOUT, *) 'Detector region alphas', IRGDET1,
     &'Detector region neutrons', IRGDET2
         END IF
      END IF

      RETURN
*
*======================================================================*
* *
* USer dependent DRAWing: *
* *
* Icode = 10x: call from Kaskad *
* 100: elastic interaction secondaries *
* 101: inelastic interaction secondaries *
* 102: particle decay secondaries *
* 103: delta ray generation secondaries *
* 104: pair production secondaries *
* 105: bremsstrahlung secondaries *
* 110: radioactive decay products *
* Icode = 20x: call from Emfsco *
* 208: bremsstrahlung secondaries *
* 210: Moller secondaries *
* 212: Bhabha secondaries *
* 214: in-flight annihilation secondaries *
* 215: annihilation at rest secondaries *
* 217: pair production secondaries *
* 219: Compton scattering secondaries *
* 221: photoelectric secondaries *
* 225: Rayleigh scattering secondaries *
* 237: mu pair production secondaries *
* Icode = 30x: call from Kasneu *
* 300: interaction secondaries *
* Icode = 40x: call from Kashea *
* 400: delta ray generation secondaries *
* For all interactions secondaries are put on GENSTK common (kp=1,np) *
* but for KASHEA delta ray generation where only the secondary elec- *
* tron is present and stacked on FLKSTK common for kp=npflka *
* *
*======================================================================*
*
      ENTRY USDRAW ( ICODE, MREG, XSCO, YSCO, ZSCO )
      IF ( .NOT. LFCOPE ) THEN
         LFCOPE = .TRUE.
         IF ( KOMPUT .EQ. 2 ) THEN
            FILNAM = '/'//CFDRAW(1:8)//' DUMP A'
         ELSE
            FILNAM = CFDRAW
         END IF
         OPEN ( UNIT = IODRAW, FILE = FILNAM, STATUS = 'NEW', FORM =
     & 'FORMATTED' )
      END IF
* No output by default:
      RETURN
*=== End of subrutine Mgdraw ==========================================*
      END


--------------52BF1110142CFFB071BB72C3--




__________________________________________________________________________
You can manage unsubscription from this mailing list at https://www.fluka.org/fluka.php?id=acc_info
Received on Wed Jan 22 2020 - 11:54:29 CET

This archive was generated by hypermail 2.3.0 : Wed Jan 22 2020 - 11:54:50 CET