G4RKPropagation.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 #ifndef G4RKPropagation_h
00028 #define G4RKPropagation_h 1
00029 
00030 #include "G4VFieldPropagation.hh"
00031 #include "G4VNuclearField.hh"
00032 #include "G4V3DNucleus.hh"
00033 #include "G4KM_DummyField.hh"
00034 #include "G4Mag_EqRhs.hh"
00035 #include <map>
00036 
00037 
00038 class G4RKPropagation: public G4VFieldPropagation
00039 {
00040 
00041 public:
00042   G4RKPropagation();
00043   virtual ~G4RKPropagation();
00044 
00045 private:
00046   G4RKPropagation(const  G4RKPropagation &right);
00047   const G4RKPropagation & operator=(const G4RKPropagation & right);
00048   G4int operator==(const G4RKPropagation & right) const;
00049   G4int operator!=(const G4RKPropagation & right) const;
00050 
00051 public:
00052 
00053   virtual void Init(G4V3DNucleus * nucleus);
00054   virtual void Transport(G4KineticTrackVector &theActive,
00055                          const G4KineticTrackVector &theSpectators,
00056                          G4double theTimeStep);
00057   G4bool GetSphereIntersectionTimes(const G4KineticTrack * track,
00058                                     G4double & t1, G4double & t2);
00059   G4ThreeVector GetMomentumTransfer() const;
00060 private:
00061   G4double theOuterRadius;
00062   G4V3DNucleus * theNucleus;
00063   std::map <G4int, G4VNuclearField *, std::less<G4int> > * theFieldMap;
00064   std::map <G4int, G4Mag_EqRhs *, std::less<G4int> > * theEquationMap;
00065   G4KM_DummyField * theField;
00066 
00067   G4ThreeVector theMomentumTranfer;
00068 
00069   G4bool GetSphereIntersectionTimes(const G4double radius,
00070                                     const G4ThreeVector & currentPos,
00071                                     const G4LorentzVector & momentum,
00072                                     G4double & t1, G4double & t2);
00073 // implementation
00074 
00075   G4bool FieldTransport(G4KineticTrack * track, const G4double timestep);
00076   G4bool FreeTransport(G4KineticTrack * track, const G4double timestep);
00077 
00078   void delete_FieldsAndMap(
00079         std::map <G4int, G4VNuclearField *, std::less<G4int> > * aMap);
00080   void delete_EquationsAndMap(
00081         std::map <G4int, G4Mag_EqRhs *, std::less<G4int> > * aMap);
00082   
00083   public:
00084   inline G4double GetBarrier(G4int encoding) 
00085   {     
00086         std::map <G4int, G4VNuclearField *, std::less<G4int> >::iterator iter;
00087         iter = theFieldMap->find(encoding);
00088         if(iter == theFieldMap->end()) return 0;
00089         return (*theFieldMap)[encoding]->GetBarrier();
00090   }
00091   
00092   inline G4double GetField(G4int encoding,G4ThreeVector pos)
00093   {
00094         std::map <G4int, G4VNuclearField *, std::less<G4int> >::iterator iter;
00095         iter = theFieldMap->find(encoding);
00096         if(iter == theFieldMap->end()) return 0;
00097         return (*theFieldMap)[encoding]->GetField(pos);
00098   }
00099 
00100 };
00101 
00102 #endif
00103 
00104 
00105 
00106 
00107 
00108 
00109 
00110 
00111 
00112 
00113 
00114 
00115 
00116 
00117 

Generated on Mon May 27 17:49:44 2013 for Geant4 by  doxygen 1.4.7