Message: physics list from 4.7.1->4.8.0 Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None physics list from 4.7.1->4.8.0 

Forum: Physics List
Date: 26 Jul, 2006
From: Marie-Helene <marie-helene.genest@umontreal.ca>

Hi,
I am trying to use 4.8.0 instead of 4.7.1. Everythig compiles without
warning so I thought I wouldn't have to change anything to my physics
list, but then I receive a segmentation fault when I try to run it...
I put below what gdb gives me and my Physics list. 
What should I change?
Thanks,
MH
-------------------------------------------------
Program received signal SIGSEGV, Segmentation fault.
0x095cb6f7 in G4ProcessManager::AddProcess (this=0x0, aProcess=0x1b306068, ordAtRestDoIt=-1, ordAlongStepDoIt=-1,
    ordPostStepDoIt=1000) at src/G4ProcessManager.cc:386
386       if (  !aProcess->IsApplicable(*theParticleType) ) {
(gdb) where
#0  0x095cb6f7 in G4ProcessManager::AddProcess (this=0x0, aProcess=0x1b306068, ordAtRestDoIt=-1, ordAlongStepDoIt=-1,
    ordPostStepDoIt=1000) at src/G4ProcessManager.cc:386
#1  0x00fb9f46 in G4ProcessManager::AddDiscreteProcess (this=0x0, aProcess=0x1b306068, ord=1000)
    at /cern/geant/slc3/4.8.0/src/geant4/source/processes/management/include/G4ProcessManager.icc:155
#2  0x00fb80d0 in detPhysicsList::ConstructEM (this=0x9bdd520) at src/detPhysicsList.cc:246
#3  0x00fb6b8d in detPhysicsList::ConstructProcess (this=0x9bdd520) at src/detPhysicsList.cc:148
#4  0x004e013b in G4VUserPhysicsList::Construct (this=0x9bdd520) at include/G4VUserPhysicsList.hh:323
#5  0x004de649 in G4RunManagerKernel::InitializePhysics (this=0x9bc8838) at src/G4RunManagerKernel.cc:249
#6  0x004e2a59 in G4RunManager::InitializePhysics (this=0x9bc87c8) at src/G4RunManager.cc:332
#7  0x004e294c in G4RunManager::Initialize (this=0x9bc87c8) at src/G4RunManager.cc:310
#8  0x004e9228 in G4RunMessenger::SetNewValue (this=0x9bd75d0, command=0x9bd76f0, newValue=
      {<std::string> = {static npos = 4294967295, _M_dataplus = {<std::allocator<char>> = {<No data fields>}, _M_p = 0x93fcd8c ""}, static _S_empty_rep_storage = {0, 0, 2857, 0}}, _vptr.G4String = 0x804c998}) at src/G4RunMessenger.cc:276
#9  0x018f71ce in G4UIcommand::DoIt (this=0x9bd76f0, parameterList=
      {<std::string> = {static npos = 4294967295, _M_dataplus = {<std::allocator<char>> = {<No data fields>}, _M_p = 0x93fcd8c ""}, static _S_empty_rep_storage = {0, 0, 2857, 0}}, _vptr.G4String = 0x804c998}) at src/G4UIcommand.cc:207
#10 0x01909f2b in G4UImanager::ApplyCommand (this=0x9bc8e18, aCmd=0xbfffccc0 "/run/initialize") at src/G4UImanager.cc:396
#11 0x018ee8b6 in G4UIbatch::SessionStart (this=0x9bf8ba8) at src/G4UIbatch.cc:89
#12 0x01908716 in G4UImanager::ExecuteMacroFile (this=0x9bc8e18, fileName=0x9bf670c "mac.mac") at src/G4UImanager.cc:219
#13 0x01905c7a in G4UIcontrolMessenger::SetNewValue (this=0x9bc8fb8, command=0x9bc90b0, newValue=
      {<std::string> = {static npos = 4294967295, _M_dataplus = {<std::allocator<char>> = {<No data fields>}, _M_p = 0x9bf670c "mac.mac"}, static _S_empty_rep_storage = {0, 0, 2857, 0}}, _vptr.G4String = 0x804c998}) at src/G4UIcontrolMessenger.cc:172
#14 0x018f71ce in G4UIcommand::DoIt (this=0x9bc90b0, parameterList=
      {<std::string> = {static npos = 4294967295, _M_dataplus = {<std::allocator<char>> = {<No data fields>}, _M_p = 0x9bf66c4 "mac.mac"}, static _S_empty_rep_storage = {0, 0, 2857, 0}}, _vptr.G4String = 0x804c998}) at src/G4UIcommand.cc:207
#15 0x01909f2b in G4UImanager::ApplyCommand (this=0x9bc8e18, aCmd=0x9bf0784 "/control/execute mac.mac")
    at src/G4UImanager.cc:396
#16 0x0190991e in G4UImanager::ApplyCommand (this=0x9bc8e18, aCmd=Cannot access memory at address 0x0
) at src/G4UImanager.cc:340
-----------------------------------------------------
#include "detPhysicsList.hh"
#include "globals.hh"
#include "G4ParticleDefinition.hh"
#include "G4ParticleWithCuts.hh"
#include "G4ProcessManager.hh"
#include "G4ProcessVector.hh"
#include "G4ParticleTypes.hh"
#include "G4ParticleTable.hh"
#include "G4BosonConstructor.hh"
#include "G4LeptonConstructor.hh"
#include "G4MesonConstructor.hh"
#include "G4BaryonConstructor.hh"
#include "G4IonConstructor.hh"
#include "G4ShortLivedConstructor.hh"
#include "G4Material.hh"
#include "G4MaterialTable.hh"
#include "G4ios.hh"
#include <stdlib.h>
#include "G4FastSimulationManagerProcess.hh"

//Hadronic Processes
#include "G4HadronElasticProcess.hh"
#include "G4PionMinusInelasticProcess.hh"
#include "G4PionPlusInelasticProcess.hh"
#include "G4ProtonInelasticProcess.hh"
#include "G4AntiProtonInelasticProcess.hh"
#include "G4NeutronInelasticProcess.hh"
#include "G4AntiNeutronInelasticProcess.hh"
#include "G4AlphaInelasticProcess.hh"
#include "G4PreCompoundModel.hh"
#include "G4ExcitationHandler.hh"

#include "G4LElastic.hh"
#include "G4LEPionPlusInelastic.hh"
#include "G4LEPionMinusInelastic.hh"
#include "G4LEProtonInelastic.hh"
#include "G4LEAntiProtonInelastic.hh"
#include "G4LENeutronInelastic.hh"
#include "G4LEAntiNeutronInelastic.hh"
#include "G4LEAlphaInelastic.hh"
#include "G4PiMinusAbsorptionAtRest.hh"

// -- low energy neutron models
#include "G4NeutronHPElastic.hh"
#include "G4NeutronHPElasticData.hh"
#include "G4NeutronHPInelastic.hh"
#include "G4NeutronHPInelasticData.hh"
#include "G4NeutronHPCapture.hh"
#include "G4NeutronHPCaptureData.hh"
#include "G4NeutronHPFission.hh"
#include "G4NeutronHPFissionData.hh"
 #include "G4NeutronHPCapture.hh"
 #include "G4NeutronHPCaptureData.hh"
 #include "G4LCapture.hh"
 #include "G4LENeutronInelastic.hh"
// -- Isotope Production
 #include "G4NeutronIsotopeProduction.hh"

// Cross Sections
#include "G4ProtonInelasticCrossSection.hh"
#include "G4NeutronInelasticCrossSection.hh"
#include "G4NeutronHPElasticData.hh"
#include "G4NeutronHPInelasticData.hh"
#include "G4NeutronHPFissionData.hh"
#include "G4NeutronHPCaptureData.hh"
#include "G4HadronElasticDataSet.hh"

detPhysicsList::detPhysicsList() : G4VUserPhysicsList()
{
	  defaultCutValue = 0.01*mm;

	    SetVerboseLevel(1);
}

detPhysicsList::~detPhysicsList()
{
}

//Construct Particles
void detPhysicsList::ConstructParticle()
{
    ConstructMyBosons();
    ConstructMyLeptons();
    ConstructMyMesons();
    ConstructMyBaryons();
    ConstructMyIons();
}

//Construct Bosons
void detPhysicsList::ConstructMyBosons()
{
//gamma
  G4Gamma::GammaDefinition();
  }

 //Construct Leptons
 void detPhysicsList::ConstructMyLeptons()
 {
   G4Electron::ElectronDefinition();
   G4Positron::PositronDefinition();

   G4NeutrinoE::NeutrinoEDefinition();
   G4AntiNeutrinoE::AntiNeutrinoEDefinition();
 }

 //Construct Mesons
 void detPhysicsList::ConstructMyMesons()
 {
   G4PionPlus::PionPlusDefinition();
   G4PionMinus::PionMinusDefinition();
   G4PionZero::PionZeroDefinition();
 }

 //Construct Baryons
 void detPhysicsList::ConstructMyBaryons()
 {
  G4Proton::ProtonDefinition();
  G4AntiProton::AntiProtonDefinition();
  G4Neutron::NeutronDefinition();
  G4AntiNeutron::AntiNeutronDefinition();
 }

//Construct Ions
void detPhysicsList::ConstructMyIons()
{
  G4Alpha::AlphaDefinition();
  G4GenericIon::GenericIonDefinition();
} 
 
//Construct Processes
void detPhysicsList::ConstructProcess()
{
  AddTransportation();
   
  ConstructEM();
  ConstructHad();
  ConstructGeneral();
}

//Electromagnetic Processes
// All particles
#include "G4MultipleScattering.hh"

//gamma
#include "G4LowEnergyRayleigh.hh"
#include "G4LowEnergyPhotoElectric.hh"
#include "G4LowEnergyCompton.hh"
#include "G4LowEnergyGammaConversion.hh"

#include "G4LowEnergyIonisation.hh"
#include "G4LowEnergyBremsstrahlung.hh"

//e+
#include "G4eIonisation.hh"
#include "G4eBremsstrahlung.hh"
#include "G4eplusAnnihilation.hh"

//mu-
#include "G4MuIonisation.hh"
#include "G4MuBremsstrahlung.hh"
#include "G4MuPairProduction.hh"

// Ions
#include "G4hLowEnergyIonisation.hh"
#include "G4hIonisation.hh"
#include "G4ionIonisation.hh"

void detPhysicsList::ConstructEM()
{
  theParticleIterator->reset();
  while((*theParticleIterator)())
	   {
	     G4ParticleDefinition* particle = theParticleIterator->value();
             G4ProcessManager* pmanager = particle->GetProcessManager();
             G4String particleName = particle->GetParticleName();
             G4String particleType = particle->GetParticleType();
             G4double charge = particle->GetPDGCharge();

    //processes
   if(particleName == "gamma") {
        G4LowEnergyPhotoElectric* lowePhot = new G4LowEnergyPhotoElectric();
        pmanager->AddDiscreteProcess(new G4LowEnergyRayleigh());
        pmanager->AddDiscreteProcess(lowePhot);
        pmanager->AddDiscreteProcess(new G4LowEnergyCompton());
        pmanager->AddDiscreteProcess(new G4LowEnergyGammaConversion());
       }
    else if (particleName == "e-") {
        G4LowEnergyIonisation* loweIon = new G4LowEnergyIonisation();
        G4LowEnergyBremsstrahlung* loweBrem = new G4LowEnergyBremsstrahlung();
        G4MultipleScattering* aMultipleScattering = new G4MultipleScattering();
        loweIon->SetCutForLowEnSecPhotons(15*eV);
        loweIon->SetCutForLowEnSecElectrons(15*eV);
        pmanager->AddProcess(aMultipleScattering,-1,1,1);
        pmanager->AddProcess(loweIon,-1,2,2);
        pmanager->AddProcess(loweBrem,-1,-1,3);
						       }
    else if (particleName == "e+") {
        G4LowEnergyIonisation* loweIon = new G4LowEnergyIonisation();
        G4LowEnergyBremsstrahlung* loweBrem = new G4LowEnergyBremsstrahlung();
        G4MultipleScattering* aMultipleScattering = new G4MultipleScattering();
        pmanager->AddProcess(aMultipleScattering,-1,1,1);
        pmanager->AddProcess(loweIon,-1,2,2);
        pmanager->AddProcess(loweBrem,-1,-1,3);
        pmanager->AddProcess(new G4eplusAnnihilation,   0,-1,4);
							      }
    else if (particleName == "mu-") {
      pmanager->AddProcess(new G4MultipleScattering, -1, 1, 1);
      pmanager->AddProcess(new G4MuIonisation,       -1, 2, 2);
      pmanager->AddProcess(new G4MuBremsstrahlung,   -1, 3, 3);
      pmanager->AddProcess(new G4MuPairProduction,   -1, 4, 4);
    							      }
    else if (particleName == "alpha") {
        G4MultipleScattering* aMultipleScattering = new G4MultipleScattering();
        G4ionIonisation* ahadronEIon = new G4ionIonisation();
        pmanager->AddProcess(aMultipleScattering,-1,1,1);
        pmanager->AddProcess(ahadronEIon,-1,2,2);
							     }

    else if (particleName == "proton" || particleName == "anti_proton") {
        G4MultipleScattering* aMultipleScattering = new G4MultipleScattering();
        G4hIonisation* ahadronIon = new G4hIonisation();
	pmanager->AddProcess(aMultipleScattering,-1,1,1);
        pmanager->AddProcess(ahadronIon,-1,2,2);
				                	      }

    else if (particleName == "GenericIon" || (particleType == "nucleus" && charge != 0)) {

        G4ionIonisation* ahadronEIon = new G4ionIonisation();
        G4HadronElasticProcess* theElasticProcess = new G4HadronElasticProcess();
        G4LElastic * IonLEElastic = new G4LElastic();
        theElasticProcess->RegisterMe(IonLEElastic);
        pmanager->AddDiscreteProcess(theElasticProcess);
        pmanager->AddProcess(ahadronEIon,-1,2,2);

    						              }
   }
}


void detPhysicsList::ConstructHad()
{
    G4HadronElasticProcess* theElasticProcess = new G4HadronElasticProcess;
    G4LElastic* theElasticModel = new G4LElastic;  
    theElasticProcess->RegisterMe(theElasticModel);

    theParticleIterator->reset();
    while((*theParticleIterator)()) 
    {
     G4ParticleDefinition* particle = theParticleIterator->value();
     G4ProcessManager* pmanager = particle->GetProcessManager();
     G4String particleName = particle->GetParticleName();
     if (particleName == "proton") {
      pmanager->AddDiscreteProcess(theElasticProcess);
       G4ProtonInelasticProcess* theInelasticProcess = new G4ProtonInelasticProcess("inelastic");
       G4LEProtonInelastic* theLEInelasticModel = new G4LEProtonInelastic;
       theInelasticProcess->RegisterMe(theLEInelasticModel);
       G4ProtonInelasticCrossSection* theProtonData1 = new G4ProtonInelasticCrossSection;
        theInelasticProcess->AddDataSet(theProtonData1); 
       pmanager->AddDiscreteProcess(theInelasticProcess);
     }
    else if (particleName == "anti_proton") {
       pmanager->AddDiscreteProcess(theElasticProcess);
       G4AntiProtonInelasticProcess* theInelasticProcess = new G4AntiProtonInelasticProcess("inelastic");
       G4LEAntiProtonInelastic* theLEInelasticModel = new G4LEAntiProtonInelastic;
       theInelasticProcess->RegisterMe(theLEInelasticModel);
       pmanager->AddDiscreteProcess(theInelasticProcess);
							       }
    else if (particleName == "neutron") {
        // Inelastic
        G4NeutronInelasticProcess* theInelasticProcess = new G4NeutronInelasticProcess("inelastic");

        //PreEquilibrium
        G4PreCompoundModel * thePreEquilib = new G4PreCompoundModel(new G4ExcitationHandler);
        theInelasticProcess->RegisterMe(thePreEquilib);
        G4NeutronHPInelasticData* theNeutronData1 = new G4NeutronHPInelasticData;
        theInelasticProcess->AddDataSet(theNeutronData1);
	// Isotope production
        G4NeutronIsotopeProduction* theNeutronIsotopeProduction = new G4NeutronIsotopeProduction;
        theInelasticProcess->RegisterIsotopeProductionModel(theNeutronIsotopeProduction);
        pmanager->AddDiscreteProcess(theInelasticProcess);
	// Capture
        G4HadronCaptureProcess* theCaptureProcess = new G4HadronCaptureProcess;
        G4NeutronHPCapture* theLENeutronCaptureModel = new G4NeutronHPCapture;
        theCaptureProcess->RegisterMe(theLENeutronCaptureModel);
        G4NeutronHPCaptureData* theNeutronData3 = new G4NeutronHPCaptureData;
        theCaptureProcess->AddDataSet(theNeutronData3);
        pmanager->AddDiscreteProcess(theCaptureProcess);

      // elastic scattering
         G4HadronElasticProcess* theNeutronElasticProcess = new G4HadronElasticProcess;
         G4LElastic* theElasticModel1 = new G4LElastic;
         G4NeutronHPElastic * theElasticNeutron = new G4NeutronHPElastic;
         theNeutronElasticProcess->RegisterMe(theElasticModel1);
         theElasticModel1->SetMinEnergy(19*MeV);
         theNeutronElasticProcess->RegisterMe(theElasticNeutron);
         G4NeutronHPElasticData * theNeutronData = new G4NeutronHPElasticData;
         theNeutronElasticProcess->AddDataSet(theNeutronData);
         pmanager->AddDiscreteProcess(theNeutronElasticProcess);
      }
    else if (particleName == "anti_neutron") {
	pmanager->AddDiscreteProcess(theElasticProcess);
	G4AntiNeutronInelasticProcess* theInelasticProcess = new G4AntiNeutronInelasticProcess("inelastic");
	G4LEAntiNeutronInelastic* theLEInelasticModel = new G4LEAntiNeutronInelastic;
	theInelasticProcess->RegisterMe(theLEInelasticModel);
        pmanager->AddDiscreteProcess(theInelasticProcess);
      }
    else if (particleName == "alpha") {
        G4HadronElasticProcess* theAlphaElasticProcess = new G4HadronElasticProcess;
        G4LElastic * theAlphaLEElastic = new G4LElastic();	
        theAlphaElasticProcess->RegisterMe(theAlphaLEElastic);
	G4HadronElasticDataSet* theHadronData = (new G4HadronElasticDataSet);
        theAlphaElasticProcess->AddDataSet(theHadronData);
	pmanager->AddDiscreteProcess(theAlphaElasticProcess);
	pmanager->AddDiscreteProcess(theElasticProcess);
	G4AlphaInelasticProcess* theInelasticProcess = new G4AlphaInelasticProcess("inelastic");
	G4LEAlphaInelastic* theLEInelasticModel = new G4LEAlphaInelastic;
	theInelasticProcess->RegisterMe(theLEInelasticModel);
        pmanager->AddDiscreteProcess(theInelasticProcess);
      }
   }
}

#include "G4Decay.hh"
#include "G4StepLimiter.hh"
#include "G4ParticleTable.hh"
void detPhysicsList::ConstructGeneral()
{
  G4Decay* theDecayProcess = new G4Decay();
  theParticleIterator->reset();
  while((*theParticleIterator)())
  {
    G4ParticleDefinition* particle = theParticleIterator->value();
    G4ProcessManager* pmanager = particle->GetProcessManager();
    if (theDecayProcess->IsApplicable(*particle)) {
     pmanager->AddProcess(theDecayProcess);
     pmanager->SetProcessOrdering(theDecayProcess,idxPostStep);
     pmanager->SetProcessOrdering(theDecayProcess,idxAtRest);
    }
  }

  G4ParticleTable* ptbl = G4ParticleTable::GetParticleTable();
  G4ParticleTable::G4PTblDicIterator* piter = ptbl->GetIterator();
  G4StepLimiter* slim = new G4StepLimiter("StepLimiter");    
  piter->reset();
  while ( (*piter)() ) {
    G4ParticleDefinition* pdef = piter->value();
    G4ProcessManager* pmgr = pdef->GetProcessManager();

  // add user limit processes for steps
  if(pmgr) {
    pmgr->AddDiscreteProcess(slim);
  }
}
}

void detPhysicsList::SetCuts()
{
    SetCutsWithDefault();
}






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

1 None: Re: physics list from 4.7.1->4.8.0   (Vladimir IVANTCHENKO - 26 Jul, 2006)
 Add Message Add Message
to: "physics list from 4.7.1->4.8.0"

 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 ]