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