How to use user routines ENDSCP

Dear FLUKA experts,

I want to use ENDSCP in carbon beam to shift energy distribution when particles enter a specific region. After reading manual, i still have some questions:

  1. How to active this user routine? I tried USERWEIG. The ENDSCP was with COMSCW. Should I use them together?
  2. How can I modify the ZTRUNK to make energy shift? Is it the distance i want to shift? then what’s the unit for this distance?

Thanks a lot. I am very appreciate your answer.

I think I understand how to use this user routine ENDSCP simplely. I made a mistake which i want to active it in a region not in scoring. The code as below can shift BraggPeak with 1 cm. And COMSCW is not needed to couple with ENDSCP.

  DIMENSION ZTRUCK (0:NTRUCK)
  double precision ZTRUCK
  LOGICAL LFIRST
  SAVE    LFIRST
  DATA    LFIRST / .TRUE. /
  IF (LFIRST) THEN
   WRITE(LUNOUT,*) 'ROUTINE ENDSCP CALLED'
   LFIRST = .FALSE.
  ENDIF
  DO I=0,NTRUCK
    ZTRUCK(I)=ZTRUCK(I)+ 1
  ENDDO
  RETURN

This topic can be closed. Thanks.

Sorry for coming late. I just wanted to highlight some of your findings:

  • as you successfully experienced and pointed out above, one does not need to use also comscw, but can stay with endscp alone, to be activated by the USERWEIG card;
  • as you realized, in agreement with the manual, the unit for the shift distance is cm.

Moreover, one should be aware that such a scoring shift (that does not alter the actual particle tracking) works only for a Cartesian USRBIN grid and applies only to continuous energy deposition, and not to point energy deposition occurrences (that do not get shifted).

Thanks for putting a spotlight on this FLUKA feature.

3 posts were split to a new topic: Question on USRYIELD