Warning, file /geant4/examples/advanced/xray_telescope/src/XrayTelPhysicsList.cc was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051 #include "XrayTelPhysicsList.hh"
0052
0053 #include "globals.hh"
0054 #include "G4SystemOfUnits.hh"
0055 #include "G4ParticleDefinition.hh"
0056 #include "G4ParticleWithCuts.hh"
0057 #include "G4ProcessManager.hh"
0058 #include "G4ProcessVector.hh"
0059 #include "G4ParticleTypes.hh"
0060 #include "G4ParticleTable.hh"
0061 #include "G4ShortLivedConstructor.hh"
0062 #include "G4Material.hh"
0063 #include "G4MaterialTable.hh"
0064 #include "G4ios.hh"
0065
0066 #include "G4MesonConstructor.hh"
0067 #include "G4BaryonConstructor.hh"
0068 #include "G4IonConstructor.hh"
0069
0070 XrayTelPhysicsList::XrayTelPhysicsList(): G4VUserPhysicsList()
0071 {
0072
0073 defaultCutValue = 2.0*mm;
0074 cutForGamma = 1.0*m;
0075 cutForElectron = 1.0*m;
0076
0077 SetVerboseLevel(1);
0078 }
0079
0080 XrayTelPhysicsList::~XrayTelPhysicsList()
0081 {}
0082
0083 void XrayTelPhysicsList::ConstructParticle()
0084 {
0085
0086 ConstructBosons();
0087 ConstructLeptons();
0088 ConstructMesons();
0089 ConstructBaryons();
0090 ConstructIons();
0091 ConstructAllShortLiveds();
0092 }
0093
0094
0095
0096 void XrayTelPhysicsList::ConstructBosons()
0097 {
0098
0099 G4Geantino::GeantinoDefinition();
0100 G4ChargedGeantino::ChargedGeantinoDefinition();
0101
0102
0103 G4Gamma::GammaDefinition();
0104
0105
0106 G4OpticalPhoton::OpticalPhotonDefinition();
0107 }
0108 void XrayTelPhysicsList::ConstructLeptons()
0109 {
0110
0111 G4Electron::ElectronDefinition();
0112 G4Positron::PositronDefinition();
0113
0114 G4NeutrinoE::NeutrinoEDefinition();
0115 G4AntiNeutrinoE::AntiNeutrinoEDefinition();
0116 G4NeutrinoMu::NeutrinoMuDefinition();
0117 G4AntiNeutrinoMu::AntiNeutrinoMuDefinition();
0118
0119 G4MuonPlus::Definition();
0120 G4MuonMinus::Definition();
0121 }
0122 void XrayTelPhysicsList::ConstructMesons()
0123 {
0124
0125 G4MesonConstructor mConstructor;
0126 mConstructor.ConstructParticle();
0127 }
0128
0129 void XrayTelPhysicsList::ConstructBaryons()
0130 {
0131
0132 G4BaryonConstructor bConstructor;
0133 bConstructor.ConstructParticle();
0134 }
0135
0136 void XrayTelPhysicsList::ConstructIons()
0137 {
0138
0139 G4IonConstructor iConstructor;
0140 iConstructor.ConstructParticle();
0141 }
0142
0143 void XrayTelPhysicsList::ConstructAllShortLiveds()
0144 {
0145
0146 G4ShortLivedConstructor slConstructor;
0147 slConstructor.ConstructParticle();
0148 }
0149
0150
0151 void XrayTelPhysicsList::ConstructProcess()
0152 {
0153
0154 AddTransportation();
0155 ConstructEM();
0156 ConstructGeneral();
0157 }
0158
0159
0160
0161 #include "G4ComptonScattering.hh"
0162 #include "G4GammaConversion.hh"
0163 #include "G4PhotoElectricEffect.hh"
0164
0165 #include "G4eMultipleScattering.hh"
0166 #include "G4hMultipleScattering.hh"
0167
0168 #include "G4eIonisation.hh"
0169 #include "G4eBremsstrahlung.hh"
0170 #include "G4eplusAnnihilation.hh"
0171
0172 #include "G4MuIonisation.hh"
0173 #include "G4MuBremsstrahlung.hh"
0174 #include "G4MuPairProduction.hh"
0175
0176 #include "G4hIonisation.hh"
0177 #include "G4hBremsstrahlung.hh"
0178 #include "G4hPairProduction.hh"
0179
0180 #include "G4ionIonisation.hh"
0181
0182 void XrayTelPhysicsList::ConstructEM()
0183 {
0184 auto particleIterator=GetParticleIterator();
0185 particleIterator->reset();
0186
0187 while( (*particleIterator)() )
0188 {
0189 G4ParticleDefinition* particle = particleIterator->value();
0190 G4ProcessManager* pmanager = particle->GetProcessManager();
0191 G4String particleName = particle->GetParticleName();
0192
0193 if (particleName == "gamma")
0194 {
0195
0196 pmanager->AddDiscreteProcess(new G4PhotoElectricEffect());
0197 pmanager->AddDiscreteProcess(new G4ComptonScattering());
0198 pmanager->AddDiscreteProcess(new G4GammaConversion());
0199 }
0200 else if (particleName == "e-")
0201 {
0202
0203 pmanager->AddProcess(new G4eMultipleScattering(),-1, 1,1);
0204 pmanager->AddProcess(new G4eIonisation(), -1, 2,2);
0205 pmanager->AddProcess(new G4eBremsstrahlung(), -1, 3,3);
0206
0207 } else if (particleName == "e+") {
0208
0209
0210 pmanager->AddProcess(new G4eMultipleScattering(),-1, 1,1);
0211 pmanager->AddProcess(new G4eIonisation(), -1, 2,2);
0212 pmanager->AddProcess(new G4eBremsstrahlung(), -1, 3,3);
0213 pmanager->AddProcess(new G4eplusAnnihilation(), 0,-1,4);
0214
0215 } else if( particleName == "mu-" ||
0216 particleName == "mu+" ) {
0217
0218
0219 pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
0220 pmanager->AddProcess(new G4MuIonisation, -1, 2, 2);
0221 pmanager->AddProcess(new G4MuBremsstrahlung, -1, 3, 3);
0222 pmanager->AddProcess(new G4MuPairProduction, -1, 4, 4);
0223
0224 } else if( particleName == "pi-" ||
0225 particleName == "pi+" ) {
0226
0227
0228 pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
0229 pmanager->AddProcess(new G4hIonisation, -1, 2, 2);
0230 pmanager->AddProcess(new G4hBremsstrahlung, -1, 3, 3);
0231 pmanager->AddProcess(new G4hPairProduction, -1, 4, 4);
0232
0233 } else if( particleName == "proton" ) {
0234
0235
0236 pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
0237 pmanager->AddProcess(new G4hIonisation, -1, 2, 2);
0238 pmanager->AddProcess(new G4hBremsstrahlung, -1, 3, 3);
0239 pmanager->AddProcess(new G4hPairProduction, -1, 4, 4);
0240
0241 } else if( particleName == "alpha" ||
0242 particleName == "He3" ||
0243 particleName == "GenericIon" ) {
0244
0245
0246 pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
0247 pmanager->AddProcess(new G4ionIonisation, -1, 2, 2);
0248
0249 } else if ((!particle->IsShortLived()) &&
0250 (particle->GetPDGCharge() != 0.0) &&
0251 (particle->GetParticleName() != "chargedgeantino")) {
0252
0253
0254 pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
0255 pmanager->AddProcess(new G4hIonisation, -1, 2, 2);
0256
0257 }
0258 }
0259 }
0260
0261 #include "G4Decay.hh"
0262
0263 void XrayTelPhysicsList::ConstructGeneral()
0264 {
0265 G4Decay* theDecayProcess = new G4Decay();
0266 auto particleIterator=GetParticleIterator();
0267 particleIterator->reset();
0268 while( (*particleIterator)() ){
0269 G4ParticleDefinition* particle = particleIterator->value();
0270 G4ProcessManager* pmanager = particle->GetProcessManager();
0271 if (theDecayProcess->IsApplicable(*particle)) {
0272 pmanager ->AddProcess(theDecayProcess);
0273 pmanager ->SetProcessOrdering(theDecayProcess, idxPostStep);
0274 pmanager ->SetProcessOrdering(theDecayProcess, idxAtRest);
0275 }
0276 }
0277 }
0278
0279 void XrayTelPhysicsList::SetCuts()
0280 {
0281
0282
0283 if (verboseLevel >1){
0284 G4cout << "XrayTelPhysicsList::SetCuts:" << G4endl;
0285 }
0286
0287
0288 SetCutValue(cutForGamma, "gamma");
0289 SetCutValue(cutForElectron, "e-");
0290 SetCutValue(cutForElectron, "e+");
0291
0292
0293
0294 if (verboseLevel >1) {
0295 DumpCutValuesTable();
0296 }
0297 }
0298
0299 void XrayTelPhysicsList::SetCutForGamma(G4double cut)
0300 {
0301 cutForGamma = cut;
0302 }
0303
0304 void XrayTelPhysicsList::SetCutForElectron(G4double cut)
0305 {
0306 cutForElectron = cut;
0307 }
0308
0309 G4double XrayTelPhysicsList::GetCutForGamma() const
0310 {
0311 return cutForGamma;
0312 }
0313
0314 G4double XrayTelPhysicsList::GetCutForElectron() const
0315 {
0316 return cutForElectron;
0317 }
0318
0319
0320
0321
0322