Message: Re: What physics list to use? Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

More Re: What physics list to use? 

Keywords: Segmentation fault
Forum: Physics List
Re: None What physics list to use? (Bari)
Date: 21 Mar, 2007
From: <bari_osmanov@yahoo.com>

 Hello, everyone. I have tried to create the physics list for 
the experiment described in my first posting. It takes into account 
four processes for neutrons. It compiles without errors but when I try 
to shoot a 1 MeV neutron, it quits with "Segmentation fault".
 Below is the source code for my physics list, I will appreciate if 
someone can tell me what I am doing wrong.

 Thanks in advance.

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

#include "PhysicsList.hh"

#include "G4ProcessManager.hh"
#include "G4ParticleDefinition.hh"

#include "G4HadronElasticProcess.hh"
#include "G4NeutronHPElastic.hh"
#include "G4NeutronHPElasticData.hh"
#include "G4NeutronInelasticProcess.hh"
#include "G4NeutronHPInelastic.hh"
#include "G4NeutronHPInelasticData.hh"
#include "G4HadronFissionProcess.hh"
#include "G4NeutronHPFission.hh"
#include "G4NeutronHPFissionData.hh"
#include "G4HadronCaptureProcess.hh"
#include "G4NeutronHPCapture.hh"
#include "G4NeutronHPCaptureData.hh"

PhysicsList::PhysicsList() {}

PhysicsList::~PhysicsList() {}

#include "G4Geantino.hh"
#include "G4Neutron.hh"
#include "G4Gamma.hh"

void PhysicsList::ConstructParticle() {

  G4Geantino::GeantinoDefinition();
  G4Neutron::NeutronDefinition();
  G4Gamma::GammaDefinition();
}

void PhysicsList::ConstructProcess() {

    AddTransportation();

    G4ParticleDefinition* particle = G4Neutron::NeutronDefinition();

    G4ProcessManager* pManager = particle->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);

}

void PhysicsList::SetCuts() {

    SetCutsWithDefault();

}

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

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

1 None: Re: What physics list to use?   (wangphysics - 01 Aug, 2007)
 Add Message Add Message
to: "Re: What physics list to use?"

 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 ]