Message: Re: GPS for gamma ray spectrum from radioactive isotope Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: GPS for gamma ray spectrum from radioactive isotope 

Forum: Particles
Re: Question GPS for gamma ray spectrum from radioactive isotope (benny)
Date: 02 Jun, 2014
From: Andrew Pollitt <Andrew Pollitt>

Hi Benny,

I am having similar problems to you. I have a very similar physics list to yours. I am trying to simulate gamma-rays from 60Co radioactive decay.

Could you post a copy of your working PhysicsList.

This is my current PhysicsList.cc file - can anybody spot the reason why it's not working (not simulating Radioactive Decay):

#include "PhysicsList.h"
#include "G4ParticleTypes.hh"
#include "globals.hh"
#include "G4ProcessManager.hh"
#include "G4IonConstructor.hh"

PhysicsList::PhysicsList()
{
  defaultCutValue = 0.05*um;
}

PhysicsList::~PhysicsList() {}

void PhysicsList::ConstructParticle() {

  G4Gamma::GammaDefinition();
  G4Electron::ElectronDefinition();
  G4Positron::PositronDefinition();

  G4Proton::ProtonDefinition();

  G4IonConstructor iConstructor;
  iConstructor.ConstructParticle(); // creates GenericIon, Alpha, Triton, Deuteron and He3

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

  G4Neutron::NeutronDefinition();
}

void PhysicsList::ConstructProcess()
{
  AddTransportation();
  ConstructEM();
  ConstructDecay();
}

#include "G4ComptonScattering.hh"
#include "G4GammaConversion.hh"
#include "G4PhotoElectricEffect.hh"

#include "G4eMultipleScattering.hh"
#include "G4eIonisation.hh"
#include "G4eBremsstrahlung.hh"
#include "G4eplusAnnihilation.hh"

#include "G4hMultipleScattering.hh"
#include "G4hIonisation.hh"
#include "G4hBremsstrahlung.hh"
#include "G4hPairProduction.hh"

#include "G4ionIonisation.hh"

#include "G4RadioactiveDecay.hh"

#include "G4Decay.hh"

#include "G4NeutronHPElastic.hh"
#include "G4NeutronHPInelastic.hh"
#include "G4NeutronHPCapture.hh"

#include "G4PenelopePhotoElectricModel.hh"

#include "G4PenelopeComptonModel.hh"

#include "G4PenelopeGammaConversionModel.hh"

#include "G4PenelopeRayleighModel.hh"

// e-

#include "G4PenelopeIonisationModel.hh"

#include "G4PenelopeBremsstrahlungModel.hh"

// e+

#include "G4PenelopeAnnihilationModel.hh"

void PhysicsList::ConstructEM()
{ 
 /*  G4NeutronInelastic *neutroninelastic = new G4NeutronInelastic();
   neutroninelastic -> SetModel(G4NeutronHPInelastic);
   G4HadronCaptureProcess *hadroncapture = new G4HadronCaptureProcess();
   hadroncapture -> SetModel(G4NeutronHPCapture);
   G4HadronElasticProcess *hadronelastic = new G4HadronElasticProcess();
   hadronelastic -> SetModel(G4NeutronHPElastic);*/

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

    if (particleName == "gamma") {
      // gamma         
      pmanager->AddDiscreteProcess(new G4PhotoElectricEffect);

      pmanager->AddDiscreteProcess(new G4ComptonScattering);
      pmanager->AddDiscreteProcess(new G4GammaConversion);

    } else if (particleName == "e-") {
      //electron
      pmanager->AddProcess(new G4eMultipleScattering, -1, 1, 1);
      pmanager->AddProcess(new G4eIonisation,         -1, 2, 2);
      pmanager->AddProcess(new G4eBremsstrahlung,     -1, 3, 3);      

    } else if (particleName == "e+") {
      //positron
      pmanager->AddProcess(new G4eMultipleScattering, -1, 1, 1);
      pmanager->AddProcess(new G4eIonisation,         -1, 2, 2);
      pmanager->AddProcess(new G4eBremsstrahlung,     -1, 3, 3);
      pmanager->AddProcess(new G4eplusAnnihilation,    0,-1, 4);

    } else if(particleName == "proton") {
      //proton  
      pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
      pmanager->AddProcess(new G4hIonisation,         -1, 2, 2);
      pmanager->AddProcess(new G4hBremsstrahlung,     -1, 3, 3);
      pmanager->AddProcess(new G4hPairProduction,     -1, 4, 4);       

    } else if(particleName == "alpha") {
      //alpha 
      pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
      pmanager->AddProcess(new G4ionIonisation,       -1, 2, 2);

    } else if(particleName == "GenericIon" ) {                        
      //Ions                                                           
      pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);       
      pmanager->AddProcess(new G4ionIonisation,       -1, 2, 2);    
      pmanager->AddProcess(new G4RadioactiveDecay,    -1, 3, 3);

    } /*else if(particleName == "neutron" ) {                        
      //Ions                                                           
      pmanager->AddProcess(new hadronelastic, -1, 1, 1);       
      pmanager->AddProcess(new neutroninelastic, -1, 2, 2);
      pmanager->AddProcess(new hadroncapture, -1, -1, 3);    
      //pmanager->AddProcess(new G4RadioactiveDecay,    -1, 3, 3);

    } */

  }
}

void PhysicsList::ConstructDecay() {

// Declare radioactive decay to the GenericIon in the IonTable.
  //
  const G4IonTable *theIonTable = G4ParticleTable::GetParticleTable()->GetIonTable();  
G4GenericIon* ion = G4GenericIon::GenericIon();
  //Initialize these members to pass the "IsApplicable" method to run "G4RadioactiveDecay"
  // ion->SetAtomicNumber(1);
  //  ion->SetAtomicMass(1);
G4RadioactiveDecay*  theRadioactiveDecay = new G4RadioactiveDecay("RadioactiveDecay");
ion->GetProcessManager()->AddProcess(theRadioactiveDecay, 0, -1, 1);
 //me  ion->GetProcessManager()->AddProcess(theRadioactiveDecay, -1, -1, 3);

  //me
  // Add Decay Process
  G4Decay* theDecayProcess = new G4Decay();

  theParticleIterator->reset();

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

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

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

}

void PhysicsList::SetCuts()
{
  SetVerboseLevel(0);                                         
  SetCutsWithDefault();   
}

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

1 Idea: Re: GPS for gamma ray spectrum from radioactive isotope   (benny - 04 Jun, 2014)
 Add Message Add Message
to: "Re: GPS for gamma ray spectrum from radioactive isotope"

 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 ]