G4CoulombScattering.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$
00027 //
00028 // -------------------------------------------------------------------
00029 //
00030 // GEANT4 Class file
00031 //
00032 //
00033 // File name:     G4CoulombScattering
00034 //
00035 // Author:        Vladimir Ivanchenko 
00036 //
00037 // Creation date: 22.08.2004
00038 //
00039 // Modifications:
00040 // 01.08.06 V.Ivanchenko add choice between G4eCoulombScatteringModel and
00041 //          G4CoulombScatteringModel
00042 //
00043 
00044 //
00045 // -------------------------------------------------------------------
00046 //
00047 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
00048 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
00049 
00050 #include "G4CoulombScattering.hh"
00051 #include "G4SystemOfUnits.hh"
00052 #include "G4eCoulombScatteringModel.hh"
00053 #include "G4Proton.hh"
00054 #include "G4LossTableManager.hh"
00055 
00056 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
00057 
00058 using namespace std;
00059 
00060 G4CoulombScattering::G4CoulombScattering(const G4String& name)
00061   : G4VEmProcess(name),q2Max(TeV*TeV),isInitialised(false)
00062 {
00063   //  G4cout << "G4CoulombScattering constructor "<< G4endl;
00064   SetBuildTableFlag(true);
00065   SetStartFromNullFlag(false);
00066   SetIntegral(true);
00067   SetSecondaryParticle(G4Proton::Proton());
00068   SetProcessSubType(fCoulombScattering);
00069   SetSplineFlag(true);
00070 }
00071 
00072 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
00073 
00074 G4CoulombScattering::~G4CoulombScattering()
00075 {}
00076 
00077 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
00078 
00079 G4bool G4CoulombScattering::IsApplicable(const G4ParticleDefinition& p)
00080 {
00081   return (p.GetPDGCharge() != 0.0 && !p.IsShortLived());
00082 }
00083 
00084 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
00085 
00086 void G4CoulombScattering::InitialiseProcess(const G4ParticleDefinition* p)
00087 {
00088   // second initialisation not allowed for the time being
00089   // this means that polar angle limit change will not be appled 
00090   // after first initialisation
00091   if(isInitialised) { return; }
00092 
00093   G4double a = G4LossTableManager::Instance()->FactorForAngleLimit()
00094     *CLHEP::hbarc/CLHEP::fermi;
00095   q2Max = 0.5*a*a;
00096   G4double theta = PolarAngleLimit();
00097 
00098   // restricted or non-restricted cross section table
00099   G4bool yes = false;
00100   if(theta == CLHEP::pi) { yes = true; }
00101   SetStartFromNullFlag(yes);
00102   /*
00103   G4cout << "### G4CoulombScattering::InitialiseProcess: "
00104          << p->GetParticleName()
00105          << " Emin(MeV)= " << MinKinEnergy()/MeV
00106          << " Emax(TeV)= " << MaxKinEnergy()/TeV
00107          << " nbins= " << LambdaBinning()
00108          << " theta= " << theta
00109          << G4endl;
00110   */
00111   /*
00112   // second initialisation
00113   if(isInitialised) {
00114     G4VEmModel* mod = EmModel(1);
00115     mod->SetPolarAngleLimit(theta);
00116     mod = GetModelByIndex(1);
00117     if(mod) { mod->SetPolarAngleLimit(theta); }
00118 
00119     // first initialisation
00120   } else {
00121   */
00122 
00123   isInitialised = true;
00124   G4double mass = p->GetPDGMass();
00125   G4String name = p->GetParticleName();
00126   //G4cout << name << "  type: " << p->GetParticleType() 
00127   //<< " mass= " << mass << G4endl;
00128   if (mass > GeV || p->GetParticleType() == "nucleus") {
00129     SetBuildTableFlag(false);
00130     if(name != "GenericIon") { SetVerboseLevel(0); }
00131   } else {
00132     if(name != "e-" && name != "e+" &&
00133        name != "mu+" && name != "mu-" && name != "pi+" && 
00134        name != "kaon+" && name != "proton" ) { SetVerboseLevel(0); }
00135   }
00136 
00137   if(!EmModel(1)) { SetEmModel(new G4eCoulombScatteringModel(), 1); }
00138   G4VEmModel* model = EmModel(1);
00139   G4double emin = std::max(MinKinEnergy(),model->LowEnergyLimit());
00140   G4double emax = std::min(MaxKinEnergy(),model->HighEnergyLimit());
00141   model->SetPolarAngleLimit(theta);
00142   model->SetLowEnergyLimit(emin);
00143   model->SetHighEnergyLimit(emax);
00144   AddEmModel(1, model);
00145 }
00146 
00147 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
00148 
00149 G4double G4CoulombScattering::MinPrimaryEnergy(const G4ParticleDefinition* part,
00150                                                const G4Material* mat)
00151 {
00152   // Pure Coulomb scattering
00153   G4double emin = 0.0;
00154 
00155   // Coulomb scattering combined with multiple or hadronic scattering
00156   G4double theta = PolarAngleLimit();
00157   if(0.0 < theta) {
00158     G4double p2 = q2Max*mat->GetIonisation()->GetInvA23()/(1.0 - cos(theta));
00159     G4double mass = part->GetPDGMass();
00160     emin = sqrt(p2 + mass*mass) - mass;
00161   }
00162 
00163   return emin;
00164 }
00165 
00166 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
00167 
00168 void G4CoulombScattering::PrintInfo()
00169 {
00170   G4cout << "      " << PolarAngleLimit()/degree
00171          << " < Theta(degree) < 180";
00172 
00173   if(q2Max < DBL_MAX) { G4cout << "; pLimit(GeV^1)= " << sqrt(q2Max)/GeV; }
00174   G4cout << G4endl;
00175 }
00176 
00177 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....

Generated on Mon May 27 17:47:58 2013 for Geant4 by  doxygen 1.4.7