Import Geant4 10.1.0 source tree
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4AdjointSteppingAction.cc 75570 2013-11-04 11:41:10Z gcosmo $
|
||||
// $Id: G4AdjointSteppingAction.cc 81774 2014-06-05 08:36:37Z gcosmo $
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Class Name: G4AdjointSteppingAction
|
||||
@@ -70,8 +70,6 @@ void G4AdjointSteppingAction::UserSteppingAction(const G4Step* aStep)
|
||||
theUserFwdSteppingAction->UserSteppingAction(aStep);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//Apply first the user adjoint stepping action
|
||||
//---------------------------
|
||||
if (theUserAdjointSteppingAction) theUserAdjointSteppingAction->UserSteppingAction(aStep);
|
||||
@@ -109,7 +107,7 @@ void G4AdjointSteppingAction::UserSteppingAction(const G4Step* aStep)
|
||||
G4bool GoingIn;
|
||||
G4ThreeVector crossing_pos;
|
||||
if (theG4AdjointCrossSurfChecker->CrossingOneOfTheRegisteredSurface(aStep, surface_name, crossing_pos, cos_to_surface, GoingIn) ){
|
||||
|
||||
|
||||
//G4cout<<"Test_step11"<<std::endl;
|
||||
if (surface_name == "ExternalSource") {
|
||||
//Registering still needed
|
||||
@@ -130,6 +128,7 @@ void G4AdjointSteppingAction::UserSteppingAction(const G4Step* aStep)
|
||||
}
|
||||
}
|
||||
//Check for reaching out of world
|
||||
//G4cout<<aStep->GetPostStepPoint()->GetStepStatus()<<std::endl;
|
||||
if (aStep->GetPostStepPoint()->GetStepStatus() == fWorldBoundary) {
|
||||
did_adj_part_reach_ext_source=true;
|
||||
last_momentum =aTrack->GetMomentum();
|
||||
@@ -140,6 +139,6 @@ void G4AdjointSteppingAction::UserSteppingAction(const G4Step* aStep)
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -50,9 +50,9 @@ G4AdjointTrackingAction::~G4AdjointTrackingAction()
|
||||
{;}
|
||||
/////////////////////////////////////////////////////////
|
||||
void G4AdjointTrackingAction::PreUserTrackingAction(const G4Track* aTrack)
|
||||
{ G4String partType = aTrack->GetParticleDefinition()->GetParticleType();
|
||||
if (aTrack->GetDynamicParticle()->GetPrimaryParticle() &&
|
||||
partType.contains(G4String("adjoint"))){
|
||||
{
|
||||
G4String partType = aTrack->GetParticleDefinition()->GetParticleType();
|
||||
if (partType.contains(G4String("adjoint"))){
|
||||
is_adjoint_tracking_mode =true;
|
||||
theAdjointSteppingAction->SetPrimWeight(aTrack->GetWeight());
|
||||
}
|
||||
@@ -65,12 +65,19 @@ void G4AdjointTrackingAction::PreUserTrackingAction(const G4Track* aTrack)
|
||||
}
|
||||
/////////////////////////////////////////////////////////
|
||||
void G4AdjointTrackingAction::PostUserTrackingAction(const G4Track* aTrack)
|
||||
{ if(!is_adjoint_tracking_mode){
|
||||
{
|
||||
|
||||
//important to have it here !
|
||||
last_weight = theAdjointSteppingAction->GetLastWeight();
|
||||
last_ekin = theAdjointSteppingAction->GetLastEkin();
|
||||
|
||||
|
||||
if(!is_adjoint_tracking_mode){
|
||||
if (theUserFwdTrackingAction)
|
||||
theUserFwdTrackingAction->PostUserTrackingAction(aTrack);
|
||||
}
|
||||
else if (theAdjointSteppingAction->GetDidAdjParticleReachTheExtSource()){
|
||||
last_pos = theAdjointSteppingAction->GetLastPosition();
|
||||
last_pos = theAdjointSteppingAction->GetLastPosition();
|
||||
last_direction = theAdjointSteppingAction->GetLastMomentum();
|
||||
last_direction /=last_direction.mag();
|
||||
last_cos_th = last_direction.z();
|
||||
@@ -85,7 +92,17 @@ void G4AdjointTrackingAction::PreUserTrackingAction(const G4Track* aTrack)
|
||||
G4double nb_nuc=double(aPartDef->GetBaryonNumber());
|
||||
last_ekin_nuc /=nb_nuc;
|
||||
}
|
||||
last_weight = theAdjointSteppingAction->GetLastWeight(); ;
|
||||
|
||||
last_fwd_part_index=-1;
|
||||
size_t i=0;
|
||||
while(i< pListOfPrimaryFwdParticles->size() && last_fwd_part_index<0) {
|
||||
if ((*pListOfPrimaryFwdParticles)[i]->GetParticleName() == last_fwd_part_name)
|
||||
last_fwd_part_index=i;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user