00001 #ifndef SimG4Core_TrackInformationExtractor_H 00002 #define SimG4Core_TrackInformationExtractor_H 00003 00004 #include "SimG4Core/Notification/interface/TrackInformation.h" 00005 #include "SimG4Core/Notification/interface/SimG4Exception.h" 00006 00007 class G4Track; 00008 00020 class TrackInformationExtractor 00021 { 00022 public: 00026 const TrackInformation & operator()(const G4Track & gtk) const; 00027 const TrackInformation & operator()(const G4Track * gtk) const { return operator()(*gtk); } 00031 TrackInformation & operator()(G4Track & gtk) const; 00032 TrackInformation & operator()(G4Track * gtk) const { return operator()(*gtk); } 00033 private: 00034 void missing(const G4Track & gtk) const 00035 { throw SimG4Exception("TrackInformationExtractor: G4Track has no TrackInformation"); } 00036 void wrongType() const 00037 { throw SimG4Exception("User information in G4Track is not of TrackInformation type"); } 00038 }; 00039 00040 #endif