Problem 571

Summary: Concrete class of G4VUserTrackInformation
Product: Geant4 Reporter: sverker.almehed
Component: trackingAssignee: Katsuya.Amako
Status: RESOLVED INVALID    
Severity: normal CC: sverker.almehed
Priority: P2    
Version: other   
Hardware: PC   
OS: Linux   

Description sverker.almehed 2004-01-27 07:41:06 CET
I am trying to make a concrete class of G4VUserTrackInformation in order
to be able to store some extra variables for each track. but I don't get
it to work.

My TrackInformation header file looks as :
#include "G4Types.hh"
#include "G4VUserTrackInformation.hh"


//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......

class Em2TrackInformation : public G4VUserTrackInformation {

  public:
  //Em2TrackInformation() {Flag=false;};
  Em2TrackInformation();
  ~Em2TrackInformation() {};

  //void SetFlag (G4bool);
  //G4bool GetFlag ();
  //void Print() const=0;

  private:
  //    G4bool Flag;
};

//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......

//inline void   Em2TrackInformation::SetFlag (G4bool b) {Flag = b;};
//inline G4bool Em2TrackInformation::GetFlag () {return Flag;};
//inline void   Em2TrackInformation::Print() const {G4cout<<"
TrackInformation flag : "<<Flag<<G4endl;};
//inline void   Em2TrackInformation::Print() const {G4cout<<"
TrackInformation flag : "<<G4endl;};



I call it from a RunAction with :
    Em2TrackInformation *iTrack = aTrack->GetUserInformation();

and get the following from the compiler :
RunAction.cc:932: type `Em2TrackInformation' is not a base type for type
`G4VUserTrackInformation'

I would be very gratefull if you could tell what is wrong with the code
above.
I have looked for an example of this in the Geant tree but didn't find
any. Do you know of one?

I use Linux and g++ 2.95.3

 Yours  Sverker Almehed Lund
Comment 1 Makoto.Asai 2004-01-27 09:38:59 CET
Em2TrackInformation *iTrack
 = (Em2TrackInformation*)(aTrack->GetUserInformation());
should work.
 Also, please understand that this bug reporting system is
for reporting a bug in Geant4 toolkit. Please use Geant4
HyperNews for questions how to use.