CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_9/src/SimG4Core/Notification/src/CurrentG4Track.cc

Go to the documentation of this file.
00001 #include "SimG4Core/Notification/interface/CurrentG4Track.h"
00002 
00003 const G4Track * CurrentG4Track::m_track = 0;
00004 bool CurrentG4Track::m_tracking = false;
00005 
00006 void CurrentG4Track::setTrack(const G4Track * t)
00007 {
00008     if (m_tracking) 
00009         throw SimG4Exception("CurrentG4Track: new track set while previous is being tracked");
00010     m_track = t;
00011     m_tracking = true;
00012 }
00013 
00014 void CurrentG4Track::postTracking(const G4Track * t) 
00015 {
00016     if (t != m_track)
00017         throw SimG4Exception("CurrentG4Track: tracking finishes for a different track");
00018     if (!m_tracking)
00019         throw SimG4Exception("CurrentG4Track: tracking finishes without having started");
00020     m_tracking = false;
00021 }
00022