Message: Is there something wrong with my photonuclear process section in physicslist Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Is there something wrong with my photonuclear process section in physicslist 

Keywords: photonuclear,segmentation error,
Forum: Physics List
Date: 03 Jan, 2007
From: long <long>

hi,everyone. I tried to add photonuclear process in my physicslist,
but met trouble. If the codes about photonuclear process removed from
the list, appplication runs without error; if the photonuclear codes added
, application will end with segmentation error.
The following is part of my physicslist. the codes on photonuclear process
are betwenn two "//--- --". What is wrong with these codes? 
    Thanks a lot.

#include "G4Decay.hh"
#include "G4GammaNuclearReaction.hh"
#include "G4PhotoNuclearProcess.hh"
void my1PhysicsList::ConstructGeneral()
{
  //Add Decay Process
  G4Decay* theDecayProcess = new G4Decay();
  theParticleIterator->reset();
  while((*theParticleIterator)() )
    {
      G4ParticleDefinition* particle = theParticleIterator->value();
      G4ProcessManager* pmanager = particle->GetProcessManager();
      if (theDecayProcess->IsApplicable(*particle))
	{  
	  // returns "true" if the decay process can be applied to the particle type. 
	  pmanager ->AddProcess(theDecayProcess);
	  pmanager ->SetProcessOrdering(theDecayProcess, idxPostStep);
	  //set ordering for PosStepDoIt and AtRestDoIt
	  pmanager ->SetProcessOrdering(theDecayProcess, idxAtRest);
	}

      G4String particleName = particle->GetParticleName();

     //--begin--------- 
     if (particleName == "gamma") 
	{
	 // Add photonuclear reaction
	  G4PhotoNuclearProcess thePhotoNuclearProcess;
	  G4GammaNuclearReaction *theGammaNuclearReaction;
	  theGammaNuclearReaction->SetMaxEnergy(3.5*GeV);
	  thePhotoNuclearProcess.RegisterMe(theGammaNuclearReaction);
	  pmanager->AddDiscreteProcess(&thePhotoNuclearProcess);
	}
     //--end---------
    }
}

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 None: Re: Is there something wrong with my photonuclear process section in physicslist   (Dennis H. Wright - 18 Jan, 2007)
 Add Message Add Message
to: "Is there something wrong with my photonuclear process section in physicslist"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]