geometry/magneticfield/include/G4Field.hh

Go to the documentation of this file.
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: G4Field.hh,v 1.10 2006/06/29 18:22:13 gunter Exp $
00028 // GEANT4 tag $Name: geant4-09-01-patch-01 $
00029 //
00030 //
00031 // class G4Field
00032 //
00033 // Class description:
00034 //
00035 // Abstract class for any kind of Field.
00036 // It allows any kind of field (vector, scalar, tensor and any set of them)
00037 // to be defined by implementing the inquiry function interface.
00038 //
00039 // The key method is  GetFieldValue( const  double Point[4],
00040 //                    *************         double *fieldArr ) 
00041 // Given an input position/time vector 'Point', 
00042 // this method must return the value of the field in "fieldArr".
00043 //
00044 // A field must also specify whether it changes a track's energy:
00045 //                    DoesFieldChangeEnergy() 
00046 //                    *********************
00047 // A field must co-work with a corresponding Equation of Motion, to
00048 // enable the integration of a particle's position, momentum and, optionally, 
00049 // spin.  For this a field and its equation of motion must follow the
00050 // same convention for the order of field components in the array "fieldArr"
00051 // -------------------------------------------------------------------
00052 // History:
00053 // - Created:  John Apostolakis, 10.03.1997
00054 // - Modified: 
00055 //   V. Grichine     8 Nov 2001: Extended "Point" arg to [4] array to add time
00056 //   J. Apostolakis  5 Nov 2003: Added virtual method DoesFieldChangeEnergy()
00057 //   J. Apostolakis 31 Aug 2004: Information on convention for components
00058 // -------------------------------------------------------------------
00059 
00060 #ifndef G4FIELD_HH
00061 #define G4FIELD_HH
00062 
00063 #include "G4Types.hh"
00064 
00065 class G4Field
00066 {
00067   public:  // with description
00068 
00069       virtual void  GetFieldValue( const  double Point[4],
00070                                           double *fieldArr ) const = 0;
00071        // Given the position time vector 'Point', 
00072        // return the value of the field in the array fieldArr.
00073        //  Notes: 
00074        //   1) The 'Point' vector has the following structure:
00075        //        Point[0]  is  x  ( position, in Geant4 units )
00076        //        Point[1]  is  y
00077        //        Point[2]  is  z
00078        //        Point[3]  is  t  ( time,  in Geant4 units )
00079        //   2) The convention for the components of the field
00080        //      array 'fieldArr' are determined by the type of field.
00081        //      See for example the class G4ElectroMagneticField.
00082 
00083       G4Field(){;}
00084       virtual ~G4Field(){;}
00085       inline G4Field& operator = (const G4Field &p); 
00086 
00087      // A field signature function that can be used to insure
00088      // that the Equation of motion object and the G4Field object
00089      // have the same "field signature"?
00090  
00091       virtual G4bool   DoesFieldChangeEnergy() const= 0 ;
00092        //  Each type/class of field should respond this accordingly
00093        //  For example:
00094        //    - an electric field     should return "true"
00095        //    - a pure magnetic field should return "false"
00096 
00097 };
00098 
00099 inline G4Field& G4Field::operator = (const G4Field &p)
00100 {
00101   if (&p != this) { *this = p; }
00102   return *this;
00103 }
00104 
00105 #endif /* G4FIELD_HH */

Generated on Fri Apr 11 17:09:50 2008 for Geant4 by  doxygen 1.4.7