source: trunk/examples/extended/runAndEvent/RE03/src/RE03PhysicsList.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: 7.0 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.2 2010/04/07 01:30:07 asaim Exp $
28// GEANT4 tag $Name: geant4-09-04-beta-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 "G4eMultipleScattering.hh"
124#include "G4eIonisation.hh"
125#include "G4eBremsstrahlung.hh"
126#include "G4eplusAnnihilation.hh"
127
128#include "G4MuMultipleScattering.hh"
129#include "G4MuIonisation.hh"
130#include "G4MuBremsstrahlung.hh"
131#include "G4MuPairProduction.hh"
132
133#include "G4hMultipleScattering.hh"
134#include "G4hIonisation.hh"
135
136void RE03PhysicsList::ConstructEM()
137{
138  theParticleIterator->reset();
139  while( (*theParticleIterator)() ){
140    G4ParticleDefinition* particle = theParticleIterator->value();
141    G4ProcessManager* pmanager = particle->GetProcessManager();
142    G4String particleName = particle->GetParticleName();
143   
144    if (particleName == "gamma") {
145      // gamma         
146      pmanager->AddDiscreteProcess(new G4PhotoElectricEffect);
147      pmanager->AddDiscreteProcess(new G4ComptonScattering);
148      pmanager->AddDiscreteProcess(new G4GammaConversion);
149     
150    } else if (particleName == "e-") {
151      //electron
152      pmanager->AddProcess(new G4eMultipleScattering,-1, 1,1);
153      pmanager->AddProcess(new G4eIonisation,       -1, 2,2);
154      pmanager->AddProcess(new G4eBremsstrahlung,   -1, 3,3);     
155
156    } else if (particleName == "e+") {
157      //positron
158      pmanager->AddProcess(new G4eMultipleScattering,-1, 1,1);
159      pmanager->AddProcess(new G4eIonisation,       -1, 2,2);
160      pmanager->AddProcess(new G4eBremsstrahlung,   -1, 3,3);
161      pmanager->AddProcess(new G4eplusAnnihilation,  0,-1,4);
162
163    } else if( particleName == "mu+" || 
164               particleName == "mu-"    ) {
165      //muon 
166      pmanager->AddProcess(new G4MuMultipleScattering,-1, 1,1);
167      pmanager->AddProcess(new G4MuIonisation,      -1, 2,2);
168      pmanager->AddProcess(new G4MuBremsstrahlung,  -1, 3,3);
169      pmanager->AddProcess(new G4MuPairProduction,  -1, 4,4);       
170     
171    } else if ((!particle->IsShortLived()) &&
172               (particle->GetPDGCharge() != 0.0) && 
173               (particle->GetParticleName() != "chargedgeantino")) {
174      //all others charged particles except geantino
175      pmanager->AddProcess(new G4hMultipleScattering,-1, 1,1);
176      pmanager->AddProcess(new G4hIonisation,       -1, 2,2); 
177    }
178  }
179}
180
181#include "G4Decay.hh"
182
183void RE03PhysicsList::ConstructDecay()
184{
185  // Add Decay Process
186  G4Decay* theDecayProcess = new G4Decay();
187  theParticleIterator->reset();
188  while( (*theParticleIterator)() ){
189    G4ParticleDefinition* particle = theParticleIterator->value();
190    G4ProcessManager* pmanager = particle->GetProcessManager();
191    if (theDecayProcess->IsApplicable(*particle)) { 
192      pmanager ->AddProcess(theDecayProcess);
193      // set ordering for PostStepDoIt and AtRestDoIt
194      pmanager ->SetProcessOrdering(theDecayProcess, idxPostStep);
195      pmanager ->SetProcessOrdering(theDecayProcess, idxAtRest);
196    }
197  }
198}
199
200void RE03PhysicsList::SetCuts()
201{
202  if (verboseLevel >0){
203    G4cout << "RE03PhysicsList::SetCuts:";
204    G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
205  }
206
207  // set cut values for gamma at first and for e- second and next for e+,
208  // because some processes for e+/e- need cut values for gamma
209  //
210  SetCutValue(defaultCutValue, "gamma");
211  SetCutValue(defaultCutValue, "e-");
212  SetCutValue(defaultCutValue, "e+");
213
214  if (verboseLevel>0) DumpCutValuesTable();
215}
216
217
Note: See TracBrowser for help on using the repository browser.