File indexing completed on 2025-01-18 09:58:02
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035 #ifndef G4CHORD_FINDER_DELEGATE_HH
0036 #define G4CHORD_FINDER_DELEGATE_HH
0037
0038 #include "G4VIntegrationDriver.hh"
0039
0040 template <class Driver>
0041 class G4ChordFinderDelegate
0042 {
0043 public:
0044
0045 virtual ~G4ChordFinderDelegate();
0046
0047 G4double AdvanceChordLimitedImpl(G4FieldTrack& track,
0048 G4double hstep,
0049 G4double eps,
0050 G4double chordDistance);
0051 void ResetStepEstimate();
0052
0053 void TestChordPrint(G4int noTrials,
0054 G4int lastStepTrial,
0055 G4double dChordStep,
0056 G4double fDeltaChord,
0057 G4double nextStepTrial);
0058
0059
0060 G4int GetNoCalls();
0061 G4int GetNoTrials();
0062 G4int GetNoMaxTrials();
0063
0064
0065 void SetFractions_Last_Next(G4double fractLast = 0.90,
0066 G4double fractNext = 0.95);
0067 void SetFirstFraction(G4double fractFirst);
0068
0069
0070 G4double GetFirstFraction();
0071 G4double GetFractionLast();
0072 G4double GetFractionNextEstimate();
0073
0074 G4double GetLastStepEstimateUnc();
0075 void SetLastStepEstimateUnc(G4double stepEst);
0076
0077 void StreamDelegateInfo( std::ostream& os ) const;
0078
0079
0080 private:
0081
0082 Driver& GetDriver();
0083
0084 G4double FindNextChord(const G4FieldTrack& yStart,
0085 G4double stepMax,
0086 G4double epsStep,
0087 G4double chordDistance,
0088 G4FieldTrack& yEnd,
0089 G4double& dyErrPos,
0090 G4double& pStepForAccuracy);
0091
0092 G4double NewStep(G4double stepTrialOld,
0093 G4double dChordStep,
0094 G4double fDeltaChord,
0095 G4double& stepEstimate_Unconstrained);
0096
0097 void AccumulateStatistics(G4int noTrials);
0098
0099 void PrintStatistics();
0100
0101 G4double fFirstFraction = 0.999;
0102 G4double fFractionLast = 1.0;
0103 G4double fFractionNextEstimate = 0.98;
0104 G4double fLastStepEstimate_Unconstrained = DBL_MAX;
0105
0106 G4int fTotalNoTrials = 0;
0107 G4int fNoCalls = 0;
0108 G4int fmaxTrials = 0;
0109 };
0110
0111 #include "G4ChordFinderDelegate.icc"
0112
0113 #endif