G4VMscModel.cc

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: G4VMscModel.cc 66590 2012-12-23 09:31:50Z vnivanch $
00027 //
00028 // -------------------------------------------------------------------
00029 //
00030 // GEANT4 Class file
00031 //
00032 //
00033 // File name:     G4VMscModel
00034 //
00035 // Author:        Vladimir Ivanchenko
00036 //
00037 // Creation date: 07.03.2008
00038 //
00039 // Modifications:
00040 //
00041 //
00042 // Class Description:
00043 //
00044 // General interface to msc models
00045 
00046 // -------------------------------------------------------------------
00047 //
00048 
00049 #include "G4VMscModel.hh"
00050 #include "G4SystemOfUnits.hh"
00051 #include "G4ParticleChangeForMSC.hh"
00052 #include "G4TransportationManager.hh"
00053 #include "G4LossTableBuilder.hh"
00054 
00055 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
00056 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
00057 
00058 G4VMscModel::G4VMscModel(const G4String& nam):
00059   G4VEmModel(nam), 
00060   safetyHelper(0),
00061   ionisation(0),
00062   facrange(0.04),
00063   facgeom(2.5),
00064   facsafety(0.3),
00065   skin(1.0),
00066   dtrl(0.05),
00067   lambdalimit(mm),
00068   geomMin(1.e-6*CLHEP::mm),
00069   geomMax(1.e50*CLHEP::mm),
00070   steppingAlgorithm(fUseSafety),
00071   samplez(false),
00072   latDisplasment(true)
00073 {
00074   dedx       = 2.0*CLHEP::MeV*CLHEP::cm2/CLHEP::g;
00075   localrange = DBL_MAX;
00076   localtkin  = 0.0;
00077   man = G4LossTableManager::Instance();
00078   currentPart = 0;
00079 }
00080 
00081 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
00082 
00083 G4VMscModel::~G4VMscModel()
00084 {}
00085 
00086 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
00087 
00088 G4ParticleChangeForMSC* 
00089 G4VMscModel::GetParticleChangeForMSC(const G4ParticleDefinition* p)
00090 {
00091   if(!safetyHelper) {
00092     safetyHelper = G4TransportationManager::GetTransportationManager()
00093       ->GetSafetyHelper();
00094     safetyHelper->InitialiseHelper();
00095   }
00096   G4ParticleChangeForMSC* change = 0;
00097   if (pParticleChange) {
00098     change = static_cast<G4ParticleChangeForMSC*>(pParticleChange);
00099   } else {
00100     change = new G4ParticleChangeForMSC();
00101   }
00102   if(p) {
00103 
00104     // table is never built for GenericIon 
00105     if(p->GetParticleName() == "GenericIon") {
00106       if(xSectionTable) {
00107         xSectionTable->clearAndDestroy();
00108         delete xSectionTable;
00109         xSectionTable = 0;
00110       }
00111 
00112       // table is always built for low mass particles 
00113     } else if(p->GetPDGMass() < 4.5*GeV || ForceBuildTableFlag()) {
00114       G4double emin = std::max(LowEnergyLimit(), LowEnergyActivationLimit());
00115       G4double emax = std::min(HighEnergyLimit(), HighEnergyActivationLimit());
00116       emin = std::max(emin, man->MinKinEnergy());
00117       emax = std::min(emax, man->MaxKinEnergy());
00118       G4LossTableBuilder* builder = man->GetTableBuilder();
00119       xSectionTable = builder->BuildTableForModel(xSectionTable, this, p, 
00120                                                   emin, emax, true);
00121       theDensityFactor = builder->GetDensityFactors();
00122       theDensityIdx = builder->GetCoupleIndexes();
00123     }
00124   }
00125   return change;
00126 }
00127 
00128 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
00129 
00130 G4ThreeVector& 
00131 G4VMscModel::SampleScattering(const G4ThreeVector&, G4double)
00132 {
00133   return fDisplacement;
00134 }
00135 
00136 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
00137 
00138 G4double G4VMscModel::ComputeTruePathLengthLimit(const G4Track&, G4double&)
00139 {
00140   return DBL_MAX;
00141 }
00142 
00143 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
00144 
00145 G4double G4VMscModel::ComputeGeomPathLength(G4double truePathLength)
00146 {
00147   return truePathLength;
00148 }
00149 
00150 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
00151 
00152 G4double G4VMscModel::ComputeTrueStepLength(G4double geomPathLength)
00153 {
00154   return geomPathLength;
00155 }
00156 
00157 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
00158 
00159 void G4VMscModel::SampleSecondaries(std::vector<G4DynamicParticle*>*,
00160                                     const G4MaterialCutsCouple*,
00161                                     const G4DynamicParticle*,
00162                                     G4double, G4double)
00163 {}
00164 
00165 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......

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