2// ********************************************************************
3// * License and Disclaimer *
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. *
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. *
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// ********************************************************************
26// G4ChordFinder inline implementations
28// Author: J.Apostolakis - Design and implementation - 25.02.1997
29// --------------------------------------------------------------------
32void G4ChordFinder::SetIntegrationDriver(G4VIntegrationDriver* driver)
34 fIntgrDriver = driver;
38G4VIntegrationDriver* G4ChordFinder::GetIntegrationDriver()
44G4double G4ChordFinder::GetDeltaChord() const
50void G4ChordFinder::SetDeltaChord(G4double newval)
56void G4ChordFinder::ResetStepEstimate()
58 fIntgrDriver->OnStartTracking();
62G4int G4ChordFinder::SetVerbose( G4int newvalue )
64 G4int oldval = fStatsVerbose;
65 fStatsVerbose = newvalue;
69// A member that calculates the inverse parabolic through
70// the three points (x,y) and returns the value x that, for the
71// inverse parabolic, corresponds to y=0.
74G4double G4ChordFinder::InvParabolic ( const G4double xa, const G4double ya,
75 const G4double xb, const G4double yb,
76 const G4double xc, const G4double yc )
78 const G4double R = yb/yc,
81 const G4double Q = (T-1)*(R-1)*(S-1);
82 if (std::fabs(Q) <DBL_MIN ) return DBL_MAX;
84 const G4double P = S*(T*(R-T)*(xc-xb) - (1-R)*(xb-xa));
89G4ChordFinder::AdvanceChordLimited(G4FieldTrack& yCurrent,
91 G4double epsStep_Relative,
92 const G4ThreeVector& /*latestSafetyOrigin*/,
93 G4double /*lasestSafetyRadius*/)
95 return fIntgrDriver->AdvanceChordLimited(yCurrent, stepInitial,
96 epsStep_Relative, fDeltaChord);
100void G4ChordFinder::OnComputeStep()
102 fIntgrDriver->OnComputeStep();