Message: Creating an Isotope and applying it to the particle gun Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Creating an Isotope and applying it to the particle gun 

Forum: Particles
Date: 10 Nov, 2010
From: Matthew Gignac <Matthew Gignac>

Hello,

First off I should mention that I am working off an example that was provided by Geant4. It is the novice example, N02. I should also say that I am quite new to Geant4 and C++ in general. I am using Geant4 for a computational physics project in University.
 
So I have managed to create an isotope, but the problem that I am having now, is using this isotope in the 'particle gun.I have created an isotope of Calcium, which I defined in the following manner, 

	G4int z, n;
	G4double a;

	G4Isotope*Calcium = new G4Isotope("Calcium", z=20 , n=40, a=40.08);

When I try to put this isotope into the particle gun, the simulation will not run after it has successfully compiled. In the example, the following is what I am using, which I know is wrong, but do not know how else to go about it, 

G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
G4ParticleDefinition* particle = particleTable->FindParticle("Calcium");
	
  particleGun->SetParticleDefinition(particle);
  particleGun->SetParticleMomentumDirection(G4ThreeVector(0.,0.,1.));
  particleGun->SetParticleEnergy(1.5*GeV);

Any help would be greatly appreciated! 

Cheers,
Matthew 

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

1 None: Re: Creating an Isotope and applying it to the particle gun   (Michael H. Kelsey - 12 Nov, 2010)
1 None: Re: Creating an Isotope and applying it to the particle gun   (Matthew Gignac - 13 Nov, 2010)
(_ None: Re: Creating an Isotope and applying it to the particle gun   (michel maire - 13 Nov, 2010)
(_ None: Re: Creating an Isotope and applying it to the particle gun   (Matthew Gignac - 13 Nov, 2010)
(_ None: Re: Creating an Isotope and applying it to the particle gun   (michel maire - 14 Nov, 2010)
(_ Idea: Re: Creating an Isotope and applying it to the particle gun   (Vladimir Ivanchenko - 14 Nov, 2010)
(_ None: Re: Creating an Isotope and applying it to the particle gun   (Matthew Gignac - 15 Nov, 2010)
(_ Ok: Re: Creating an Isotope and applying it to the particle gun   (Matthew Gignac - 15 Nov, 2010)
2 Question: Re: Creating an Isotope and applying it to the particle gun   (Pierre - 01 Sep, 2014)
1 Idea: Re: Creating an Isotope and applying it to the particle gun   (Michael H. Kelsey - 01 Sep, 2014)
3 Question: Re: Creating an Isotope and applying it to the particle gun   (Baljeet Seniwal - Nov 17, 09:07)
4 Question: Re: Creating an Isotope and applying it to the particle gun   (Baljeet Seniwal - Nov 17, 09:07)
 Add Message Add Message
to: "Creating an Isotope and applying it to the particle gun"

 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 ]