source: trunk/examples/extended/medical/fanoCavity2/src/PhysicsList.cc

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

tag geant4.9.4 beta 1 + modifs locales

File size: 6.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// $Id: PhysicsList.cc,v 1.8 2010/01/20 15:41:14 maire Exp $
27// GEANT4 tag $Name: geant4-09-04-beta-01 $
28//
29//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
30//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
31
32#include "PhysicsList.hh"
33#include "PhysicsListMessenger.hh"
34
35#include "PhysListEmStandard_option0.hh"
36#include "PhysListEmStandard_option2.hh"
37#include "PhysListEmStandard_option3.hh"
38#include "PhysListEmStandard_GS.hh"
39#include "PhysListEmStandard_WVI.hh"
40#include "PhysListEmStandard_SS.hh"
41
42#include "StepMax.hh"
43
44#include "G4ParticleDefinition.hh"
45
46#include "G4ProcessManager.hh"
47#include "G4LossTableManager.hh"
48
49// Bosons
50#include "G4ChargedGeantino.hh"
51#include "G4Geantino.hh"
52#include "G4Gamma.hh"
53
54// leptons
55#include "G4Electron.hh"
56#include "G4Positron.hh"
57
58// Hadrons
59#include "G4Proton.hh"
60
61
62//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
63
64PhysicsList::PhysicsList(DetectorConstruction* det)
65: G4VModularPhysicsList(), detector(det)
66{
67  G4LossTableManager::Instance();
68  pMessenger = new PhysicsListMessenger(this); 
69   
70  // EM physics
71  emName = G4String("standard_opt3");
72  emPhysicsList = new PhysListEmStandard_option3(emName,detector);
73     
74  defaultCutValue = 10*km;
75
76  SetVerboseLevel(1); 
77 
78  G4LossTableManager::Instance();
79}
80
81//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
82
83PhysicsList::~PhysicsList()
84{
85  delete emPhysicsList;
86  delete pMessenger; 
87}
88
89//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
90
91void PhysicsList::ConstructParticle()
92{
93  // pseudo-particles
94  G4Geantino::GeantinoDefinition();
95  G4ChargedGeantino::ChargedGeantinoDefinition();
96 
97  // gamma
98  G4Gamma::GammaDefinition();
99 
100  // leptons
101  G4Electron::ElectronDefinition();
102  G4Positron::PositronDefinition();
103
104  // baryons
105  G4Proton::ProtonDefinition(); 
106}
107
108//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
109
110void PhysicsList::ConstructProcess()
111{
112  AddTransportation();
113  emPhysicsList->ConstructProcess();
114
115  AddStepMax();
116}
117
118//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
119
120void PhysicsList::AddStepMax()
121{
122  // Step limitation seen as a process
123  StepMax* stepMaxProcess = new StepMax();
124
125  theParticleIterator->reset();
126  while ((*theParticleIterator)()){
127      G4ParticleDefinition* particle = theParticleIterator->value();
128      G4ProcessManager* pmanager = particle->GetProcessManager();
129
130      if (stepMaxProcess->IsApplicable(*particle) && !particle->IsShortLived())
131        {
132          pmanager ->AddDiscreteProcess(stepMaxProcess);
133        }
134  }
135}
136
137//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
138
139void PhysicsList::AddPhysicsList(const G4String& name)
140{
141  if (verboseLevel>-1) {
142    G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
143  }
144
145  if (name == emName) return;
146
147  if (name == "standard_opt0") {
148
149    emName = name;
150    delete emPhysicsList;
151    emPhysicsList = new PhysListEmStandard_option0(name,detector);
152   
153  } else if (name == "standard_opt2") {
154
155    emName = name;
156    delete emPhysicsList;
157    emPhysicsList = new PhysListEmStandard_option2(name,detector);
158   
159  } else if (name == "standard_opt3") {
160
161    emName = name;
162    delete emPhysicsList;
163    emPhysicsList = new PhysListEmStandard_option3(name,detector);
164       
165  } else if (name == "standard_GS") {
166
167    emName = name;
168    delete emPhysicsList;
169    emPhysicsList = new PhysListEmStandard_GS(name,detector);   
170       
171  } else if (name == "standard_WVI") {
172
173    emName = name;
174    delete emPhysicsList;
175    emPhysicsList = new PhysListEmStandard_WVI(name,detector);
176           
177  } else if (name == "standard_SS") {
178
179    emName = name;
180    delete emPhysicsList;
181    emPhysicsList = new PhysListEmStandard_SS(name,detector);
182       
183  } else {
184
185    G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
186           << " is not defined"
187           << G4endl;
188  }
189}
190
191//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
192
193#include "G4UnitsTable.hh"
194
195void PhysicsList::SetCuts()
196{
197  if (verboseLevel >0){
198    G4cout << "PhysicsList::SetCuts:";
199    G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
200  }
201     
202  // set cut values for gamma at first and for e- second and next for e+,
203  // because some processes for e+/e- need cut values for gamma
204  SetCutValue(defaultCutValue, "gamma");
205  SetCutValue(defaultCutValue, "e-");
206  SetCutValue(defaultCutValue, "e+");
207  SetCutValue(defaultCutValue, "proton"); 
208}
209
210//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Note: See TracBrowser for help on using the repository browser.