Electron single coulomb scattering simulated only in particular G4Region

Hi all,

I am working on a simulation of an electron scattering experiment with a lead target. The electron beam energy is 155 MeV. The project requires a slightly modified electron single Coulomb scattering model to obtain a scattering angle for each CoulombScat process happening in the target.

I produced the most physical results when G4eSingleCoulombScatteringModel in the precise mode was used. However, this model requires a lot of computation resources. Suppose I use it in my Physics List as a model for any electron Coulomb scattering process in general. In that case, it is also being used to simulate the interaction of scattered electrons with the shielding and many other volumes in the detector setup.

Thus, I tried to construct a physics list in a way that this model would only be used in the target, while much faster multiple scattering would be used for any other volume, utilizing G4Region class and SetExtraEmModel method of the G4EmConfigurator class. For that, I used the extended/medical/dna/microdosimetry example as a reference and did the following for the EM Physics List:

G4ParticleTable::G4PTblDicIterator* aParticleIterator = GetParticleIterator();
aParticleIterator->reset();
while ((*aParticleIterator)()){
	G4ProcessManager* pmanager = particle->GetProcessManager();
	G4String particleName = particle->GetParticleName();
	...
	if(particleName == "e-") {
		// Multiple scattering
		G4eMultipleScattering* msc = new G4eMultipleScattering();
		msc->AddEmModel(0, new G4GoudsmitSaundersonMscModel());
				   
		// Single scattering
		G4CoulombScattering* ss = new G4CoulombScattering();
		ss->SetEmModel(new G4DummyModel(),1);

		pmanager->AddDiscreteProcess(ss);
		pmanager->AddProcess(msc, -1, 2, 2);
		pmanager->AddProcess(new G4eIonisation, -1, 3, 3);
		pmanager->AddProcess(new G4eBremsstrahlung, -1, 4, 4);
	}
	...
}
G4EmConfigurator* em_config = G4LossTableManager::Instance()->EmConfigurator();
G4VEmModel* mod;
mod = new G4GoudsmitSaundersonMscModel();
mod->SetActivationLowEnergyLimit(1000. * MeV);
em_config->SetExtraEmModel("e-", "msc", mod, "target");

electronSscModel = new G4eSingleCoulombScatteringModelModified();
electronSscModel->SetXSectionModel("precise");
em_config->SetExtraEmModel("e-", "CoulombScat", electronSscModel, "target");

When I do so, the electron Coulomb scattering occurs only in the target region as needed, and the msc process occurs everywhere but in the target. But every time the process CoulombScat takes place the scattering angle of the electrons appears to be zero, as if the G4DummyModel were still responsible for the cross sections. At the same time I am still able to access the parameters of the G4eSingleCoulombScatteringModelModified through the electronSscModel, which is a private variable for my EM physics list class, as if the model was running in the target for every event, but for some reason would not change the actual momenta of the scattered electron. I can also access a non-zero scattering angle generated by the G4eSingleCoulombScatteringModelModified, but it is just not being applied to the electron itself. All of the distributions for the electrons in the target are also the same as when I simply use the G4eSingleCoulombScatteringModelModified for every volume, except for the scattering angle, which is dramatically smaller than expected (as the electron only experience deflection when eBrem or eIon processes take place).

I tried multiple variations of the implementation above, but with this one, I got as close as I could to what I wanted. The only problem is this zero value of the actual scattering angle for every CoulombScat process. Could you possibly give me a hint on how to fix it? Or is there maybe a different way to choose a specific model to use just in one region of the detector setup?

Best regards,
Nikita

The problem was solved and the code above works fine, the reason for the mentioned problem was interference with the Coulomb scattering of positrons.