Message: Is there a problem with my neutron elastic setup? Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Is there a problem with my neutron elastic setup? 

Forum: Hadronic Processes
Date: 21 Apr, 2007
From: Andy <ashoaf@purdue.edu>

Below is a copy of the code I am using in my physics list. The program works just fine as is, but when I uncomment the elastic process block, I recieve a segmentation fault almost immediatly after the simulation begins. Any assistance is appreciated.

#include "ExN01PhysicsList.hh"
#include "G4ProcessManager.hh"
#include "G4ParticleTypes.hh"
#include "G4NeutronHPFission.hh"
#include "G4NeutronHPCapture.hh"
#include "G4NeutronHPElastic.hh"
#include "G4NeutronHPInelastic.hh"
#include "G4NeutronHPFissionData.hh"
#include "G4NeutronHPCaptureData.hh"
#include "G4NeutronHPElasticData.hh"
#include "G4NeutronHPInelasticData.hh"
#include "G4IonConstructor.hh"

ExN01PhysicsList::ExN01PhysicsList() {;}

ExN01PhysicsList::~ExN01PhysicsList() {;}

void ExN01PhysicsList::ConstructParticle()
{
 //Construct particles

  G4Geantino::GeantinoDefinition();
  G4Neutron::NeutronDefinition();
  G4Proton::ProtonDefinition();
  G4Gamma::GammaDefinition();
  G4IonConstructor pConstructor;
  pConstructor.ConstructParticle();

}

void ExN01PhysicsList::ConstructProcess()
{
  // Define transportation processes and neutron interactions

  AddTransportation();
  ConstructNeutronProcess();

}

void ExN01PhysicsList::ConstructNeutronProcess() {

G4ProcessManager* pmanager = G4Neutron::Neutron()->GetProcessManager();

  // Neutron elastic process, models and cross sections
/*
  G4HadronElasticProcess* elasticProcess = new G4HadronElasticProcess();
  G4NeutronHPElastic* theHPElasticModel = new G4NeutronHPElastic();
  G4NeutronHPElasticData* theHPElasticData = new G4NeutronHPElasticData();
  elasticProcess->RegisterMe(theHPElasticModel);
  elasticProcess->AddDataSet(theHPElasticData);
  pmanager->AddDiscreteProcess(elasticProcess);
*/
  // Neutron inelastic process, models and cross sections

  G4NeutronInelasticProcess* ninelProc = new G4NeutronInelasticProcess();
  G4NeutronHPInelastic* theHPInelasticModel = new G4NeutronHPInelastic();
  G4NeutronHPInelasticData* theHPInelasticData = new G4NeutronHPInelasticData();
  ninelProc->RegisterMe(theHPInelasticModel);
  ninelProc->AddDataSet(theHPInelasticData);
  pmanager->AddDiscreteProcess(ninelProc);

  // Neutron-induced fission process, models and cross sections

  G4HadronFissionProcess* neutronFission = new G4HadronFissionProcess();
  G4NeutronHPFission* theHPFissionModel = new G4NeutronHPFission();
  G4NeutronHPFissionData* theHPFissionData=new G4NeutronHPFissionData();
  neutronFission->RegisterMe(theHPFissionModel);
  neutronFission->AddDataSet(theHPFissionData);
  pmanager->AddDiscreteProcess(neutronFission);

  // Neutron capture process, models and cross sections

  G4HadronCaptureProcess* neutronCapture = new G4HadronCaptureProcess();
  G4NeutronHPCapture* theHPCaptureModel = new G4NeutronHPCapture();
  G4NeutronHPCaptureData* theHPCaptureData = new G4NeutronHPCaptureData();
  neutronCapture->RegisterMe(theHPCaptureModel);
  neutronCapture->AddDataSet(theHPCaptureData);
  pmanager->AddDiscreteProcess(neutronCapture);

}

Simulation output:

*************************************************************
 Geant4 version Name: geant4-08-02    (15-December-2006)
                      Copyright : Geant4 Collaboration
                      Reference : NIM A 506 (2003), 250-303
                            WWW : http://cern.ch/geant4
*************************************************************

/home/andy/Geant4/geant4.8.2/data/G4NDL3.10 Segmentation fault

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

1 None: Re: Is there a problem with my neutron elastic setup?   (Vladimir IVANTCHENKO - 21 Apr, 2007)
2 None: Re: Is there a problem with my neutron elastic setup?   (Victor - 31 May, 2007)
 Add Message Add Message
to: "Is there a problem with my neutron elastic setup?"

 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 ]