Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OpNovicePhysicsList.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 //
27 //
28 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
30 
31 #include "globals.hh"
32 #include "OpNovicePhysicsList.hh"
34 
35 #include "G4ParticleDefinition.hh"
36 #include "G4ParticleTypes.hh"
37 #include "G4ParticleTable.hh"
38 
39 #include "G4BosonConstructor.hh"
40 #include "G4LeptonConstructor.hh"
41 #include "G4MesonConstructor.hh"
42 #include "G4BaryonConstructor.hh"
43 #include "G4IonConstructor.hh"
45 
46 #include "G4ProcessManager.hh"
47 
48 #include "G4Cerenkov.hh"
49 #include "G4Scintillation.hh"
50 #include "G4OpAbsorption.hh"
51 #include "G4OpRayleigh.hh"
52 #include "G4OpMieHG.hh"
53 #include "G4OpBoundaryProcess.hh"
54 
55 #include "G4LossTableManager.hh"
56 #include "G4EmSaturation.hh"
57 
58 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
59 
62  fVerboseLebel(1)
63 {
64  // default values.
68 
71 
72  fMessenger = new OpNovicePhysicsListMessenger(this);
73 }
74 
75 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
76 
78 
79 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
80 
82 {
83  // In this method, static member functions should be called
84  // for all particles which you want to use.
85  // This ensures that objects of these particle types will be
86  // created in the program.
87 
88  G4BosonConstructor bConstructor;
89  bConstructor.ConstructParticle();
90 
91  G4LeptonConstructor lConstructor;
92  lConstructor.ConstructParticle();
93 
94  G4MesonConstructor mConstructor;
95  mConstructor.ConstructParticle();
96 
97  G4BaryonConstructor rConstructor;
98  rConstructor.ConstructParticle();
99 
100  G4IonConstructor iConstructor;
101  iConstructor.ConstructParticle();
102 }
103 
104 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
105 
107 {
109  ConstructDecay();
110  ConstructEM();
111  ConstructOp();
112 }
113 
114 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
115 
116 #include "G4Decay.hh"
117 
118 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
119 
121 {
122  // Add Decay Process
123  G4Decay* theDecayProcess = new G4Decay();
124  theParticleIterator->reset();
125  while( (*theParticleIterator)() ){
126  G4ParticleDefinition* particle = theParticleIterator->value();
127  G4ProcessManager* pmanager = particle->GetProcessManager();
128  if (theDecayProcess->IsApplicable(*particle)) {
129  pmanager ->AddProcess(theDecayProcess);
130  // set ordering for PostStepDoIt and AtRestDoIt
131  pmanager ->SetProcessOrdering(theDecayProcess, idxPostStep);
132  pmanager ->SetProcessOrdering(theDecayProcess, idxAtRest);
133  }
134  }
135 }
136 
137 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
138 
139 #include "G4ComptonScattering.hh"
140 #include "G4GammaConversion.hh"
141 #include "G4PhotoElectricEffect.hh"
142 
143 #include "G4eMultipleScattering.hh"
144 #include "G4MuMultipleScattering.hh"
145 #include "G4hMultipleScattering.hh"
146 
147 #include "G4eIonisation.hh"
148 #include "G4eBremsstrahlung.hh"
149 #include "G4eplusAnnihilation.hh"
150 
151 #include "G4MuIonisation.hh"
152 #include "G4MuBremsstrahlung.hh"
153 #include "G4MuPairProduction.hh"
154 
155 #include "G4hIonisation.hh"
156 
157 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
158 
160 {
161  theParticleIterator->reset();
162  while( (*theParticleIterator)() ){
163  G4ParticleDefinition* particle = theParticleIterator->value();
164  G4ProcessManager* pmanager = particle->GetProcessManager();
165  G4String particleName = particle->GetParticleName();
166 
167  if (particleName == "gamma") {
168  // gamma
169  // Construct processes for gamma
170  pmanager->AddDiscreteProcess(new G4GammaConversion());
171  pmanager->AddDiscreteProcess(new G4ComptonScattering());
172  pmanager->AddDiscreteProcess(new G4PhotoElectricEffect());
173 
174  } else if (particleName == "e-") {
175  //electron
176  // Construct processes for electron
177  pmanager->AddProcess(new G4eMultipleScattering(),-1, 1, 1);
178  pmanager->AddProcess(new G4eIonisation(), -1, 2, 2);
179  pmanager->AddProcess(new G4eBremsstrahlung(), -1, 3, 3);
180 
181  } else if (particleName == "e+") {
182  //positron
183  // Construct processes for positron
184  pmanager->AddProcess(new G4eMultipleScattering(),-1, 1, 1);
185  pmanager->AddProcess(new G4eIonisation(), -1, 2, 2);
186  pmanager->AddProcess(new G4eBremsstrahlung(), -1, 3, 3);
187  pmanager->AddProcess(new G4eplusAnnihilation(), 0,-1, 4);
188 
189  } else if( particleName == "mu+" ||
190  particleName == "mu-" ) {
191  //muon
192  // Construct processes for muon
193  pmanager->AddProcess(new G4MuMultipleScattering(),-1, 1, 1);
194  pmanager->AddProcess(new G4MuIonisation(), -1, 2, 2);
195  pmanager->AddProcess(new G4MuBremsstrahlung(), -1, 3, 3);
196  pmanager->AddProcess(new G4MuPairProduction(), -1, 4, 4);
197 
198  } else {
199  if ((particle->GetPDGCharge() != 0.0) &&
200  (particle->GetParticleName() != "chargedgeantino") &&
201  !particle->IsShortLived()) {
202  // all others charged particles except geantino
203  pmanager->AddProcess(new G4hMultipleScattering(),-1,1,1);
204  pmanager->AddProcess(new G4hIonisation(), -1,2,2);
205  }
206  }
207  }
208 }
209 
210 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
211 #include "G4Threading.hh"
212 
214 {
215  G4Cerenkov* cerenkovProcess = new G4Cerenkov("Cerenkov");
216  G4Scintillation* scintillationProcess = new G4Scintillation("Scintillation");
217  G4OpAbsorption* absorptionProcess = new G4OpAbsorption();
218  G4OpRayleigh* rayleighScatteringProcess = new G4OpRayleigh();
219  G4OpMieHG* mieHGScatteringProcess = new G4OpMieHG();
220  G4OpBoundaryProcess* boundaryProcess = new G4OpBoundaryProcess();
221 
222  cerenkovProcess->SetVerboseLevel(fVerboseLebel);
223  scintillationProcess->SetVerboseLevel(fVerboseLebel);
224  absorptionProcess->SetVerboseLevel(fVerboseLebel);
225  rayleighScatteringProcess->SetVerboseLevel(fVerboseLebel);
226  mieHGScatteringProcess->SetVerboseLevel(fVerboseLebel);
227  boundaryProcess->SetVerboseLevel(fVerboseLebel);
228 
229  // Use Birks Correction in the Scintillation process
231  {
232  G4EmSaturation* emSaturation =
234  G4Scintillation::AddSaturation(emSaturation);
235  }
236 
237  theParticleIterator->reset();
238  while( (*theParticleIterator)() ){
239  G4ParticleDefinition* particle = theParticleIterator->value();
240  G4ProcessManager* pmanager = particle->GetProcessManager();
241  G4String particleName = particle->GetParticleName();
242  if (cerenkovProcess->IsApplicable(*particle)) {
243  pmanager->AddProcess(cerenkovProcess);
244  pmanager->SetProcessOrdering(cerenkovProcess,idxPostStep);
245  }
246  if (scintillationProcess->IsApplicable(*particle)) {
247  pmanager->AddProcess(scintillationProcess);
248  pmanager->SetProcessOrderingToLast(scintillationProcess, idxAtRest);
249  pmanager->SetProcessOrderingToLast(scintillationProcess, idxPostStep);
250  }
251  if (particleName == "opticalphoton") {
252  G4cout << " AddDiscreteProcess to OpticalPhoton " << G4endl;
253  pmanager->AddDiscreteProcess(absorptionProcess);
254  pmanager->AddDiscreteProcess(rayleighScatteringProcess);
255  pmanager->AddDiscreteProcess(mieHGScatteringProcess);
256  pmanager->AddDiscreteProcess(boundaryProcess);
257  }
258  }
259 }
260 
261 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
262 
264 {
265  fVerboseLebel = verbose;
266 }
267 
268 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
269 
271 {
273 }
274 
275 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
276 
278 {
279  // " G4VUserPhysicsList::SetCutsWithDefault" method sets
280  // the default cut value for all particle types
281  //
283 
285 }
286 
287 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
static void SetMaxBetaChangePerStep(const G4double d)
Definition: G4Cerenkov.cc:148
static G4LossTableManager * Instance()
void SetNbOfPhotonsCerenkov(G4int)
virtual void ConstructProcess()
static void SetTrackSecondariesFirst(const G4bool state)
Definition: G4Cerenkov.cc:143
virtual G4bool IsApplicable(const G4ParticleDefinition &)
Definition: G4Decay.cc:89
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
G4bool IsApplicable(const G4ParticleDefinition &aParticleType)
static void ConstructParticle()
static void ConstructParticle()
G4ProcessManager * GetProcessManager() const
int G4int
Definition: G4Types.hh:78
const G4String & GetParticleName() const
static void ConstructParticle()
static void SetScintillationYieldFactor(const G4double yieldfactor)
void DumpCutValuesTable(G4int flag=1)
G4GLOB_DLL std::ostream G4cout
static void ConstructParticle()
static void AddSaturation(G4EmSaturation *)
G4int AddProcess(G4VProcess *aProcess, G4int ordAtRestDoIt=ordInActive, G4int ordAlongSteptDoIt=ordInActive, G4int ordPostStepDoIt=ordInActive)
G4EmSaturation * EmSaturation()
static void SetMaxNumPhotonsPerStep(const G4int NumPhotons)
Definition: G4Cerenkov.cc:153
void SetProcessOrdering(G4VProcess *aProcess, G4ProcessVectorDoItIndex idDoIt, G4int ordDoIt=ordDefault)
static void ConstructParticle()
G4bool IsWorkerThread()
Definition: G4Threading.cc:104
static void SetTrackSecondariesFirst(const G4bool state)
void SetProcessOrderingToLast(G4VProcess *aProcess, G4ProcessVectorDoItIndex idDoIt)
virtual void ConstructParticle()
#define G4endl
Definition: G4ios.hh:61
G4double GetPDGCharge() const
#define theParticleIterator
void SetVerboseLevel(G4int value)
Definition: G4VProcess.hh:437
G4bool IsApplicable(const G4ParticleDefinition &aParticleType)
Definition: G4Cerenkov.cc:132