Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4AdjointStackingAction Class Reference

#include <G4AdjointStackingAction.hh>

+ Inheritance diagram for G4AdjointStackingAction:

Public Member Functions

 G4AdjointStackingAction (G4AdjointTrackingAction *anAction)
 
virtual ~G4AdjointStackingAction ()
 
virtual G4ClassificationOfNewTrack ClassifyNewTrack (const G4Track *aTrack)
 
virtual void NewStage ()
 
virtual void PrepareNewEvent ()
 
void SetUserFwdStackingAction (G4UserStackingAction *anAction)
 
void SetUserAdjointStackingAction (G4UserStackingAction *anAction)
 
void SetKillTracks (G4bool aBool)
 
void SetAdjointMode (G4bool aBool)
 
- Public Member Functions inherited from G4UserStackingAction
 G4UserStackingAction ()
 
virtual ~G4UserStackingAction ()
 
void SetStackManager (G4StackManager *value)
 
virtual G4ClassificationOfNewTrack ClassifyNewTrack (const G4Track *aTrack)
 
virtual void NewStage ()
 
virtual void PrepareNewEvent ()
 

Additional Inherited Members

- Protected Attributes inherited from G4UserStackingAction
G4StackManagerstackManager = nullptr
 

Detailed Description

Definition at line 53 of file G4AdjointStackingAction.hh.

Constructor & Destructor Documentation

◆ G4AdjointStackingAction()

G4AdjointStackingAction::G4AdjointStackingAction ( G4AdjointTrackingAction anAction)

Definition at line 40 of file G4AdjointStackingAction.cc.

42{
43 theAdjointTrackingAction = anAction;
44}

◆ ~G4AdjointStackingAction()

G4AdjointStackingAction::~G4AdjointStackingAction ( )
virtual

Definition at line 48 of file G4AdjointStackingAction.cc.

49{;}

Member Function Documentation

◆ ClassifyNewTrack()

G4ClassificationOfNewTrack G4AdjointStackingAction::ClassifyNewTrack ( const G4Track aTrack)
virtual

Reimplemented from G4UserStackingAction.

Definition at line 54 of file G4AdjointStackingAction.cc.

55{
56 G4ClassificationOfNewTrack classification = fUrgent;
57 G4String partType = aTrack->GetParticleDefinition()->GetParticleType();
58 adjoint_mode = partType.contains(G4String("adjoint"));
59 if (!adjoint_mode )
60 {
61 if (!reclassification_stage)
62 {
63 classification = fWaiting;
64 }
65 else // need to check if forwrad tracking can be continued use of
66 {
67 if (theAdjointTrackingAction->GetNbOfAdointTracksReachingTheExternalSurface()>0)
68 {
69 if (theFwdStackingAction)
70 {
71 classification = theFwdStackingAction->ClassifyNewTrack(aTrack);
72 }
73 }
74 else
75 {
76 classification = fKill;
77 }
78 }
79 }
80 else if (theUserAdjointStackingAction)
81 {
82 classification = theUserAdjointStackingAction->ClassifyNewTrack(aTrack);
83 }
84 return classification;
85}
std::size_t GetNbOfAdointTracksReachingTheExternalSurface()
const G4String & GetParticleType() const
G4bool contains(const std::string &) const
const G4ParticleDefinition * GetParticleDefinition() const
virtual G4ClassificationOfNewTrack ClassifyNewTrack(const G4Track *aTrack)

◆ NewStage()

void G4AdjointStackingAction::NewStage ( )
virtual

Reimplemented from G4UserStackingAction.

Definition at line 89 of file G4AdjointStackingAction.cc.

90{
91 reclassification_stage = true;
92 if (first_reclassification_stage)
93 {
94 if (theUserAdjointStackingAction)
95 {
96 theUserAdjointStackingAction->NewStage();
97 }
99 }
100 else if (theFwdStackingAction) theFwdStackingAction->NewStage();
101 {
102 first_reclassification_stage = false;
103 }
104}
G4StackManager * stackManager

◆ PrepareNewEvent()

void G4AdjointStackingAction::PrepareNewEvent ( )
virtual

Reimplemented from G4UserStackingAction.

Definition at line 108 of file G4AdjointStackingAction.cc.

109{
110 reclassification_stage = false;
111 first_reclassification_stage = true;
112 if (theUserAdjointStackingAction)
113 {
114 theUserAdjointStackingAction->PrepareNewEvent();
115 }
116}
virtual void PrepareNewEvent()

◆ SetAdjointMode()

void G4AdjointStackingAction::SetAdjointMode ( G4bool  aBool)
inline

Definition at line 69 of file G4AdjointStackingAction.hh.

70 { adjoint_mode=aBool; }

Referenced by G4AdjointSimManager::SetAdjointTrackingMode().

◆ SetKillTracks()

void G4AdjointStackingAction::SetKillTracks ( G4bool  aBool)
inline

Definition at line 67 of file G4AdjointStackingAction.hh.

68 { kill_tracks =aBool; }

Referenced by G4AdjointSimManager::SetAdjointTrackingMode().

◆ SetUserAdjointStackingAction()

void G4AdjointStackingAction::SetUserAdjointStackingAction ( G4UserStackingAction anAction)
inline

Definition at line 65 of file G4AdjointStackingAction.hh.

66 { theUserAdjointStackingAction = anAction; }

Referenced by G4AdjointSimManager::SetAdjointStackingAction().

◆ SetUserFwdStackingAction()

void G4AdjointStackingAction::SetUserFwdStackingAction ( G4UserStackingAction anAction)
inline

Definition at line 63 of file G4AdjointStackingAction.hh.

64 { theFwdStackingAction = anAction; }

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