CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Static Public Member Functions | Static Private Member Functions | Static Private Attributes | Friends
CurrentG4Track Class Reference

#include <CurrentG4Track.h>

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  )
inlinestaticprivate

Definition at line 28 of file CurrentG4Track.h.

References m_track.

Referenced by id(), and track().

29  { if (m_track == 0) throw SimG4Exception("CurrentG4Track requested but not set"); }
static const G4Track * m_track
static int CurrentG4Track::id ( void  )
inlinestatic

Definition at line 21 of file CurrentG4Track.h.

References check(), and m_track.

21 { check(); return m_track->GetTrackID(); }
static const G4Track * m_track
static void check()
void CurrentG4Track::postTracking ( const G4Track *  t)
staticprivate

Definition at line 14 of file CurrentG4Track.cc.

References m_track, and m_tracking.

Referenced by TrackingAction::PostUserTrackingAction().

15 {
16  if (t != m_track)
17  throw SimG4Exception("CurrentG4Track: tracking finishes for a different track");
18  if (!m_tracking)
19  throw SimG4Exception("CurrentG4Track: tracking finishes without having started");
20  m_tracking = false;
21 }
static const G4Track * m_track
static bool m_tracking
void CurrentG4Track::setTrack ( const G4Track *  t)
staticprivate

Definition at line 6 of file CurrentG4Track.cc.

References m_track, m_tracking, and lumiQTWidget::t.

Referenced by TrackingAction::PreUserTrackingAction().

7 {
8  if (m_tracking)
9  throw SimG4Exception("CurrentG4Track: new track set while previous is being tracked");
10  m_track = t;
11  m_tracking = true;
12 }
static const G4Track * m_track
static bool m_tracking
static const G4Track* CurrentG4Track::track ( void  )
inlinestatic

Definition at line 22 of file CurrentG4Track.h.

References check(), and m_track.

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

22 { check(); return m_track; }
static const G4Track * m_track
static void check()

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
staticprivate

Definition at line 24 of file CurrentG4Track.h.

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

bool CurrentG4Track::m_tracking = false
staticprivate

Definition at line 25 of file CurrentG4Track.h.

Referenced by postTracking(), and setTrack().