# Scoring (or counting) number of specific process

**URL:** <https://fluka-forum.web.cern.ch/t/scoring-or-counting-number-of-specific-process/3775>\
**Category:** Scoring\
**Created:** [19 October 2022 04:36 UTC](https://fluka-forum.web.cern.ch/t/scoring-or-counting-number-of-specific-process/3775 "2022-10-19T04:36:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![eng\_jwbae](https://fluka-forum.web.cern.ch/letter_avatar_proxy/v4/letter/e/53a042/32.png) [@eng\_jwbae](https://fluka-forum.web.cern.ch/u/eng_jwbae)\
**Post date:** [19 October 2022 04:36 UTC](https://fluka-forum.web.cern.ch/t/scoring-or-counting-number-of-specific-process/3775/1 "2022-10-19T04:36:18Z")

</div>

Dear FLUKA users,

Hi. I want to score the number of specific process: especially, the muon decay\* with its spatial distribution.  
What I’ve tried is scoring fluence distribution of ANEUTRIM (muon anti-neutrino) using USRBIN. But, the neutrinos are traveling, and it definitely makes fluence even there’s no decay in the bin. So I think folloing methods can be considered:

1. Count the specific process its number and where it happen
2. Stop transportation of neutrino for its first step of scoring bin
3. Time gate after decay (like after \>500 ns by considering muon mean life time of ~2200 ns)

Is there ways to execute the methods above, or suggestions of other ways are always welcome.

Best,  
Junwoo

\*A three body decay of muons. e.g., mu+ → POSITRON + ANEUTRIM + NEUTRIE

---

<div class="post-metadata">

**Author:** ![dprelipc](https://fluka-forum.web.cern.ch/user_avatar/fluka-forum.web.cern.ch/dprelipc/32/2129_2.png) [@dprelipc](https://fluka-forum.web.cern.ch/u/dprelipc)\
**Post date:** [19 October 2022 16:22 UTC](https://fluka-forum.web.cern.ch/t/scoring-or-counting-number-of-specific-process/3775/3 "2022-10-19T16:22:56Z")

</div>

Dear @eng_jwbae,

Thank you for your question!

If you are looking to count the number of muon decays, then there is no ready-to-use scoring targeted at this and one would have to come up with work-arounds, as those that you mention. However, I recommend tailoring a user routine to your needs.

Please find here a routine [mgdraw.f](https://fluka-forum.web.cern.ch/uploads/short-url/rbINIhowD18Ksxd8TMyUE0A7tLh.f) (14.6 KB) that will dump the information that you select. In particular, at the end of the file, there are the following lines:

```auto
      IF ( ICODE .EQ. 102 .AND. JTRACK .EQ. 10) THEN
         WRITE (IODRAW, *) JTRACK, XSCO, YSCO, ZSCO
      END IF

```

which filters on the interaction code `ICODE` for `102: particle decay secondaries` and `JTRACK` for `10` (FLUKA particle id) for positive muons, and then saving the `X`, `Y` and `Z` coordinates. Of course, if you wish to filter also on more variables, e.g. region number `MREG`, or to save more information, e.g. direction cosines, this is also possible.

Please find here also a working example [test.inp](https://fluka-forum.web.cern.ch/uploads/short-url/yUHBjPdpoqLqqKkThUadau05j5p.inp) (1.1 KB) that shoots 0.1 MeV muons which decay within meters based on the [output.dat](https://fluka-forum.web.cern.ch/uploads/short-url/87NUCyvWxDeFmtWSXFnbAMLVoTW.dat) (910 Bytes).

Please find [here](https://fluka.cern/documentation/running/user-routines) more information on how to use user routines. You will have to compile linking your customized user routine and add a `USERDUMP` card (as in the example I attached above) to activate the `mgdraw.f` routine.

As common practice for future questions, please upload your input file as well.

I hope this helps.

Best regards,  
Daniel Prelipcean

---

<div class="post-metadata">

**Author:** ![eng\_jwbae](https://fluka-forum.web.cern.ch/letter_avatar_proxy/v4/letter/e/53a042/32.png) [@eng\_jwbae](https://fluka-forum.web.cern.ch/u/eng_jwbae)\
**Post date:** [20 October 2022 04:47 UTC](https://fluka-forum.web.cern.ch/t/scoring-or-counting-number-of-specific-process/3775/4 "2022-10-20T04:47:53Z")

</div>

Dear @dprelipc,

Thank you very much of your answer. I’ve never used the user routine before and it is a perfect tutorial for me. Thank you for your support with kind example of the .f and input files.

With my best,  
Junwoo

---

<div class="post-metadata">

**Author:** ![rversaci](https://fluka-forum.web.cern.ch/letter_avatar_proxy/v4/letter/r/cc9497/32.png) [@rversaci](https://fluka-forum.web.cern.ch/u/rversaci)\
**Post date:** [20 October 2022 05:27 UTC](https://fluka-forum.web.cern.ch/t/scoring-or-counting-number-of-specific-process/3775/5 "2022-10-20T05:27:25Z")

</div>

Closed on 20 October 2022 05:27 UTC


