File indexing completed on 2025-01-18 09:17:10
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 #include "XrayFluoPhysicsList.hh"
0035 #include "XrayFluoPhysicsListMessenger.hh"
0036
0037 #include "G4SystemOfUnits.hh"
0038 #include "G4LossTableManager.hh"
0039 #include "G4EmParameters.hh"
0040 #include "G4ProcessManager.hh"
0041
0042
0043
0044 #include "G4EmStandardPhysics.hh"
0045 #include "G4EmStandardPhysics_option1.hh"
0046 #include "G4EmStandardPhysics_option2.hh"
0047 #include "G4EmStandardPhysics_option3.hh"
0048
0049 #include "G4EmLivermorePhysics.hh"
0050 #include "G4EmPenelopePhysics.hh"
0051
0052
0053 #include "G4Decay.hh"
0054 #include "XrayFluoStepMax.hh"
0055
0056 #include "G4UnitsTable.hh"
0057
0058 #include "G4ParticleDefinition.hh"
0059 #include "G4ProcessManager.hh"
0060
0061
0062 #include "G4ChargedGeantino.hh"
0063 #include "G4Geantino.hh"
0064 #include "G4Gamma.hh"
0065 #include "G4OpticalPhoton.hh"
0066
0067
0068 #include "G4MuonPlus.hh"
0069 #include "G4MuonMinus.hh"
0070 #include "G4NeutrinoMu.hh"
0071 #include "G4AntiNeutrinoMu.hh"
0072
0073 #include "G4Electron.hh"
0074 #include "G4Positron.hh"
0075 #include "G4NeutrinoE.hh"
0076 #include "G4AntiNeutrinoE.hh"
0077
0078
0079 #include "G4Proton.hh"
0080 #include "G4MesonConstructor.hh"
0081 #include "G4BaryonConstructor.hh"
0082 #include "G4IonConstructor.hh"
0083
0084
0085
0086 XrayFluoPhysicsList::XrayFluoPhysicsList() : G4VModularPhysicsList()
0087 {
0088 pMessenger = new XrayFluoPhysicsListMessenger(this);
0089
0090
0091 G4LossTableManager::Instance()->SetVerbose(1);
0092
0093 defaultCutValue = 1.*mm;
0094
0095 cutForGamma = defaultCutValue;
0096 cutForElectron = defaultCutValue;
0097 cutForPositron = defaultCutValue;
0098 cutForProton = defaultCutValue;
0099
0100
0101
0102 SetCutValue(cutForGamma, "gamma");
0103 SetCutValue(cutForElectron, "e-");
0104 SetCutValue(cutForPositron, "e+");
0105
0106 DumpCutValuesTable();
0107 SetVerboseLevel(1);
0108
0109
0110 emName = G4String("emlivermore");
0111 emPhysicsList = new G4EmLivermorePhysics;
0112 }
0113
0114
0115
0116 XrayFluoPhysicsList::~XrayFluoPhysicsList()
0117 {
0118 delete emPhysicsList;
0119 delete pMessenger;
0120 }
0121
0122
0123
0124 void XrayFluoPhysicsList::ConstructParticle()
0125 {
0126
0127 G4Geantino::GeantinoDefinition();
0128 G4ChargedGeantino::ChargedGeantinoDefinition();
0129
0130
0131 G4Gamma::GammaDefinition();
0132
0133
0134 G4Electron::ElectronDefinition();
0135 G4Positron::PositronDefinition();
0136 G4MuonPlus::MuonPlusDefinition();
0137 G4MuonMinus::MuonMinusDefinition();
0138
0139 G4NeutrinoE::NeutrinoEDefinition();
0140 G4AntiNeutrinoE::AntiNeutrinoEDefinition();
0141 G4NeutrinoMu::NeutrinoMuDefinition();
0142 G4AntiNeutrinoMu::AntiNeutrinoMuDefinition();
0143
0144
0145 G4MesonConstructor mConstructor;
0146 mConstructor.ConstructParticle();
0147
0148
0149 G4BaryonConstructor bConstructor;
0150 bConstructor.ConstructParticle();
0151
0152
0153 G4IonConstructor iConstructor;
0154 iConstructor.ConstructParticle();
0155 }
0156
0157
0158
0159 void XrayFluoPhysicsList::ConstructProcess()
0160 {
0161 AddTransportation();
0162 emPhysicsList->ConstructProcess();
0163 AddDecay();
0164 AddStepMax();
0165
0166
0167
0168 G4EmParameters* param = G4EmParameters::Instance();
0169 param->SetFluo(true);
0170 param->SetAuger(true);
0171 param->SetPixe(true);
0172 }
0173
0174
0175
0176 void XrayFluoPhysicsList::AddDecay()
0177 {
0178
0179
0180 G4Decay* fDecayProcess = new G4Decay();
0181
0182 auto particleIterator=GetParticleIterator();
0183 particleIterator->reset();
0184 while( (*particleIterator)() ){
0185 G4ParticleDefinition* particle = particleIterator->value();
0186 G4ProcessManager* pmanager = particle->GetProcessManager();
0187
0188 if (fDecayProcess->IsApplicable(*particle) && !particle->IsShortLived()) {
0189
0190 pmanager ->AddProcess(fDecayProcess);
0191
0192
0193 pmanager ->SetProcessOrdering(fDecayProcess, idxPostStep);
0194 pmanager ->SetProcessOrdering(fDecayProcess, idxAtRest);
0195
0196 }
0197 }
0198 }
0199
0200
0201
0202 void XrayFluoPhysicsList::AddStepMax()
0203 {
0204
0205 XrayFluoStepMax* stepMaxProcess = new XrayFluoStepMax();
0206
0207 auto particleIterator=GetParticleIterator();
0208 particleIterator->reset();
0209 while ((*particleIterator)()){
0210 G4ParticleDefinition* particle = particleIterator->value();
0211 G4ProcessManager* pmanager = particle->GetProcessManager();
0212
0213 if (stepMaxProcess->IsApplicable(*particle) && !particle->IsShortLived())
0214 {
0215 pmanager ->AddDiscreteProcess(stepMaxProcess);
0216 }
0217 }
0218 }
0219
0220
0221
0222 void XrayFluoPhysicsList::AddPhysicsList(const G4String& name)
0223 {
0224 if (verboseLevel>-1) {
0225 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
0226 }
0227
0228 if (name == emName) return;
0229
0230 if (name == "emlivermore") {
0231
0232 emName = name;
0233 delete emPhysicsList;
0234 emPhysicsList = new G4EmLivermorePhysics;
0235
0236 } else if (name == "emstandard") {
0237 emName = name;
0238 delete emPhysicsList;
0239 emPhysicsList = new G4EmStandardPhysics();
0240
0241 } else if (name == "emstandard_opt1") {
0242
0243 emName = name;
0244 delete emPhysicsList;
0245 emPhysicsList = new G4EmStandardPhysics_option1();
0246
0247 } else if (name == "emstandard_opt2") {
0248
0249 emName = name;
0250 delete emPhysicsList;
0251 emPhysicsList = new G4EmStandardPhysics_option2();
0252
0253 } else if (name == "emstandard_opt3") {
0254
0255 emName = name;
0256 delete emPhysicsList;
0257 emPhysicsList = new G4EmStandardPhysics_option3();
0258
0259 } else if (name == "empenelope"){
0260 emName = name;
0261 delete emPhysicsList;
0262 emPhysicsList = new G4EmPenelopePhysics();
0263
0264 } else {
0265
0266 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
0267 << " is not defined"
0268 << G4endl;
0269 }
0270 }
0271
0272
0273
0274 void XrayFluoPhysicsList::SetCutForGamma(G4double cut)
0275 {
0276 cutForGamma = cut;
0277 SetParticleCuts(cutForGamma, G4Gamma::Gamma());
0278 }
0279
0280
0281
0282 void XrayFluoPhysicsList::SetCutForElectron(G4double cut)
0283 {
0284 cutForElectron = cut;
0285 SetParticleCuts(cutForElectron, G4Electron::Electron());
0286 }
0287
0288
0289
0290 void XrayFluoPhysicsList::SetCutForPositron(G4double cut)
0291 {
0292 cutForPositron = cut;
0293 SetParticleCuts(cutForPositron, G4Positron::Positron());
0294 }
0295
0296
0297
0298 void XrayFluoPhysicsList::SetCutForProton(G4double cut)
0299 {
0300 cutForProton = cut;
0301 SetParticleCuts(cutForProton, G4Proton::Proton());
0302 }
0303
0304
0305
0306
0307
0308
0309
0310
0311
0312
0313
0314
0315
0316
0317
0318
0319
0320