Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:59:03

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 
0027 #ifndef G4RKPropagation_h
0028 #define G4RKPropagation_h 1
0029 
0030 #include "G4VFieldPropagation.hh"
0031 #include "G4VNuclearField.hh"
0032 #include "G4V3DNucleus.hh"
0033 #include "G4KM_DummyField.hh"
0034 #include "G4Mag_EqRhs.hh"
0035 #include <map>
0036 
0037 
0038 class G4RKPropagation: public G4VFieldPropagation
0039 {
0040 
0041 public:
0042   G4RKPropagation();
0043   virtual ~G4RKPropagation();
0044 
0045 private:
0046   G4RKPropagation(const  G4RKPropagation &right);
0047   const G4RKPropagation & operator=(const G4RKPropagation & right);
0048   G4bool operator==(const G4RKPropagation & right) const;
0049   G4bool operator!=(const G4RKPropagation & right) const;
0050 
0051 public:
0052 
0053   virtual void Init(G4V3DNucleus * nucleus);
0054   virtual void Transport(G4KineticTrackVector &theActive,
0055              const G4KineticTrackVector &theSpectators,
0056              G4double theTimeStep);
0057   G4bool GetSphereIntersectionTimes(const G4KineticTrack * track,
0058                     G4double & t1, G4double & t2);
0059   G4ThreeVector GetMomentumTransfer() const;
0060 private:
0061   G4double theOuterRadius;
0062   G4V3DNucleus * theNucleus;
0063   std::map <G4int, G4VNuclearField *, std::less<G4int> > * theFieldMap;
0064   std::map <G4int, G4Mag_EqRhs *, std::less<G4int> > * theEquationMap;
0065   G4KM_DummyField * theField;
0066 
0067   G4ThreeVector theMomentumTranfer;
0068 
0069   G4bool GetSphereIntersectionTimes(const G4double radius,
0070                     const G4ThreeVector & currentPos,
0071                     const G4LorentzVector & momentum,
0072                     G4double & t1, G4double & t2);
0073 // implementation
0074 
0075   G4bool FieldTransport(G4KineticTrack * track, const G4double timestep);
0076   G4bool FreeTransport(G4KineticTrack * track, const G4double timestep);
0077 
0078   void delete_FieldsAndMap(
0079     std::map <G4int, G4VNuclearField *, std::less<G4int> > * aMap);
0080   void delete_EquationsAndMap(
0081     std::map <G4int, G4Mag_EqRhs *, std::less<G4int> > * aMap);
0082   
0083   public:
0084   inline G4double GetBarrier(G4int encoding) 
0085   {     
0086     std::map <G4int, G4VNuclearField *, std::less<G4int> >::iterator iter;
0087     iter = theFieldMap->find(encoding);
0088     if(iter == theFieldMap->end()) return 0;
0089     return (*theFieldMap)[encoding]->GetBarrier();
0090   }
0091   
0092   inline G4double GetField(G4int encoding,G4ThreeVector pos)
0093   {
0094     std::map <G4int, G4VNuclearField *, std::less<G4int> >::iterator iter;
0095     iter = theFieldMap->find(encoding);
0096     if(iter == theFieldMap->end()) return 0;
0097     return (*theFieldMap)[encoding]->GetField(pos);
0098   }
0099 
0100 };
0101 
0102 #endif
0103 
0104 
0105 
0106 
0107 
0108 
0109 
0110 
0111 
0112 
0113 
0114 
0115 
0116 
0117