A question about physical process registration

Hi:

I wanted to add the G4PenelopeComptonModel physics process to my experiment, I wrote my own header file and inherited the G4VModularPhysicsList. then I added the G4PenelopeComptonModel physics process to my experiment with the command RegisterPhysics(newG4PenelopeComptonModel()); in the constructor I then registered the G4PenelopeComptonModel physics process in the constructor with the following overall code.

 DicomPhysicsList::DicomPhysicsList() 
: G4VModularPhysicsList()
{
  SetDefaultCutValue(1.0*micrometer);
  SetVerboseLevel(1);

  G4int verbose = 1;

  RegisterPhysics(new G4DecayPhysics());
  
  RegisterPhysics(new G4RadioactiveDecayPhysics());

  RegisterPhysics(new G4EmStandardPhysics_option3());

  RegisterPhysics(new G4HadronElasticPhysicsXS(verbose));

  RegisterPhysics(new G4StoppingPhysics(verbose));

  RegisterPhysics(new G4IonPhysics(verbose));

  RegisterPhysics(new G4HadronInelasticQBBC(verbose));

  RegisterPhysics(new G4NeutronTrackingCut(verbose));

  RegisterPhysics(new G4PenelopeComptonModel());

  G4ProductionCutsTable::GetProductionCutsTable()->
      SetEnergyRange(100*eV, 1*GeV);
  G4EmParameters* param = G4EmParameters::Instance();
  param->SetMinEnergy(100*eV);
  param->SetMaxEnergy(1*GeV);
}

However, when registering G4PenelopeComptonModel(), I encountered a problem, the code reported an error and prompted me that the real parameter of type “G4PenelopeComptonModel *” is incompatible with the formal parameter of type "G4VPhysicsConstructor *

How should I register G4PenelopeComptonModel, a physical list, please?

1 Like

Ciao,

G4PenelopeComptonModel is a model and not a modular physics list. If you want to take a ready-for-the-use physics list, you should replace

RegisterPhysics(new G4EmStandardPhysics_option3());

with

RegisterPhysics(new G4EmPenelopePhysics());

This will call a Geant4 EM constructor which uses the Penelope processes for gamma-rays, electrons and positrons. If you want to change only one specific model (e.g. the Compton scattering), you have to write your own EM builder, e.g. taking inspiration from G4EmStandardPhysics_option3(), with the appropriate replacements.

Hope this helps,
Luciano

1 Like

Thank you for your reply, I now understand what was asked and I will try the method you mentioned.