Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:21:46

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 // This example is provided by the Geant4-DNA collaboration
0027 // Any report or published results obtained using the Geant4-DNA software
0028 // shall cite the following Geant4-DNA collaboration publication:
0029 // Med. Phys. 37 (2010) 4692-4708
0030 // The Geant4-DNA web site is available at http://geant4-dna.org
0031 //
0032 
0033 #include "PhysicsList.hh"
0034 
0035 #include "DetectorConstruction.hh"
0036 #include "PhysicsListMessenger.hh"
0037 
0038 #include "G4PhysicsConstructorRegistry.hh"
0039 #include "G4PhysicsListHelper.hh"
0040 #include "G4RunManager.hh"
0041 #include "G4SystemOfUnits.hh"
0042 // #include "CommandLineParser.hh"
0043 
0044 #include "G4BetheBlochIonGasModel.hh"
0045 #include "G4BraggIonGasModel.hh"
0046 #include "G4ComptonScattering.hh"
0047 #include "G4DNAAttachment.hh"
0048 #include "G4DNABornExcitationModel.hh"
0049 #include "G4DNABornIonisationModel.hh"
0050 #include "G4DNAChampionElasticModel.hh"
0051 #include "G4DNAChargeDecrease.hh"
0052 #include "G4DNAChargeIncrease.hh"
0053 #include "G4DNAChemistryManager.hh"
0054 #include "G4DNADingfelderChargeDecreaseModel.hh"
0055 #include "G4DNADingfelderChargeIncreaseModel.hh"
0056 #include "G4DNADiracRMatrixExcitationModel.hh"
0057 #include "G4DNAELSEPAElasticModel.hh"
0058 #include "G4DNAElastic.hh"
0059 #include "G4DNAExcitation.hh"
0060 #include "G4DNAGenericIonsManager.hh"
0061 #include "G4DNAIonisation.hh"
0062 #include "G4DNAMeltonAttachmentModel.hh"
0063 #include "G4DNAMillerGreenExcitationModel.hh"
0064 #include "G4DNAPlasmonExcitation.hh"
0065 #include "G4DNAQuinnPlasmonExcitationModel.hh"
0066 #include "G4DNARelativisticIonisationModel.hh"
0067 #include "G4DNARuddIonisationModel.hh"
0068 #include "G4DNASancheExcitationModel.hh"
0069 #include "G4DNAVibExcitation.hh"
0070 #include "G4DummyModel.hh"
0071 #include "G4EmConfigurator.hh"
0072 #include "G4Gamma.hh"
0073 #include "G4GammaConversion.hh"
0074 #include "G4GoudsmitSaundersonMscModel.hh"
0075 #include "G4IonFluctuations.hh"
0076 #include "G4LivermoreBremsstrahlungModel.hh"
0077 #include "G4LivermoreComptonModel.hh"
0078 #include "G4LivermoreGammaConversionModel.hh"
0079 #include "G4LivermoreIonisationModel.hh"
0080 #include "G4LivermorePhotoElectricModel.hh"
0081 #include "G4LivermoreRayleighModel.hh"
0082 #include "G4LossTableManager.hh"
0083 #include "G4MollerBhabhaModel.hh"
0084 #include "G4PenelopeBremsstrahlungModel.hh"
0085 #include "G4PenelopeIonisationModel.hh"
0086 #include "G4PhotoElectricEffect.hh"
0087 #include "G4RayleighScattering.hh"
0088 #include "G4SeltzerBergerModel.hh"
0089 #include "G4StepLimiter.hh"
0090 #include "G4UAtomicDeexcitation.hh"
0091 #include "G4UniversalFluctuation.hh"
0092 #include "G4UrbanMscModel.hh"
0093 #include "G4VEmModel.hh"
0094 #include "G4eBremsstrahlung.hh"
0095 #include "G4eIonisation.hh"
0096 #include "G4eMultipleScattering.hh"
0097 #include "G4hIonisation.hh"
0098 #include "G4hMultipleScattering.hh"
0099 #include "G4ionIonisation.hh"
0100 
0101 // #include "G4ElectronCapture.hh"
0102 
0103 #include "G4ProcessTable.hh"
0104 
0105 // using namespace G4DNAPARSER;
0106 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0107 
0108 PhysicsList::PhysicsList() : G4VModularPhysicsList(), fpDetector(0)
0109 {
0110   fpDetector = dynamic_cast<const DetectorConstruction*>(
0111     G4RunManager::GetRunManager()->GetUserDetectorConstruction());
0112   defaultCutValue = 0.1 * nanometer;
0113   fcutForGamma = defaultCutValue;
0114   fcutForElectron = defaultCutValue;
0115   fcutForPositron = defaultCutValue;
0116   fcutForProton = defaultCutValue;
0117 
0118   fPhysMessenger = new PhysicsListMessenger(this);
0119   SetVerboseLevel(1);
0120 
0121   // RegisterConstructor("G4EmDNAChemistry");
0122 }
0123 
0124 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0125 
0126 PhysicsList::~PhysicsList()
0127 {
0128   delete fPhysMessenger;
0129 }
0130 
0131 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0132 
0133 void PhysicsList::RegisterConstructor(const G4String& name)
0134 {
0135   RegisterPhysics(G4PhysicsConstructorRegistry::Instance()->GetPhysicsConstructor(name));
0136 }
0137 
0138 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0139 
0140 void PhysicsList::ConstructParticle()
0141 {
0142   ConstructBosons();
0143   ConstructLeptons();
0144   ConstructBarions();
0145 
0146   G4VModularPhysicsList::ConstructParticle();
0147 }
0148 
0149 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0150 
0151 void PhysicsList::ConstructBosons()
0152 {
0153   G4Gamma::GammaDefinition();
0154 }
0155 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0156 
0157 void PhysicsList::ConstructLeptons()
0158 {
0159   G4Electron::ElectronDefinition();
0160   G4Positron::PositronDefinition();
0161 }
0162 
0163 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0164 
0165 void PhysicsList::ConstructBarions()
0166 {
0167   G4Proton::ProtonDefinition();
0168   G4GenericIon::GenericIonDefinition();
0169 
0170   G4DNAGenericIonsManager* genericIonsManager;
0171   genericIonsManager = G4DNAGenericIonsManager::Instance();
0172   genericIonsManager->GetIon("alpha++");
0173   genericIonsManager->GetIon("alpha+");
0174   genericIonsManager->GetIon("helium");
0175   genericIonsManager->GetIon("hydrogen");
0176 }
0177 
0178 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0179 
0180 void PhysicsList::ConstructProcess()
0181 {
0182   ConstructEM();
0183   ConstructGeneral();
0184 
0185   // Contruct processes of the chemistry list
0186   G4VModularPhysicsList::ConstructProcess();
0187 }
0188 
0189 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0190 
0191 void PhysicsList::ConstructEM()
0192 {
0193   G4bool isGNP = false;
0194   if (fphysname == "") fphysname = "DNA";
0195 
0196   G4Material* NPMaterial = fpDetector->GetNPMaterial();
0197   G4String npname = NPMaterial->GetName();
0198 
0199   if (npname == "G4_Au") isGNP = true;
0200 
0201   auto theParticleIterator = GetParticleIterator();
0202   theParticleIterator->reset();
0203 
0204   while ((*theParticleIterator)()) {
0205     G4ParticleDefinition* particle = theParticleIterator->value();
0206 
0207     G4ProcessManager* pm = particle->GetProcessManager();
0208 
0209     G4String particleName = particle->GetParticleName();
0210 
0211     if (particleName == "e-") {
0212       G4DNAElastic* theDNAElasticProcess = new G4DNAElastic("e-_G4DNAElastic");
0213       theDNAElasticProcess->SetEmModel(new G4DNAChampionElasticModel(), 1);
0214       pm->AddDiscreteProcess(theDNAElasticProcess);
0215 
0216       G4DNAExcitation* theDNAExcitationProcess = new G4DNAExcitation("e-_G4DNAExcitation");
0217       theDNAExcitationProcess->SetEmModel(new G4DNABornExcitationModel(), 1);
0218       pm->AddDiscreteProcess(theDNAExcitationProcess);
0219 
0220       G4DNAIonisation* theDNAIonizationProcess = new G4DNAIonisation("e-_G4DNAIonisation");
0221       theDNAIonizationProcess->SetEmModel(new G4DNABornIonisationModel(), 1);
0222       pm->AddDiscreteProcess(theDNAIonizationProcess);
0223 
0224       G4DNAAttachment* theDNAAttachmentProcess = new G4DNAAttachment("e-_G4DNAAttachment");
0225       pm->AddDiscreteProcess(theDNAAttachmentProcess);
0226 
0227       G4DNAVibExcitation* theDNAVibExcProcess = new G4DNAVibExcitation("e-_G4DNAVibExcitation");
0228       pm->AddDiscreteProcess(theDNAVibExcProcess);
0229 
0230       G4eBremsstrahlung* theDNABremProcess = new G4eBremsstrahlung("e-_G4DNABremsstrahlung");
0231       pm->AddDiscreteProcess(theDNABremProcess);
0232 
0233       if (isGNP) {
0234         if (fphysname == "DNA") {
0235           G4DNAElastic* theDNAELSEPAElasticProcess = new G4DNAElastic("e-_G4DNAELSEPAElastic");
0236           theDNAELSEPAElasticProcess->SetEmModel(new G4DummyModel(), 1);
0237           pm->AddDiscreteProcess(theDNAELSEPAElasticProcess);
0238           G4DNAExcitation* theDNADRMExcitationProcess =
0239             new G4DNAExcitation("e-_G4DNADRMExcitation");
0240           theDNADRMExcitationProcess->SetEmModel(new G4DummyModel(), 1);
0241           pm->AddDiscreteProcess(theDNADRMExcitationProcess);
0242           G4DNAIonisation* theDNARelativisticIonizationProcess =
0243             new G4DNAIonisation("e-_G4DNARelativisticIonisation");
0244           theDNARelativisticIonizationProcess->SetEmModel(new G4DummyModel(), 1);
0245           pm->AddDiscreteProcess(theDNARelativisticIonizationProcess);
0246           G4DNAPlasmonExcitation* theDNAPExcitationProcess =
0247             new G4DNAPlasmonExcitation("e-_G4DNAPlasmonExcitation");
0248           theDNAPExcitationProcess->SetEmModel(new G4DummyModel(), 1);
0249           pm->AddDiscreteProcess(theDNAPExcitationProcess);
0250           G4eBremsstrahlung* theDNAeBremProcess =
0251             new G4eBremsstrahlung("e-_G4DNABremsstrahlung_GNP");
0252           theDNAeBremProcess->SetEmModel(new G4DummyModel(), 1);
0253           pm->AddDiscreteProcess(theDNAeBremProcess);
0254         }
0255         if (fphysname == "Livermore") {
0256           G4eMultipleScattering* msc = new G4eMultipleScattering();
0257           msc->SetEmModel(new G4DummyModel(), 1);
0258           pm->AddDiscreteProcess(msc);
0259           G4eIonisation* eIoni = new G4eIonisation("e-_G4LivermoreIoni");
0260           eIoni->SetEmModel(new G4DummyModel(), 1);
0261           pm->AddDiscreteProcess(eIoni);
0262           G4eBremsstrahlung* eBrem = new G4eBremsstrahlung("e-_G4LivermoreBrem");
0263           eBrem->SetEmModel(new G4DummyModel(), 1);
0264           pm->AddDiscreteProcess(eBrem);
0265 
0266           G4StepLimiter* steplimit = new G4StepLimiter();
0267           pm->AddDiscreteProcess(steplimit);
0268         }
0269         if (fphysname == "Penelope") {
0270           G4eMultipleScattering* msc = new G4eMultipleScattering();
0271           msc->SetEmModel(new G4DummyModel(), 1);
0272           pm->AddDiscreteProcess(msc);
0273           G4eIonisation* eIoni = new G4eIonisation("e-_G4PenelopeIoni");
0274           eIoni->SetEmModel(new G4DummyModel(), 1);
0275           pm->AddDiscreteProcess(eIoni);
0276           G4eBremsstrahlung* eBrem = new G4eBremsstrahlung("e-_G4PenelopeBrem");
0277           eBrem->SetEmModel(new G4DummyModel(), 1);
0278           pm->AddDiscreteProcess(eBrem);
0279 
0280           G4StepLimiter* steplimit = new G4StepLimiter();
0281           pm->AddDiscreteProcess(steplimit);
0282         }
0283       }
0284 
0285       //// Capture of low-energy e-
0286       // G4ElectronCapture* ecap = new G4ElectronCapture("NP",10.*eV);
0287       // pm->AddDiscreteProcess(ecap);
0288     }
0289     else if (particleName == "proton") {
0290     }
0291     else if (particleName == "hydrogen") {
0292     }
0293     else if (particleName == "gamma") {
0294       G4PhotoElectricEffect* thePhotoElectricEffect = new G4PhotoElectricEffect();
0295       thePhotoElectricEffect->SetEmModel(new G4LivermorePhotoElectricModel(), 1);
0296       pm->AddDiscreteProcess(thePhotoElectricEffect);
0297 
0298       G4ComptonScattering* theComptonScattering = new G4ComptonScattering();
0299       theComptonScattering->SetEmModel(new G4LivermoreComptonModel(), 1);
0300       pm->AddDiscreteProcess(theComptonScattering);
0301 
0302       G4GammaConversion* theGammaConversion = new G4GammaConversion();
0303       theGammaConversion->SetEmModel(new G4LivermoreGammaConversionModel(), 1);
0304       pm->AddDiscreteProcess(theGammaConversion);
0305 
0306       G4RayleighScattering* theRayleigh = new G4RayleighScattering();
0307       pm->AddDiscreteProcess(theRayleigh);
0308     }
0309   }
0310 
0311   if (isGNP) {
0312     G4EmConfigurator* em_config = G4LossTableManager::Instance()->EmConfigurator();
0313     G4VEmModel* mod;
0314     mod = new G4DNAChampionElasticModel();
0315     mod->SetActivationLowEnergyLimit(1 * GeV);
0316     em_config->SetExtraEmModel("e-", "e-_G4DNAElastic", mod, "NP");
0317     mod = new G4DNABornExcitationModel();
0318     mod->SetActivationLowEnergyLimit(1 * GeV);
0319     em_config->SetExtraEmModel("e-", "e-_G4DNAExcitation", mod, "NP");
0320     mod = new G4DNABornIonisationModel();
0321     mod->SetActivationLowEnergyLimit(1 * GeV);
0322     em_config->SetExtraEmModel("e-", "e-_G4DNAIonisation", mod, "NP");
0323     mod = new G4DNAMeltonAttachmentModel();
0324     mod->SetActivationLowEnergyLimit(1 * GeV);
0325     em_config->SetExtraEmModel("e-", "e-_G4DNAAttachment", mod, "NP");
0326     mod = new G4DNASancheExcitationModel();
0327     mod->SetActivationLowEnergyLimit(1 * GeV);
0328     em_config->SetExtraEmModel("e-", "e-_G4DNAVibExcitation", mod, "NP");
0329     mod = new G4SeltzerBergerModel();
0330     mod->SetActivationLowEnergyLimit(1 * GeV);
0331     em_config->SetExtraEmModel("e-", "e-_G4DNABremsstrahlung", mod, "NP");
0332 
0333     if (fphysname == "DNA") {
0334       mod = new G4DNAELSEPAElasticModel();
0335       em_config->SetExtraEmModel("e-", "e-_G4DNAELSEPAElastic", mod, "NP", 10 * eV, 1 * GeV);
0336       mod = new G4DNADiracRMatrixExcitationModel();
0337       em_config->SetExtraEmModel("e-", "e-_G4DNADRMExcitation", mod, "NP", 10 * eV, 1 * GeV);
0338       mod = new G4DNARelativisticIonisationModel();
0339       em_config->SetExtraEmModel("e-", "e-_G4DNARelativisticIonisation", mod, "NP", 10 * eV,
0340                                  1 * GeV);
0341       mod = new G4DNAQuinnPlasmonExcitationModel();
0342       em_config->SetExtraEmModel("e-", "e-_G4DNAPlasmonExcitation", mod, "NP", 10 * eV, 1 * GeV);
0343       mod = new G4SeltzerBergerModel();
0344       em_config->SetExtraEmModel("e-", "e-_G4DNABremsstrahlung_GNP", mod, "NP", 10 * eV, 1 * GeV);
0345     }
0346     if (fphysname == "Livermore") {
0347       mod = new G4UrbanMscModel();
0348       // mod = new G4GoudsmitSaundersonMscModel();
0349       em_config->SetExtraEmModel("e-", "msc", mod, "NP", 0 * eV, 100 * MeV,
0350                                  new G4UniversalFluctuation());
0351       mod = new G4LivermoreIonisationModel();
0352       em_config->SetExtraEmModel("e-", "e-_G4LivermoreIoni", mod, "NP", 0 * eV, 1.0 * MeV,
0353                                  new G4UniversalFluctuation());
0354       mod = new G4LivermoreBremsstrahlungModel();
0355       em_config->SetExtraEmModel("e-", "e-_G4LivermoreBrem", mod, "NP", 0 * eV, 1 * GeV,
0356                                  new G4UniversalFluctuation());
0357     }
0358     if (fphysname == "Penelope") {
0359       mod = new G4UrbanMscModel();
0360       // mod = new G4GoudsmitSaundersonMscModel();
0361       em_config->SetExtraEmModel("e-", "msc", mod, "NP", 0 * eV, 100 * MeV,
0362                                  new G4UniversalFluctuation());
0363       mod = new G4PenelopeIonisationModel();
0364       em_config->SetExtraEmModel("e-", "e-_G4PenelopeIoni", mod, "NP", 0 * eV, 1.0 * MeV,
0365                                  new G4UniversalFluctuation());
0366       mod = new G4PenelopeBremsstrahlungModel();
0367       em_config->SetExtraEmModel("e-", "e-_G4PenelopeBrem", mod, "NP", 0 * eV, 1 * GeV,
0368                                  new G4UniversalFluctuation());
0369     }
0370   }
0371 
0372   G4VAtomDeexcitation* de = new G4UAtomicDeexcitation();
0373   G4LossTableManager::Instance()->SetAtomDeexcitation(de);
0374   de->SetFluo(true);
0375   de->SetPIXE(true);
0376   de->SetAuger(true);
0377   de->SetAugerCascade(true);
0378 }
0379 
0380 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0381 
0382 void PhysicsList::ConstructGeneral() {}
0383 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0384 
0385 void PhysicsList::SetCuts()
0386 {
0387   if (verboseLevel > 0) {
0388     G4cout << "PhysicsList::SetCuts:";
0389     G4cout << "CutLength : " << G4BestUnit(defaultCutValue, "Length") << G4endl;
0390   }
0391 
0392   SetCutValue(fcutForGamma, "gamma");
0393   SetCutValue(fcutForElectron, "e-");
0394   SetCutValue(fcutForPositron, "e+");
0395 
0396   if (verboseLevel > 0) {
0397     DumpCutValuesTable();
0398   }
0399 }
0400 void PhysicsList::SetPhysics4NP(const G4String& name)
0401 {
0402   fphysname = name;
0403 }