Message: Modifying example TestEm1 to utilize the GPS instead of particle gun Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Modifying example TestEm1 to utilize the GPS instead of particle gun 

Keywords: TestEm1, GPS vs ParticleGun, Positron Range in Magnetic Field
Forum: Event and Track Management
Date: 28 Jun, 2007
From: Matthew Middione <middionematt@csufresno.edu>

I am interested in tracking the effects of positrons traveling in a 
transverse magnetic field.

To model this, I am using the example TestEm1 which is located in:
Geant4/geant4.8.2.p01/examples/extended/electromagnetic/TestEm1

I have created a copy of this example simulation and entitles it MyTest.  
This example has everything I need as far as the Detector Construction and 
Magnetic Field goes, but it utilizes a particle gun.  This would be great
if I were modeling monoentergetic positrons, but I am in the need of 
modeling the entire spectra for a given positron emitting radionuclide.

Using F-18 as an example, I would like to use the GPS to create an positron
emitting F-18 ion in a surrounding volume of tissue like material 
(which I have constructed).  I want the entire energy spectra of F-18 from 
0 to 0.64 Mev to be accounted for.  The reason I need the entire spectra 
is because I am attempting to look at the effects of the range that the 
positrons travel from the F-18 source when they are introduced to a 
transverse magnetic field.  F-18 has a continuous energy spectra with 
different probabilities of energy occurrence along the spectra and I want
this accounted for.  This is why a monoentergetic model will not work.

I have altered the TestEm1 example and everything runs and compiles 
correctly, but the problem arises during the linking.

Here is the error message I am receiving:
Linking MyTest ...
/home/public/Desktop/TestPR/tmp/Linux-g++/MyTest/libMyTest.a(RunAction.o)(.text+0xdf): In function `RunAction::EndOfRunAction(G4Run const*)':
: undefined reference to `PrimaryGeneratorAction::GetParticleGun()'
/home/public/Desktop/TestPR/tmp/Linux-g++/MyTest/libMyTest.a(RunAction.o)(.text+0x10d): In function `RunAction::EndOfRunAction(G4Run const*)':
: undefined reference to `PrimaryGeneratorAction::GetParticleGun()'
/home/public/Desktop/TestPR/tmp/Linux-g++/MyTest/libMyTest.a(TrackingAction.o)(.text+0xdb): In function `TrackingAction::PostUserTrackingAction(G4Track const*)':
: undefined reference to `PrimaryGeneratorAction::GetParticleGun()'
collect2: ld returned 1 exit status
make: *** [/home/public/Desktop/TestPR/bin/Linux-g++/MyTest] Error 1

Any idea of what I can do to alleviate this issue.  

Here is my PrimaryGeneratorAction.cc
#include "PrimaryGeneratorAction.hh"

#include "G4Event.hh"
#include "G4GeneralParticleSource.hh"
#include "G4ParticleTable.hh"
#include "G4ParticleDefinition.hh"
#include "globals.hh"

PrimaryGeneratorAction::PrimaryGeneratorAction()
{
   particleGun = new G4GeneralParticleSource();
}

PrimaryGeneratorAction::~PrimaryGeneratorAction()
{
  delete particleGun;
}

void PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
{
  particleGun->GeneratePrimaryVertex(anEvent) ;
}

I can provide you with my other files if need be, but I elected not
to make this question any longer than it already is.

I sincerely appreciate your time and efforts.

Thanks in anticipation,
Matthew Middione

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

 Add Message Add Message
to: "Modifying example TestEm1 to utilize the GPS instead of 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 ]