Import Geant4 10.3.0 source tree
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4AdjointStackingAction.cc 76257 2013-11-08 11:31:00Z gcosmo $
|
||||
// $Id: G4AdjointStackingAction.cc 98744 2016-08-09 13:21:26Z gcosmo $
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Class Name: G4AdjointCrossSurfChecker
|
||||
@@ -34,15 +34,19 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "G4AdjointStackingAction.hh"
|
||||
#include "G4AdjointTrackingAction.hh"
|
||||
#include "G4Event.hh"
|
||||
#include "G4Track.hh"
|
||||
#include "G4ios.hh"
|
||||
#include "G4StackManager.hh"
|
||||
|
||||
G4AdjointStackingAction::G4AdjointStackingAction()
|
||||
: kill_tracks(true), adjoint_mode(true)
|
||||
|
||||
G4AdjointStackingAction::G4AdjointStackingAction(G4AdjointTrackingAction* anAction)
|
||||
: reclassification_stage (false)
|
||||
{
|
||||
theFwdStackingAction =0;
|
||||
theUserAdjointStackingAction =0;
|
||||
theAdjointTrackingAction = anAction;
|
||||
}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -51,24 +55,38 @@ G4AdjointStackingAction::~G4AdjointStackingAction()
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
G4ClassificationOfNewTrack G4AdjointStackingAction::ClassifyNewTrack(const G4Track * aTrack)
|
||||
{ G4ClassificationOfNewTrack classification = fUrgent;
|
||||
if ( kill_tracks) classification=fKill;
|
||||
else if (!adjoint_mode && theFwdStackingAction) classification = theFwdStackingAction->ClassifyNewTrack(aTrack);
|
||||
else if (adjoint_mode && theUserAdjointStackingAction) classification = theUserAdjointStackingAction->ClassifyNewTrack(aTrack);
|
||||
{
|
||||
G4ClassificationOfNewTrack classification = fUrgent;
|
||||
G4String partType = aTrack->GetParticleDefinition()->GetParticleType();
|
||||
adjoint_mode = partType.contains(G4String("adjoint"));
|
||||
if (!adjoint_mode ){
|
||||
if (!reclassification_stage) classification = fWaiting;
|
||||
else { //need to check if forwrad tracking can be continued use of
|
||||
if (theAdjointTrackingAction->GetNbOfAdointTracksReachingTheExternalSurface()>0) {
|
||||
if (theFwdStackingAction) classification = theFwdStackingAction->ClassifyNewTrack(aTrack);
|
||||
}
|
||||
else classification = fKill;
|
||||
}
|
||||
}
|
||||
else if (theUserAdjointStackingAction) classification = theUserAdjointStackingAction->ClassifyNewTrack(aTrack);
|
||||
return classification;
|
||||
}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
void G4AdjointStackingAction::NewStage()
|
||||
{
|
||||
if ( !adjoint_mode && theFwdStackingAction) theFwdStackingAction->NewStage();
|
||||
else if (adjoint_mode && theUserAdjointStackingAction) theUserAdjointStackingAction->NewStage();
|
||||
{ reclassification_stage =true;
|
||||
if (first_reclassification_stage){
|
||||
if (theUserAdjointStackingAction) theUserAdjointStackingAction->NewStage();
|
||||
stackManager->ReClassify();
|
||||
}
|
||||
else if (theFwdStackingAction) theFwdStackingAction->NewStage();
|
||||
first_reclassification_stage =false;
|
||||
}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
void G4AdjointStackingAction::PrepareNewEvent()
|
||||
{
|
||||
if ( !adjoint_mode && theFwdStackingAction) theFwdStackingAction->PrepareNewEvent();
|
||||
else if (adjoint_mode && theUserAdjointStackingAction) theUserAdjointStackingAction->PrepareNewEvent();
|
||||
{ reclassification_stage =false;
|
||||
first_reclassification_stage =true;
|
||||
if (theUserAdjointStackingAction) theUserAdjointStackingAction->PrepareNewEvent();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user