CMS 3D CMS Logo

CurrentG4Track Class Reference

This class is NOT intended for general use. More...

#include <SimG4Core/Notification/interface/CurrentG4Track.h>

List of all members.

Static Public Member Functions

static int id ()
static const G4Track * track ()

Static Private Member Functions

static void check ()
static void postTracking (const G4Track *)
static void setTrack (const G4Track *)

Static Private Attributes

static const G4Track * m_track = 0
static bool m_tracking = false

Friends

class TrackingAction


Detailed Description

This class is NOT intended for general use.

It provides immediate access to the currently tracked G4Track for places that can't access this information easily, like StackingAction. If an acceptable geant4 mechanism is found for this, this class will be removed.

Definition at line 18 of file CurrentG4Track.h.


Member Function Documentation

static void CurrentG4Track::check ( void   )  [inline, static, private]

Definition at line 28 of file CurrentG4Track.h.

References m_track.

Referenced by id(), and track().

00029     { if (m_track == 0) throw SimG4Exception("CurrentG4Track requested but not set"); }

static int CurrentG4Track::id ( void   )  [inline, static]

Definition at line 21 of file CurrentG4Track.h.

References check(), and m_track.

00021 { check(); return m_track->GetTrackID(); }

void CurrentG4Track::postTracking ( const G4Track *  t  )  [static, private]

Definition at line 14 of file CurrentG4Track.cc.

References m_track, and m_tracking.

Referenced by TrackingAction::PostUserTrackingAction().

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 }

void CurrentG4Track::setTrack ( const G4Track *  t  )  [static, private]

Definition at line 6 of file CurrentG4Track.cc.

References m_track, and m_tracking.

Referenced by TrackingAction::PreUserTrackingAction().

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 }

static const G4Track* CurrentG4Track::track ( void   )  [inline, static]

Definition at line 22 of file CurrentG4Track.h.

References check(), and m_track.

Referenced by StackingAction::ClassifyNewTrack(), and KillSecondariesStackingAction::ClassifyNewTrack().

00022 { check(); return m_track; }


Friends And Related Function Documentation

friend class TrackingAction [friend]

Definition at line 30 of file CurrentG4Track.h.


Member Data Documentation

const G4Track * CurrentG4Track::m_track = 0 [static, private]

Definition at line 24 of file CurrentG4Track.h.

Referenced by check(), id(), postTracking(), setTrack(), and track().

bool CurrentG4Track::m_tracking = false [static, private]

Definition at line 25 of file CurrentG4Track.h.

Referenced by postTracking(), and setTrack().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:17:35 2009 for CMSSW by  doxygen 1.5.4