CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_2_9_HLT1_bphpatch4/src/SimG4Core/Notification/interface/CurrentG4Track.h

Go to the documentation of this file.
00001 #ifndef SimG4Core_CurrentG4Track_H
00002 #define SimG4Core_CurrentG4Track_H
00003 
00004 #include "SimG4Core/Notification/interface/SimG4Exception.h"
00005 
00006 #include "G4Track.hh"
00007 
00008 class TrackingAction;
00009 
00018 class CurrentG4Track 
00019 {
00020 public:
00021     static int id() { check(); return m_track->GetTrackID(); }
00022     static const G4Track * track() { check(); return m_track; }
00023 private:
00024     static const G4Track * m_track;
00025     static bool m_tracking;
00026     static void setTrack(const G4Track *);
00027     static void postTracking(const G4Track *);
00028     static void check() 
00029     { if (m_track == 0) throw SimG4Exception("CurrentG4Track requested but not set"); }
00030     friend class TrackingAction;
00031 };
00032 
00033 #endif