source: trunk/examples/extended/parallel/ExDiane/src/BrachyPhysicsList.cc@ 1036

Last change on this file since 1036 was 807, checked in by garnier, 17 years ago

update

File size: 5.2 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//
27// Code developed by: S.Guatelli
28//
29// **********************************
30// * *
31// * BrachyPhysicsList.cc *
32// * *
33// **********************************
34//
35// $Id: BrachyPhysicsList.cc,v 1.3 2006/06/29 17:33:29 gunter Exp $
36// GEANT4 tag $Name: $
37//
38#include "BrachyPhysicsList.hh"
39
40#include "G4ParticleDefinition.hh"
41#include "G4ParticleWithCuts.hh"
42#include "G4ProcessManager.hh"
43#include "G4ParticleTypes.hh"
44#include "G4ParticleTable.hh"
45#include "G4Material.hh"
46#include "G4UnitsTable.hh"
47#include "G4ios.hh"
48
49
50BrachyPhysicsList::BrachyPhysicsList(): G4VUserPhysicsList()
51{
52 defaultCutValue = 0.1*mm;
53 cutForGamma = defaultCutValue;
54 cutForElectron = defaultCutValue;
55 cutForPositron = defaultCutValue;
56
57 SetVerboseLevel(1);
58}
59
60BrachyPhysicsList::~BrachyPhysicsList()
61{
62}
63
64void BrachyPhysicsList::ConstructParticle()
65{
66 // In this method, static member functions should be called
67 // for all particles which you want to use.
68 // This ensures that objects of these particle types will be
69 // created in the program.
70
71 ConstructBosons();
72 ConstructLeptons();
73}
74
75void BrachyPhysicsList::ConstructBosons()
76{
77 // gamma
78 G4Gamma::GammaDefinition();
79
80}
81
82void BrachyPhysicsList::ConstructLeptons()
83{
84 // leptons
85 G4Electron::ElectronDefinition();
86 G4Positron::PositronDefinition();
87}
88
89void BrachyPhysicsList::ConstructProcess()
90{
91 AddTransportation();
92 ConstructEM();
93}
94
95#include "G4MultipleScattering.hh"
96// gamma
97#include "G4LowEnergyRayleigh.hh"
98#include "G4LowEnergyPhotoElectric.hh"
99#include "G4LowEnergyCompton.hh"
100#include "G4LowEnergyGammaConversion.hh"
101// e-
102#include "G4LowEnergyIonisation.hh"
103#include "G4LowEnergyBremsstrahlung.hh"
104// e+
105#include "G4eIonisation.hh"
106#include "G4eBremsstrahlung.hh"
107#include "G4eplusAnnihilation.hh"
108
109void BrachyPhysicsList::ConstructEM()
110{
111 theParticleIterator -> reset();
112 while( (*theParticleIterator)() ){
113 G4ParticleDefinition* particle = theParticleIterator -> value();
114 G4ProcessManager* pmanager = particle -> GetProcessManager();
115 G4String particleName = particle -> GetParticleName();
116
117 //processes
118
119 if (particleName == "gamma") {
120 //gamma
121 lowePhot = new G4LowEnergyPhotoElectric("LowEnPhotoElec");
122 pmanager -> AddDiscreteProcess(new G4LowEnergyRayleigh);
123 pmanager -> AddDiscreteProcess(lowePhot);
124 pmanager -> AddDiscreteProcess(new G4LowEnergyCompton);
125 pmanager -> AddDiscreteProcess(new G4LowEnergyGammaConversion);
126
127 } else if (particleName == "e-") {
128 //electron
129 loweIon = new G4LowEnergyIonisation("LowEnergyIoni");
130 loweBrem = new G4LowEnergyBremsstrahlung("LowEnBrem");
131 loweBrem -> SetAngularGenerator("tsai");
132
133 pmanager -> AddProcess(new G4MultipleScattering, -1, 1,1);
134 pmanager -> AddProcess(loweIon, -1, 2,2);
135 pmanager -> AddProcess(loweBrem, -1,-1,3);
136
137 } else if (particleName == "e+") {
138 //positron
139 pmanager -> AddProcess(new G4MultipleScattering, -1, 1,1);
140 pmanager -> AddProcess(new G4eIonisation, -1, 2,2);
141 pmanager -> AddProcess(new G4eBremsstrahlung, -1,-1,3);
142 pmanager -> AddProcess(new G4eplusAnnihilation, 0,-1,4);
143
144 }
145 }
146}
147
148void BrachyPhysicsList::SetCuts()
149{
150 if (verboseLevel >0){
151 G4cout << "BrachyPhysicsList::SetCuts:";
152 G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
153 }
154
155 SetCutValue(cutForGamma, "gamma");
156 SetCutValue(cutForElectron, "e-");
157 SetCutValue(cutForPositron, "e+");
158
159 if (verboseLevel>0) DumpCutValuesTable();
160}
161
162
Note: See TracBrowser for help on using the repository browser.