Geant4  10.02.p03
XPhononStackingAction Class Reference

#include <XPhononStackingAction.hh>

Inheritance diagram for XPhononStackingAction:
Collaboration diagram for XPhononStackingAction:

Public Member Functions

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

Additional Inherited Members

- Protected Attributes inherited from G4UserStackingAction
G4StackManagerstackManager
 

Detailed Description

Definition at line 39 of file XPhononStackingAction.hh.

Constructor & Destructor Documentation

◆ XPhononStackingAction()

XPhononStackingAction::XPhononStackingAction ( )

Definition at line 50 of file XPhononStackingAction.cc.

50 {;}

◆ ~XPhononStackingAction()

XPhononStackingAction::~XPhononStackingAction ( )
virtual

Definition at line 54 of file XPhononStackingAction.cc.

54 {;}

Member Function Documentation

◆ ClassifyNewTrack()

G4ClassificationOfNewTrack XPhononStackingAction::ClassifyNewTrack ( const G4Track *  aTrack)
virtual

Reimplemented from G4UserStackingAction.

Definition at line 59 of file XPhononStackingAction.cc.

59  {
60  G4ClassificationOfNewTrack classification = fUrgent;
61 
62  if (aTrack->GetParentID() == 0) {
63  //Obtain LatticeManager for phonon dynamics
65 
66  G4int pol = G4PhononPolarization::Get(aTrack->GetDefinition());
67 
68  //Compute random wave-vector (override whatever ParticleGun did)
70 
71  //Store wave-vector as track information
73  theKmap->SetK(aTrack, Ran);
74 
75  //Compute direction of propagation from wave vector
76  G4ThreeVector momentumDir = LM->MapKtoVDir(aTrack->GetVolume(), pol, Ran);
77 
78  //Compute true velocity of propagation
79  G4double velocity = LM->MapKtoV(aTrack->GetVolume(), pol, Ran);
80 
81  //cast to non-const pointer so we can set the velocity
82  G4Track* theTrack = const_cast<G4Track*>(aTrack);
83 
84  theTrack->SetMomentumDirection(momentumDir);
85  theTrack->SetVelocity(velocity);
86  theTrack->UseGivenVelocity(true);
87  }
88 
89  return classification;
90 }
static G4LatticeManager * GetLatticeManager()
G4ThreeVector G4RandomDirection()
int G4int
Definition: G4Types.hh:78
void SetK(const G4Track *track, const G4ThreeVector &K)
G4int Get(const G4ParticleDefinition *aPD)
static G4PhononTrackMap * GetPhononTrackMap()
G4double MapKtoV(G4VPhysicalVolume *, G4int, const G4ThreeVector &) const
double G4double
Definition: G4Types.hh:76
G4ThreeVector MapKtoVDir(G4VPhysicalVolume *, G4int, const G4ThreeVector &) const
Here is the call graph for this function:

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