// // ******************************************************************** // * License and Disclaimer * // * * // * The Geant4 software is copyright of the Copyright Holders of * // * the Geant4 Collaboration. It is provided under the terms and * // * conditions of the Geant4 Software License, included in the file * // * LICENSE and available at http://cern.ch/geant4/license . These * // * include a list of copyright holders. * // * * // * Neither the authors of this software system, nor their employing * // * institutes,nor the agencies providing financial support for this * // * work make any representation or warranty, express or implied, * // * regarding this software system or assume any liability for its * // * use. Please see the license in the file LICENSE and URL above * // * for the full disclaimer and the limitation of liability. * // * * // * This code implementation is the result of the scientific and * // * technical work of the GEANT4 collaboration. * // * By using, copying, modifying or distributing the software (or * // * any work based on the software) you agree to acknowledge its * // * use in resulting scientific publications, and indicate your * // * acceptance of all terms of the Geant4 Software license. * // ******************************************************************** // // // $Id: G4ChordFinder.icc,v 1.14 2008/10/29 14:34:35 gcosmo Exp $ // GEANT4 tag $Name: geant4-09-04-beta-01 $ // // G4ChordFinder inline implementations // // -------------------------------------------------------------------- inline void G4ChordFinder::SetIntegrationDriver(G4MagInt_Driver* IntegrationDriver) { fIntgrDriver=IntegrationDriver; } inline G4MagInt_Driver* G4ChordFinder::GetIntegrationDriver() { return fIntgrDriver; } inline G4bool G4ChordFinder::AcceptableMissDist(G4double dChordStep) const { return (dChordStep <= fDeltaChord) ; } inline void G4ChordFinder::SetChargeMomentumMass(G4double pCharge, // in e+ units G4double pMomentum, G4double pMass) { fIntgrDriver-> SetChargeMomentumMass(pCharge, pMomentum, pMass); } inline G4double G4ChordFinder::GetDeltaChord() const { return fDeltaChord; } inline void G4ChordFinder::SetDeltaChord(G4double newval) { fDeltaChord=newval; } // ...................................................................... inline G4double G4ChordFinder::GetLastStepEstimateUnc() { return fLastStepEstimate_Unconstrained; } inline void G4ChordFinder::SetLastStepEstimateUnc( G4double stepEst ) { fLastStepEstimate_Unconstrained = stepEst; } inline void G4ChordFinder::ResetStepEstimate() { fLastStepEstimate_Unconstrained = DBL_MAX; } // ...................................................................... inline G4int G4ChordFinder::GetNoCalls() { return fNoCalls_FNC; } inline G4int G4ChordFinder::GetNoTrials() { return fTotalNoTrials_FNC; } inline G4int G4ChordFinder::GetNoMaxTrials() { return fmaxTrials_FNC; } inline G4double G4ChordFinder::GetFirstFraction() { return fFirstFraction; } inline G4double G4ChordFinder::GetFractionLast() { return fFractionLast; } inline G4double G4ChordFinder::GetFractionNextEstimate() { return fFractionNextEstimate; } inline G4double G4ChordFinder::GetMultipleRadius() { return fMultipleRadius; } inline void G4ChordFinder::SetFirstFraction(G4double val){ fFirstFraction=val; } inline G4int G4ChordFinder::SetVerbose( G4int newvalue ) { G4int oldval= fStatsVerbose; fStatsVerbose = newvalue; return oldval; } inline void G4ChordFinder::AccumulateStatistics( G4int noTrials ) { // Statistics fTotalNoTrials_FNC += noTrials; fNoCalls_FNC++; // if( noTrials >= fmaxTrials_FNC ){ if (noTrials > fmaxTrials_FNC ) { fmaxTrials_FNC=noTrials; // fnoTimesMaxTrFNC=0; } else { // fnoTimesMaxTrFNC++; } // } } // A member that calculates the inverse parabolic through // the three points (x,y) and returns the value x that, for the // inverse parabolic, corresponds to y=0. // inline G4double G4ChordFinder::InvParabolic ( const G4double xa, const G4double ya, const G4double xb, const G4double yb, const G4double xc, const G4double yc ) { const G4double R = yb/yc, S = yb/ya, T = ya/yc; const G4double Q = (T-1)*(R-1)*(S-1); if (std::fabs(Q)