Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:58:14

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 // G4EquationOfMotion
0027 //
0028 // Class description:
0029 //
0030 // Abstract Base Class for the right hand size of the equation of
0031 // motion of a particle in a field.
0032 
0033 // Created: J.Apostolakis, 1998
0034 // -------------------------------------------------------------------
0035 #ifndef G4EQUATIONOFMOTION_HH
0036 #define G4EQUATIONOFMOTION_HH
0037 
0038 #include "G4Types.hh"
0039 #include "G4Field.hh"   // required in inline method implementations
0040 
0041 #include "G4ChargeState.hh"
0042 
0043 class G4EquationOfMotion 
0044 {
0045   public:  // with description
0046 
0047      G4EquationOfMotion( G4Field* Field );
0048      virtual ~G4EquationOfMotion();
0049        // Constructor and virtual destructor. No operations.
0050 
0051      virtual void EvaluateRhsGivenB( const G4double y[],
0052                                      const G4double B[3],
0053                                      G4double dydx[] ) const = 0;
0054        // Given the value of the  field "B", this function 
0055        // calculates the value of the derivative dydx.
0056        // --------------------------------------------------------
0057        // This is the _only_ function a subclass must define.
0058        // The other two functions use Rhs_givenB.
0059 
0060      virtual void SetChargeMomentumMass(G4ChargeState particleCharge,
0061                                         G4double MomentumXc,
0062                                         G4double MassXc2) = 0;
0063        // Set the charge, momentum and mass of the current particle
0064        // --> used to set the equation's coefficients ...
0065 
0066      inline void RightHandSide( const G4double y[],
0067                                       G4double dydx[] ) const;
0068        // This calculates the value of the derivative dydx at y.
0069        // It is the usual enquiry function.
0070        // ---------------------------
0071        // (It is not virtual, but calls the virtual function above.)
0072 
0073      inline void EvaluateRhsReturnB( const G4double y[],
0074                                            G4double dydx[],
0075                                            G4double Field[] ) const;
0076        // Same as RHS above, but also returns the value of B.
0077        // Should be made the new default ? after putting dydx & B in a class.
0078 
0079      inline void GetFieldValue( const G4double Point[4],
0080                                       G4double Field[] ) const;
0081        // Obtain only the field - the stepper assumes it is pure Magnetic.
0082        // Not protected, because G4RKG3_Stepper uses it directly.
0083 
0084      inline const G4Field* GetFieldObj() const;
0085      inline G4Field* GetFieldObj();
0086      inline void SetFieldObj(G4Field* pField);
0087 
0088   private:
0089 
0090      G4Field* itsField = nullptr;
0091 };
0092 
0093 #include "G4EquationOfMotion.icc"
0094 
0095 #endif