Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 // G4MagInt_Driver inline methods implementati << 27 // 26 // 28 // V.Grichine, 07.10.1996 - Created << 27 // $Id: G4MagIntegratorDriver.icc,v 1.13 2007-05-10 10:10:48 japost Exp $ >> 28 // GEANT4 tag $Name: geant4-09-04-patch-01 $ >> 29 // 29 // ------------------------------------------- 30 // -------------------------------------------------------------------- 30 31 31 inline 32 inline 32 G4double G4MagInt_Driver:: << 33 AdvanceChordLimited(G4FieldTrack& track, G4dou << 34 G4double epsStep, G4double << 35 { << 36 return ChordFinderDelegate::AdvanceChordLimi << 37 << 38 } << 39 << 40 inline << 41 void G4MagInt_Driver::OnStartTracking() << 42 { << 43 ChordFinderDelegate::ResetStepEstimate(); << 44 } << 45 << 46 inline << 47 G4double G4MagInt_Driver::GetHmin() const 33 G4double G4MagInt_Driver::GetHmin() const 48 { 34 { 49 return fMinimumStep; << 35 return fMinimumStep; 50 } 36 } 51 37 52 inline 38 inline 53 G4double G4MagInt_Driver::Hmin() const 39 G4double G4MagInt_Driver::Hmin() const 54 { 40 { 55 return fMinimumStep; << 41 return fMinimumStep; 56 } 42 } 57 43 58 inline 44 inline 59 G4double G4MagInt_Driver::GetSafety() const 45 G4double G4MagInt_Driver::GetSafety() const 60 { 46 { 61 return safety; << 47 return safety; 62 } 48 } 63 49 64 inline 50 inline 65 G4double G4MagInt_Driver::GetPshrnk() const 51 G4double G4MagInt_Driver::GetPshrnk() const 66 { 52 { 67 return pshrnk; << 53 return pshrnk; 68 } 54 } 69 55 70 inline 56 inline 71 G4double G4MagInt_Driver::GetPgrow() const 57 G4double G4MagInt_Driver::GetPgrow() const 72 { 58 { 73 return pgrow; << 59 return pgrow; 74 } 60 } 75 61 76 inline 62 inline 77 G4double G4MagInt_Driver::GetErrcon() const 63 G4double G4MagInt_Driver::GetErrcon() const 78 { 64 { 79 return errcon; << 65 return errcon; 80 } 66 } 81 67 82 inline 68 inline 83 void G4MagInt_Driver::SetHmin(G4double newval) 69 void G4MagInt_Driver::SetHmin(G4double newval) 84 { 70 { 85 fMinimumStep = newval; << 71 fMinimumStep = newval; 86 } 72 } 87 73 88 inline 74 inline 89 G4double G4MagInt_Driver::ComputeAndSetErrcon( 75 G4double G4MagInt_Driver::ComputeAndSetErrcon() 90 { 76 { 91 errcon = std::pow(max_stepping_increase/GetS << 77 errcon = std::pow(max_stepping_increase/GetSafety(),1.0/GetPgrow()); 92 return errcon; << 78 return errcon; 93 } 79 } 94 80 95 inline 81 inline 96 void G4MagInt_Driver::ReSetParameters(G4double 82 void G4MagInt_Driver::ReSetParameters(G4double new_safety) 97 { 83 { 98 safety = new_safety; << 84 safety = new_safety; 99 pshrnk = -1.0 / pIntStepper->IntegratorOrder << 85 pshrnk = -1.0 / pIntStepper->IntegratorOrder(); 100 pgrow = -1.0 / (1.0 + pIntStepper->Integrat << 86 pgrow = -1.0 / (1.0 + pIntStepper->IntegratorOrder()); 101 ComputeAndSetErrcon(); << 87 ComputeAndSetErrcon(); 102 } 88 } 103 89 104 inline 90 inline 105 void G4MagInt_Driver::SetSafety(G4double val) 91 void G4MagInt_Driver::SetSafety(G4double val) 106 { 92 { 107 safety = val; << 93 safety=val; 108 ComputeAndSetErrcon(); << 94 ComputeAndSetErrcon(); 109 } 95 } 110 96 111 inline 97 inline 112 void G4MagInt_Driver::SetPgrow(G4double val) 98 void G4MagInt_Driver::SetPgrow(G4double val) 113 { 99 { 114 pgrow = val; << 100 pgrow=val; 115 ComputeAndSetErrcon(); << 101 ComputeAndSetErrcon(); 116 } 102 } 117 103 118 inline 104 inline 119 void G4MagInt_Driver::SetErrcon(G4double val) 105 void G4MagInt_Driver::SetErrcon(G4double val) 120 { 106 { 121 errcon = val; << 107 errcon=val; >> 108 } >> 109 >> 110 inline >> 111 void G4MagInt_Driver::RenewStepperAndAdjust(G4MagIntegratorStepper *pItsStepper) >> 112 { >> 113 pIntStepper = pItsStepper; >> 114 ReSetParameters(); >> 115 } >> 116 >> 117 inline >> 118 void G4MagInt_Driver::SetChargeMomentumMass(G4double particleCharge, // e+ >> 119 G4double MomentumXc, >> 120 G4double Mass ) >> 121 { >> 122 pIntStepper->GetEquationOfMotion() >> 123 ->SetChargeMomentumMass(particleCharge, MomentumXc, Mass); >> 124 } >> 125 >> 126 inline >> 127 const G4MagIntegratorStepper* G4MagInt_Driver::GetStepper() const >> 128 { >> 129 return pIntStepper; 122 } 130 } 123 131 124 inline 132 inline 125 G4int G4MagInt_Driver::GetMaxNoSteps() const 133 G4int G4MagInt_Driver::GetMaxNoSteps() const 126 { 134 { 127 return fMaxNoSteps; 135 return fMaxNoSteps; 128 } 136 } 129 137 130 inline 138 inline 131 void G4MagInt_Driver::SetMaxNoSteps(G4int val) 139 void G4MagInt_Driver::SetMaxNoSteps(G4int val) 132 { 140 { 133 fMaxNoSteps = val; << 141 fMaxNoSteps= val; 134 } 142 } 135 143 136 inline 144 inline 137 G4int G4MagInt_Driver::GetVerboseLevel() const << 145 void G4MagInt_Driver::GetDerivatives(const G4FieldTrack &y_curr, // const, INput >> 146 G4double dydx[]) // OUTput >> 147 { >> 148 G4double tmpValArr[G4FieldTrack::ncompSVEC]; >> 149 y_curr.DumpToArray( tmpValArr ); >> 150 pIntStepper -> RightHandSide( tmpValArr , dydx ); >> 151 } >> 152 >> 153 inline >> 154 G4double G4MagInt_Driver::GetVerboseLevel() const 138 { 155 { 139 return fVerboseLevel; << 156 return fVerboseLevel; 140 } 157 } 141 158 142 inline 159 inline 143 void G4MagInt_Driver::SetVerboseLevel(G4int ne 160 void G4MagInt_Driver::SetVerboseLevel(G4int newLevel) 144 { 161 { 145 fVerboseLevel = newLevel; << 162 fVerboseLevel= newLevel; 146 } 163 } 147 164 148 inline 165 inline 149 G4double G4MagInt_Driver::GetSmallestFraction( 166 G4double G4MagInt_Driver::GetSmallestFraction() const 150 { 167 { 151 return fSmallestFraction; << 168 return fSmallestFraction; 152 } << 169 } 153 170