| [831] | 1 | //
|
|---|
| 2 | // ********************************************************************
|
|---|
| 3 | // * License and Disclaimer *
|
|---|
| 4 | // * *
|
|---|
| 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. *
|
|---|
| 10 | // * *
|
|---|
| 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. *
|
|---|
| 17 | // * *
|
|---|
| 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 | // ********************************************************************
|
|---|
| 25 | //
|
|---|
| 26 | //
|
|---|
| 27 | // $Id: G4EquationOfMotion.hh,v 1.10 2006/06/29 18:22:05 gunter Exp $
|
|---|
| [921] | 28 | // GEANT4 tag $Name: geant4-09-02-cand-01 $
|
|---|
| [831] | 29 | //
|
|---|
| 30 | //
|
|---|
| 31 | // class G4EquationOfMotion
|
|---|
| 32 | //
|
|---|
| 33 | // Class description:
|
|---|
| 34 | //
|
|---|
| 35 | // Abstract Base Class for the right hand size of the equation of
|
|---|
| 36 | // motion of a particle in a field.
|
|---|
| 37 |
|
|---|
| 38 | // History:
|
|---|
| 39 | // - Created. J.Apostolakis
|
|---|
| 40 | // -------------------------------------------------------------------
|
|---|
| 41 |
|
|---|
| 42 | #ifndef G4_EquationOfMotion_DEF
|
|---|
| 43 | #define G4_EquationOfMotion_DEF
|
|---|
| 44 |
|
|---|
| 45 | #include "G4Types.hh" // "globals.hh"
|
|---|
| 46 | #include "G4Field.hh" // required in inline method implementations
|
|---|
| 47 |
|
|---|
| 48 | class G4EquationOfMotion
|
|---|
| 49 | {
|
|---|
| 50 | public: // with description
|
|---|
| 51 |
|
|---|
| 52 | G4EquationOfMotion( G4Field *Field );
|
|---|
| 53 | virtual ~G4EquationOfMotion();
|
|---|
| 54 | // Constructor and virtual destructor. No operations.
|
|---|
| 55 |
|
|---|
| 56 | virtual void EvaluateRhsGivenB( const G4double y[],
|
|---|
| 57 | const G4double B[3],
|
|---|
| 58 | G4double dydx[] ) const = 0;
|
|---|
| 59 | // Given the value of the field "B", this function
|
|---|
| 60 | // calculates the value of the derivative dydx.
|
|---|
| 61 | // --------------------------------------------------------
|
|---|
| 62 | // This is the _only_ function a subclass must define.
|
|---|
| 63 | // The other two functions use Rhs_givenB.
|
|---|
| 64 |
|
|---|
| 65 | virtual void SetChargeMomentumMass(G4double particleCharge, // in e+ units
|
|---|
| 66 | G4double MomentumXc,
|
|---|
| 67 | G4double MassXc2) = 0;
|
|---|
| 68 | // Set the charge, momentum and mass of the current particle
|
|---|
| 69 | // --> used to set the equation's coefficients ...
|
|---|
| 70 |
|
|---|
| 71 | inline
|
|---|
| 72 | void RightHandSide( const G4double y[],
|
|---|
| 73 | G4double dydx[] ) const;
|
|---|
| 74 | // This calculates the value of the derivative dydx at y.
|
|---|
| 75 | // It is the usual enquiry function.
|
|---|
| 76 | // ---------------------------
|
|---|
| 77 | // (It is not virtual, but calls the virtual function above.)
|
|---|
| 78 |
|
|---|
| 79 | void EvaluateRhsReturnB( const G4double y[],
|
|---|
| 80 | G4double dydx[],
|
|---|
| 81 | G4double Field[] ) const;
|
|---|
| 82 | // Same as RHS above, but also returns the value of B.
|
|---|
| 83 | // Should be made the new default ? after putting dydx & B in a class.
|
|---|
| 84 |
|
|---|
| 85 | void GetFieldValue( const G4double Point[4],
|
|---|
| 86 | G4double Field[] ) const;
|
|---|
| 87 | // Obtain only the field - the stepper assumes it is pure Magnetic.
|
|---|
| 88 | // Not protected, because G4RKG3_Stepper uses it directly.
|
|---|
| 89 |
|
|---|
| 90 | const G4Field* GetFieldObj() const;
|
|---|
| 91 | void SetFieldObj(G4Field* pField);
|
|---|
| 92 |
|
|---|
| 93 | private:
|
|---|
| 94 | // static const int G4maximum_number_of_field_components = 16;
|
|---|
| 95 | enum { G4maximum_number_of_field_components = 16 } ;
|
|---|
| 96 |
|
|---|
| 97 | G4Field *itsField;
|
|---|
| 98 |
|
|---|
| 99 | };
|
|---|
| 100 |
|
|---|
| 101 | #include "G4EquationOfMotion.icc"
|
|---|
| 102 |
|
|---|
| 103 | #endif /* G4_EquationOfMotion_DEF */
|
|---|