Different DOSE by using USRBIN and comscw

I am trying to score the dose distribution of a proton in a water phantom using incident carbon ions.
I conducted two sets of experiments, using the AUXSCORE&USRBIN card for one set and COMSCW.f to score the proton dose for the other set.
For both sets of experiments, I configured the same beam information and water phantom information, and used the same seed. To my understanding, I should get the same result from the two experiments. However, the dose distribution using COMSCW.f is less than the card when I sum the dose.
截屏2023-10-30 22.41.46

The specific setup details are as follows:
In COMSCW.f, I set JTRACK .eq.1 to score the dose of the proton, while in the other card experiment, I setted what(5)=1 and what(6)=1 in AUXSCORE, which means Z and A of particles.
Can someone help me identify where I went wrong in the above-mentioned setup?
I have attached my .inp, comscw.f files, and a Python file to sum the dose distribution.
Thanks in advance!
carbon_card.inp (1.2 KB)
carbon_f.inp (1.1 KB)
comscw.f (5.3 KB)
sum.py (909 Bytes)

Hi @liweiguang,

The reason why you see such a discrepancy is because in your comscw.f, the contribution of heavy recoils originating from proton interactions is missing. In order to include them, your routine should look like the following:

	COMSCW = ONEONE
	IF (TITUSB(JSCRNG)(1:5) .EQ. "pDOSE") THEN 
		IF (JTRACK.EQ.1) THEN
			COMSCW = ONEONE
		ELSEIF (JTRACK.EQ.208 .AND. J0TRCK.EQ.1) THEN
			COMSCW = ONEONE
		ELSE 
			COMSCW = ZERZER
		ENDIF
	ENDIF

Where 208 represents heavy recoils, and J0TRCK is the originating particle. Details can be found in the comments about JTRACK in track.inc.

Hope this helps,
Fran

2 Likes

Dear Ogallar,

Your advice is correct. I followed your advice and reenacted the simulation, and obtained the same results. Thank you!