Problem 571 - Concrete class of G4VUserTrackInformation
Summary: Concrete class of G4VUserTrackInformation
Status: RESOLVED INVALID
Alias: None
Product: Geant4
Classification: Unclassified
Component: tracking (show other problems)
Version: other
Hardware: PC Linux
: P2 normal
Assignee: Katsuya.Amako
URL:
Depends on:
Blocks:
 
Reported: 2004-01-27 07:41 CET by sverker.almehed
Modified: 2004-01-27 11:33 CET (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
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.