Message: Re: G4GeneralParticleSource problem Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: G4GeneralParticleSource problem 

Forum: Physics List
Re: None G4GeneralParticleSource problem (Jérôme Souin)
Date: 20 Jul, 2007
From: Vladimir IVANTCHENKO <vnivanch@mail.cern.ch>

On Fri, 20 Jul 2007, Jérôme Souin wrote:

> *** Discussion title: Physics List
> Email replies to PublicHyperNews@slac.stanford.edu must include:
>   In-Reply-To: <"/phys-list/394"@geant4-hn.slac.stanford.edu>
>   Subject: ...change this to be about your reply.
> 
> Hi,
> 
> I'm a begginer in Geant4 (8.3) and I want to construct a radioactive
> source of 60Co using G4GeneralParticleSource. I'm following the examples
> 
> : novice N02 and extended exrdm.
> 
> Every thing is ok during the compilation but my nucleus don't decay...
> and the process "Decay" doesn't appear in the list of process??
> 
> Idle> process/list
>      Transportation,                msc,              hIoni,        StepLimiter
>               eIoni,              eBrem,            annihil,               phot
>               compt,               conv,             muIoni,            muBrems
>          muPairProd
> 
> I get only that as result :
> 
> *********************************************************************************************************
> * G4Track Information:   Particle = Co60[0.0],   Track ID = 1,   Parent ID = 0
> *********************************************************************************************************
> 
> Step#      X         Y         Z        KineE    dEStep   StepLeng  TrakLeng    Volume     Process
>     0      0 fm      0 fm      0 fm      0 eV      0 eV      0 fm      0 fm   physicopper    initStep
> 
> #Step#      X         Y         Z        KineE    dEStep   StepLeng  TrakLeng    Volume     Process
>     1      0 fm      0 fm      0 fm      0 eV      0 eV      0 fm      0 fm   physicopper   UserLimit
> Track (trackID 1, parentID 0) is processed with stopping code 2
> 
> In my PhysicList I have :
> 
> #include "globals.hh"
> #include "ExPerso2PhysicsList.hh"
> 
> #include "G4ProcessManager.hh"
> #include "G4ParticleTypes.hh"
> 
> //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
> 
> ExPerso2PhysicsList::ExPerso2PhysicsList():  G4VUserPhysicsList()
> {
>   defaultCutValue = 1.0*cm;
>    SetVerboseLevel(1);
> }
> 
> //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
> 
> ExPerso2PhysicsList::~ExPerso2PhysicsList() {}
> 
> //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
> 
> void ExPerso2PhysicsList::ConstructParticle()
> {
>   // In this method, static member functions should be called
>   // for all particles which you want to use.
>   // This ensures that objects of these particle types will be
>   // created in the program. 
> 
>   ConstructBosons();
>   ConstructLeptons();
>   ConstructBaryons();
> }
> 
> //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
> 
> void ExPerso2PhysicsList::ConstructBosons()
> {
>   // pseudo-particles
>   G4Geantino::GeantinoDefinition();
>   G4ChargedGeantino::ChargedGeantinoDefinition();
> 
>   // gamma
>   G4Gamma::GammaDefinition();
> }
> 
> //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
> 
> void ExPerso2PhysicsList::ConstructLeptons()
> {
>   // leptons
>   //  e+/-
>   G4Electron::ElectronDefinition();
>   G4Positron::PositronDefinition();
>   // mu+/-
>   G4MuonPlus::MuonPlusDefinition();
>   G4MuonMinus::MuonMinusDefinition();
>   // nu_e
>   G4NeutrinoE::NeutrinoEDefinition();
>   G4AntiNeutrinoE::AntiNeutrinoEDefinition();
>   // nu_mu
>   G4NeutrinoMu::NeutrinoMuDefinition();
>   G4AntiNeutrinoMu::AntiNeutrinoMuDefinition();
> }
> 
> //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
> 
> void ExPerso2PhysicsList::ConstructBaryons()
> {
>   //  barions
>   G4Proton::ProtonDefinition();
>   G4AntiProton::AntiProtonDefinition();
> 
>   G4Neutron::NeutronDefinition();
>   G4AntiNeutron::AntiNeutronDefinition();
> }
> //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
> 
> void ExPerso2PhysicsList::ConstructProcess()
> {
>   AddTransportation();
>   ConstructEM();
>   ConstructGeneral();
> }
> 
> //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
> 
> #include "G4ComptonScattering.hh"
> #include "G4GammaConversion.hh"
> #include "G4PhotoElectricEffect.hh"
> 
> #include "G4MultipleScattering.hh"
> 
> #include "G4eIonisation.hh"
> #include "G4eBremsstrahlung.hh"
> #include "G4eplusAnnihilation.hh"
> 
> #include "G4MuIonisation.hh"
> #include "G4MuBremsstrahlung.hh"
> #include "G4MuPairProduction.hh"
> 
> #include "G4hIonisation.hh"
> 
> #include "G4StepLimiter.hh"
> #include "G4UserSpecialCuts.hh"
> 
> //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
> 
> void ExPerso2PhysicsList::ConstructEM()
> {
>   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 G4MultipleScattering,-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 G4MultipleScattering,-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 == "mu+" || 
>                particleName == "mu-"    ) {
>       //muon  
>       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 ((!particle->IsShortLived()) &&
>                (particle->GetPDGCharge() != 0.0) && 
>                (particle->GetParticleName() != "chargedgeantino")) {
>       //all others charged particles except geantino
>       pmanager->AddProcess(new G4MultipleScattering,-1, 1,1);
>       pmanager->AddProcess(new G4hIonisation,       -1, 2,2);
>       //step limit
>       pmanager->AddProcess(new G4StepLimiter,       -1,-1,3);         
>       ///pmanager->AddProcess(new G4UserSpecialCuts,   -1,-1,4);  
>     }
>   }       
> 
> }
> 
> //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
> 
> #include "G4GenericIon.hh"
> #include "G4RadioactiveDecay.hh"
> #include "G4ParticleDefinition.hh"
> #include "G4ParticleTable.hh"
> 
> void ExPerso2PhysicsList::ConstructGeneral() {
> 
>      const G4IonTable     *theIonTable =  G4ParticleTable::GetParticleTable()->GetIonTable();
>      G4RadioactiveDecay*   theRadioactiveDecay  = new G4RadioactiveDecay();
> 
>     for (G4int i=0; i<theIonTable->Entries(); i++) 
>     {   
>       G4ParticleDefinition* ionparticle = theIonTable->GetParticle(i);
>       G4String particleName = theIonTable->GetParticle(i)->GetParticleName();
>       if (particleName == "GenericIon") 
>       {
>          G4ProcessManager* ionpmanager = ionparticle->GetProcessManager();
>          ionpmanager->SetVerboseLevel(3);
>          ionpmanager->AddProcess(theRadioactiveDecay);
>          ionpmanager->SetProcessOrdering(theRadioactiveDecay, idxPostStep, 1);
>          ionpmanager->SetProcessOrdering(theRadioactiveDecay, idxAtRest, 1);
>      } 
>     }
> }
> 
> //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
> 
> void ExPerso2PhysicsList::SetCuts()
> {
>   //G4VUserPhysicsList::SetCutsWithDefault method sets 
>   //the default cut value for all particle types 
>   //
>   SetCutsWithDefault();
> 
> if (verboseLevel>0) DumpCutValuesTable(); }
> 
> Thank you for your help,
> 
> J.
> 

Please, consult $G4INSTALL/examples/extended/eventgenerator/exgps

VI

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

1 None: G4GeneralParticleSource problem   (Jérôme Souin - 20 Jul, 2007)
(_ None: Re: G4GeneralParticleSource problem   (Vladimir IVANTCHENKO - 20 Jul, 2007)
(_ None: Re: G4GeneralParticleSource problem   (Jérôme Souin - 26 Jul, 2007)
(_ None: Re: G4GeneralParticleSource problem   (Vladimir IVANTCHENKO - 26 Jul, 2007)
 Add Message Add Message
to: "Re: G4GeneralParticleSource problem"

 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 ]