source: trunk/source/digits_hits/utils/test/test1/src/Tst1PhysicsList.cc @ 1316

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

update geant4-09-04-beta-cand-01 interfaces-V09-03-09 vis-V09-03-08

File size: 10.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//
27// $Id: Tst1PhysicsList.cc,v 1.1 2007/07/13 05:55:34 asaim Exp $
28// GEANT4 tag $Name:  $
29//
30
31#include "Tst1PhysicsList.hh"
32
33#include "G4ParticleDefinition.hh"
34#include "G4ProcessManager.hh"
35#include "G4ProcessVector.hh"
36#include "G4ParticleTypes.hh"
37#include "G4ParticleTable.hh"
38#include "G4ios.hh"             
39
40Tst1PhysicsList::Tst1PhysicsList():  G4VUserPhysicsList()
41{
42 defaultCutValue = 1.0*mm;
43 SetVerboseLevel(1);
44}
45
46Tst1PhysicsList::~Tst1PhysicsList()
47{}
48
49void Tst1PhysicsList::ConstructParticle()
50{
51  // In this method, static member functions should be called
52  // for all particles which you want to use.
53  // This ensures that objects of these particle types will be
54  // created in the program.
55
56  ConstructBosons();
57  ConstructLeptons();
58  ConstructMesons();
59  ConstructBaryons();
60}
61
62void Tst1PhysicsList::ConstructBosons()
63{
64  // pseudo-particles
65  G4Geantino::GeantinoDefinition();
66  G4ChargedGeantino::ChargedGeantinoDefinition();
67
68  // gamma
69  G4Gamma::GammaDefinition();
70}
71
72void Tst1PhysicsList::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 Tst1PhysicsList::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 Tst1PhysicsList::ConstructBaryons()
103{
104//  barions
105  G4Proton::ProtonDefinition();
106  G4AntiProton::AntiProtonDefinition();
107  G4Neutron::NeutronDefinition();
108  G4AntiNeutron::AntiNeutronDefinition();
109}
110
111void Tst1PhysicsList::ConstructProcess()
112{
113  AddTransportation();
114  ConstructGeneral();
115  ConstructEM();
116}
117
118#include "G4ComptonScattering.hh"
119#include "G4GammaConversion.hh"
120#include "G4PhotoElectricEffect.hh"
121
122#include "G4MultipleScattering.hh"
123
124#include "G4eIonisation.hh"
125#include "G4eBremsstrahlung.hh"
126#include "G4eplusAnnihilation.hh"
127
128#include "G4MuIonisation.hh"
129#include "G4MuBremsstrahlung.hh"
130#include "G4MuPairProduction.hh"
131
132#include "G4hIonisation.hh"
133
134void Tst1PhysicsList::ConstructEM()
135{
136  G4bool displacementFlg = true; // for multiple scattering
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 G4GammaConversion());
146      pmanager->AddDiscreteProcess(new G4ComptonScattering());     
147      pmanager->AddDiscreteProcess(new G4PhotoElectricEffect());
148
149    } else if (particleName == "e-") {
150    //electron
151      G4MultipleScattering* theeminusMultipleScattering = new G4MultipleScattering();
152      theeminusMultipleScattering->SetLateralDisplasmentFlag(displacementFlg);
153      G4VProcess* theeminusIonisation         = new G4eIonisation();
154      G4VProcess* theeminusBremsstrahlung     = new G4eBremsstrahlung();
155      //
156      // add processes
157      pmanager->AddProcess(theeminusMultipleScattering);
158      pmanager->AddProcess(theeminusIonisation);
159      pmanager->AddProcess(theeminusBremsstrahlung);
160      //     
161      // set ordering for AlongStepDoIt
162      pmanager->SetProcessOrdering(theeminusMultipleScattering, idxAlongStep,1);
163      pmanager->SetProcessOrdering(theeminusIonisation,         idxAlongStep,2);
164      pmanager->SetProcessOrdering(theeminusBremsstrahlung,     idxAlongStep,3);     
165      //
166      // set ordering for PostStepDoIt
167      pmanager->SetProcessOrdering(theeminusMultipleScattering, idxPostStep,1);
168      pmanager->SetProcessOrdering(theeminusIonisation,         idxPostStep,2);
169      pmanager->SetProcessOrdering(theeminusBremsstrahlung,     idxPostStep,3);
170
171    } else if (particleName == "e+") {
172    //positron
173      G4MultipleScattering* theeplusMultipleScattering = new G4MultipleScattering();
174      theeplusMultipleScattering->SetLateralDisplasmentFlag(displacementFlg);
175      G4VProcess* theeplusIonisation         = new G4eIonisation();
176      G4VProcess* theeplusBremsstrahlung     = new G4eBremsstrahlung();
177      G4VProcess* theeplusAnnihilation       = new G4eplusAnnihilation();
178      //
179      // add processes
180      pmanager->AddProcess(theeplusMultipleScattering);
181      pmanager->AddProcess(theeplusIonisation);
182      pmanager->AddProcess(theeplusBremsstrahlung);
183      pmanager->AddProcess(theeplusAnnihilation);
184      //
185      // set ordering for AtRestDoIt
186      pmanager->SetProcessOrderingToFirst(theeplusAnnihilation, idxAtRest);
187      //
188      // set ordering for AlongStepDoIt
189      pmanager->SetProcessOrdering(theeplusMultipleScattering, idxAlongStep,1);
190      pmanager->SetProcessOrdering(theeplusIonisation,         idxAlongStep,2);
191      pmanager->SetProcessOrdering(theeplusBremsstrahlung,     idxAlongStep,3);     
192      //
193      // set ordering for PostStepDoIt
194      pmanager->SetProcessOrdering(theeplusMultipleScattering, idxPostStep,1);
195      pmanager->SetProcessOrdering(theeplusIonisation,         idxPostStep,2);
196      pmanager->SetProcessOrdering(theeplusBremsstrahlung,     idxPostStep,3);
197      pmanager->SetProcessOrdering(theeplusAnnihilation,       idxPostStep,4);
198 
199    } else if( particleName == "mu+" || 
200               particleName == "mu-"    ) {
201    //muon 
202      G4MultipleScattering* aMultipleScattering = new G4MultipleScattering();
203      aMultipleScattering->SetLateralDisplasmentFlag(displacementFlg);
204      G4VProcess* aBremsstrahlung     = new G4MuBremsstrahlung();
205      G4VProcess* aPairProduction     = new G4MuPairProduction();
206      G4VProcess* anIonisation        = new G4MuIonisation();
207      //
208      // add processes
209      pmanager->AddProcess(anIonisation);
210      pmanager->AddProcess(aMultipleScattering);
211      pmanager->AddProcess(aBremsstrahlung);
212      pmanager->AddProcess(aPairProduction);
213      //
214      // set ordering for AlongStepDoIt
215      pmanager->SetProcessOrdering(aMultipleScattering, idxAlongStep,1);
216      pmanager->SetProcessOrdering(anIonisation,        idxAlongStep,2);
217      pmanager->SetProcessOrdering(aBremsstrahlung,     idxAlongStep,3);
218      pmanager->SetProcessOrdering(aPairProduction,     idxAlongStep,4);
219     
220      //
221      // set ordering for PostStepDoIt
222      pmanager->SetProcessOrdering(aMultipleScattering, idxPostStep,1);
223      pmanager->SetProcessOrdering(anIonisation,        idxPostStep,2);
224      pmanager->SetProcessOrdering(aBremsstrahlung,     idxPostStep,3);
225      pmanager->SetProcessOrdering(aPairProduction,     idxPostStep,4);
226
227     } else if ((!particle->IsShortLived()) &&
228               (particle->GetPDGCharge() != 0.0) && 
229               (particle->GetParticleName() != "chargedgeantino")) {
230     // all others charged particles except geantino     
231     G4MultipleScattering* aMultipleScattering = new G4MultipleScattering();
232     aMultipleScattering->SetLateralDisplasmentFlag(displacementFlg);
233     G4VProcess* anIonisation        = new G4hIonisation();
234     //
235     // add processes
236     pmanager->AddProcess(anIonisation);
237     pmanager->AddProcess(aMultipleScattering);
238     //
239     // set ordering for AlongStepDoIt
240     pmanager->SetProcessOrdering(aMultipleScattering, idxAlongStep,1);
241     pmanager->SetProcessOrdering(anIonisation,        idxAlongStep,2);
242     //
243     // set ordering for PostStepDoIt
244     pmanager->SetProcessOrdering(aMultipleScattering, idxPostStep,1);
245     pmanager->SetProcessOrdering(anIonisation,        idxPostStep,2);
246    }
247  }
248}
249
250#include "G4Decay.hh"
251
252void Tst1PhysicsList::ConstructGeneral()
253{
254  // Add Decay Process and Parallel world Scoring Process
255  G4Decay* theDecayProcess = new G4Decay();
256
257  theParticleIterator->reset();
258  while( (*theParticleIterator)() ){
259    G4ParticleDefinition* particle = theParticleIterator->value();
260    G4ProcessManager* pmanager = particle->GetProcessManager();
261    if (theDecayProcess->IsApplicable(*particle)) { 
262      pmanager ->AddProcess(theDecayProcess);
263      pmanager ->SetProcessOrdering(theDecayProcess, idxPostStep);
264      pmanager ->SetProcessOrdering(theDecayProcess, idxAtRest);
265    }
266  }
267}
268
269void Tst1PhysicsList::SetCuts()
270{
271  // These values are used as the default production thresholds
272  // for the world volume.
273  SetCutsWithDefault();
274}
275
276
Note: See TracBrowser for help on using the repository browser.