Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Data Fields
DMXStackingAction Class Reference

#include <DMXStackingAction.hh>

Inheritance diagram for DMXStackingAction:
G4UserStackingAction

Public Member Functions

 DMXStackingAction ()
 
virtual ~DMXStackingAction ()
 
virtual G4ClassificationOfNewTrack ClassifyNewTrack (const G4Track *aTrack)
 
virtual void NewStage ()
 
virtual void PrepareNewEvent ()
 
void SetKillGammasFlag (G4bool val)
 
- Public Member Functions inherited from G4UserStackingAction
 G4UserStackingAction ()
 
virtual ~G4UserStackingAction ()
 
void SetStackManager (G4StackManager *value)
 

Data Fields

DMXStackingActionMessengertheMessenger
 

Additional Inherited Members

- Protected Attributes inherited from G4UserStackingAction
G4StackManagerstackManager
 

Detailed Description

Definition at line 53 of file DMXStackingAction.hh.

Constructor & Destructor Documentation

DMXStackingAction::DMXStackingAction ( )

Definition at line 57 of file DMXStackingAction.cc.

References G4TransportationManager::GetNavigatorForTracking(), G4TransportationManager::GetTransportationManager(), and theMessenger.

57  {
58 
59  // new messenger
61 
62  // messenger defaults
63  killGammasFlag = 0;
64 
65  // global geometry navigator
68 }
G4Navigator * GetNavigatorForTracking() const
static G4TransportationManager * GetTransportationManager()
DMXStackingActionMessenger * theMessenger
DMXStackingAction::~DMXStackingAction ( )
virtual

Definition at line 71 of file DMXStackingAction.cc.

References theMessenger.

71  {
72 
73  delete theMessenger;
74 }
DMXStackingActionMessenger * theMessenger

Member Function Documentation

G4ClassificationOfNewTrack DMXStackingAction::ClassifyNewTrack ( const G4Track aTrack)
virtual

Reimplemented from G4UserStackingAction.

Definition at line 78 of file DMXStackingAction.cc.

References fKill, fWaiting, G4cout, G4endl, G4Gamma::GammaDefinition(), G4Track::GetDefinition(), G4VPhysicalVolume::GetName(), and G4Track::GetPosition().

78  {
79 
80 
81  static G4int gammasKilled = 0;
82 
83  G4ClassificationOfNewTrack classification = fWaiting;
84 
85  // Kill gammas from neutrons in concrete wall
86  if(killGammasFlag) {
87  // check if particle is gamma
88  G4ParticleDefinition* particleType = aTrack->GetDefinition();
89  if(particleType==G4Gamma::GammaDefinition()) {
90  // check if particle is in world_phys
91  G4ThreeVector pos = aTrack->GetPosition();
92  G4ThreeVector *ptr = NULL;
93  G4VPhysicalVolume *theVolume;
94  theVolume = gNavigator->LocateGlobalPointAndSetup(pos,ptr,false);
95  if(theVolume->GetName() == "world_phys") {
96  classification = fKill;
97  G4cout << " Total for session Gammas killed in concrete wall (world_phys): "
98  << ++gammasKilled << G4endl;
99  }
100  }
101  }
102 
103  return classification;
104 
105 }
G4ParticleDefinition * GetDefinition() const
const G4ThreeVector & GetPosition() const
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
const G4String & GetName() const
virtual G4VPhysicalVolume * LocateGlobalPointAndSetup(const G4ThreeVector &point, const G4ThreeVector *direction=0, const G4bool pRelativeSearch=true, const G4bool ignoreDirection=true)
Definition: G4Navigator.cc:118
#define G4endl
Definition: G4ios.hh:61
static G4Gamma * GammaDefinition()
Definition: G4Gamma.cc:81
void DMXStackingAction::NewStage ( )
virtual

Reimplemented from G4UserStackingAction.

Definition at line 108 of file DMXStackingAction.cc.

108 {;}
void DMXStackingAction::PrepareNewEvent ( )
virtual

Reimplemented from G4UserStackingAction.

Definition at line 111 of file DMXStackingAction.cc.

111 {;}
void DMXStackingAction::SetKillGammasFlag ( G4bool  val)
inline

Definition at line 73 of file DMXStackingAction.hh.

73 {killGammasFlag = val;};

Field Documentation

DMXStackingActionMessenger* DMXStackingAction::theMessenger

Definition at line 64 of file DMXStackingAction.hh.

Referenced by DMXStackingAction(), and ~DMXStackingAction().


The documentation for this class was generated from the following files: