Import Geant4 10.7.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2020-06-26 10:23:25 +02:00
parent c02c370437
commit 67ba86d073
1871 changed files with 174422 additions and 131884 deletions
@@ -23,38 +23,34 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// G4AdjointSteppingAction
//
/////////////////////////////////////////////////////////////////////////////////
// Class Name: G4AdjointSteppingAction
// Author: L. Desorgher
// Contract: ESA contract 21435/08/NL/AT
// Organisation: SpaceIT GmbH
// Customer: ESA/ESTEC
/////////////////////////////////////////////////////////////////////////////////
//
// CHANGE HISTORY
// --------------
// ChangeHistory:
// -15/01/2007 Creation by L. Desorgher
// -01/11/2009 Some cleaning and adding of documentation for the first Release in the Geant4 toolkit, L. Desorgher
// -04/11/2009 Adding the possibility to use user stepping action, L. Desorgher
// -20/11/2009 Correct the stop of adjoint particles tracking when it reenters the adjoint source.
//
//
//-------------------------------------------------------------
// Documentation:
// Stepping action used in the adjoint simulation.
// It is responsible to stop the adjoint tracking phase when:
// -a)The adjoint track reaches the external surface.
// -b)The being tracked adjoint dynamic particle get an energy higher than the maximum energy of the external source.
// -c)The adjoint track enters the volume delimited by the adjoint source.
// In the case a) the info (energy,weight,...) of the adjoint dynamic particle associated to the track
// when crossing the external source is registered and in the next event a forward primary is generated. In the other cases b) and c)
// The next generated fwd particle is killed before being tracked and the next tracking of an adjoint particle is started directly.
// Class description:
//
// Stepping action used in the adjoint simulation.
// It is responsible to stop the adjoint tracking phase when:
// a) The adjoint track reaches the external surface.
// b) The being tracked adjoint dynamic particle get an energy higher than
// the maximum energy of the external source.
// c) The adjoint track enters the volume delimited by the adjoint source.
// In the case a) the info (energy,weight,...) of the adjoint dynamic particle
// associated to the track when crossing the external source is registered and
// in the next event a forward primary is generated.
// In the other cases b) and c) the next generated fwd particle is killed
// before being tracked and the next tracking of an adjoint particle is
// started directly.
#ifndef G4AdjointSteppingAction_h
#define G4AdjointSteppingAction_h 1
// Author: L. Desorgher, SpaceIT GmbH
// Contract: ESA contract 21435/08/NL/AT
// Customer: ESA/ESTEC
// History:
// - 15/01/2007 L.Desorgher, created.
// - 04/11/2009 L.Desorgher, added possibility to use user stepping action.
// - 20/11/2009 L.Desorgher, corrected stop of adjoint particles tracking
// when reentering the adjoint source.
//---------------------------------------------------------------------
#ifndef G4AdjointSteppingAction_hh
#define G4AdjointSteppingAction_hh 1
#include "G4UserSteppingAction.hh"
#include "globals.hh"
@@ -63,52 +59,62 @@
class G4AdjointCrossSurfChecker;
class G4ParticleDefinition;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class G4AdjointSteppingAction : public G4UserSteppingAction
{
public:
G4AdjointSteppingAction();
~G4AdjointSteppingAction();
void UserSteppingAction(const G4Step*);
inline void SetExtSourceEMax(G4double Emax){ext_sourceEMax=Emax;}
inline void SetStartEvent(G4bool aBool){start_event =aBool;}
inline G4bool GetDidAdjParticleReachTheExtSource(){return did_adj_part_reach_ext_source;}
inline G4ThreeVector GetLastMomentum(){return last_momentum;}
inline G4ThreeVector GetLastPosition(){return last_pos;}
inline G4double GetLastEkin(){return last_ekin;}
inline G4double GetLastWeight(){return last_weight;}
inline void SetPrimWeight(G4double weight){prim_weight=weight;}
inline G4ParticleDefinition* GetLastPartDef(){return last_part_def;}
inline void SetUserAdjointSteppingAction( G4UserSteppingAction* anAction) {
theUserAdjointSteppingAction = anAction;}
inline void SetUserForwardSteppingAction( G4UserSteppingAction* anAction) {
theUserFwdSteppingAction = anAction;}
inline void SetAdjointTrackingMode(G4bool aBool){is_adjoint_tracking_mode =aBool;}
inline void SetExtSourceEMax(G4double Emax)
{ ext_sourceEMax = Emax; }
inline void SetStartEvent(G4bool aBool)
{ start_event = aBool; }
inline G4bool GetDidAdjParticleReachTheExtSource()
{ return did_adj_part_reach_ext_source; }
inline G4ThreeVector GetLastMomentum()
{ return last_momentum; }
inline G4ThreeVector GetLastPosition()
{ return last_pos; }
inline G4double GetLastEkin()
{ return last_ekin; }
inline G4double GetLastWeight()
{ return last_weight; }
inline void SetPrimWeight(G4double weight)
{ prim_weight = weight; }
inline G4ParticleDefinition* GetLastPartDef()
{ return last_part_def; }
inline void SetUserAdjointSteppingAction(G4UserSteppingAction* anAction)
{ theUserAdjointSteppingAction = anAction; }
inline void SetUserForwardSteppingAction(G4UserSteppingAction* anAction)
{ theUserFwdSteppingAction = anAction; }
inline void SetAdjointTrackingMode(G4bool aBool)
{ is_adjoint_tracking_mode = aBool; }
inline void ResetDidOneAdjPartReachExtSourceDuringEvent()
{did_one_adj_part_reach_ext_source_during_event =false;}
inline void SetAdjointGeantinoTrackingMode(G4bool aBool){is_adjoint_geantino_tracking_mode =aBool;}
{ did_one_adj_part_reach_ext_source_during_event = false; }
inline void SetAdjointGeantinoTrackingMode(G4bool aBool)
{ is_adjoint_geantino_tracking_mode = aBool; }
private:
G4double ext_sourceEMax;
G4AdjointCrossSurfChecker* theG4AdjointCrossSurfChecker;
G4bool start_event;
G4double ext_sourceEMax = 0.0;
G4AdjointCrossSurfChecker* theG4AdjointCrossSurfChecker = nullptr;
G4bool did_adj_part_reach_ext_source;
G4bool did_one_adj_part_reach_ext_source_during_event;
G4ThreeVector last_momentum, 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;
G4double last_ekin = 0.0;
G4double last_weight = 0.0;
G4double prim_weight = 1.0;
G4ParticleDefinition* last_part_def = nullptr;
G4UserSteppingAction* theUserAdjointSteppingAction = nullptr;
G4UserSteppingAction* theUserFwdSteppingAction = nullptr;
G4bool start_event = false;
G4bool did_adj_part_reach_ext_source = false;
G4bool did_one_adj_part_reach_ext_source_during_event = false;
G4bool is_adjoint_tracking_mode = false;
G4bool is_adjoint_geantino_tracking_mode = false;
};
#endif
#endif