I’m trying to ionise (heavy) daughter products emitted from a source by passing them through a very diffuse gas (Helium). As a control I set the pressure of the gas to 0 and I see ionised primaries! However if I use G4_Galactic as a cross-check for the control I see no ionised primaries/daughters which is to be expected.
I’m creating N2 gas thus:
density = 0.12506*mg/cm3; // STP
temperature = STP_Temperature;
pressure = 1.0e-0STP_Pressure; //1.0e-0STP_Pressure;
Your code example (which really needs to have the backticks!) has
pressure = 1.0e-0 * STP_Pressure;
which means “1 times”, not “zero times”. First, why do you think you’re setting the pressure to zero? Second, I’m not 100% sure that setting density to the STP value, but pressure to something else, works.
Hmmm. I’ve always been skeptical (or at least confused) about the interaction of density/temperature/pressure when kStateGas is used. After all, if you’re specifying the molar mass, then giving all three of them overdetermines the system. So which one gets ignored? It’s not obvious to me from the documentation, so in my personal configurations, I just don’t. I compute what the density is “supposed to be”, and put that in directly.
Thanks Mike. So you and I are equally confused. Changing the molar mass seems to be a brutal and unsophisticated approach. I think it’s ok for the 0 atm but I’m very loath to use it for any other variations of pressure.
Please notice :
1- density must be strictly positive. Null density is forbidden; a check of that is done in G4Material constructor.
Galactic is an example of such vacuum.
2- G4Material constructor itself does nothing with (temperature, pressure). It is the user responsability to define a density coherent with its (temperature, pressure) .