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