#include <G4AdjointSteppingAction.hh>
Inheritance 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) |
Definition at line 69 of file G4AdjointSteppingAction.hh.
G4AdjointSteppingAction::G4AdjointSteppingAction | ( | ) |
Definition at line 43 of file G4AdjointSteppingAction.cc.
References G4AdjointCrossSurfChecker::GetInstance().
00044 : ext_sourceEMax(0.), start_event(false), 00045 did_adj_part_reach_ext_source(false), last_ekin(0.), last_weight(0.), 00046 prim_weight(0.), last_part_def(0), theUserAdjointSteppingAction(0) 00047 { 00048 theG4AdjointCrossSurfChecker = G4AdjointCrossSurfChecker::GetInstance(); 00049 }
G4AdjointSteppingAction::~G4AdjointSteppingAction | ( | ) |
G4bool G4AdjointSteppingAction::GetDidAdjParticleReachTheExtSource | ( | ) | [inline] |
Definition at line 79 of file G4AdjointSteppingAction.hh.
Referenced by G4AdjointSimManager::GetDidAdjParticleReachTheExtSource().
G4double G4AdjointSteppingAction::GetLastEkin | ( | ) | [inline] |
Definition at line 82 of file G4AdjointSteppingAction.hh.
Referenced by G4AdjointSimManager::RegisterAtEndOfAdjointTrack().
G4ThreeVector G4AdjointSteppingAction::GetLastMomentum | ( | ) | [inline] |
Definition at line 80 of file G4AdjointSteppingAction.hh.
Referenced by G4AdjointSimManager::RegisterAtEndOfAdjointTrack().
G4ParticleDefinition* G4AdjointSteppingAction::GetLastPartDef | ( | ) | [inline] |
Definition at line 85 of file G4AdjointSteppingAction.hh.
Referenced by G4AdjointSimManager::RegisterAtEndOfAdjointTrack().
G4ThreeVector G4AdjointSteppingAction::GetLastPosition | ( | ) | [inline] |
Definition at line 81 of file G4AdjointSteppingAction.hh.
Referenced by G4AdjointSimManager::RegisterAtEndOfAdjointTrack().
G4double G4AdjointSteppingAction::GetLastWeight | ( | ) | [inline] |
Definition at line 83 of file G4AdjointSteppingAction.hh.
Referenced by G4AdjointSimManager::RegisterAtEndOfAdjointTrack().
void G4AdjointSteppingAction::SetExtSourceEMax | ( | G4double | Emax | ) | [inline] |
Definition at line 77 of file G4AdjointSteppingAction.hh.
Referenced by G4AdjointSimManager::SetExtSourceEmax().
void G4AdjointSteppingAction::SetPrimWeight | ( | G4double | weight | ) | [inline] |
Definition at line 84 of file G4AdjointSteppingAction.hh.
Referenced by G4AdjointSimManager::RegisterAdjointPrimaryWeight().
void G4AdjointSteppingAction::SetStartEvent | ( | G4bool | aBool | ) | [inline] |
void G4AdjointSteppingAction::SetUserAdjointSteppingAction | ( | G4UserSteppingAction * | anAction | ) | [inline] |
Definition at line 86 of file G4AdjointSteppingAction.hh.
Referenced by G4AdjointSimManager::SetAdjointSteppingAction().
void G4AdjointSteppingAction::UserSteppingAction | ( | const G4Step * | ) | [virtual] |
Reimplemented from G4UserSteppingAction.
Definition at line 57 of file G4AdjointSteppingAction.cc.
References G4AdjointCrossSurfChecker::CrossingOneOfTheRegisteredSurface(), fStopAndKill, fWorldBoundary, G4ParticleDefinition::GetBaryonNumber(), G4Track::GetDefinition(), G4Track::GetKineticEnergy(), G4Track::GetMomentum(), G4ParticleDefinition::GetParticleType(), G4Track::GetWeight(), G4Track::SetTrackStatus(), and G4UserSteppingAction::UserSteppingAction().
00058 { 00059 //Apply first the user adjoint stepping action 00060 //--------------------------- 00061 if (theUserAdjointSteppingAction) theUserAdjointSteppingAction->UserSteppingAction(aStep); 00062 00063 G4Track* aTrack =aStep->GetTrack(); 00064 G4double nb_nuc=1.; 00065 G4ParticleDefinition* thePartDef = aTrack->GetDefinition(); 00066 00067 if (thePartDef->GetParticleType() == "adjoint_nucleus"){ 00068 nb_nuc=double(thePartDef->GetBaryonNumber()); 00069 } 00070 //Kill conditions for adjoint particles reaching the maximum energy 00071 //----------------------------------------------------------------- 00072 if(aTrack->GetKineticEnergy() >= ext_sourceEMax*nb_nuc){ 00073 aTrack->SetTrackStatus(fStopAndKill); 00074 did_adj_part_reach_ext_source=false; 00075 return; 00076 } 00077 00078 G4double weight_factor = aTrack->GetWeight()/prim_weight; 00079 00080 if ( (weight_factor>0 && weight_factor<=0) || weight_factor<= 1e-290 || weight_factor>1.e200) 00081 { 00082 //std::cout<<"Weight_factor problem! Value = "<<weight_factor<<std::endl; 00083 aTrack->SetTrackStatus(fStopAndKill); 00084 did_adj_part_reach_ext_source=false; 00085 return; 00086 } 00087 00088 00089 //Kill conditions for surface crossing 00090 //-------------------------------------- 00091 00092 G4String surface_name; 00093 G4double cos_to_surface; 00094 G4bool GoingIn; 00095 G4ThreeVector crossing_pos; 00096 if (theG4AdjointCrossSurfChecker->CrossingOneOfTheRegisteredSurface(aStep, surface_name, crossing_pos, cos_to_surface, GoingIn) ){ 00097 00098 //G4cout<<"Test_step11"<<std::endl; 00099 //G4cout<<surface_name<<std::endl; 00100 if (surface_name == "ExternalSource") { 00101 //Registering still needed 00102 did_adj_part_reach_ext_source=true; 00103 aTrack->SetTrackStatus(fStopAndKill); 00104 //now register the adjoint particles reaching the external surface 00105 last_momentum =aTrack->GetMomentum(); 00106 last_ekin=aTrack->GetKineticEnergy(); 00107 last_weight = aTrack->GetWeight(); 00108 last_part_def = aTrack->GetDefinition(); 00109 last_pos = crossing_pos; 00110 return; 00111 } 00112 else if (surface_name == "AdjointSource" && GoingIn) { 00113 did_adj_part_reach_ext_source=false; 00114 aTrack->SetTrackStatus(fStopAndKill); 00115 return; 00116 } 00117 } 00118 //Check for reaching out of world 00119 if (aStep->GetPostStepPoint()->GetStepStatus() == fWorldBoundary) { 00120 did_adj_part_reach_ext_source=true; 00121 last_momentum =aTrack->GetMomentum(); 00122 last_ekin=aTrack->GetKineticEnergy(); 00123 last_weight = aTrack->GetWeight(); 00124 last_part_def = aTrack->GetDefinition(); 00125 last_pos = crossing_pos; 00126 return; 00127 00128 } 00129 00130 }