source: trunk/examples/extended/electromagnetic/TestEm4/src/PhysicsList.cc @ 1279

Last change on this file since 1279 was 1230, checked in by garnier, 15 years ago

update to geant4.9.3

File size: 5.3 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// $Id: PhysicsList.cc,v 1.7 2008/04/07 13:09:43 maire Exp $
28// GEANT4 tag $Name: geant4-09-03-cand-01 $
29//
30
31//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
32//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
33
34#include "PhysicsList.hh"
35
36#include "G4ParticleDefinition.hh"
37#include "G4ProcessManager.hh"
38#include "G4ParticleTypes.hh"
39#include "G4ParticleTable.hh"
40
41//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
42
43PhysicsList::PhysicsList()
44: G4VUserPhysicsList()
45{
46  defaultCutValue = 1.0*mm;
47  SetVerboseLevel(1);
48}
49
50//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
51
52PhysicsList::~PhysicsList()
53{}
54
55//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
56
57void PhysicsList::ConstructParticle()
58{
59  // In this method, static member functions should be called
60  // for all particles which you want to use.
61  // This ensures that objects of these particle types will be
62  // created in the program.
63
64  ConstructBosons();
65  ConstructLeptons();
66}
67
68//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
69
70void PhysicsList::ConstructBosons()
71{
72  G4Gamma::GammaDefinition();
73}
74
75//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
76
77void PhysicsList::ConstructLeptons()
78{
79  G4Electron::ElectronDefinition();
80  G4Positron::PositronDefinition();
81}
82
83//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
84
85void PhysicsList::ConstructProcess()
86{
87  AddTransportation();
88  ConstructEM();
89}
90
91//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
92
93#include "G4ComptonScattering.hh"
94#include "G4GammaConversion.hh"
95#include "G4PhotoElectricEffect.hh"
96
97#include "G4eMultipleScattering.hh"
98
99#include "G4eIonisation.hh"
100#include "G4eBremsstrahlung.hh"
101#include "G4eplusAnnihilation.hh"
102
103//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
104
105void PhysicsList::ConstructEM()
106{
107  theParticleIterator->reset();
108  while( (*theParticleIterator)() ){
109    G4ParticleDefinition* particle = theParticleIterator->value();
110    G4ProcessManager* pmanager = particle->GetProcessManager();
111    G4String particleName = particle->GetParticleName();
112     
113    if (particleName == "gamma") {
114    // gamma
115         
116      pmanager->AddDiscreteProcess(new G4PhotoElectricEffect);
117      pmanager->AddDiscreteProcess(new G4ComptonScattering);
118      pmanager->AddDiscreteProcess(new G4GammaConversion);
119     
120    } else if (particleName == "e-") {
121    //electron
122
123      pmanager->AddProcess(new G4eMultipleScattering,-1, 1,1);
124      pmanager->AddProcess(new G4eIonisation,        -1, 2,2);
125      pmanager->AddProcess(new G4eBremsstrahlung,    -1, 3,3);     
126
127    } else if (particleName == "e+") {
128    //positron
129
130      pmanager->AddProcess(new G4eMultipleScattering,-1, 1,1);
131      pmanager->AddProcess(new G4eIonisation,        -1, 2,2);
132      pmanager->AddProcess(new G4eBremsstrahlung,    -1, 3,3);
133      pmanager->AddProcess(new G4eplusAnnihilation,   0,-1,4);     
134    }
135  }
136}
137
138//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
139
140void PhysicsList::SetCuts()
141{
142  if (verboseLevel >0){
143    G4cout << "PhysicsList::SetCuts:";
144    G4cout << "CutLength : " << defaultCutValue/mm << " (mm)" << G4endl;
145  }
146     
147  // set cut values for gamma at first and for e- second and next for e+,
148  // because some processes for e+/e- need cut values for gamma
149  SetCutValue(defaultCutValue, "gamma");
150  SetCutValue(defaultCutValue, "e-");
151  SetCutValue(defaultCutValue, "e+");
152}
153
154//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
155
156
157
158
Note: See TracBrowser for help on using the repository browser.