Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
P6DPhysicsList.cc
Go to the documentation of this file.
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 // $Id: P6DPhysicsList.cc 78019 2013-12-02 15:52:19Z gcosmo $
27 //
28 /// \file eventgenerator/pythia/decayer6/src/P6DPhysicsList.cc
29 /// \brief Implementation of the P6DPhysicsList class
30 
31 #include "P6DPhysicsList.hh"
32 
33 #include "G4ProcessManager.hh"
34 
35 #include "G4BosonConstructor.hh"
36 #include "G4LeptonConstructor.hh"
37 #include "G4MesonConstructor.hh"
38 #include "G4BosonConstructor.hh"
39 #include "G4BaryonConstructor.hh"
40 #include "G4IonConstructor.hh"
41 
42 #include "G4Decay.hh"
43 #include "G4Pythia6Decayer.hh"
44 
45 #include "G4SystemOfUnits.hh"
46 
47 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
48 
51 {
52  defaultCutValue = 1.0*mm;
53  SetVerboseLevel(1);
54 }
55 
56 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
57 
59 {
60 }
61 
62 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
63 
65 {
66  // In this method, static member functions should be called
67  // for all particles which you want to use.
68  // This ensures that objects of these particle types will be
69  // created in the program.
70 
71  G4BosonConstructor pBosonConstructor;
72  pBosonConstructor.ConstructParticle();
73 
74  G4LeptonConstructor pLeptonConstructor;
75  pLeptonConstructor.ConstructParticle();
76 
77  G4MesonConstructor pMesonConstructor;
78  pMesonConstructor.ConstructParticle();
79 
80  G4BaryonConstructor pBaryonConstructor;
81  pBaryonConstructor.ConstructParticle();
82 
83  G4IonConstructor pIonConstructor;
84  pIonConstructor.ConstructParticle();
85 }
86 
87 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
88 
90 {
92  ConstructEM();
93  ConstructDecay();
94 }
95 
96 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
97 
98 #include "G4ComptonScattering.hh"
99 #include "G4GammaConversion.hh"
100 #include "G4PhotoElectricEffect.hh"
101 
102 #include "G4eMultipleScattering.hh"
103 #include "G4eIonisation.hh"
104 #include "G4eBremsstrahlung.hh"
105 #include "G4eplusAnnihilation.hh"
106 
107 #include "G4MuMultipleScattering.hh"
108 #include "G4MuIonisation.hh"
109 #include "G4MuBremsstrahlung.hh"
110 #include "G4MuPairProduction.hh"
111 
112 #include "G4hMultipleScattering.hh"
113 #include "G4hIonisation.hh"
114 #include "G4hBremsstrahlung.hh"
115 #include "G4hPairProduction.hh"
116 
117 #include "G4ionIonisation.hh"
118 
119 void P6DPhysicsList::ConstructEM()
120 {
121  theParticleIterator->reset();
122  while( (*theParticleIterator)() ){
123  G4ParticleDefinition* particle = theParticleIterator->value();
124  G4ProcessManager* pmanager = particle->GetProcessManager();
125  G4String particleName = particle->GetParticleName();
126 
127  if (particleName == "gamma") {
128  // gamma
131  pmanager->AddDiscreteProcess(new G4GammaConversion);
132 
133  } else if (particleName == "e-") {
134  //electron
135  pmanager->AddProcess(new G4eMultipleScattering,-1, 1, 1);
136  pmanager->AddProcess(new G4eIonisation, -1, 2, 2);
137  pmanager->AddProcess(new G4eBremsstrahlung, -1, 3, 3);
138 
139  } else if (particleName == "e+") {
140  //positron
141  pmanager->AddProcess(new G4eMultipleScattering,-1, 1, 1);
142  pmanager->AddProcess(new G4eIonisation, -1, 2, 2);
143  pmanager->AddProcess(new G4eBremsstrahlung, -1, 3, 3);
144  pmanager->AddProcess(new G4eplusAnnihilation, 0,-1, 4);
145 
146  } else if( particleName == "mu+" ||
147  particleName == "mu-" ) {
148  //muon
149  pmanager->AddProcess(new G4MuMultipleScattering,-1, 1, 1);
150  pmanager->AddProcess(new G4MuIonisation, -1, 2, 2);
151  pmanager->AddProcess(new G4MuBremsstrahlung, -1, 3, 3);
152  pmanager->AddProcess(new G4MuPairProduction, -1, 4, 4);
153 
154  } else if( particleName == "proton" ||
155  particleName == "pi-" ||
156  particleName == "pi+" ) {
157  //proton
158  pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
159  pmanager->AddProcess(new G4hIonisation, -1, 2, 2);
160  pmanager->AddProcess(new G4hBremsstrahlung, -1, 3, 3);
161  pmanager->AddProcess(new G4hPairProduction, -1, 4, 4);
162 
163  } else if( particleName == "alpha" ||
164  particleName == "He3" ) {
165  //alpha
166  pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
167  pmanager->AddProcess(new G4ionIonisation, -1, 2, 2);
168 
169  } else if( particleName == "GenericIon" ) {
170  //Ions
171  pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
172  pmanager->AddProcess(new G4ionIonisation, -1, 2, 2);
173 
174  } else if ((!particle->IsShortLived()) &&
175  (particle->GetPDGCharge() != 0.0) &&
176  (particle->GetParticleName() != "chargedgeantino")) {
177  //all others charged particles except geantino
178  pmanager->AddProcess(new G4hMultipleScattering,-1, 1, 1);
179  pmanager->AddProcess(new G4hIonisation, -1, 2, 2);
180  }
181  }
182 }
183 
184 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
185 
186 void P6DPhysicsList::ConstructDecay()
187 {
188  // Add Decay Process
189  G4Decay* theDecayProcess = new G4Decay();
190 
191  // Create Geant4 external decayer
192  G4Pythia6Decayer* extDecayer = new G4Pythia6Decayer();
193  extDecayer->SetVerboseLevel(2);
194  // The extDecayer is deleted in G4Decay destructor
195  theDecayProcess->SetExtDecayer(extDecayer);
196 
197  theParticleIterator->reset();
198  while( (*theParticleIterator)() )
199  {
200  G4ParticleDefinition* particle = theParticleIterator->value();
201  G4ProcessManager* pmanager = particle->GetProcessManager();
202  if (theDecayProcess->IsApplicable(*particle))
203  {
204  pmanager ->AddProcess(theDecayProcess);
205  // set ordering for PostStepDoIt and AtRestDoIt
206  pmanager ->SetProcessOrdering(theDecayProcess, idxPostStep);
207  pmanager ->SetProcessOrdering(theDecayProcess, idxAtRest);
208  }
209  }
210 }
211 
212 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
213 
215 {
216  if (verboseLevel >0)
217  {
218  G4cout << "P6DPhysicsList::SetCuts:";
219  G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
220  }
221 
222  // set cut values for gamma at first and for e- second and next for e+,
223  // because some processes for e+/e- need cut values for gamma
224  //
225  SetCutValue(defaultCutValue, "gamma");
228  SetCutValue(defaultCutValue, "proton");
229 
231 }
232 
233 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
234 
235 
void SetCutValue(G4double aCut, const G4String &pname)
virtual G4bool IsApplicable(const G4ParticleDefinition &)
Definition: G4Decay.cc:89
Definition of the P6DPhysicsList class.
virtual void ConstructParticle()
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
virtual void SetCuts()
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
static void ConstructParticle()
Definition of the G4Pythia6Decayer class.
static void ConstructParticle()
G4ProcessManager * GetProcessManager() const
const G4String & GetParticleName() const
static void ConstructParticle()
void DumpCutValuesTable(G4int flag=1)
G4GLOB_DLL std::ostream G4cout
static void ConstructParticle()
void SetVerboseLevel(G4int value)
G4int AddProcess(G4VProcess *aProcess, G4int ordAtRestDoIt=ordInActive, G4int ordAlongSteptDoIt=ordInActive, G4int ordPostStepDoIt=ordInActive)
void SetProcessOrdering(G4VProcess *aProcess, G4ProcessVectorDoItIndex idDoIt, G4int ordDoIt=ordDefault)
static void ConstructParticle()
void SetVerboseLevel(G4int verboseLevel)
#define G4endl
Definition: G4ios.hh:61
void SetExtDecayer(G4VExtDecayer *)
Definition: G4Decay.cc:458
G4double GetPDGCharge() const
virtual void ConstructProcess()
#define theParticleIterator