Message: Re: Altering Example TestEm1 to use GPS to simulate positron source emission Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Re: Altering Example TestEm1 to use GPS to simulate positron source emission  

Forum: Particles
Re: Question Altering Example TestEm1 to use GPS to simulate positron source emission (Matthew Middione)
Re: None Re: Altering Example TestEm1 to use GPS to simulate positron source emission (Vladimir IVANTCHENKO )
Re: None Re: Altering Example TestEm1 to use GPS to simulate positron source emission (Matthew Middione)
Re: Note Re: Altering Example TestEm1 to use GPS to simulate positron source emission (Matthew Middione)
Date: 07 Apr, 2009
From: Rahul Shah <Rahul Shah>

I obtain the same compilation error on trying to replace G4ParticleGun with G4GeneralParticleSource. In short the error says: cannot convert 'G4GeneralParticleSource*' to 'G4ParticleGun* in assignment

My code is quite similar to the earlier one in this thread. Are we missing something obvious? Thanks, Rahul

On Thu, 28 Jun 2007 16:43:08 GMT, Matthew Middione wrote:

> I realized that if I use the GPS then I can just use the gps commands so
> most of the code I wrote in the previous message has been deleted.  
> Here is my code:
> 
>  #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) ;
>  }
> 
> And the error received is as follows:
> 
> Compiling PrimaryGeneratorAction.cc ...
> src/PrimaryGeneratorAction.cc: In constructor `PrimaryGeneratorAction::PrimaryGeneratorAction(DetectorConstruction*)':
> src/PrimaryGeneratorAction.cc:13: error: cannot convert `G4GeneralParticleSource*' to `G4ParticleGun*' in assignment
> make: *** [/home/public/Desktop/TestPR/tmp/Linux-g++/MyTest/PrimaryGeneratorAction.o] Error 1
> 
> Any help would be much appreciated...
> 
> Thanks,
> Matthew Middione
> 

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

1 Feedback: Re: Altering Example TestEm1 to use GPS to simulate positron source emission   (Giovanni Santin - 07 Apr, 2009)
 Add Message Add Message
to: "Re: Altering Example TestEm1 to use GPS to simulate positron source emission "

 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 ]