source: trunk/source/processes/electromagnetic/standard/src/G4CoulombScattering.cc @ 1315

Last change on this file since 1315 was 1315, checked in by garnier, 14 years ago

update geant4-09-04-beta-cand-01 interfaces-V09-03-09 vis-V09-03-08

File size: 6.1 KB
Line 
1//
2// ********************************************************************
3// * License and Disclaimer                                           *
4// *                                                                  *
5// * The  Geant4 software  is  copyright of the Copyright Holders  of *
6// * the Geant4 Collaboration.  It is provided  under  the terms  and *
7// * conditions of the Geant4 Software License,  included in the file *
8// * LICENSE and available at  http://cern.ch/geant4/license .  These *
9// * include a list of copyright holders.                             *
10// *                                                                  *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work  make  any representation or  warranty, express or implied, *
14// * regarding  this  software system or assume any liability for its *
15// * use.  Please see the license in the file  LICENSE  and URL above *
16// * for the full disclaimer and the limitation of liability.         *
17// *                                                                  *
18// * This  code  implementation is the result of  the  scientific and *
19// * technical work of the GEANT4 collaboration.                      *
20// * By using,  copying,  modifying or  distributing the software (or *
21// * any work based  on the software)  you  agree  to acknowledge its *
22// * use  in  resulting  scientific  publications,  and indicate your *
23// * acceptance of all terms of the Geant4 Software license.          *
24// ********************************************************************
25//
26// $Id: G4CoulombScattering.cc,v 1.28 2010/05/25 18:41:12 vnivanch Exp $
27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
28//
29// -------------------------------------------------------------------
30//
31// GEANT4 Class file
32//
33//
34// File name:     G4CoulombScattering
35//
36// Author:        Vladimir Ivanchenko
37//
38// Creation date: 22.08.2004
39//
40// Modifications:
41// 01.08.06 V.Ivanchenko add choice between G4eCoulombScatteringModel and
42//          G4CoulombScatteringModel
43//
44
45//
46// -------------------------------------------------------------------
47//
48//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
49//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
50
51#include "G4CoulombScattering.hh"
52#include "G4CoulombScatteringModel.hh"
53#include "G4eCoulombScatteringModel.hh"
54//#include "G4hCoulombScatteringModel.hh"
55#include "G4Electron.hh"
56#include "G4Proton.hh"
57#include "G4LossTableManager.hh"
58
59//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
60
61using namespace std;
62
63G4CoulombScattering::G4CoulombScattering(const G4String& name)
64  : G4VEmProcess(name),thetaMin(0.0),thetaMax(pi),q2Max(TeV*TeV),
65    isInitialised(false)
66{
67  //  G4cout << "G4CoulombScattering constructor "<< G4endl;
68  SetBuildTableFlag(true);
69  SetStartFromNullFlag(false);
70  SetIntegral(true);
71  thEnergy = PeV;
72  thEnergyElec = PeV;
73  if(name == "CoulombScat") {
74    thEnergy = 10.*MeV;
75    thEnergyElec = 10.*GeV;
76  }
77  SetSecondaryParticle(G4Electron::Electron());
78  SetProcessSubType(fCoulombScattering);
79}
80
81//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
82
83G4CoulombScattering::~G4CoulombScattering()
84{}
85
86//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
87
88G4bool G4CoulombScattering::IsApplicable(const G4ParticleDefinition& p)
89{
90  return (p.GetPDGCharge() != 0.0 && !p.IsShortLived());
91}
92
93//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
94
95void G4CoulombScattering::InitialiseProcess(const G4ParticleDefinition* p)
96{
97  //G4cout << "### G4CoulombScattering::InitialiseProcess : "
98  //     << p->GetParticleName() << G4endl;
99  G4double a = 
100    G4LossTableManager::Instance()->FactorForAngleLimit()*CLHEP::hbarc/CLHEP::fermi;
101  q2Max = 0.5*a*a;
102 
103  // second initialisation
104  if(isInitialised) {
105    G4VEmModel* mod = GetModelByIndex(0);
106    mod->SetPolarAngleLimit(PolarAngleLimit());
107    mod = GetModelByIndex(1);
108    if(mod) { mod->SetPolarAngleLimit(PolarAngleLimit()); }
109
110    // first initialisation
111  } else {
112    isInitialised = true;
113    aParticle = p;
114    G4double mass = p->GetPDGMass();
115    G4String name = p->GetParticleName();
116    //G4cout << name << "  type: " << p->GetParticleType()
117    //<< " mass= " << mass << G4endl;
118    if (mass > GeV || p->GetParticleType() == "nucleus") {
119      SetBuildTableFlag(false);
120      if(name != "GenericIon") { SetVerboseLevel(0); }
121    } else {
122      if(name != "e-" && name != "e+" &&
123         name != "mu+" && name != "mu-" && name != "pi+" && 
124         name != "kaon+" && name != "proton" ) { SetVerboseLevel(0); }
125    }
126
127    G4double emin = MinKinEnergy();
128    G4double emax = MaxKinEnergy();
129    //    G4gCoulombScatteringModel* model = new G4hCoulombScatteringModel();
130    G4eCoulombScatteringModel* model = new G4eCoulombScatteringModel();
131    model->SetPolarAngleLimit(PolarAngleLimit());
132    model->SetLowEnergyLimit(emin);
133    model->SetHighEnergyLimit(emax);
134    AddEmModel(1, model);
135    /*
136
137    G4double eth  = thEnergy;
138    if(mass < MeV) eth  = thEnergyElec;
139    if(eth > emin) {
140      G4eCoulombScatteringModel* model = new G4eCoulombScatteringModel();
141      model->SetPolarAngleLimit(PolarAngleLimit());
142      model->SetLowEnergyLimit(emin);
143      model->SetHighEnergyLimit(std::min(eth,emax));
144      AddEmModel(1, model);
145    }
146    if(eth < emax) {
147      G4CoulombScatteringModel* model = new G4CoulombScatteringModel();
148      model->SetPolarAngleLimit(PolarAngleLimit());
149      model->SetLowEnergyLimit(eth);
150      model->SetHighEnergyLimit(emax);
151      AddEmModel(2, model);
152    }
153    */
154  }
155}
156
157//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
158
159void G4CoulombScattering::PrintInfo()
160{
161  G4cout << "      " << PolarAngleLimit()/degree
162         << " < Theta(degree) < 180"
163         << ", Eth(MeV)= ";
164
165  if(aParticle->GetPDGMass() < MeV) G4cout << thEnergyElec;
166  else                              G4cout << thEnergy;
167
168  if(q2Max < DBL_MAX) { G4cout << "; pLimit(GeV^1)= " << sqrt(q2Max)/GeV; }
169  G4cout << G4endl;
170}
171
172//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
Note: See TracBrowser for help on using the repository browser.