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 #include "PhysicsList.hh"
0032 #include "G4SystemOfUnits.hh"
0033 
0034 // Geant4-MicroElec MODELS
0035 
0036 #include "G4MicroElecElastic.hh"
0037 #include "G4MicroElecElasticModel.hh"
0038 
0039 #include "G4MicroElecInelastic.hh"
0040 #include "G4MicroElecInelasticModel.hh"
0041 //
0042 
0043 #include "G4LossTableManager.hh"
0044 #include "G4EmConfigurator.hh"
0045 #include "G4VEmModel.hh"
0046 #include "G4DummyModel.hh"
0047 #include "G4eIonisation.hh"
0048 #include "G4hIonisation.hh"
0049 #include "G4ionIonisation.hh"
0050 #include "G4eMultipleScattering.hh"
0051 #include "G4hMultipleScattering.hh"
0052 #include "G4BraggModel.hh"
0053 #include "G4BraggIonModel.hh"
0054 #include "G4BetheBlochModel.hh"
0055 #include "G4UrbanMscModel.hh"
0056 #include "G4MollerBhabhaModel.hh"
0057 #include "G4IonFluctuations.hh"
0058 #include "G4UniversalFluctuation.hh"
0059 
0060 #include "G4ElectronCapture.hh"
0061 
0062 #include "G4UAtomicDeexcitation.hh"
0063 
0064 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0065 
0066 PhysicsList::PhysicsList():  G4VUserPhysicsList()
0067 {
0068   defaultCutValue = 1*micrometer;
0069   cutForGamma     = defaultCutValue;
0070   cutForElectron  = defaultCutValue;
0071   cutForPositron  = defaultCutValue;
0072   cutForProton    = defaultCutValue;
0073   
0074   SetVerboseLevel(1);
0075 }
0076 
0077 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0078 
0079 PhysicsList::~PhysicsList()
0080 {}
0081 
0082 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0083 
0084 void PhysicsList::ConstructParticle()
0085 {
0086   ConstructBosons();
0087   ConstructLeptons();
0088   ConstructBarions();
0089 }
0090 
0091 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0092 
0093 void PhysicsList::ConstructBosons()
0094 { 
0095   // gamma
0096   G4Gamma::GammaDefinition();
0097 }
0098  //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0099 
0100 void PhysicsList::ConstructLeptons()
0101 {
0102   // leptons
0103   G4Electron::ElectronDefinition();
0104   G4Positron::PositronDefinition();
0105 }
0106 
0107 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0108 
0109 void PhysicsList::ConstructBarions()
0110 {
0111   //  baryons
0112   G4Proton::ProtonDefinition();
0113   G4GenericIon::GenericIonDefinition();
0114 }
0115 
0116 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0117 
0118 void PhysicsList::ConstructProcess()
0119 {
0120   AddTransportation();
0121   ConstructEM();
0122   ConstructGeneral();
0123 }
0124 
0125 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0126 
0127 void PhysicsList::ConstructEM()
0128 {
0129 
0130   auto particleIterator=GetParticleIterator();
0131   particleIterator->reset();
0132   
0133   while( (*particleIterator)() )
0134   {
0135 
0136     G4ParticleDefinition* particle = particleIterator->value();
0137     G4ProcessManager* pmanager = particle->GetProcessManager();
0138     G4String particleName = particle->GetParticleName();
0139 
0140     // *********************************
0141     // 1) Processes for the World region
0142     // *********************************
0143 
0144     if (particleName == "e-") {
0145 
0146       // STANDARD msc is active in the world
0147       G4eMultipleScattering* msc = new G4eMultipleScattering();
0148       msc->AddEmModel(1, new G4UrbanMscModel());
0149       pmanager->AddProcess(msc, -1, 1, -1);
0150 
0151       // STANDARD ionisation is active in the world
0152       G4eIonisation* eion = new G4eIonisation();
0153       pmanager->AddProcess(eion, -1, 2, 2);
0154 
0155       // MicroElec elastic is not active in the world 
0156       G4MicroElecElastic* theMicroElecElasticProcess = new G4MicroElecElastic("e-_G4MicroElecElastic");
0157       theMicroElecElasticProcess->SetEmModel(new G4DummyModel());
0158       pmanager->AddDiscreteProcess(theMicroElecElasticProcess);
0159 
0160       // MicroElec ionisation is not active in the world 
0161       G4MicroElecInelastic* microelecioni = new G4MicroElecInelastic("e-_G4MicroElecInelastic");
0162       microelecioni->SetEmModel(new G4DummyModel()); 
0163       pmanager->AddDiscreteProcess(microelecioni);
0164 
0165       // THE FOLLOWING PROCESS WILL KILL ALL ELECTRONS BELOW A SELECTED ENERY THRESHOLD
0166       // Capture of low-energy e-
0167       G4ElectronCapture* ecap = new G4ElectronCapture("Target", 16.7*eV);
0168       pmanager->AddDiscreteProcess(ecap);
0169             
0170     } else if ( particleName == "proton" ) {
0171 
0172       // STANDARD msc is active in the world 
0173       G4hMultipleScattering* msc = new G4hMultipleScattering();
0174       msc->AddEmModel(1, new G4UrbanMscModel());
0175       pmanager->AddProcess(msc, -1, 1, -1);
0176 
0177       // STANDARD ionisation is active in the world 
0178       G4hIonisation* hion = new G4hIonisation();
0179       pmanager->AddProcess(hion, -1, 2, 2);
0180 
0181       // MicroElec ionisation is not active in the world 
0182       G4MicroElecInelastic* microelecioni = new G4MicroElecInelastic("p_G4MicroElecInelastic");
0183       microelecioni->SetEmModel(new G4DummyModel()); 
0184       microelecioni->SetEmModel(new G4DummyModel()); 
0185       pmanager->AddDiscreteProcess(microelecioni);
0186 
0187     } else if (particleName == "GenericIon") { 
0188 
0189       // STANDARD msc is active in the world 
0190       G4hMultipleScattering* msc = new G4hMultipleScattering();
0191       msc->AddEmModel(1, new G4UrbanMscModel());
0192       pmanager->AddProcess(new G4hMultipleScattering, -1, 1, -1);
0193 
0194       // STANDARD ionisation is active in the world 
0195       G4ionIonisation* hion = new G4ionIonisation();
0196       pmanager->AddProcess(hion, -1, 2, 2);
0197 
0198       // MicroElec ionisation is not active in the world 
0199       G4MicroElecInelastic* microelecioni = new G4MicroElecInelastic("ion_G4MicroElecInelastic");
0200       microelecioni->SetEmModel(new G4DummyModel()); 
0201       microelecioni->SetEmModel(new G4DummyModel());
0202       pmanager->AddDiscreteProcess(microelecioni);
0203     } 
0204   }
0205 
0206   // **************************************
0207   // 2) Define processes for Target region 
0208   // **************************************
0209 
0210   // STANDARD EM processes should be inactivated when corresponding MicroElec processes are used
0211   // - STANDARD EM e- processes are inactivated below 100 MeV
0212   // - STANDARD EM proton & ion processes are inactivated below standEnergyLimit
0213   //
0214   G4EmConfigurator* em_config = G4LossTableManager::Instance()->EmConfigurator();
0215 
0216   G4VEmModel* mod;
0217   // *** e-
0218 
0219   // ---> STANDARD EM processes are inactivated below 100 MeV
0220   
0221   G4UrbanMscModel* msc =  new G4UrbanMscModel();
0222   msc->SetActivationLowEnergyLimit(100*MeV);
0223   em_config->SetExtraEmModel("e-","msc",msc,"Target");
0224   
0225   mod = new G4MollerBhabhaModel();
0226   mod->SetActivationLowEnergyLimit(100*MeV);
0227   em_config->SetExtraEmModel("e-","eIoni",mod,"Target",0.0,10*TeV, new G4UniversalFluctuation());
0228 
0229   // ---> MicroElec processes activated
0230 
0231   mod = new G4MicroElecElasticModel();
0232   em_config->SetExtraEmModel("e-","e-_G4MicroElecElastic",mod,"Target",0.0,100*MeV);
0233   
0234   mod = new G4MicroElecInelasticModel();
0235   em_config->SetExtraEmModel("e-","e-_G4MicroElecInelastic",mod,"Target",16.7*eV,100*MeV);
0236 
0237   // *** proton
0238   
0239   // ---> STANDARD EM processes inactivated below standEnergyLimit
0240 
0241   // STANDARD msc is still active
0242   // Inactivate following STANDARD processes 
0243     
0244   mod = new G4BraggModel();
0245   mod->SetActivationHighEnergyLimit(50*keV);
0246   em_config->SetExtraEmModel("proton","hIoni",mod,"Target",0.0,2*MeV, new G4IonFluctuations());
0247     
0248   mod = new G4BetheBlochModel();
0249   mod->SetActivationLowEnergyLimit(10*GeV);
0250   em_config->SetExtraEmModel("proton","hIoni",mod,"Target",2*MeV,10*TeV, new G4IonFluctuations());
0251                  
0252   // ---> MicroElec processes activated  
0253   mod = new G4MicroElecInelasticModel(); 
0254   mod->SetActivationLowEnergyLimit(50*keV);
0255   em_config->SetExtraEmModel("proton","p_G4MicroElecInelastic",mod,"Target",0.0,10*GeV);
0256   em_config->SetExtraEmModel("proton","p_G4MicroElecInelastic",new G4DummyModel,
0257                  "Target",10*GeV,10*TeV);
0258 
0259  // *** ion
0260 
0261   // ---> STANDARD EM processes inactivated below standEnergyLimit
0262 
0263   // STANDARD msc is still active
0264   // Inactivate following STANDARD processes 
0265 
0266   mod = new G4BraggIonModel();
0267   mod->SetActivationHighEnergyLimit(50*keV);
0268   em_config->SetExtraEmModel("GenericIon","ionIoni",mod,"Target",0.0,2*MeV, new G4IonFluctuations());
0269  
0270   mod = new G4BetheBlochModel();
0271   mod->SetActivationLowEnergyLimit(10*GeV);
0272   em_config->SetExtraEmModel("GenericIon","ionIoni",mod,"Target",2*MeV,10*TeV, new G4IonFluctuations());
0273    
0274   // ---> MicroElec processes activated
0275   mod = new G4MicroElecInelasticModel(); 
0276   mod->SetActivationLowEnergyLimit(50*keV);
0277   em_config->SetExtraEmModel("GenericIon","ion_G4MicroElecInelastic",mod,
0278                  "Target",0.0,10*GeV);
0279   em_config->SetExtraEmModel("GenericIon","ion_G4MicroElecInelastic",new G4DummyModel,
0280                  "Target",10*GeV,10*TeV);
0281 
0282   // Deexcitation
0283   //
0284   G4VAtomDeexcitation* de = new G4UAtomicDeexcitation();
0285   G4LossTableManager::Instance()->SetAtomDeexcitation(de);
0286   de->SetFluo(true);
0287   de->SetAuger(true);   
0288   de->SetPIXE(true);  
0289   de->InitialiseForNewRun();
0290 
0291 
0292 }
0293 
0294 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0295 
0296 void PhysicsList::ConstructGeneral()
0297 { }
0298 
0299 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0300 
0301 void PhysicsList::SetCuts()
0302 {
0303   if (verboseLevel >0)
0304   {
0305     G4cout << "PhysicsList::SetCuts:";
0306     G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
0307   }  
0308   
0309   // set cut values for gamma at first and for e- second and next for e+,
0310   // because some processes for e+/e- need cut values for gamma 
0311   SetCutValue(cutForGamma, "gamma");
0312   SetCutValue(cutForElectron, "e-");
0313   SetCutValue(cutForPositron, "e+");
0314   SetCutValue(cutForProton, "proton");
0315   
0316   if (verboseLevel>0) { DumpCutValuesTable(); }
0317 }