source: trunk/source/processes/electromagnetic/standard/src/G4eMultipleScattering.cc@ 1005

Last change on this file since 1005 was 991, checked in by garnier, 17 years ago

update

File size: 4.8 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: G4eMultipleScattering.cc,v 1.7 2008/10/23 17:55:20 vnivanch Exp $
27// GEANT4 tag $Name: geant4-09-02 $
28//
29// -----------------------------------------------------------------------------
30//
31// GEANT4 Class file
32//
33// File name: G4eMultipleScattering
34//
35// Author: Vladimir Ivanchenko
36//
37// Creation date: 10 March 2008
38//
39// Modifications:
40//
41// -----------------------------------------------------------------------------
42//
43//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
44//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
45
46#include "G4eMultipleScattering.hh"
47#include "G4UrbanMscModel2.hh"
48#include "G4MscStepLimitType.hh"
49#include "G4Electron.hh"
50#include "G4Positron.hh"
51
52//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
53
54using namespace std;
55
56G4eMultipleScattering::G4eMultipleScattering(const G4String& processName)
57 : G4VMultipleScattering(processName)
58{
59 isInitialized = false;
60 SetRangeFactor(0.04);
61}
62
63//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
64
65G4eMultipleScattering::~G4eMultipleScattering()
66{}
67
68//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
69
70G4bool G4eMultipleScattering::IsApplicable (const G4ParticleDefinition& p)
71{
72 return (p.GetPDGCharge() != 0.0 && !p.IsShortLived());
73 // return (&p == G4Electron::Electron() || &p == G4Positron::Positron());
74}
75
76//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
77
78void G4eMultipleScattering::InitialiseProcess(const G4ParticleDefinition* p)
79{
80 // Modification of parameters between runs
81 if(isInitialized) {
82 if (p->GetParticleType() != "nucleus") {
83 mscUrban->SetStepLimitType(StepLimitType());
84 mscUrban->SetLateralDisplasmentFlag(LateralDisplasmentFlag());
85 mscUrban->SetSkin(Skin());
86 mscUrban->SetRangeFactor(RangeFactor());
87 mscUrban->SetGeomFactor(GeomFactor());
88 }
89 return;
90 }
91
92 // defaults for ions, which cannot be overwritten
93 if (p->GetParticleType() == "nucleus") {
94 SetStepLimitType(fMinimal);
95 SetLateralDisplasmentFlag(false);
96 SetBuildLambdaTable(false);
97 }
98
99 // initialisation of parameters - defaults for particles other
100 // than ions can be overwritten by users
101 mscUrban = new G4UrbanMscModel2();
102 mscUrban->SetStepLimitType(StepLimitType());
103 mscUrban->SetLateralDisplasmentFlag(LateralDisplasmentFlag());
104 mscUrban->SetSkin(Skin());
105 mscUrban->SetRangeFactor(RangeFactor());
106 mscUrban->SetGeomFactor(GeomFactor());
107
108 AddEmModel(1,mscUrban);
109 isInitialized = true;
110 /*
111 G4cout << "G4eMultipleScattering::InitialiseProcess for "
112 << p->GetParticleName()
113 << " skin= " << Skin()
114 << " SA= " << steppingAlgorithm
115 << G4endl;
116 */
117}
118
119//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
120
121void G4eMultipleScattering::PrintInfo()
122{
123 G4cout << " RangeFactor= " << RangeFactor()
124 << ", step limit type: " << StepLimitType()
125 << ", lateralDisplacement: " << LateralDisplasmentFlag()
126 << ", skin= " << Skin()
127 << ", geomFactor= " << GeomFactor()
128 << G4endl;
129}
130
131//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
132
Note: See TracBrowser for help on using the repository browser.