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