CMS 3D CMS Logo

Static Public Member Functions | Static Private Member Functions | Static Private Attributes | Friends

CurrentG4Track Class Reference

#include <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().

    { 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.

{ 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().

{
    if (t != m_track)
        throw SimG4Exception("CurrentG4Track: tracking finishes for a different track");
    if (!m_tracking)
        throw SimG4Exception("CurrentG4Track: tracking finishes without having started");
    m_tracking = false;
}
void CurrentG4Track::setTrack ( const G4Track *  t) [static, private]

Definition at line 6 of file CurrentG4Track.cc.

References m_track, m_tracking, and matplotRender::t.

Referenced by TrackingAction::PreUserTrackingAction().

{
    if (m_tracking) 
        throw SimG4Exception("CurrentG4Track: new track set while previous is being tracked");
    m_track = t;
    m_tracking = true;
}
static const G4Track* CurrentG4Track::track ( void  ) [inline, static]

Definition at line 22 of file CurrentG4Track.h.

References check(), and m_track.

{ 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().