00001 // 00002 // ******************************************************************** 00003 // * License and Disclaimer * 00004 // * * 00005 // * The Geant4 software is copyright of the Copyright Holders of * 00006 // * the Geant4 Collaboration. It is provided under the terms and * 00007 // * conditions of the Geant4 Software License, included in the file * 00008 // * LICENSE and available at http://cern.ch/geant4/license . These * 00009 // * include a list of copyright holders. * 00010 // * * 00011 // * Neither the authors of this software system, nor their employing * 00012 // * institutes,nor the agencies providing financial support for this * 00013 // * work make any representation or warranty, express or implied, * 00014 // * regarding this software system or assume any liability for its * 00015 // * use. Please see the license in the file LICENSE and URL above * 00016 // * for the full disclaimer and the limitation of liability. * 00017 // * * 00018 // * This code implementation is the result of the scientific and * 00019 // * technical work of the GEANT4 collaboration. * 00020 // * By using, copying, modifying or distributing the software (or * 00021 // * any work based on the software) you agree to acknowledge its * 00022 // * use in resulting scientific publications, and indicate your * 00023 // * acceptance of all terms of the Geant4 Software license. * 00024 // ******************************************************************** 00025 // 00026 // 00027 // $Id: G4EquationOfMotion.hh 69786 2013-05-15 09:38:51Z gcosmo $ 00028 // 00029 // 00030 // class G4EquationOfMotion 00031 // 00032 // Class description: 00033 // 00034 // Abstract Base Class for the right hand size of the equation of 00035 // motion of a particle in a field. 00036 00037 // History: 00038 // - Created. J.Apostolakis 00039 // ------------------------------------------------------------------- 00040 00041 #ifndef G4_EquationOfMotion_DEF 00042 #define G4_EquationOfMotion_DEF 00043 00044 #include "G4Types.hh" // "globals.hh" 00045 #include "G4Field.hh" // required in inline method implementations 00046 00047 class G4EquationOfMotion 00048 { 00049 public: // with description 00050 00051 G4EquationOfMotion( G4Field *Field ); 00052 virtual ~G4EquationOfMotion(); 00053 // Constructor and virtual destructor. No operations. 00054 00055 virtual void EvaluateRhsGivenB( const G4double y[], 00056 const G4double B[3], 00057 G4double dydx[] ) const = 0; 00058 // Given the value of the field "B", this function 00059 // calculates the value of the derivative dydx. 00060 // -------------------------------------------------------- 00061 // This is the _only_ function a subclass must define. 00062 // The other two functions use Rhs_givenB. 00063 00064 virtual void SetChargeMomentumMass(G4double particleCharge, // in e+ units 00065 G4double MomentumXc, 00066 G4double MassXc2) = 0; 00067 // Set the charge, momentum and mass of the current particle 00068 // --> used to set the equation's coefficients ... 00069 00070 inline 00071 void RightHandSide( const G4double y[], 00072 G4double dydx[] ) const; 00073 // This calculates the value of the derivative dydx at y. 00074 // It is the usual enquiry function. 00075 // --------------------------- 00076 // (It is not virtual, but calls the virtual function above.) 00077 00078 void EvaluateRhsReturnB( const G4double y[], 00079 G4double dydx[], 00080 G4double Field[] ) const; 00081 // Same as RHS above, but also returns the value of B. 00082 // Should be made the new default ? after putting dydx & B in a class. 00083 00084 void GetFieldValue( const G4double Point[4], 00085 G4double Field[] ) const; 00086 // Obtain only the field - the stepper assumes it is pure Magnetic. 00087 // Not protected, because G4RKG3_Stepper uses it directly. 00088 00089 const G4Field* GetFieldObj() const; 00090 void SetFieldObj(G4Field* pField); 00091 00092 private: 00093 // static const int G4maximum_number_of_field_components = 16; 00094 enum { G4maximum_number_of_field_components = 16 } ; 00095 00096 G4Field *itsField; 00097 00098 }; 00099 00100 #include "G4EquationOfMotion.icc" 00101 00102 #endif /* G4_EquationOfMotion_DEF */