Geant4  10.02
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 
66 
67 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
68 
71 {
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  fCerenkovProcess = new G4Cerenkov("Cerenkov");
219  fScintillationProcess = new G4Scintillation("Scintillation");
226 
233 
234  // Use Birks Correction in the Scintillation process
236  {
237  G4EmSaturation* emSaturation =
239  fScintillationProcess->AddSaturation(emSaturation);
240  }
241 
242  theParticleIterator->reset();
243  while( (*theParticleIterator)() ){
244  G4ParticleDefinition* particle = theParticleIterator->value();
245  G4ProcessManager* pmanager = particle->GetProcessManager();
246  G4String particleName = particle->GetParticleName();
247  if (fCerenkovProcess->IsApplicable(*particle)) {
248  pmanager->AddProcess(fCerenkovProcess);
250  }
251  if (fScintillationProcess->IsApplicable(*particle)) {
255  }
256  if (particleName == "opticalphoton") {
257  G4cout << " AddDiscreteProcess to OpticalPhoton " << G4endl;
262  }
263  }
264 }
265 
266 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
267 
269 {
270  fVerboseLevel = verbose;
271 
278 }
279 
280 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
281 
283 {
284  fMaxNumPhotonStep = MaxNumber;
285 
287 }
288 
289 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
290 
292 {
293  // " G4VUserPhysicsList::SetCutsWithDefault" method sets
294  // the default cut value for all particle types
295  //
297 
299 }
300 
301 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void SetMaxBetaChangePerStep(const G4double d)
Definition: G4Cerenkov.cc:151
static G4LossTableManager * Instance()
void SetNbOfPhotonsCerenkov(G4int)
virtual void ConstructProcess()
void SetTrackSecondariesFirst(const G4bool state)
Definition: G4Cerenkov.cc:146
virtual G4bool IsApplicable(const G4ParticleDefinition &)
Definition: G4Decay.cc:89
static G4ThreadLocal G4Cerenkov * fCerenkovProcess
static G4ThreadLocal G4int fMaxNumPhotonStep
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
G4bool IsApplicable(const G4ParticleDefinition &aParticleType)
static G4ThreadLocal G4OpRayleigh * fRayleighScatteringProcess
static void ConstructParticle()
#define G4ThreadLocal
Definition: tls.hh:89
static void ConstructParticle()
G4ProcessManager * GetProcessManager() const
int G4int
Definition: G4Types.hh:78
const G4String & GetParticleName() const
static void ConstructParticle()
OpNovicePhysicsListMessenger * fMessenger
void SetScintillationYieldFactor(const G4double yieldfactor)
void DumpCutValuesTable(G4int flag=1)
static G4ThreadLocal G4OpBoundaryProcess * fBoundaryProcess
G4GLOB_DLL std::ostream G4cout
static void ConstructParticle()
void AddSaturation(G4EmSaturation *)
G4int AddProcess(G4VProcess *aProcess, G4int ordAtRestDoIt=ordInActive, G4int ordAlongSteptDoIt=ordInActive, G4int ordPostStepDoIt=ordInActive)
G4EmSaturation * EmSaturation()
void SetMaxNumPhotonsPerStep(const G4int NumPhotons)
Definition: G4Cerenkov.cc:156
void SetProcessOrdering(G4VProcess *aProcess, G4ProcessVectorDoItIndex idDoIt, G4int ordDoIt=ordDefault)
static void ConstructParticle()
static G4ThreadLocal G4OpMieHG * fMieHGScatteringProcess
static G4ThreadLocal G4OpAbsorption * fAbsorptionProcess
void SetTrackSecondariesFirst(const G4bool state)
void SetProcessOrderingToLast(G4VProcess *aProcess, G4ProcessVectorDoItIndex idDoIt)
virtual void ConstructParticle()
#define G4endl
Definition: G4ios.hh:61
G4bool IsMasterThread()
Definition: G4Threading.cc:130
G4double GetPDGCharge() const
static G4ThreadLocal G4int fVerboseLevel
#define theParticleIterator
void SetVerboseLevel(G4int value)
Definition: G4VProcess.hh:437
static G4ThreadLocal G4Scintillation * fScintillationProcess
G4bool IsApplicable(const G4ParticleDefinition &aParticleType)
Definition: G4Cerenkov.cc:135