source: trunk/examples/extended/electromagnetic/TestEm1/src/PhysListEmStandard.cc @ 1342

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

tag geant4.9.4 beta 1 + modifs locales

File size: 6.7 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: PhysListEmStandard.cc,v 1.21 2009/11/13 15:44:28 maire Exp $
28// GEANT4 tag $Name: geant4-09-04-beta-01 $
29//
30//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
31//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
32
33#include "PhysListEmStandard.hh"
34#include "G4ParticleDefinition.hh"
35#include "G4ProcessManager.hh"
36
37#include "G4ComptonScattering.hh"
38#include "G4GammaConversion.hh"
39#include "G4PhotoElectricEffect.hh"
40
41#include "G4eMultipleScattering.hh"
42#include "G4UrbanMscModel93.hh"
43#include "G4eIonisation.hh"
44#include "G4eBremsstrahlung.hh"
45#include "G4eplusAnnihilation.hh"
46
47#include "G4MuMultipleScattering.hh"
48#include "G4MuIonisation.hh"
49#include "G4MuBremsstrahlung.hh"
50#include "G4MuPairProduction.hh"
51
52#include "G4hMultipleScattering.hh"
53#include "G4hIonisation.hh"
54#include "G4hBremsstrahlung.hh"
55#include "G4hPairProduction.hh"
56
57#include "G4ionIonisation.hh"
58
59#include "G4EmProcessOptions.hh"
60#include "G4MscStepLimitType.hh"
61
62//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
63
64PhysListEmStandard::PhysListEmStandard(const G4String& name)
65  :  G4VPhysicsConstructor(name)
66{ }
67
68//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
69
70PhysListEmStandard::~PhysListEmStandard()
71{ }
72
73//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
74
75void PhysListEmStandard::ConstructProcess()
76{
77  // Add standard EM Processes
78
79  theParticleIterator->reset();
80  while( (*theParticleIterator)() ){
81    G4ParticleDefinition* particle = theParticleIterator->value();
82    G4ProcessManager* pmanager = particle->GetProcessManager();
83    G4String particleName = particle->GetParticleName();
84     
85    if (particleName == "gamma") {
86      // gamma         
87      pmanager->AddDiscreteProcess(new G4PhotoElectricEffect);
88      pmanager->AddDiscreteProcess(new G4ComptonScattering);
89      pmanager->AddDiscreteProcess(new G4GammaConversion);
90     
91    } else if (particleName == "e-") {
92      //electron
93      G4eMultipleScattering* msc = new G4eMultipleScattering();
94      msc->AddEmModel(0, new G4UrbanMscModel93());
95      pmanager->AddProcess(msc,                       -1, 1, 1);
96      pmanager->AddProcess(new G4eIonisation,         -1, 2, 2);
97      pmanager->AddProcess(new G4eBremsstrahlung,     -1, 3, 3);
98           
99    } else if (particleName == "e+") {
100      //positron
101      G4eMultipleScattering* msc = new G4eMultipleScattering();
102      msc->AddEmModel(0, new G4UrbanMscModel93());
103      pmanager->AddProcess(msc,                       -1, 1, 1);     
104      pmanager->AddProcess(new G4eIonisation,         -1, 2, 2);
105      pmanager->AddProcess(new G4eBremsstrahlung,     -1, 3, 3);
106      pmanager->AddProcess(new G4eplusAnnihilation,    0,-1, 4);
107     
108    } else if( particleName == "mu+" || 
109               particleName == "mu-"    ) {
110      //muon 
111      pmanager->AddProcess(new G4MuMultipleScattering,-1, 1, 1);
112      pmanager->AddProcess(new G4MuIonisation,        -1, 2, 2);
113      pmanager->AddProcess(new G4MuBremsstrahlung,    -1, 3, 3);
114      pmanager->AddProcess(new G4MuPairProduction,    -1, 4, 4);       
115             
116    } else if( particleName == "proton" ||
117               particleName == "pi-" ||
118               particleName == "pi+"    ) {
119      //proton 
120      pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
121      pmanager->AddProcess(new G4hIonisation,         -1, 2, 2);
122      pmanager->AddProcess(new G4hBremsstrahlung,     -1, 3, 3);
123      pmanager->AddProcess(new G4hPairProduction,     -1, 4, 4);       
124         
125    } else if( particleName == "alpha" ||
126               particleName == "He3" ||
127               particleName == "GenericIon" ) { 
128
129      pmanager->AddProcess(new G4hMultipleScattering,-1, 1, 1);
130      pmanager->AddProcess(new G4ionIonisation,      -1, 2, 2);
131
132    } else if ((!particle->IsShortLived()) &&
133               (particle->GetPDGCharge() != 0.0) && 
134               (particle->GetParticleName() != "chargedgeantino")) {
135      //all others charged particles except geantino
136      pmanager->AddProcess(new G4hMultipleScattering,-1, 1, 1);
137      pmanager->AddProcess(new G4hIonisation,        -1, 2, 2);
138    }
139  }
140
141  // Em options
142  //
143  // Main options and setting parameters are shown here.
144  // Several of them have default values.
145  //
146  G4EmProcessOptions emOptions;
147 
148  //physics tables
149  //
150  emOptions.SetMinEnergy(100*eV);       //default   
151  emOptions.SetMaxEnergy(100*TeV);      //default 
152  emOptions.SetDEDXBinning(12*20);      //default=12*7 
153  emOptions.SetLambdaBinning(12*20);    //default=12*7
154  emOptions.SetSplineFlag(true);        //default
155     
156  //multiple coulomb scattering
157  //
158  emOptions.SetMscStepLimitation(fUseDistanceToBoundary);  //default=fUseSafety
159  emOptions.SetMscRangeFactor(0.04);    //default
160  emOptions.SetMscGeomFactor (2.5);     //default       
161  emOptions.SetSkin(3.);                //default
162     
163  //energy loss
164  //
165  emOptions.SetStepFunction(0.2, 100*um);       //default=(0.2, 1*mm)   
166  emOptions.SetLinearLossLimit(1.e-2);          //default
167   
168  //ionization
169  //
170  emOptions.SetSubCutoff(false);                //default=false 
171}
172
173//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
174
Note: See TracBrowser for help on using the repository browser.