Message: Example B1 Modification Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Example B1 Modification 

Forum: Particles
Date: 04 Feb, 2014
From: Maxwell Dierken <Maxwell Dierken>

Hello Geant4 Users,

I am using geant4-10.0.0 on SLC6 and I am attempting to modify example B1 to use the G$GeneralParticleSource class instead of G4ParticleGun. The GPS User's Manual states that:

G4GeneralParticleSource is used exactly the same way as G4ParticleGun in a Geant4 application. In existing application one can simply change yourPrimaryGeneratorAction by globally replacing "G4ParticleGun" with "G4GeneralParticleSource".

I have replaced all the instances of "G4ParticleGun" with "G4GeneralParticleSource" in all of my project files, however I still receive the following error when trying to compile the application in cmake:

-- Configuring done -- Generating done -- Build files have been written to: /home/apistudent/Desktop/S1.1-build

[apistudent@ip021-146 S1.1-build]$ make

Scanning dependencies of target exampleS1 [ 12%] Building CXX object CMakeFiles/exampleS1.dir/exampleS1.cc.o [ 25%] Building CXX object CMakeFiles/exampleS1.dir/src/S1DetectorConstruction.cc.o [ 37%] Building CXX object CMakeFiles/exampleS1.dir/src/S1EventAction.cc.o [ 50%] Building CXX object CMakeFiles/exampleS1.dir/src/S1ActionInitialization.cc.o [ 62%] Building CXX object CMakeFiles/exampleS1.dir/src/S1RunAction.cc.o /home/apistudent/Desktop/S1/src/S1RunAction.cc: In member function ‘virtual void S1RunAction::EndOfRunAction(const G4Run*)’: /home/apistudent/Desktop/S1/src/S1RunAction.cc:113: error: no matching function for call to ‘G4GeneralParticleSource::GetParticleDefinition() const’ /home/apistudent/Desktop/geant4.10.0-install/include/Geant4/G4GeneralParticleSource.hh:186: note: candidates are: G4ParticleDefinition* G4GeneralParticleSource::GetParticleDefinition() <near match> /home/apistudent/Desktop/S1/src/S1RunAction.cc:115: error: no matching function for call to ‘G4GeneralParticleSource::GetParticleEnergy() const’ /home/apistudent/Desktop/geant4.10.0-install/include/Geant4/G4GeneralParticleSource.hh:203: note: candidates are: G4double G4GeneralParticleSource::GetParticleEnergy() <near match> /home/apistudent/Desktop/geant4.10.0-install/include/Geant4/CLHEP/Units/PhysicalConstants.h: At global scope: /home/apistudent/Desktop/geant4.10.0-install/include/Geant4/CLHEP/Units/PhysicalConstants.h:79: warning: ‘CLHEP::electron_charge’ defined but not used /home/apistudent/Desktop/geant4.10.0-install/include/Geant4/CLHEP/Random/Randomize.h:61: warning: ‘CLHEP::HepRandomGenActive’ defined but not used make[2]: *** [CMakeFiles/exampleS1.dir/src/S1RunAction.cc.o] Error 1 make[1]: *** [CMakeFiles/exampleS1.dir/all] Error 2 make: *** [all] Error 2

[apistudent@ip021-146 S1.1-build]$

I was hoping someone could give me some insight as to why S1RunAction.cc and G4GeneralParticleSource.hh are not communicating.

Thank you in advance.

        -Maxwell

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

1 Feedback: Re: Example B1 Modification   (Gumplinger Peter - 04 Feb, 2014)
(_ Question: Re: Example B1 Modification   (Maxwell Dierken - 05 Feb, 2014)
(_ Feedback: Re: Example B1 Modification   (Gumplinger Peter - 05 Feb, 2014)
(_ None: Re: Example B1 Modification   (Maxwell Dierken - 05 Feb, 2014)
 Add Message Add Message
to: "Example B1 Modification"

 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 ]