FDsimG4PhysicsList.cc
Go to the documentation of this file.
1 //
2 // Description: Physics List for FDsimG4 application
3 // Definition of boundary effects
4 // Version 1.0: For now only EM and optical process
5 //
6 //
7 
8 #include "G4ios.hh"
9 #include "globals.hh"
10 
11 #include "FDsimG4PhysicsList.hh"
12 
13 #include "G4ParticleDefinition.hh"
14 #include "G4ParticleTypes.hh"
15 #include "G4ParticleWithCuts.hh"
16 #include "G4UserSpecialCuts.hh"
17 #include "G4ParticleTable.hh"
18 #include "G4Material.hh"
19 #include "G4MaterialTable.hh"
20 #include "G4ProcessManager.hh"
21 #include "G4ProcessVector.hh"
22 
23 #include <unconfig.h>
24 #include <utl/config.h>
25 #include "G4Version.hh"
26 
27 #undef __G4_V9__
28 #if (G4VERSION_NUMBER>900)
29 #define __G4_V9__
30 #endif
31 
32 using namespace TelescopeSimulatorLX;
33 
34 
35 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
36 
37 FDsimG4PhysicsList::FDsimG4PhysicsList() : G4VUserPhysicsList() {;}
38 
39 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
40 
42 
43 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
44 
46 {
47  // In this method, static member functions should be called
48  // for all particles which you want to use.
49  // This ensures that objects of these particle types will be
50  // created in the program.
51 
54 
55  // ConstructMesons();
56  // ConstructBaryons();
57 
58 }
59 
60 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
61 
63 {
64  // pseudo-particles
65  G4Geantino::GeantinoDefinition();
66  G4ChargedGeantino::ChargedGeantinoDefinition();
67 
68  // gamma
69  G4Gamma::GammaDefinition();
70 
71  // optical photon
72  G4OpticalPhoton::OpticalPhotonDefinition();
73 }
74 
75 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
76 
78 {
79  // leptons
80  G4Electron::ElectronDefinition();
81  G4Positron::PositronDefinition();
82  G4NeutrinoE::NeutrinoEDefinition();
83  G4AntiNeutrinoE::AntiNeutrinoEDefinition();
84  G4MuonPlus::MuonPlusDefinition();
85  G4MuonMinus::MuonMinusDefinition();
86  G4NeutrinoMu::NeutrinoMuDefinition();
87  G4AntiNeutrinoMu::AntiNeutrinoMuDefinition();
88 }
89 
90 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
91 
93 {
94  // mesons
95  G4PionPlus::PionPlusDefinition();
96  G4PionMinus::PionMinusDefinition();
97  G4PionZero::PionZeroDefinition();
98 }
99 
100 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
101 
103 {
104  // barions
105  G4Proton::ProtonDefinition();
106  G4AntiProton::AntiProtonDefinition();
107  G4Neutron::NeutronDefinition();
108  G4AntiNeutron::AntiNeutronDefinition();
109 }
110 
111 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
112 
114 {
115  AddTransportation();
117  // ConstructEM();
118  ConstructOp();
119 
120 }
121 
122 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
123 
124 #include "G4Decay.hh"
125 
127 {
128  G4Decay* theDecayProcess = new G4Decay();
129  theParticleIterator->reset();
130  while( (*theParticleIterator)() ){
131  G4ParticleDefinition* particle = theParticleIterator->value();
132  G4ProcessManager* pmanager = particle->GetProcessManager();
133  if (theDecayProcess->IsApplicable(*particle)) {
134  pmanager->AddDiscreteProcess(theDecayProcess);
135  }
136  }
137 }
138 
139 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
140 
141 #include "G4ComptonScattering.hh"
142 #include "G4GammaConversion.hh"
143 #include "G4PhotoElectricEffect.hh"
144 
145 #if (G4VERSION_NUMBER>=930)
146 #include "G4eMultipleScattering.hh"
147 #include "G4MuMultipleScattering.hh"
148 #include "G4hMultipleScattering.hh"
149 #else
150 #include "G4MultipleScattering.hh"
151 #endif
152 
153 #include "G4eIonisation.hh"
154 #include "G4eBremsstrahlung.hh"
155 #include "G4eplusAnnihilation.hh"
156 
157 #include "G4MuIonisation.hh"
158 #include "G4MuBremsstrahlung.hh"
159 #include "G4MuPairProduction.hh"
160 
161 #include "G4hIonisation.hh"
162 
163 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
164 
166 {
167  theParticleIterator->reset();
168  while( (*theParticleIterator)() ){
169  G4ParticleDefinition* particle = theParticleIterator->value();
170  G4ProcessManager* pmanager = particle->GetProcessManager();
171  G4String particleName = particle->GetParticleName();
172 
173  if (particleName == "gamma")
174  {
175  // gamma
176  // Construct processes for gamma
177  pmanager->AddDiscreteProcess(new G4GammaConversion());
178  pmanager->AddDiscreteProcess(new G4ComptonScattering());
179  pmanager->AddDiscreteProcess(new G4PhotoElectricEffect());
180 
181  } else if (particleName == "e-") {
182  //electron
183  // Construct processes for electron
184 #if (G4VERSION_NUMBER>=930)
185  pmanager->AddProcess(new G4eMultipleScattering(),-1,1,1) ;
186 #else
187  pmanager->AddProcess(new G4MultipleScattering(),-1,1,1) ;
188 #endif
189  pmanager->AddProcess(new G4eIonisation(),-1,2,2) ;
190  pmanager->AddProcess(new G4eBremsstrahlung(),-1,-1,3) ;
191  pmanager->AddProcess(new G4UserSpecialCuts(),-1,-1,1) ;
192  } else if (particleName == "e+") {
193 
194  //positron
195  // Construct processes for positron
196 #if (G4VERSION_NUMBER>=930)
197  pmanager->AddProcess(new G4eMultipleScattering(),-1,1,1);
198 #else
199  pmanager->AddProcess(new G4MultipleScattering(),-1,1,1);
200 #endif
201  pmanager->AddProcess(new G4eIonisation(),-1,2,2);
202  pmanager->AddProcess(new G4eBremsstrahlung(),-1,-1,3);
203  pmanager->AddProcess(new G4eplusAnnihilation(),0,-1,4);
204  pmanager->AddProcess(new G4UserSpecialCuts(),-1,-1,1) ;
205 
206  } else if( particleName == "mu+" ||
207  particleName == "mu-" ) {
208  //muon
209  // Construct processes for muon
210 #if (G4VERSION_NUMBER>=930)
211  pmanager->AddProcess(new G4MuMultipleScattering(),-1,1,1);
212 #else
213  pmanager->AddProcess(new G4MultipleScattering(),-1,1,1);
214 #endif
215  pmanager->AddProcess(new G4MuIonisation(),-1,2,2);
216  pmanager->AddProcess(new G4MuBremsstrahlung(),-1,-1,3);
217  pmanager->AddProcess(new G4MuPairProduction(),-1,-1,4);
218 
219  } else {
220  if ((particle->GetPDGCharge() != 0.0) &&
221  (particle->GetParticleName() != "chargedgeantino")) {
222  // all others charged particles except geantino
223 #if (G4VERSION_NUMBER>=930)
224  pmanager->AddProcess(new G4hMultipleScattering(),-1,1,1);
225 #else
226  pmanager->AddProcess(new G4MultipleScattering(),-1,1,1);
227 #endif
228  pmanager->AddProcess(new G4hIonisation(),-1,2,2);
229  }
230  }
231  }
232 }
233 
234 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
235 
236 #include "G4Cerenkov.hh"
237 #include "G4OpAbsorption.hh"
238 #include "G4OpRayleigh.hh"
240 
242 {
243  // this Cerenkov Process
244  G4Cerenkov* theCerenkovProcess = new G4Cerenkov("Cerenkov");
245  // this absorption process inside optical media
246  G4OpAbsorption* theAbsorptionProcess = new G4OpAbsorption();
247  // Rayleigh scattering for optical photons (aerogel radiators)
248  G4OpRayleigh* theRayleighScatteringProcess = new G4OpRayleigh();
249 
250  // Boundary process definition Class
251 
252  FDsimG4OpBoundaryProcess* theBoundaryProcess = new FDsimG4OpBoundaryProcess();
253 
254  // Chose level 0 (no verbose)
255  theCerenkovProcess->SetVerboseLevel(0);
256  theAbsorptionProcess->SetVerboseLevel(0);
257  theRayleighScatteringProcess->SetVerboseLevel(0);
258  theBoundaryProcess->SetVerboseLevel(0);
259 
260 
261  // Chose MaxNumPhotons that can be generated. Lets ignore this for now
262  G4int MaxNumPhotons = 100000 ;
263  theCerenkovProcess->SetMaxNumPhotonsPerStep(MaxNumPhotons);
264  theCerenkovProcess->SetTrackSecondariesFirst(true);
265 
266  // Boundary model (UNIFIED OR GLISUR (OLD GEANT3)) For now only GEANT3
267  G4OpticalSurfaceModel themodel = unified;
268  theBoundaryProcess->SetModel(themodel);
269 
270  theParticleIterator->reset();
271  while( (*theParticleIterator)() ){
272  G4ParticleDefinition* particle = theParticleIterator->value();
273  G4ProcessManager* pmanager = particle->GetProcessManager();
274  G4String particleName = particle->GetParticleName();
275 
276  if (theCerenkovProcess->IsApplicable(*particle))
277  {
278 #ifdef __G4_V9__
279  pmanager->AddProcess(theCerenkovProcess);
280  pmanager->SetProcessOrdering(theCerenkovProcess,idxPostStep);
281 #else
282  pmanager->AddContinuousProcess(theCerenkovProcess);
283 #endif
284 
285 
286  }
287 
288  if (particleName == "opticalphoton") {
289  G4cerr << " Adding DiscreteProcesses to OpticalPhoton " << G4endl;
290  pmanager->AddDiscreteProcess(theAbsorptionProcess);
291  // pmanager->AddDiscreteProcess(theRayleighScatteringProcess);
292  pmanager->AddDiscreteProcess(theBoundaryProcess);
293  }
294  }
295 }
296 
297 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
298 
300 {
301  if (verboseLevel >1){
302  G4cerr << "FDsimG4PhysicsList::SetCuts:";
303  }
304  // " G4VUserPhysicsList::SetCutsWithDefault" method sets
305  // the default cut value for all particle types
306 
307  SetCutsWithDefault();
308 
309 }
310 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
struct particle_info particle[80]

, generated on Tue Sep 26 2023.