Geant4  10.02.p03
G4AdjointSteppingAction Class Reference

#include <G4AdjointSteppingAction.hh>

Inheritance diagram for G4AdjointSteppingAction:
Collaboration diagram for G4AdjointSteppingAction:

Public Member Functions

 G4AdjointSteppingAction ()
 
 ~G4AdjointSteppingAction ()
 
void UserSteppingAction (const G4Step *)
 
void SetExtSourceEMax (G4double Emax)
 
void SetStartEvent (G4bool aBool)
 
G4bool GetDidAdjParticleReachTheExtSource ()
 
G4ThreeVector GetLastMomentum ()
 
G4ThreeVector GetLastPosition ()
 
G4double GetLastEkin ()
 
G4double GetLastWeight ()
 
void SetPrimWeight (G4double weight)
 
G4ParticleDefinition * GetLastPartDef ()
 
void SetUserAdjointSteppingAction (G4UserSteppingAction *anAction)
 
void SetUserForwardSteppingAction (G4UserSteppingAction *anAction)
 
void SetAdjointTrackingMode (G4bool aBool)
 
void SetAdjointGeantinoTrackingMode (G4bool aBool)
 
- Public Member Functions inherited from G4UserSteppingAction
 G4UserSteppingAction ()
 
virtual ~G4UserSteppingAction ()
 
void SetSteppingManagerPointer (G4SteppingManager *pValue)
 

Private Attributes

G4double ext_sourceEMax
 
G4AdjointCrossSurfChecker * theG4AdjointCrossSurfChecker
 
G4bool start_event
 
G4bool did_adj_part_reach_ext_source
 
G4ThreeVector last_momentum
 
G4ThreeVector last_pos
 
G4double last_ekin
 
G4double last_weight
 
G4double prim_weight
 
G4ParticleDefinition * last_part_def
 
G4UserSteppingAction * theUserAdjointSteppingAction
 
G4UserSteppingAction * theUserFwdSteppingAction
 
G4bool is_adjoint_tracking_mode
 
G4bool is_adjoint_geantino_tracking_mode
 

Additional Inherited Members

- Protected Attributes inherited from G4UserSteppingAction
G4SteppingManager * fpSteppingManager
 

Detailed Description

Definition at line 69 of file G4AdjointSteppingAction.hh.

Constructor & Destructor Documentation

◆ G4AdjointSteppingAction()

G4AdjointSteppingAction::G4AdjointSteppingAction ( )

Definition at line 44 of file G4AdjointSteppingAction.cc.

45  : ext_sourceEMax(0.), start_event(false),
49 {
51 }
G4UserSteppingAction * theUserAdjointSteppingAction
G4AdjointCrossSurfChecker * theG4AdjointCrossSurfChecker
G4UserSteppingAction * theUserFwdSteppingAction
static G4AdjointCrossSurfChecker * GetInstance()
G4ParticleDefinition * last_part_def
Here is the call graph for this function:

◆ ~G4AdjointSteppingAction()

G4AdjointSteppingAction::~G4AdjointSteppingAction ( )

Definition at line 54 of file G4AdjointSteppingAction.cc.

55 {;}

Member Function Documentation

◆ GetDidAdjParticleReachTheExtSource()

G4bool G4AdjointSteppingAction::GetDidAdjParticleReachTheExtSource ( )
inline

Definition at line 79 of file G4AdjointSteppingAction.hh.

Here is the caller graph for this function:

◆ GetLastEkin()

G4double G4AdjointSteppingAction::GetLastEkin ( )
inline

Definition at line 82 of file G4AdjointSteppingAction.hh.

Here is the caller graph for this function:

◆ GetLastMomentum()

G4ThreeVector G4AdjointSteppingAction::GetLastMomentum ( )
inline

Definition at line 80 of file G4AdjointSteppingAction.hh.

80 {return last_momentum;}
Here is the caller graph for this function:

◆ GetLastPartDef()

G4ParticleDefinition* G4AdjointSteppingAction::GetLastPartDef ( )
inline

Definition at line 85 of file G4AdjointSteppingAction.hh.

85 {return last_part_def;}
G4ParticleDefinition * last_part_def
Here is the caller graph for this function:

◆ GetLastPosition()

G4ThreeVector G4AdjointSteppingAction::GetLastPosition ( )
inline

Definition at line 81 of file G4AdjointSteppingAction.hh.

81 {return last_pos;}
Here is the caller graph for this function:

◆ GetLastWeight()

G4double G4AdjointSteppingAction::GetLastWeight ( )
inline

Definition at line 83 of file G4AdjointSteppingAction.hh.

Here is the caller graph for this function:

◆ SetAdjointGeantinoTrackingMode()

void G4AdjointSteppingAction::SetAdjointGeantinoTrackingMode ( G4bool  aBool)
inline

◆ SetAdjointTrackingMode()

void G4AdjointSteppingAction::SetAdjointTrackingMode ( G4bool  aBool)
inline

Definition at line 90 of file G4AdjointSteppingAction.hh.

Here is the caller graph for this function:

◆ SetExtSourceEMax()

void G4AdjointSteppingAction::SetExtSourceEMax ( G4double  Emax)
inline

Definition at line 77 of file G4AdjointSteppingAction.hh.

static const G4double Emax
Here is the caller graph for this function:

◆ SetPrimWeight()

void G4AdjointSteppingAction::SetPrimWeight ( G4double  weight)
inline

Definition at line 84 of file G4AdjointSteppingAction.hh.

Here is the caller graph for this function:

◆ SetStartEvent()

void G4AdjointSteppingAction::SetStartEvent ( G4bool  aBool)
inline

Definition at line 78 of file G4AdjointSteppingAction.hh.

◆ SetUserAdjointSteppingAction()

void G4AdjointSteppingAction::SetUserAdjointSteppingAction ( G4UserSteppingAction *  anAction)
inline

Definition at line 86 of file G4AdjointSteppingAction.hh.

86  {
87  theUserAdjointSteppingAction = anAction;}
G4UserSteppingAction * theUserAdjointSteppingAction
Here is the caller graph for this function:

◆ SetUserForwardSteppingAction()

void G4AdjointSteppingAction::SetUserForwardSteppingAction ( G4UserSteppingAction *  anAction)
inline

Definition at line 88 of file G4AdjointSteppingAction.hh.

88  {
89  theUserFwdSteppingAction = anAction;}
G4UserSteppingAction * theUserFwdSteppingAction
Here is the caller graph for this function:

◆ UserSteppingAction()

void G4AdjointSteppingAction::UserSteppingAction ( const G4Step *  aStep)
virtual

Reimplemented from G4UserSteppingAction.

Definition at line 59 of file G4AdjointSteppingAction.cc.

60 {
61  G4Track* aTrack =aStep->GetTrack();
62  //forward tracking mode
64  //check if last adjoint did reach the external source
66  aTrack->SetTrackStatus(fStopAndKill);
67  return;
68  }
71  return;
72  }
73  //Apply first the user adjoint stepping action
74  //---------------------------
76 
77 
78  G4double nb_nuc=1.;
79  G4ParticleDefinition* thePartDef = aTrack->GetDefinition();
80 
81  if (thePartDef->GetParticleType() == "adjoint_nucleus"){
82  nb_nuc=double(thePartDef->GetBaryonNumber());
83  }
84  //Kill conditions for adjoint particles reaching the maximum energy
85  //-----------------------------------------------------------------
86  if(aTrack->GetKineticEnergy() >= ext_sourceEMax*nb_nuc){
87  aTrack->SetTrackStatus(fStopAndKill);
89  return;
90  }
91 
92  G4double weight_factor = aTrack->GetWeight()/prim_weight;
93  if ( (weight_factor>0 && weight_factor<=0) || weight_factor<= 1e-290 || weight_factor>1.e200)
94  {
95  //std::cout<<"Weight_factor problem! Value = "<<weight_factor<<std::endl;
96  aTrack->SetTrackStatus(fStopAndKill);
98  return;
99  }
100 
101 
102  //Kill conditions for surface crossing
103  //--------------------------------------
104 
105  G4String surface_name;
106  G4double cos_to_surface;
107  G4bool GoingIn;
108  G4ThreeVector crossing_pos;
109  if (theG4AdjointCrossSurfChecker->CrossingOneOfTheRegisteredSurface(aStep, surface_name, crossing_pos, cos_to_surface, GoingIn) ){
110 
111  //G4cout<<"Test_step11"<<std::endl;
112  if (surface_name == "ExternalSource") {
113  //Registering still needed
115  aTrack->SetTrackStatus(fStopAndKill);
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) {
126  aTrack->SetTrackStatus(fStopAndKill);
127  return;
128  }
129  }
130  //Check for reaching out of world
131  //G4cout<<aStep->GetPostStepPoint()->GetStepStatus()<<std::endl;
132  if (aStep->GetPostStepPoint()->GetStepStatus() == fWorldBoundary) {
134  last_momentum =aTrack->GetMomentum();
135  last_ekin=aTrack->GetKineticEnergy();
136  last_weight = aTrack->GetWeight();
137  last_part_def = aTrack->GetDefinition();
138  last_pos = crossing_pos;
139  return;
140 
141  }
142 
143 }
G4UserSteppingAction * theUserAdjointSteppingAction
const G4String & GetParticleType() const
virtual void UserSteppingAction(const G4Step *)
G4AdjointCrossSurfChecker * theG4AdjointCrossSurfChecker
bool G4bool
Definition: G4Types.hh:79
G4UserSteppingAction * theUserFwdSteppingAction
G4bool CrossingOneOfTheRegisteredSurface(const G4Step *aStep, G4String &surface_name, G4ThreeVector &crossing_pos, G4double &cos_to_surface, G4bool &GoingIn)
G4ParticleDefinition * last_part_def
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:

Member Data Documentation

◆ did_adj_part_reach_ext_source

G4bool G4AdjointSteppingAction::did_adj_part_reach_ext_source
private

Definition at line 98 of file G4AdjointSteppingAction.hh.

◆ ext_sourceEMax

G4double G4AdjointSteppingAction::ext_sourceEMax
private

Definition at line 94 of file G4AdjointSteppingAction.hh.

◆ is_adjoint_geantino_tracking_mode

G4bool G4AdjointSteppingAction::is_adjoint_geantino_tracking_mode
private

Definition at line 107 of file G4AdjointSteppingAction.hh.

◆ is_adjoint_tracking_mode

G4bool G4AdjointSteppingAction::is_adjoint_tracking_mode
private

Definition at line 106 of file G4AdjointSteppingAction.hh.

◆ last_ekin

G4double G4AdjointSteppingAction::last_ekin
private

Definition at line 100 of file G4AdjointSteppingAction.hh.

◆ last_momentum

G4ThreeVector G4AdjointSteppingAction::last_momentum
private

Definition at line 99 of file G4AdjointSteppingAction.hh.

◆ last_part_def

G4ParticleDefinition* G4AdjointSteppingAction::last_part_def
private

Definition at line 103 of file G4AdjointSteppingAction.hh.

◆ last_pos

G4ThreeVector G4AdjointSteppingAction::last_pos
private

Definition at line 99 of file G4AdjointSteppingAction.hh.

◆ last_weight

G4double G4AdjointSteppingAction::last_weight
private

Definition at line 101 of file G4AdjointSteppingAction.hh.

◆ prim_weight

G4double G4AdjointSteppingAction::prim_weight
private

Definition at line 102 of file G4AdjointSteppingAction.hh.

◆ start_event

G4bool G4AdjointSteppingAction::start_event
private

Definition at line 96 of file G4AdjointSteppingAction.hh.

◆ theG4AdjointCrossSurfChecker

G4AdjointCrossSurfChecker* G4AdjointSteppingAction::theG4AdjointCrossSurfChecker
private

Definition at line 95 of file G4AdjointSteppingAction.hh.

◆ theUserAdjointSteppingAction

G4UserSteppingAction* G4AdjointSteppingAction::theUserAdjointSteppingAction
private

Definition at line 104 of file G4AdjointSteppingAction.hh.

◆ theUserFwdSteppingAction

G4UserSteppingAction* G4AdjointSteppingAction::theUserFwdSteppingAction
private

Definition at line 105 of file G4AdjointSteppingAction.hh.


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