Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:20:23

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 // -------------------------------------------------------------------
0027 // -------------------------------------------------------------------
0028 
0029 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0030 
0031 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0032 
0033 #include "MicroElecPhysics.hh"
0034 #include "G4SystemOfUnits.hh"
0035 
0036 
0037 // Geant4-MicroElec MODELS
0038 
0039 #include "G4MicroElecElastic.hh"
0040 #include "G4MicroElecElasticModel_new.hh"
0041 
0042 #include "G4MicroElecInelastic.hh"
0043 #include "G4MicroElecInelasticModel_new.hh"
0044 
0045 #include "G4MicroElecLOPhononScattering.hh"
0046 #include "G4MicroElecLOPhononModel.hh"
0047 #include "G4MicroElecSurface.hh"
0048 
0049 //
0050 
0051 #include "G4LossTableManager.hh"
0052 #include "G4EmConfigurator.hh"
0053 #include "G4VEmModel.hh"
0054 #include "G4DummyModel.hh"
0055 #include "G4eIonisation.hh"
0056 #include "G4hIonisation.hh"
0057 #include "G4ionIonisation.hh"
0058 #include "G4eMultipleScattering.hh"
0059 #include "G4hMultipleScattering.hh"
0060 #include "G4BraggModel.hh"
0061 #include "G4BraggIonModel.hh"
0062 #include "G4BetheBlochModel.hh"
0063 #include "G4UrbanMscModel.hh"
0064 #include "G4MollerBhabhaModel.hh"
0065 #include "G4IonFluctuations.hh"
0066 #include "G4UniversalFluctuation.hh"
0067 
0068 #include "ElectronCapture.hh"
0069 
0070 #include "G4UAtomicDeexcitation.hh"
0071 
0072 
0073 
0074 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0075 
0076 MicroElecPhysics::MicroElecPhysics():  G4VUserPhysicsList()
0077 {
0078   defaultCutValue = 1*micrometer;
0079   cutForGamma     = defaultCutValue;
0080   cutForElectron  = defaultCutValue;
0081   cutForPositron  = defaultCutValue;
0082   cutForProton    = defaultCutValue;
0083   
0084   SetVerboseLevel(1);
0085 }
0086 
0087 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0088 
0089 MicroElecPhysics::~MicroElecPhysics()
0090 {}
0091 
0092 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0093 
0094 void MicroElecPhysics::ConstructParticle()
0095 {
0096   ConstructBosons();
0097   ConstructLeptons();
0098   ConstructBarions();
0099 }
0100 
0101 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0102 
0103 void MicroElecPhysics::ConstructBosons()
0104 { 
0105   // gamma
0106   G4Gamma::GammaDefinition();
0107 }
0108  //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0109 
0110 void MicroElecPhysics::ConstructLeptons()
0111 {
0112   // leptons
0113   G4Electron::ElectronDefinition();
0114   G4Positron::PositronDefinition();
0115 }
0116 
0117 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0118 
0119 void MicroElecPhysics::ConstructBarions()
0120 {
0121   //  baryons
0122   G4Proton::ProtonDefinition();
0123   G4GenericIon::GenericIonDefinition();
0124 }
0125 
0126 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0127 
0128 void MicroElecPhysics::ConstructProcess()
0129 {
0130   AddTransportation();
0131   ConstructEM();
0132   ConstructGeneral();
0133 }
0134 
0135 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0136 
0137 
0138 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0139 
0140 void MicroElecPhysics::ConstructEM()
0141 {
0142 
0143     G4EmParameters* param = G4EmParameters::Instance();
0144     //param->SetDefaults();
0145     param->SetBuildCSDARange(true);
0146     //param->SetMscStepLimitType(fUseSafetyPlus);
0147     //param->SetMscStepLimitType(fUseDistanceToBoundary);
0148     param->SetMscStepLimitType(fUseSafety);
0149     param->RegionsMicroElec();
0150     // physicList ISS
0151     param->SetDefaults();
0152     param->SetMinEnergy(0.1*eV);
0153     param->SetMaxEnergy(10 * TeV);
0154     param->SetLowestElectronEnergy(0 * eV); //<--- Energie de cut dans le vide!!! A fixer  0eV pour ne pas fausser les SEY
0155     param->SetNumberOfBinsPerDecade(20);
0156     param->ActivateAngularGeneratorForIonisation(true);
0157     param->SetAugerCascade(true);//*/
0158   
0159   auto particleIterator=GetParticleIterator();
0160   particleIterator->reset();
0161   
0162   while( (*particleIterator)() )
0163   {
0164 
0165     G4ParticleDefinition* particle = particleIterator->value();
0166     G4ProcessManager* pmanager = particle->GetProcessManager();
0167     G4String particleName = particle->GetParticleName();
0168 
0169     // *********************************
0170     // 1) Processes for the World region
0171     // *********************************
0172 
0173     if (particleName == "e-") {
0174 
0175     
0176       // STANDARD msc is active in the world
0177       G4eMultipleScattering* msc = new G4eMultipleScattering();
0178       msc->AddEmModel(1, new G4UrbanMscModel());
0179       pmanager->AddProcess(msc, -1, 1, -1);
0180 
0181       // STANDARD ionisation is active in the world
0182       G4eIonisation* eion = new G4eIonisation();
0183       pmanager->AddProcess(eion, -1, 2, 2);
0184 
0185       // MicroElec elastic is not active in the world 
0186       //G4MicroElecElasticCorrected* theMicroElecElasticProcess = new G4MicroElecElasticCorrected("e-_G4MicroElecElastic");
0187       //theMicroElecElasticProcess->SetEmModel(new G4DummyModel(),1);
0188       //pmanager->AddDiscreteProcess(theMicroElecElasticProcess);
0189 
0190     G4MicroElecElastic* theMicroElecElasticProcess = new G4MicroElecElastic("e-_G4MicroElecElastic");
0191         theMicroElecElasticProcess->SetEmModel(new G4DummyModel(),1);
0192        // G4MicroElecElasticModel_new* mod = new G4MicroElecElasticModel_new();
0193         //theMicroElecElasticProcess->AddEmModel(0,mod);
0194         pmanager->AddDiscreteProcess(theMicroElecElasticProcess);
0195                 
0196       // MicroElec ionisation is not active in the world 
0197       /*G4MicroElecInelastic* microelecioni = new G4MicroElecInelastic("e-_G4MicroElecInelastic");
0198       microelecioni->SetEmModel(new G4DummyModel(),1);
0199       pmanager->AddDiscreteProcess(microelecioni);*/
0200 
0201       G4MicroElecInelastic* microelecioni = new G4MicroElecInelastic("e-_G4Dielectrics");
0202       microelecioni->SetEmModel(new G4DummyModel(),1); 
0203       pmanager->AddDiscreteProcess(microelecioni);
0204       
0205       //Phonons for SiO2
0206 
0207       G4MicroElecLOPhononScattering* opticalPhonon = new G4MicroElecLOPhononScattering("e-_G4LOPhononScattering");
0208       opticalPhonon->SetEmModel(new G4DummyModel(), 1);
0209       pmanager->AddDiscreteProcess(opticalPhonon);
0210 
0211       /*G4LOPhononScattering* LO60 = new G4LOPhononScattering("e-_G4LO60");
0212       LO60->SetEmModel(new G4DummyModel(), 1);
0213       pmanager->AddDiscreteProcess(LO60);//*/
0214 
0215 
0216 
0217       G4MicroElecSurface* MicroElecSurf = new G4MicroElecSurface("e-_G4MicroElecSurface");
0218       MicroElecSurf->SetProcessManager(pmanager);
0219       pmanager->AddDiscreteProcess(MicroElecSurf);//*/
0220 
0221      ElectronCapture* ecap = new ElectronCapture("Target",0.9*eV); //<--- Piges pour Al2O3
0222       pmanager->AddDiscreteProcess(ecap);//*/
0223             
0224     } else if ( particleName == "proton" ) {
0225 
0226       // STANDARD msc is active in the world 
0227       /*G4hMultipleScattering* msc = new G4hMultipleScattering();
0228       msc->AddEmModel(1, new G4UrbanMscModel());
0229       pmanager->AddProcess(msc, -1, 1, -1);*/
0230 
0231 
0232       // STANDARD ionisation is active in the world 
0233       G4hIonisation* hion = new G4hIonisation();
0234       pmanager->AddProcess(hion, -1, 2, 2);
0235 
0236       // Dielectric ionisation is not active in the world
0237       G4MicroElecInelastic* dielectricioni = new G4MicroElecInelastic("p_G4Dielectrics");
0238       dielectricioni->SetEmModel(new G4DummyModel(),1);
0239       //dielectricioni->SetEmModel(new G4DummyModel(),2);
0240       pmanager->AddDiscreteProcess(dielectricioni);
0241 
0242     } else if(particleName == "alpha") {
0243 
0244 
0245       // STANDARD ionisation is active in the world
0246       G4ionIonisation* hion = new G4ionIonisation();
0247       pmanager->AddProcess(hion, -1, 2, 2);
0248       // Dielectric ionisation is not active in the world
0249       G4MicroElecInelastic* dielectricioni = new G4MicroElecInelastic("alpha_G4Dielectrics");
0250       dielectricioni->SetEmModel(new G4DummyModel(),1);
0251       dielectricioni->SetEmModel(new G4DummyModel(),2);
0252       pmanager->AddDiscreteProcess(dielectricioni);
0253 
0254     } else if (particleName == "GenericIon") {
0255 
0256       // STANDARD msc is active in the world 
0257       /*G4hMultipleScattering* msc = new G4hMultipleScattering();
0258       msc->AddEmModel(1, new G4UrbanMscModel());
0259       pmanager->AddProcess(new G4hMultipleScattering, -1, 1, -1);*/
0260 
0261       /*G4CoulombScattering* cs = new G4CoulombScattering();
0262       cs->AddEmModel(0, new G4IonCoulombScatteringModel());
0263       cs->SetBuildTableFlag(false);
0264       pmanager->AddDiscreteProcess(cs);*/
0265 
0266 
0267 
0268       // STANDARD ionisation is active in the world 
0269       G4ionIonisation* hion = new G4ionIonisation();
0270       pmanager->AddProcess(hion, -1, 2, 2);
0271 
0272       // Dielectric ionisation is not actived in the world
0273       G4MicroElecInelastic* dielectricioni = new G4MicroElecInelastic("ion_G4Dielectrics");
0274       dielectricioni->SetEmModel(new G4DummyModel(),1);
0275       dielectricioni->SetEmModel(new G4DummyModel(),2);
0276       pmanager->AddDiscreteProcess(dielectricioni);
0277     } 
0278   }
0279 
0280   // **************************************
0281   // 2) Define processes for Target region 
0282   // **************************************
0283 
0284   // STANDARD EM processes should be inactivated when corresponding MicroElec processes are used
0285   // - STANDARD EM e- processes are inactivated below 100 MeV
0286   // - STANDARD EM proton & ion processes are inactivated below standEnergyLimit
0287   //
0288   G4EmConfigurator* em_config = G4LossTableManager::Instance()->EmConfigurator();
0289 
0290   G4VEmModel* mod;
0291   // *** e-
0292 
0293   // ---> STANDARD EM processes are inactivated below 100 MeV
0294   
0295   G4UrbanMscModel* msc =  new G4UrbanMscModel();
0296   msc->SetActivationLowEnergyLimit(100*MeV);
0297   em_config->SetExtraEmModel("e-","msc",msc,"Target");
0298   
0299 
0300   mod = new G4MollerBhabhaModel();
0301   mod->SetActivationLowEnergyLimit(10*MeV);
0302   em_config->SetExtraEmModel("e-","eIoni",mod,"Target",0.0,10*TeV, new G4UniversalFluctuation());
0303   
0304 
0305   // ---> MicroElec processes activated
0306 
0307 
0308   mod = new G4MicroElecElasticModel_new();
0309   em_config->SetExtraEmModel("e-","e-_G4MicroElecElastic",mod,"Target",0.1*eV,100*MeV);
0310  
0311   mod = new G4MicroElecInelasticModel_new();
0312   em_config->SetExtraEmModel("e-","e-_G4Dielectrics",mod,"Target",0.1*eV,10*MeV);
0313 
0314 //  G4double hw = 0.15*eV;
0315 
0316   //Old phonon
0317 
0318   /*mod = new LOPhononModel(0.153*eV,false);
0319   em_config->SetExtraEmModel("e-", "e-_G4LOPhononScattering", mod, "Target", 0.153*eV, 10 * MeV);
0320 
0321   mod = new LOPhononModel(0.063*eV,false);
0322   em_config->SetExtraEmModel("e-", "e-_G4LO60", mod, "Target", 0.06*eV, 10 * MeV);//*/
0323 
0324  //Phonons LO pour sio2 et al2o3
0325   
0326   mod = new G4MicroElecLOPhononModel();
0327   em_config->SetExtraEmModel("e-", "e-_G4LOPhononScattering", mod, "Target", 0.1 * eV, 10 * MeV);//*/
0328 
0329 
0330   // *** proton ----------------------------------------------------------
0331   
0332   // ---> STANDARD EM processes inactivated below standEnergyLimit
0333 
0334   // STANDARD msc is still active
0335   // Inactivate following STANDARD processes 
0336 
0337   // il faut desactiver Bragg puisque notre modle descend en-dessous de 50 keV
0338   /*mod = new G4BraggModel();
0339   mod->SetActivationHighEnergyLimit(50*keV);
0340   em_config->SetExtraEmModel("proton","hIoni",mod,"Target",0.0,2*MeV, new G4IonFluctuations());*/
0341     
0342   mod = new G4BetheBlochModel();
0343   mod->SetActivationLowEnergyLimit(10*MeV);
0344   em_config->SetExtraEmModel("proton","hIoni",mod,"Target",2*MeV,10*TeV, new G4IonFluctuations());
0345                  
0346   // ---> Dielectric processes activated
0347 
0348   
0349   mod = new G4MicroElecInelasticModel_new();
0350   mod->SetActivationLowEnergyLimit(100*eV);
0351   em_config->SetExtraEmModel("proton","p_G4Dielectrics",mod,"Target",100*eV,10*MeV);
0352   //em_config->SetExtraEmModel("proton","p_G4Dielectrics",new G4DummyModel,"Target",10*MeV,10*TeV);
0353 
0354   //*/
0355 
0356 
0357   // *** alpha ----------------------------------------------------------
0358   mod = new G4BetheBlochModel();
0359   mod->SetActivationLowEnergyLimit(10*MeV);
0360   em_config->SetExtraEmModel("alpha","ionIoni",mod,"Target",10*MeV,10*TeV, new G4IonFluctuations());
0361 
0362   /*mod = new G4MicroElecInelasticModel_new();
0363   //mod->SetActivationLowEnergyLimit(100*eV);
0364   em_config->SetExtraEmModel("alpha","alpha_G4Dielectrics",mod,"Target",0.0,10*MeV);//*/
0365 
0366   // *** ion ----------------------------------------------------------
0367 
0368   // ---> STANDARD EM processes inactivated below standEnergyLimit
0369 
0370   // STANDARD msc is still active
0371   // Inactivate following STANDARD processes
0372 
0373 
0374   /*mod = new G4BraggIonModel();
0375   mod->SetActivationHighEnergyLimit(50*keV);
0376   em_config->SetExtraEmModel("GenericIon","ionIoni",mod,"Target",0.0,2*MeV, new G4IonFluctuations());*/
0377  
0378   mod = new G4BetheBlochModel();
0379   mod->SetActivationLowEnergyLimit(10*MeV);
0380   em_config->SetExtraEmModel("GenericIon","ionIoni",mod,"Target",10*MeV,10*TeV, new G4IonFluctuations());
0381    
0382   // ---> Dielectric processes activated
0383   mod = new G4MicroElecInelasticModel_new();
0384   mod->SetActivationLowEnergyLimit(100*eV);
0385   em_config->SetExtraEmModel("GenericIon","ion_G4Dielectrics",mod,"Target",0.0,10*MeV);
0386   //em_config->SetExtraEmModel("GenericIon","ion_G4Dielectrics",new G4DummyModel,"Target",10*GeV,10*TeV);
0387 
0388   // Deexcitation
0389   //
0390   G4VAtomDeexcitation* de = new G4UAtomicDeexcitation();
0391   G4LossTableManager::Instance()->SetAtomDeexcitation(de);
0392   de->SetFluo(true);
0393   de->SetAuger(true);   
0394   de->SetPIXE(true);  
0395   de->InitialiseForNewRun();
0396 
0397  // G4ProductionCutsTable::GetProductionCutsTable()->SetEnergyRange(5*eV, 100.0*GeV);
0398 
0399 }
0400 
0401 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0402 
0403 void MicroElecPhysics::ConstructGeneral()
0404 { }
0405 
0406 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0407 
0408 void MicroElecPhysics::SetCuts()
0409 {
0410   if (verboseLevel >0)
0411   {
0412     G4cout << "MicroElecPhysics::SetCuts:";
0413     G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
0414   }  
0415   
0416   // set cut values for gamma at first and for e- second and next for e+,
0417   // because some processes for e+/e- need cut values for gamma 
0418   SetCutValue(cutForGamma, "gamma");
0419   SetCutValue(cutForElectron, "e-");
0420   SetCutValue(cutForPositron, "e+");
0421   SetCutValue(cutForProton, "proton");
0422   
0423   if (verboseLevel>0) { DumpCutValuesTable(); }
0424 }