Import Geant4 10.6.0 source tree
This commit is contained in:
@@ -23,55 +23,129 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
// class G4BFieldIntegrationDriver
|
||||
// G4BFieldIntegrationDriver
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// Specialized integration driver for pure magnetic field
|
||||
|
||||
// History:
|
||||
// - Created. D.Sorokin
|
||||
// Author: D.Sorokin
|
||||
// --------------------------------------------------------------------
|
||||
#ifndef G4BFIELD_INTEGRATION_DRIVER_HH
|
||||
#define G4BFIELD_INTEGRATION_DRIVER_HH
|
||||
|
||||
#ifndef G4BFieldIntegrationDriver_HH
|
||||
#define G4BFieldIntegrationDriver_HH
|
||||
#include "G4VIntegrationDriver.hh"
|
||||
#include "G4Mag_EqRhs.hh"
|
||||
|
||||
#include "G4IntegrationDriver.hh"
|
||||
#include "G4HelixExplicitEuler.hh"
|
||||
#include <memory>
|
||||
|
||||
template <class T>
|
||||
class G4BFieldIntegrationDriver : public G4IntegrationDriver<T> {
|
||||
public:
|
||||
G4BFieldIntegrationDriver( G4double hminimum,
|
||||
T* stepper,
|
||||
G4int numberOfComponents = 6,
|
||||
G4int statisticsVerbosity = 1);
|
||||
class G4BFieldIntegrationDriver : public G4VIntegrationDriver
|
||||
{
|
||||
public:
|
||||
|
||||
G4BFieldIntegrationDriver(
|
||||
std::unique_ptr<G4VIntegrationDriver> smallStepDriver,
|
||||
std::unique_ptr<G4VIntegrationDriver> largeStepDriver);
|
||||
|
||||
G4BFieldIntegrationDriver(const G4BFieldIntegrationDriver &) = delete;
|
||||
const G4BFieldIntegrationDriver& operator =(const G4BFieldIntegrationDriver &) = delete;
|
||||
|
||||
virtual G4bool QuickAdvance(
|
||||
G4FieldTrack& fieldTrack,
|
||||
const G4double dydx[],
|
||||
G4double hstep,
|
||||
G4double inverseCurvatureRadius,
|
||||
G4double& dchord_step,
|
||||
G4double& dyerr) override;
|
||||
virtual G4double AdvanceChordLimited(G4FieldTrack& track,
|
||||
G4double hstep,
|
||||
G4double eps,
|
||||
G4double chordDistance) override;
|
||||
|
||||
virtual G4bool AccurateAdvance(G4FieldTrack& track,
|
||||
G4double hstep,
|
||||
G4double eps,
|
||||
G4double hinitial = 0) override
|
||||
{
|
||||
return fCurrDriver->AccurateAdvance(track, hstep, eps, hinitial);
|
||||
}
|
||||
|
||||
virtual G4bool DoesReIntegrate() override
|
||||
{
|
||||
return fCurrDriver->DoesReIntegrate();
|
||||
}
|
||||
|
||||
//[[deprecated("will be removed")]]
|
||||
virtual void GetDerivatives(const G4FieldTrack& track,
|
||||
G4double dydx[]) const override
|
||||
{
|
||||
fCurrDriver->GetDerivatives(track, dydx);
|
||||
}
|
||||
|
||||
//[[deprecated("will be removed")]]
|
||||
virtual void GetDerivatives(const G4FieldTrack& track,
|
||||
G4double dydx[],
|
||||
G4double field[]) const override
|
||||
{
|
||||
fCurrDriver->GetDerivatives(track, dydx, field);
|
||||
}
|
||||
|
||||
virtual void SetEquationOfMotion(G4EquationOfMotion* equation) override;
|
||||
|
||||
virtual G4double GetInverseCurvatureRadius(const G4FieldTrack& track,
|
||||
G4double field[]) const override;
|
||||
virtual G4EquationOfMotion* GetEquationOfMotion() override
|
||||
{
|
||||
return fCurrDriver->GetEquationOfMotion();
|
||||
}
|
||||
|
||||
private:
|
||||
G4double fallbackThreshold;
|
||||
G4Mag_EqRhs* fequation;
|
||||
G4HelixExplicitEuler fallbackStepper;
|
||||
//[[deprecated("use GetEquationOfMotion() instead of GetStepper()->GetEquationOfMotion()")]]
|
||||
virtual const G4MagIntegratorStepper* GetStepper() const override
|
||||
{
|
||||
return fCurrDriver->GetStepper();
|
||||
}
|
||||
|
||||
virtual G4MagIntegratorStepper* GetStepper() override
|
||||
{
|
||||
return fCurrDriver->GetStepper();
|
||||
}
|
||||
|
||||
virtual G4double ComputeNewStepSize(G4double errMaxNorm,
|
||||
G4double hstepCurrent) override
|
||||
{
|
||||
return fCurrDriver->ComputeNewStepSize(errMaxNorm, hstepCurrent);
|
||||
}
|
||||
|
||||
virtual void SetVerboseLevel(G4int level) override
|
||||
{
|
||||
fSmallStepDriver->SetVerboseLevel(level);
|
||||
fLargeStepDriver->SetVerboseLevel(level);
|
||||
}
|
||||
|
||||
virtual G4int GetVerboseLevel() const override
|
||||
{
|
||||
return fCurrDriver->GetVerboseLevel();
|
||||
}
|
||||
|
||||
virtual void OnComputeStep() override
|
||||
{
|
||||
fSmallStepDriver->OnComputeStep();
|
||||
fLargeStepDriver->OnComputeStep();
|
||||
}
|
||||
|
||||
virtual void OnStartTracking() override
|
||||
{
|
||||
fSmallStepDriver->OnStartTracking();
|
||||
fLargeStepDriver->OnStartTracking();
|
||||
}
|
||||
|
||||
void PrintStatistics() const;
|
||||
|
||||
private:
|
||||
|
||||
G4double CurvatureRadius(const G4FieldTrack& track) const;
|
||||
|
||||
void GetFieldValue(const G4FieldTrack& track,
|
||||
G4double Field[] ) const;
|
||||
|
||||
std::unique_ptr<G4VIntegrationDriver> fSmallStepDriver;
|
||||
std::unique_ptr<G4VIntegrationDriver> fLargeStepDriver;
|
||||
G4VIntegrationDriver* fCurrDriver = nullptr;
|
||||
G4Mag_EqRhs* fEquation = nullptr;
|
||||
|
||||
G4int fSmallDriverSteps = 0;
|
||||
G4int fLargeDriverSteps = 0;
|
||||
};
|
||||
|
||||
#include "G4BFieldIntegrationDriver.icc"
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user