Geant4 11.1.1
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)
 
 ~G4AdjointStackingAction () override=default
 
G4ClassificationOfNewTrack ClassifyNewTrack (const G4Track *aTrack) override
 
void NewStage () override
 
void PrepareNewEvent () override
 
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 ()=default
 
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)
explicit

Definition at line 40 of file G4AdjointStackingAction.cc.

42{
43 theAdjointTrackingAction = anAction;
44}

◆ ~G4AdjointStackingAction()

G4AdjointStackingAction::~G4AdjointStackingAction ( )
overridedefault

Member Function Documentation

◆ ClassifyNewTrack()

G4ClassificationOfNewTrack G4AdjointStackingAction::ClassifyNewTrack ( const G4Track aTrack)
overridevirtual

Reimplemented from G4UserStackingAction.

Definition at line 49 of file G4AdjointStackingAction.cc.

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

◆ NewStage()

void G4AdjointStackingAction::NewStage ( )
overridevirtual

Reimplemented from G4UserStackingAction.

Definition at line 84 of file G4AdjointStackingAction.cc.

85{
86 reclassification_stage = true;
87 if (first_reclassification_stage)
88 {
89 if (theUserAdjointStackingAction != nullptr)
90 {
91 theUserAdjointStackingAction->NewStage();
92 }
94 }
95 else if (theFwdStackingAction != nullptr) theFwdStackingAction->NewStage();
96 {
97 first_reclassification_stage = false;
98 }
99}
G4StackManager * stackManager

◆ PrepareNewEvent()

void G4AdjointStackingAction::PrepareNewEvent ( )
overridevirtual

Reimplemented from G4UserStackingAction.

Definition at line 103 of file G4AdjointStackingAction.cc.

104{
105 reclassification_stage = false;
106 first_reclassification_stage = true;
107 if (theUserAdjointStackingAction != nullptr)
108 {
109 theUserAdjointStackingAction->PrepareNewEvent();
110 }
111}
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: