Problem 691 - Segmentation fault in TestEm7 ( Temporal solution of #690)
Summary: Segmentation fault in TestEm7 ( Temporal solution of #690)
Status: RESOLVED FIXED
Alias: None
Product: Examples/Extended
Classification: Unclassified
Component: electromagnetic/TestEM5 (show other problems)
Version: 6.2
Hardware: Other Other
: P2 normal
Assignee: Michel.Maire
URL:
Depends on:
Blocks:
 
Reported: 2004-11-17 15:49 CET by tkoi
Modified: 2007-04-08 18:24 CEST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description tkoi 2004-11-17 15:49:16 CET
As report#690, Hadron Physics of TestEM7 has a problem.
This problem is produced by the following way.

Some Particles created in Binary Cascade ( and also Binary Cascade Light Ion)
do not have ProcessManger.
So that at the applying DecayProcess for all applicable particles in
PhysicsList::ConstructProcess,
pmanager ->AddProcess(fDecayProcess); line makes core dump,
because pmanger is NULL.

The simplest way to avoid this trouble is to change the order of preocess
creations. To apply DecayProcesses ahead to the creation of Hadronic Processes.

Change PhyisicsList.cc ConstructProcess() like this,
*******************************************************************************
  // decay process
  //
  G4Decay* fDecayProcess = new G4Decay();

  theParticleIterator->reset();
  while( (*theParticleIterator)() ){
    G4ParticleDefinition* particle = theParticleIterator->value();
    G4ProcessManager* pmanager = particle->GetProcessManager();

    if (fDecayProcess->IsApplicable(*particle)) {
      pmanager ->AddProcess(fDecayProcess);

      // set ordering for PostStepDoIt and AtRestDoIt
      pmanager ->SetProcessOrdering(fDecayProcess, idxPostStep);
      pmanager ->SetProcessOrdering(fDecayProcess, idxAtRest);
  }

  // hadronic physics lists
  for(size_t i=0; i<hadronPhys.size(); i++) hadronPhys[i]->ConstructProcess();


*******************************************************************************

The other way is to check a particle has a processManager or not in applying
the Decay Processe.

The study for more essential solution may be necessity.

Tatsumi
Comment 1 Michel.Maire 2004-11-18 05:42:59 CET
Thanks. The correction was already done, in a similar way as you suggested.
See last reference tag.