G4WentzelVIModel.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 // $Id: G4WentzelVIModel.hh 66592 2012-12-23 09:34:55Z vnivanch $
00027 //
00028 // -------------------------------------------------------------------
00029 //
00030 //
00031 // GEANT4 Class header file
00032 //
00033 //
00034 // File name:     G4WentzelVIModel
00035 //
00036 // Author:        V.Ivanchenko 
00037 //
00038 // Creation date: 09.04.2008 from G4MuMscModel
00039 //
00040 // Modifications:
00041 // 27-05-2010 V.Ivanchenko added G4WentzelOKandVIxSection class to
00042 //              compute cross sections and sample scattering angle
00043 //
00044 // Class Description:
00045 //
00046 // Implementation of the model of multiple scattering based on
00047 // G.Wentzel, Z. Phys. 40 (1927) 590.
00048 // H.W.Lewis, Phys Rev 78 (1950) 526.
00049 // J.M. Fernandez-Varea et al., NIM B73 (1993) 447.
00050 // L.Urban, CERN-OPEN-2006-077.
00051 
00052 // -------------------------------------------------------------------
00053 //
00054 
00055 #ifndef G4WentzelVIModel_h
00056 #define G4WentzelVIModel_h 1
00057 
00058 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
00059 
00060 #include "G4VMscModel.hh"
00061 #include "G4MaterialCutsCouple.hh"
00062 #include "G4WentzelOKandVIxSection.hh"
00063 
00064 class G4ParticleDefinition;
00065 class G4LossTableManager;
00066 class G4NistManager;
00067 class G4Pow;
00068 
00069 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
00070 
00071 class G4WentzelVIModel : public G4VMscModel
00072 {
00073 
00074 public:
00075 
00076   G4WentzelVIModel(const G4String& nam = "WentzelVIUni");
00077 
00078   virtual ~G4WentzelVIModel();
00079 
00080   virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&);
00081 
00082   void StartTracking(G4Track*);
00083 
00084   virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition*,
00085                                               G4double KineticEnergy,
00086                                               G4double AtomicNumber,
00087                                               G4double AtomicWeight=0., 
00088                                               G4double cut = DBL_MAX,
00089                                               G4double emax= DBL_MAX);
00090 
00091   virtual G4ThreeVector& SampleScattering(const G4ThreeVector&, 
00092                                           G4double safety);
00093 
00094   virtual G4double ComputeTruePathLengthLimit(const G4Track& track,
00095                                               G4double& currentMinimalStep);
00096 
00097   virtual G4double ComputeGeomPathLength(G4double truePathLength);
00098 
00099   virtual G4double ComputeTrueStepLength(G4double geomStepLength);
00100 
00101 private:
00102 
00103   G4double ComputeXSectionPerVolume();
00104 
00105   inline void SetupParticle(const G4ParticleDefinition*);
00106 
00107   inline void DefineMaterial(const G4MaterialCutsCouple*);
00108 
00109   //  hide assignment operator
00110   G4WentzelVIModel & operator=(const  G4WentzelVIModel &right);
00111   G4WentzelVIModel(const  G4WentzelVIModel&);
00112 
00113   G4LossTableManager*       theManager;
00114   G4NistManager*            fNistManager;
00115   G4ParticleChangeForMSC*   fParticleChange;
00116   G4WentzelOKandVIxSection* wokvi;
00117   G4Pow*                    fG4pow;
00118 
00119   const G4DataVector*       currentCuts;
00120 
00121   G4double tlimitminfix;
00122   G4double invsqrt12;
00123 
00124   // cache kinematics
00125   G4double preKinEnergy;
00126   G4double tPathLength;
00127   G4double zPathLength;
00128   G4double lambdaeff;
00129   G4double currentRange; 
00130 
00131   // data for single scattering mode
00132   G4double xtsec;
00133   std::vector<G4double> xsecn;
00134   std::vector<G4double> prob;
00135   G4int    nelments;
00136 
00137   G4double numlimit;
00138 
00139   // cache material
00140   G4int    currentMaterialIndex;
00141   const G4MaterialCutsCouple* currentCouple;
00142   const G4Material* currentMaterial;
00143 
00144   // single scattering parameters
00145   G4double cosThetaMin;
00146   G4double cosThetaMax;
00147   G4double cosTetMaxNuc;
00148 
00149   // projectile
00150   const G4ParticleDefinition* particle;
00151   G4double lowEnergyLimit;
00152 
00153   // flags
00154   G4bool   inside;
00155   G4bool   singleScatteringMode;
00156 };
00157 
00158 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
00159 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
00160 
00161 inline
00162 void G4WentzelVIModel::DefineMaterial(const G4MaterialCutsCouple* cup) 
00163 { 
00164   if(cup != currentCouple) {
00165     currentCouple = cup;
00166     SetCurrentCouple(cup); 
00167     currentMaterial = cup->GetMaterial();
00168     currentMaterialIndex = currentCouple->GetIndex(); 
00169   }
00170 }
00171 
00172 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
00173 
00174 inline void G4WentzelVIModel::SetupParticle(const G4ParticleDefinition* p)
00175 {
00176   // Initialise mass and charge
00177   if(p != particle) {
00178     particle = p;
00179     wokvi->SetupParticle(p);
00180   }
00181 }
00182 
00183 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
00184 
00185 #endif
00186 

Generated on Mon May 27 17:50:25 2013 for Geant4 by  doxygen 1.4.7