Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4ChordFinderDelegate.hh
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26// G4ChordFinderDelegate
27//
28// Class description:
29//
30// Implementation of common algorithm of finding step size
31// with distance to chord less then provided value.
32
33// Created: D.Sorokin
34// --------------------------------------------------------------------
35#ifndef G4CHORD_FINDER_DELEGATE_HH
36#define G4CHORD_FINDER_DELEGATE_HH
37
39
40template <class Driver>
42{
43 public:
44
46
48 G4double hstep,
49 G4double eps,
50 G4double chordDistance);
52
53 void TestChordPrint(G4int noTrials,
54 G4int lastStepTrial,
55 G4double dChordStep,
56 G4double fDeltaChord,
57 G4double nextStepTrial);
58
59 // Get statistics about number of calls & trials in FindNextChord
61 G4int GetNoTrials(); // Total number of trials
62 G4int GetNoMaxTrials(); // Maximum # of trials for one call
63
64 // Parameters for performance ... change with great care
65 void SetFractions_Last_Next(G4double fractLast = 0.90,
66 G4double fractNext = 0.95);
67 void SetFirstFraction(G4double fractFirst);
68
69 // Printing for monitoring ...
70 G4double GetFirstFraction(); // Originally 0.999
71 G4double GetFractionLast(); // Originally 1.000
72 G4double GetFractionNextEstimate(); // Originally 0.980
73
76
77 void StreamDelegateInfo( std::ostream& os ) const;
78 // Write out the parameters / state of the driver
79
80 private:
81
82 Driver& GetDriver();
83
84 G4double FindNextChord(const G4FieldTrack& yStart,
85 G4double stepMax,
86 G4double epsStep,
87 G4double chordDistance,
88 G4FieldTrack& yEnd, // Endpoint
89 G4double& dyErrPos, // Error of endpoint
90 G4double& pStepForAccuracy);
91
92 G4double NewStep(G4double stepTrialOld,
93 G4double dChordStep, // Curr. dchord achieved
94 G4double fDeltaChord,
95 G4double& stepEstimate_Unconstrained);
96
97 void AccumulateStatistics(G4int noTrials);
98
99 void PrintStatistics();
100
101 G4double fFirstFraction = 0.999;
102 G4double fFractionLast = 1.0;
103 G4double fFractionNextEstimate = 0.98;
104 G4double fLastStepEstimate_Unconstrained = DBL_MAX;
105
106 G4int fTotalNoTrials = 0;
107 G4int fNoCalls = 0;
108 G4int fmaxTrials = 0;
109};
110
111#include "G4ChordFinderDelegate.icc"
112
113#endif
double G4double
Definition: G4Types.hh:83
int G4int
Definition: G4Types.hh:85
G4double GetFirstFraction()
void StreamDelegateInfo(std::ostream &os) const
void SetFractions_Last_Next(G4double fractLast=0.90, G4double fractNext=0.95)
void SetFirstFraction(G4double fractFirst)
void SetLastStepEstimateUnc(G4double stepEst)
G4double AdvanceChordLimitedImpl(G4FieldTrack &track, G4double hstep, G4double eps, G4double chordDistance)
G4double GetFractionNextEstimate()
G4double GetFractionLast()
void TestChordPrint(G4int noTrials, G4int lastStepTrial, G4double dChordStep, G4double fDeltaChord, G4double nextStepTrial)
virtual ~G4ChordFinderDelegate()
G4double GetLastStepEstimateUnc()
#define DBL_MAX
Definition: templates.hh:62