Geant4-11
Public Member Functions | Protected Attributes | Private Attributes
G4AdjointSteppingAction Class Reference

#include <G4AdjointSteppingAction.hh>

Inheritance diagram for G4AdjointSteppingAction:
G4UserSteppingAction

Public Member Functions

 G4AdjointSteppingAction ()
 
G4bool GetDidAdjParticleReachTheExtSource ()
 
G4double GetLastEkin ()
 
G4ThreeVector GetLastMomentum ()
 
G4ParticleDefinitionGetLastPartDef ()
 
G4ThreeVector GetLastPosition ()
 
G4double GetLastWeight ()
 
void ResetDidOneAdjPartReachExtSourceDuringEvent ()
 
void SetAdjointGeantinoTrackingMode (G4bool aBool)
 
void SetAdjointTrackingMode (G4bool aBool)
 
void SetExtSourceEMax (G4double Emax)
 
void SetPrimWeight (G4double weight)
 
void SetStartEvent (G4bool aBool)
 
virtual void SetSteppingManagerPointer (G4SteppingManager *pValue)
 
void SetUserAdjointSteppingAction (G4UserSteppingAction *anAction)
 
void SetUserForwardSteppingAction (G4UserSteppingAction *anAction)
 
void UserSteppingAction (const G4Step *)
 
 ~G4AdjointSteppingAction ()
 

Protected Attributes

G4SteppingManagerfpSteppingManager = nullptr
 

Private Attributes

G4bool did_adj_part_reach_ext_source = false
 
G4bool did_one_adj_part_reach_ext_source_during_event = false
 
G4double ext_sourceEMax = 0.0
 
G4bool is_adjoint_geantino_tracking_mode = false
 
G4bool is_adjoint_tracking_mode = false
 
G4double last_ekin = 0.0
 
G4ThreeVector last_momentum
 
G4ParticleDefinitionlast_part_def = nullptr
 
G4ThreeVector last_pos
 
G4double last_weight = 0.0
 
G4double prim_weight = 1.0
 
G4bool start_event = false
 
G4AdjointCrossSurfCheckertheG4AdjointCrossSurfChecker = nullptr
 
G4UserSteppingActiontheUserAdjointSteppingAction = nullptr
 
G4UserSteppingActiontheUserFwdSteppingAction = nullptr
 

Detailed Description

Definition at line 62 of file G4AdjointSteppingAction.hh.

Constructor & Destructor Documentation

◆ G4AdjointSteppingAction()

G4AdjointSteppingAction::G4AdjointSteppingAction ( )

◆ ~G4AdjointSteppingAction()

G4AdjointSteppingAction::~G4AdjointSteppingAction ( )

Definition at line 48 of file G4AdjointSteppingAction.cc.

49{
50}

Member Function Documentation

◆ GetDidAdjParticleReachTheExtSource()

G4bool G4AdjointSteppingAction::GetDidAdjParticleReachTheExtSource ( )
inline

◆ GetLastEkin()

G4double G4AdjointSteppingAction::GetLastEkin ( )
inline

◆ GetLastMomentum()

G4ThreeVector G4AdjointSteppingAction::GetLastMomentum ( )
inline

◆ GetLastPartDef()

G4ParticleDefinition * G4AdjointSteppingAction::GetLastPartDef ( )
inline

◆ GetLastPosition()

G4ThreeVector G4AdjointSteppingAction::GetLastPosition ( )
inline

◆ GetLastWeight()

G4double G4AdjointSteppingAction::GetLastWeight ( )
inline

◆ ResetDidOneAdjPartReachExtSourceDuringEvent()

void G4AdjointSteppingAction::ResetDidOneAdjPartReachExtSourceDuringEvent ( )
inline

◆ SetAdjointGeantinoTrackingMode()

void G4AdjointSteppingAction::SetAdjointGeantinoTrackingMode ( G4bool  aBool)
inline

◆ SetAdjointTrackingMode()

void G4AdjointSteppingAction::SetAdjointTrackingMode ( G4bool  aBool)
inline

◆ SetExtSourceEMax()

void G4AdjointSteppingAction::SetExtSourceEMax ( G4double  Emax)
inline

Definition at line 71 of file G4AdjointSteppingAction.hh.

72 { ext_sourceEMax = Emax; }
static const G4double Emax

References Emax, and ext_sourceEMax.

Referenced by G4AdjointSimManager::SetExtSourceEmax().

◆ SetPrimWeight()

void G4AdjointSteppingAction::SetPrimWeight ( G4double  weight)
inline

◆ SetStartEvent()

void G4AdjointSteppingAction::SetStartEvent ( G4bool  aBool)
inline

Definition at line 73 of file G4AdjointSteppingAction.hh.

References start_event.

◆ SetSteppingManagerPointer()

void G4UserSteppingAction::SetSteppingManagerPointer ( G4SteppingManager pValue)
virtualinherited

Reimplemented in G4MultiSteppingAction.

Definition at line 63 of file G4UserSteppingAction.cc.

65{
66 fpSteppingManager = pValue;
67}
G4SteppingManager * fpSteppingManager

References G4UserSteppingAction::fpSteppingManager.

Referenced by G4TrackingManager::SetUserAction().

◆ SetUserAdjointSteppingAction()

void G4AdjointSteppingAction::SetUserAdjointSteppingAction ( G4UserSteppingAction anAction)
inline

Definition at line 89 of file G4AdjointSteppingAction.hh.

90 { theUserAdjointSteppingAction = anAction; }
G4UserSteppingAction * theUserAdjointSteppingAction

References theUserAdjointSteppingAction.

Referenced by G4AdjointSimManager::SetAdjointSteppingAction().

◆ SetUserForwardSteppingAction()

void G4AdjointSteppingAction::SetUserForwardSteppingAction ( G4UserSteppingAction anAction)
inline

Definition at line 91 of file G4AdjointSteppingAction.hh.

92 { theUserFwdSteppingAction = anAction; }
G4UserSteppingAction * theUserFwdSteppingAction

References theUserFwdSteppingAction.

Referenced by G4AdjointSimManager::DefineUserActions().

◆ UserSteppingAction()

void G4AdjointSteppingAction::UserSteppingAction ( const G4Step aStep)
virtual

Reimplemented from G4UserSteppingAction.

Definition at line 54 of file G4AdjointSteppingAction.cc.

55{
56 G4Track* aTrack = aStep->GetTrack();
57 if(!is_adjoint_tracking_mode) // forward tracking mode
58 {
60 {
62 return;
63 }
65 {
67 }
68 return;
69 }
70
71 // Apply first the user adjoint stepping action
72 // --------------------------------------------
73
76 {
78 }
79
80 G4double nb_nuc = 1.;
81 G4ParticleDefinition* thePartDef = aTrack->GetDefinition();
82
83 if (thePartDef->GetParticleType() == "adjoint_nucleus")
84 {
85 nb_nuc = G4double(thePartDef->GetBaryonNumber());
86 }
87
88 // Kill conditions for adjoint particles reaching the maximum energy
89 // -----------------------------------------------------------------
90
91 if(aTrack->GetKineticEnergy() >= ext_sourceEMax*nb_nuc)
92 {
95 return;
96 }
97
98 // Kill conditions for surface crossing
99 // --------------------------------------
100
101 G4String surface_name;
102 G4double cos_to_surface;
103 G4bool GoingIn;
104 G4ThreeVector crossing_pos;
106 ->CrossingOneOfTheRegisteredSurface(aStep, surface_name,
107 crossing_pos, cos_to_surface, GoingIn))
108 {
109 if (surface_name == "ExternalSource")
110 {
111 // Registering still needed
115
116 // now register the adjoint particles reaching the external surface
117 last_momentum = aTrack->GetMomentum();
118 last_ekin = aTrack->GetKineticEnergy();
119 last_weight = aTrack->GetWeight();
120 last_part_def = aTrack->GetDefinition();
121 last_pos = crossing_pos;
122 return;
123 }
124 else if (surface_name == "AdjointSource" && GoingIn)
125 {
128 return;
129 }
130 }
131
132 // Check for reaching out of world
133 //
135 {
138 last_momentum =aTrack->GetMomentum();
139 last_ekin=aTrack->GetKineticEnergy();
140 last_weight = aTrack->GetWeight();
141 last_part_def = aTrack->GetDefinition();
142 last_pos = crossing_pos;
143 return;
144 }
145}
@ fWorldBoundary
Definition: G4StepStatus.hh:41
@ fStopAndKill
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
const G4String & GetParticleType() const
G4StepStatus GetStepStatus() const
G4Track * GetTrack() const
G4StepPoint * GetPostStepPoint() const
void SetTrackStatus(const G4TrackStatus aTrackStatus)
G4double GetWeight() const
G4ThreeVector GetMomentum() const
G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
virtual void UserSteppingAction(const G4Step *)

References did_adj_part_reach_ext_source, did_one_adj_part_reach_ext_source_during_event, ext_sourceEMax, fStopAndKill, fWorldBoundary, G4ParticleDefinition::GetBaryonNumber(), G4Track::GetDefinition(), G4Track::GetKineticEnergy(), G4Track::GetMomentum(), G4ParticleDefinition::GetParticleType(), G4Step::GetPostStepPoint(), G4StepPoint::GetStepStatus(), G4Step::GetTrack(), G4Track::GetWeight(), is_adjoint_tracking_mode, last_ekin, last_momentum, last_part_def, last_pos, last_weight, G4Track::SetTrackStatus(), theG4AdjointCrossSurfChecker, theUserAdjointSteppingAction, theUserFwdSteppingAction, and G4UserSteppingAction::UserSteppingAction().

Field Documentation

◆ did_adj_part_reach_ext_source

G4bool G4AdjointSteppingAction::did_adj_part_reach_ext_source = false
private

◆ did_one_adj_part_reach_ext_source_during_event

G4bool G4AdjointSteppingAction::did_one_adj_part_reach_ext_source_during_event = false
private

◆ ext_sourceEMax

G4double G4AdjointSteppingAction::ext_sourceEMax = 0.0
private

Definition at line 102 of file G4AdjointSteppingAction.hh.

Referenced by SetExtSourceEMax(), and UserSteppingAction().

◆ fpSteppingManager

G4SteppingManager* G4UserSteppingAction::fpSteppingManager = nullptr
protectedinherited

◆ is_adjoint_geantino_tracking_mode

G4bool G4AdjointSteppingAction::is_adjoint_geantino_tracking_mode = false
private

Definition at line 117 of file G4AdjointSteppingAction.hh.

Referenced by SetAdjointGeantinoTrackingMode().

◆ is_adjoint_tracking_mode

G4bool G4AdjointSteppingAction::is_adjoint_tracking_mode = false
private

Definition at line 116 of file G4AdjointSteppingAction.hh.

Referenced by SetAdjointTrackingMode(), and UserSteppingAction().

◆ last_ekin

G4double G4AdjointSteppingAction::last_ekin = 0.0
private

Definition at line 106 of file G4AdjointSteppingAction.hh.

Referenced by GetLastEkin(), and UserSteppingAction().

◆ last_momentum

G4ThreeVector G4AdjointSteppingAction::last_momentum
private

Definition at line 105 of file G4AdjointSteppingAction.hh.

Referenced by GetLastMomentum(), and UserSteppingAction().

◆ last_part_def

G4ParticleDefinition* G4AdjointSteppingAction::last_part_def = nullptr
private

Definition at line 109 of file G4AdjointSteppingAction.hh.

Referenced by GetLastPartDef(), and UserSteppingAction().

◆ last_pos

G4ThreeVector G4AdjointSteppingAction::last_pos
private

Definition at line 105 of file G4AdjointSteppingAction.hh.

Referenced by GetLastPosition(), and UserSteppingAction().

◆ last_weight

G4double G4AdjointSteppingAction::last_weight = 0.0
private

Definition at line 107 of file G4AdjointSteppingAction.hh.

Referenced by GetLastWeight(), and UserSteppingAction().

◆ prim_weight

G4double G4AdjointSteppingAction::prim_weight = 1.0
private

Definition at line 108 of file G4AdjointSteppingAction.hh.

Referenced by SetPrimWeight().

◆ start_event

G4bool G4AdjointSteppingAction::start_event = false
private

Definition at line 113 of file G4AdjointSteppingAction.hh.

Referenced by SetStartEvent().

◆ theG4AdjointCrossSurfChecker

G4AdjointCrossSurfChecker* G4AdjointSteppingAction::theG4AdjointCrossSurfChecker = nullptr
private

Definition at line 103 of file G4AdjointSteppingAction.hh.

Referenced by G4AdjointSteppingAction(), and UserSteppingAction().

◆ theUserAdjointSteppingAction

G4UserSteppingAction* G4AdjointSteppingAction::theUserAdjointSteppingAction = nullptr
private

Definition at line 110 of file G4AdjointSteppingAction.hh.

Referenced by SetUserAdjointSteppingAction(), and UserSteppingAction().

◆ theUserFwdSteppingAction

G4UserSteppingAction* G4AdjointSteppingAction::theUserFwdSteppingAction = nullptr
private

Definition at line 111 of file G4AdjointSteppingAction.hh.

Referenced by SetUserForwardSteppingAction(), and UserSteppingAction().


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