Import Geant4 11.3.0 source tree
This commit is contained in:
@@ -23,75 +23,83 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
//
|
||||
// G4BOptnForceFreeFlight
|
||||
//
|
||||
// Class Description:
|
||||
// A G4VBiasingOperation physics-based biasing operation.
|
||||
// If forces the physics process to not act on the track.
|
||||
// In this implementation (meant for the ForceCollision
|
||||
// operator) the free flight is done under zero weight for
|
||||
// the track, and the action is meant to accumulate the weight
|
||||
// change for making this uninteracting flight,
|
||||
// cumulatedWeightChange.
|
||||
// When the track reaches the current volume boundary, its
|
||||
// weight is restored with value :
|
||||
// initialWeight * cumulatedWeightChange
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
// Initial version Nov. 2013 M. Verderi
|
||||
// A G4VBiasingOperation physics-based biasing operation.
|
||||
// If forces the physics process to not act on the track.
|
||||
// In this implementation (meant for the ForceCollision
|
||||
// operator) the free flight is done under zero weight for
|
||||
// the track, and the action is meant to accumulate the weight
|
||||
// change for making this uninteracting flight,
|
||||
// cumulatedWeightChange.
|
||||
// When the track reaches the current volume boundary, its
|
||||
// weight is restored with value: initialWeight * cumulatedWeightChange
|
||||
//
|
||||
// Author: Marc Verderi, November 2013.
|
||||
// --------------------------------------------------------------------
|
||||
#ifndef G4BOptnForceFreeFlight_hh
|
||||
#define G4BOptnForceFreeFlight_hh 1
|
||||
|
||||
#include "G4VBiasingOperation.hh"
|
||||
#include "G4ForceCondition.hh"
|
||||
#include "G4ParticleChange.hh" // -- §§ should add a dedicated "weight change only" particle change
|
||||
#include "G4ParticleChange.hh" // Should add a dedicated "weight change only"
|
||||
// particle change
|
||||
class G4ILawForceFreeFlight;
|
||||
|
||||
class G4BOptnForceFreeFlight : public G4VBiasingOperation
|
||||
{
|
||||
public:
|
||||
|
||||
class G4BOptnForceFreeFlight : public G4VBiasingOperation {
|
||||
public:
|
||||
// -- Constructor :
|
||||
G4BOptnForceFreeFlight(G4String name);
|
||||
// -- destructor:
|
||||
virtual ~G4BOptnForceFreeFlight();
|
||||
// -- Constructor :
|
||||
G4BOptnForceFreeFlight(const G4String& name);
|
||||
// -- destructor:
|
||||
virtual ~G4BOptnForceFreeFlight();
|
||||
|
||||
public:
|
||||
// -- Methods from G4VBiasingOperation interface:
|
||||
// -------------------------------------------
|
||||
// -- Used:
|
||||
virtual const G4VBiasingInteractionLaw* ProvideOccurenceBiasingInteractionLaw( const G4BiasingProcessInterface*, G4ForceCondition& );
|
||||
virtual void AlongMoveBy( const G4BiasingProcessInterface*, const G4Step*, G4double );
|
||||
virtual G4VParticleChange* ApplyFinalStateBiasing( const G4BiasingProcessInterface*, const G4Track*, const G4Step*, G4bool&);
|
||||
// -- Methods from G4VBiasingOperation interface:
|
||||
// -------------------------------------------
|
||||
// -- Used:
|
||||
virtual const G4VBiasingInteractionLaw*
|
||||
ProvideOccurenceBiasingInteractionLaw( const G4BiasingProcessInterface*,
|
||||
G4ForceCondition& );
|
||||
virtual void AlongMoveBy( const G4BiasingProcessInterface*,
|
||||
const G4Step*, G4double );
|
||||
virtual G4VParticleChange*
|
||||
ApplyFinalStateBiasing( const G4BiasingProcessInterface*,
|
||||
const G4Track*, const G4Step*, G4bool& );
|
||||
|
||||
// -- Unused:
|
||||
virtual G4double DistanceToApplyOperation( const G4Track*,
|
||||
G4double,
|
||||
G4ForceCondition*) {return DBL_MAX;}
|
||||
virtual G4VParticleChange* GenerateBiasingFinalState( const G4Track*,
|
||||
const G4Step* ) {return 0;}
|
||||
// -- Unused:
|
||||
virtual G4double DistanceToApplyOperation( const G4Track*,
|
||||
G4double, G4ForceCondition* ) { return DBL_MAX; }
|
||||
virtual G4VParticleChange* GenerateBiasingFinalState( const G4Track*,
|
||||
const G4Step* ) { return nullptr; }
|
||||
|
||||
// -- Additional methods, specific to this class:
|
||||
// ----------------------------------------------
|
||||
// -- return concrete type of interaction law:
|
||||
G4ILawForceFreeFlight* GetForceFreeFlightLaw()
|
||||
{
|
||||
return fForceFreeFlightInteractionLaw;
|
||||
}
|
||||
// -- initialization for weight:
|
||||
void ResetInitialTrackWeight(G4double w)
|
||||
{
|
||||
fInitialTrackWeight = w;
|
||||
fCumulatedWeightChange = 1.0;
|
||||
}
|
||||
G4bool OperationComplete() const
|
||||
{
|
||||
return fOperationComplete;
|
||||
}
|
||||
|
||||
public:
|
||||
// -- Additional methods, specific to this class:
|
||||
// ----------------------------------------------
|
||||
// -- return concrete type of interaction law:
|
||||
G4ILawForceFreeFlight* GetForceFreeFlightLaw() {
|
||||
return fForceFreeFlightInteractionLaw;
|
||||
}
|
||||
// -- initialization for weight:
|
||||
void ResetInitialTrackWeight(G4double w) {fInitialTrackWeight = w; fCumulatedWeightChange = 1.0;}
|
||||
G4bool OperationComplete() const { return fOperationComplete; }
|
||||
|
||||
private:
|
||||
G4ILawForceFreeFlight* fForceFreeFlightInteractionLaw;
|
||||
G4double fCumulatedWeightChange,
|
||||
fInitialTrackWeight;
|
||||
G4ParticleChange fParticleChange;
|
||||
G4bool fOperationComplete;
|
||||
private:
|
||||
|
||||
G4ILawForceFreeFlight* fForceFreeFlightInteractionLaw = nullptr;
|
||||
G4double fCumulatedWeightChange = -1.0,
|
||||
fInitialTrackWeight = -1.0;
|
||||
G4ParticleChange fParticleChange;
|
||||
G4bool fOperationComplete = true;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user