Forcing the interaction to be of a single type

Hi everyone,

I am back, and I once again ask for your support…

My current problem is that I would very much like to focus on a single interaction type, i.e. only compton or only photoelectric (energy ~<= 140keV). If I remember correctly, it was possible in geant4 to use a command on the form
/process/inactivate compt and /process/inactivate phot to deactivate the respective interaction types. Is this something that has been implemented into APSQ in some simple way?

In the mean time I guess the following could work?
Looking through the source code, and assuming that I am using FTFP_BERT_PEN physics list, I am guessing that I can comment out the lines that add the different effects in
xxxx/geant4/geant4_src/source/physics_lists/constructors/electromagnetic/src/G4EmPenelopePhysics.cc, i.e. say that I want to remove the photoelectric effect I comment out

  //Photo-electric effect
  G4PhotoElectricEffect* thePhotoElectricEffect = new G4PhotoElectricEffect();
  thePhotoElectricEffect->SetEmModel(new G4PEEffectFluoModel());
  G4PenelopePhotoElectricModel* thePEPenelopeModel = new G4PenelopePhotoElectricModel();   
  thePEPenelopeModel->SetHighEnergyLimit(PenelopeHighEnergyLimit);
  thePhotoElectricEffect->AddEmModel(0, thePEPenelopeModel);

and similarly for the Compton effect and others. And then, of course, rebuild everything. Will this achieve what I want, or am I under a grave misapprehension and something else is needed?

All the best,
Rickard

Since I found the answer by trial and error, I’ll answer it myself.

Step 1

So I guess that commenting out the lines

//Photo-electric effect
G4PhotoElectricEffect* thePhotoElectricEffect = new G4PhotoElectricEffect();
thePhotoElectricEffect->SetEmModel(new G4PEEffectFluoModel());
G4PenelopePhotoElectricModel* thePEPenelopeModel = new G4PenelopePhotoElectricModel();   
thePEPenelopeModel->SetHighEnergyLimit(PenelopeHighEnergyLimit);
thePhotoElectricEffect->AddEmModel(0, thePEPenelopeModel);

is unnecessary, but I did it anyways just to be sure, lines 177-181 in G4EmPenelopePhysics.cc or thereabout, but most importantly to comment out

ph->RegisterProcess(thePhotoElectricEffect, particle);

on line 201 in the same file.

Step 2

Rebuild geant4

Step 3

Rebuild APSQ

Step 4

Enjoy having no photoelectric effect.

==============================================
The other effects can also be commented out in a similar fashion, but one needs to rebuild every time.

Although, if there is something I missed and I am getting something different than what I am thinking, please correct me.