source: trunk/examples/extended/runAndEvent/RE03/src/RE03PhysicsList.cc @ 1314

Last change on this file since 1314 was 1230, checked in by garnier, 14 years ago

update to geant4.9.3

File size: 6.9 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: RE03PhysicsList.cc,v 1.1 2007/11/13 19:55:43 asaim Exp $
28// GEANT4 tag $Name: geant4-09-03-cand-01 $
29//
30//
31
32#include "RE03PhysicsList.hh"
33
34#include "G4ProcessManager.hh"
35#include "G4ParticleTypes.hh"
36
37RE03PhysicsList::RE03PhysicsList():  G4VUserPhysicsList()
38{
39  defaultCutValue = 1.0*mm;
40  SetVerboseLevel(1);
41}
42
43RE03PhysicsList::~RE03PhysicsList()
44{;}
45
46void RE03PhysicsList::ConstructParticle()
47{
48  // In this method, static member functions should be called
49  // for all particles which you want to use.
50  // This ensures that objects of these particle types will be
51  // created in the program.
52
53  ConstructBosons();
54  ConstructLeptons();
55  ConstructMesons();
56  ConstructBaryons();
57}
58
59void RE03PhysicsList::ConstructBosons()
60{
61  // pseudo-particles
62  G4Geantino::GeantinoDefinition();
63  G4ChargedGeantino::ChargedGeantinoDefinition();
64
65  // gamma
66  G4Gamma::GammaDefinition();
67
68  // optical photon
69  G4OpticalPhoton::OpticalPhotonDefinition();
70}
71
72void RE03PhysicsList::ConstructLeptons()
73{
74  // leptons
75  G4Electron::ElectronDefinition();
76  G4Positron::PositronDefinition();
77  G4MuonPlus::MuonPlusDefinition();
78  G4MuonMinus::MuonMinusDefinition();
79
80  G4NeutrinoE::NeutrinoEDefinition();
81  G4AntiNeutrinoE::AntiNeutrinoEDefinition();
82  G4NeutrinoMu::NeutrinoMuDefinition();
83  G4AntiNeutrinoMu::AntiNeutrinoMuDefinition();
84}
85
86void RE03PhysicsList::ConstructMesons()
87{
88 //  mesons
89  G4PionPlus::PionPlusDefinition();
90  G4PionMinus::PionMinusDefinition();
91  G4PionZero::PionZeroDefinition();
92  G4Eta::EtaDefinition();
93  G4EtaPrime::EtaPrimeDefinition();
94  G4KaonPlus::KaonPlusDefinition();
95  G4KaonMinus::KaonMinusDefinition();
96  G4KaonZero::KaonZeroDefinition();
97  G4AntiKaonZero::AntiKaonZeroDefinition();
98  G4KaonZeroLong::KaonZeroLongDefinition();
99  G4KaonZeroShort::KaonZeroShortDefinition();
100}
101
102void RE03PhysicsList::ConstructBaryons()
103{
104  //  barions
105  G4Proton::ProtonDefinition();
106  G4AntiProton::AntiProtonDefinition();
107  G4Neutron::NeutronDefinition();
108  G4AntiNeutron::AntiNeutronDefinition();
109}
110
111
112void RE03PhysicsList::ConstructProcess()
113{
114  AddTransportation();
115  ConstructEM();
116  ConstructDecay();
117}
118
119#include "G4ComptonScattering.hh"
120#include "G4GammaConversion.hh"
121#include "G4PhotoElectricEffect.hh"
122
123#include "G4MultipleScattering.hh"
124
125#include "G4eIonisation.hh"
126#include "G4eBremsstrahlung.hh"
127#include "G4eplusAnnihilation.hh"
128
129#include "G4MuIonisation.hh"
130#include "G4MuBremsstrahlung.hh"
131#include "G4MuPairProduction.hh"
132
133#include "G4hIonisation.hh"
134
135void RE03PhysicsList::ConstructEM()
136{
137  theParticleIterator->reset();
138  while( (*theParticleIterator)() ){
139    G4ParticleDefinition* particle = theParticleIterator->value();
140    G4ProcessManager* pmanager = particle->GetProcessManager();
141    G4String particleName = particle->GetParticleName();
142   
143    if (particleName == "gamma") {
144      // gamma         
145      pmanager->AddDiscreteProcess(new G4PhotoElectricEffect);
146      pmanager->AddDiscreteProcess(new G4ComptonScattering);
147      pmanager->AddDiscreteProcess(new G4GammaConversion);
148     
149    } else if (particleName == "e-") {
150      //electron
151      pmanager->AddProcess(new G4MultipleScattering,-1, 1,1);
152      pmanager->AddProcess(new G4eIonisation,       -1, 2,2);
153      pmanager->AddProcess(new G4eBremsstrahlung,   -1, 3,3);     
154
155    } else if (particleName == "e+") {
156      //positron
157      pmanager->AddProcess(new G4MultipleScattering,-1, 1,1);
158      pmanager->AddProcess(new G4eIonisation,       -1, 2,2);
159      pmanager->AddProcess(new G4eBremsstrahlung,   -1, 3,3);
160      pmanager->AddProcess(new G4eplusAnnihilation,  0,-1,4);
161
162    } else if( particleName == "mu+" || 
163               particleName == "mu-"    ) {
164      //muon 
165      pmanager->AddProcess(new G4MultipleScattering,-1, 1,1);
166      pmanager->AddProcess(new G4MuIonisation,      -1, 2,2);
167      pmanager->AddProcess(new G4MuBremsstrahlung,  -1, 3,3);
168      pmanager->AddProcess(new G4MuPairProduction,  -1, 4,4);       
169     
170    } else if ((!particle->IsShortLived()) &&
171               (particle->GetPDGCharge() != 0.0) && 
172               (particle->GetParticleName() != "chargedgeantino")) {
173      //all others charged particles except geantino
174      pmanager->AddProcess(new G4MultipleScattering,-1, 1,1);
175      pmanager->AddProcess(new G4hIonisation,       -1, 2,2); 
176    }
177  }
178}
179
180#include "G4Decay.hh"
181
182void RE03PhysicsList::ConstructDecay()
183{
184  // Add Decay Process
185  G4Decay* theDecayProcess = new G4Decay();
186  theParticleIterator->reset();
187  while( (*theParticleIterator)() ){
188    G4ParticleDefinition* particle = theParticleIterator->value();
189    G4ProcessManager* pmanager = particle->GetProcessManager();
190    if (theDecayProcess->IsApplicable(*particle)) { 
191      pmanager ->AddProcess(theDecayProcess);
192      // set ordering for PostStepDoIt and AtRestDoIt
193      pmanager ->SetProcessOrdering(theDecayProcess, idxPostStep);
194      pmanager ->SetProcessOrdering(theDecayProcess, idxAtRest);
195    }
196  }
197}
198
199void RE03PhysicsList::SetCuts()
200{
201  if (verboseLevel >0){
202    G4cout << "RE03PhysicsList::SetCuts:";
203    G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
204  }
205
206  // set cut values for gamma at first and for e- second and next for e+,
207  // because some processes for e+/e- need cut values for gamma
208  //
209  SetCutValue(defaultCutValue, "gamma");
210  SetCutValue(defaultCutValue, "e-");
211  SetCutValue(defaultCutValue, "e+");
212
213  if (verboseLevel>0) DumpCutValuesTable();
214}
215
216
Note: See TracBrowser for help on using the repository browser.