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

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

update to geant4.9.3

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