Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /geant4/examples/advanced/dna/dsbandrepair/src/PhysicsList.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 // * 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 #include "PhysicsList.hh"
0028 #include "G4SystemOfUnits.hh"
0029 #include "G4EmDNAPhysics.hh"
0030 #include "G4EmDNAPhysics_option1.hh"
0031 #include "G4EmDNAPhysics_option2.hh"
0032 #include "G4EmDNAPhysics_option3.hh"
0033 #include "G4EmDNAPhysics_option4.hh"
0034 #include "G4EmDNAPhysics_option5.hh"
0035 #include "G4EmDNAPhysics_option6.hh"
0036 #include "G4EmDNAPhysics_option7.hh"
0037 #include "G4EmDNAPhysics_option8.hh"
0038 #include "G4PhysicsConstructorRegistry.hh"
0039 #include "G4ProcessTable.hh"
0040 #include "G4ProcessManager.hh"
0041 #include "G4DNAChampionElasticModel.hh"
0042 #include "G4DNAScreenedRutherfordElasticModel.hh"
0043 #include "G4DNAElastic.hh"
0044 #include "G4PhysicsListHelper.hh"
0045 #include "G4DNAVibExcitation.hh"
0046 #include "G4DNASancheExcitationModel.hh"
0047 #include "G4DNAElectronSolvation.hh"
0048 #include "G4DNAChemistryManager.hh"
0049 #include "G4LeptonConstructor.hh"
0050 #include "G4BosonConstructor.hh"
0051 #include "G4MesonConstructor.hh"
0052 #include "G4BaryonConstructor.hh"
0053 #include "G4ShortLivedConstructor.hh"
0054 #include "G4DNAMolecule.hh"
0055 #include "UserChoosingDNASolvationModel.hh"
0056 #include "DetectorConstruction.hh"
0057 #include "DetectorConstruction.hh"
0058 
0059 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0060 
0061 PhysicsList::PhysicsList()
0062     : G4VModularPhysicsList()
0063 {
0064     DefineCommands();
0065     SetDefaultCutValue(1.0*nanometer);
0066     SetVerboseLevel(1);
0067     RegisterPhysicsList("G4EmDNAPhysics_option2");
0068     G4ProductionCutsTable::GetProductionCutsTable()->SetEnergyRange(100*eV, 1*GeV);
0069     if (gRunMode == RunningMode::Phys){
0070         G4DNAChemistryManager::Instance()->SetChemistryActivation(false);
0071     }
0072 }
0073 
0074 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0075 
0076 void PhysicsList::ConstructParticle()
0077 {
0078     if(fDNAPhysicsList != nullptr)    
0079     {
0080         fDNAPhysicsList->ConstructParticle();
0081         //dna molecules to get rid of warning
0082         G4Deoxyribose::Definition();
0083         G4Phosphate::Definition();
0084         G4Adenine::Definition();
0085         G4Guanine::Definition();
0086         G4Thymine::Definition();
0087         G4Cytosine::Definition();
0088         G4Histone::Definition(); 
0089     }
0090     if(fEmDNAChemistryList != nullptr)
0091     {
0092         fEmDNAChemistryList->ConstructParticle();
0093     }
0094     // construct following pqrticles to get rid of warning
0095     
0096     G4LeptonConstructor lConstructor;
0097     lConstructor.ConstructParticle();
0098     G4BosonConstructor  pBosonConstructor;
0099     pBosonConstructor.ConstructParticle();
0100     G4MesonConstructor pMesonConstructor;
0101     pMesonConstructor.ConstructParticle();
0102     G4BaryonConstructor pBaryonConstructor;
0103     pBaryonConstructor.ConstructParticle();
0104     G4ShortLivedConstructor pShortLivedConstructor;
0105     pShortLivedConstructor.ConstructParticle();
0106 
0107 }
0108 
0109 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0110 
0111 void PhysicsList::ConstructProcess()
0112 {
0113     AddTransportation();
0114     
0115     if(fDNAPhysicsList != nullptr)    
0116     {
0117         fDNAPhysicsList->ConstructProcess(); 
0118     }
0119 
0120     if (gRunMode == RunningMode::Chem) {
0121         if(fEmDNAChemistryList != nullptr)
0122         {
0123             fEmDNAChemistryList->ConstructProcess();
0124         }
0125     } else {
0126         G4VProcess* process = G4ProcessTable::GetProcessTable()->FindProcess(
0127                     "e-_G4DNAVibExcitation", "e-");
0128 
0129         if (process)
0130         {
0131             G4DNAVibExcitation* vibExcitation = (G4DNAVibExcitation*) process;
0132             G4VEmModel* model = vibExcitation->EmModel();
0133             G4DNASancheExcitationModel* sancheExcitationMod =
0134                     dynamic_cast<G4DNASancheExcitationModel*>(model);
0135             if(sancheExcitationMod)
0136             {
0137                 sancheExcitationMod->ExtendLowEnergyLimit(0.025 * eV);
0138             }
0139         }
0140 
0141         // Modify elastic scattering models to avoid killing electrons
0142         // at low energy
0143         //
0144         process = G4ProcessTable::GetProcessTable()->FindProcess("e-_G4DNAElastic", "e-");
0145 
0146         if (process)
0147         {
0148             G4DNAElastic* vibExcitation = (G4DNAElastic*) process;
0149             G4VEmModel* model = vibExcitation->EmModel();
0150 
0151             if(G4DNAChampionElasticModel* championMod =
0152                 dynamic_cast<G4DNAChampionElasticModel*>(model))
0153             {
0154             championMod->SetKillBelowThreshold(-1);
0155             }
0156             else if(G4DNAScreenedRutherfordElasticModel* screenRutherfordMod =
0157                 dynamic_cast<G4DNAScreenedRutherfordElasticModel*>(model))
0158             {
0159             screenRutherfordMod->SetKillBelowThreshold(-1);
0160             }
0161         }
0162 
0163         // force to use UserChoosingDNASolvationModel to 
0164         //invoke G4EmDNAChemistryManager::CreateSovaltedElectron() 
0165         // when G4DNAChemistryManager is disable
0166         if (!G4DNAChemistryManager::IsActivated()) {
0167             process = G4ProcessTable::GetProcessTable()->FindProcess("e-_G4DNAElectronSolvation", "e-");
0168             if (!process){
0169                 auto pPhysicsListHelper = G4PhysicsListHelper::GetPhysicsListHelper();
0170                 pPhysicsListHelper->RegisterProcess(new G4DNAElectronSolvation("e-_G4DNAElectronSolvation"), 
0171                                                     G4Electron::Definition());
0172             } 
0173             G4DNAElectronSolvation* solvation = dynamic_cast<G4DNAElectronSolvation*>(process);
0174             G4double hLimitE= 0;
0175             G4VEmModel* therm = solvation->GetModelByIndex(0,1);
0176             if (therm) {
0177                 
0178                 hLimitE = therm->HighEnergyLimit();
0179                 therm->SetHighEnergyLimit(0*keV);
0180             }
0181             auto thermz = UserChoosingDNASolvationModel::UserGetMacroDefinedModel();
0182             thermz->SetHighEnergyLimit(hLimitE);
0183             solvation->AddEmModel(-1,thermz);
0184         }
0185     
0186     }
0187 }
0188 
0189 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0190 
0191 void PhysicsList::RegisterPhysicsList(const G4String& name)
0192 {
0193     if(name == fPhysDNAName) 
0194     {
0195         return; 
0196     }
0197     if(verboseLevel > 0) 
0198     {
0199         G4cout << "===== Register constructor ==== " << name << G4endl; 
0200     }
0201     
0202     if(name == "G4EmDNAPhysics") 
0203     {
0204         fDNAPhysicsList.reset(new G4EmDNAPhysics(verboseLevel));
0205         fPhysDNAName = name;
0206     } 
0207     else if(name == "G4EmDNAPhysics_option1") 
0208     {
0209         fDNAPhysicsList.reset(new G4EmDNAPhysics_option1(verboseLevel));
0210         fPhysDNAName = name;
0211     } 
0212     else if(name == "G4EmDNAPhysics_option2") 
0213     {
0214         fDNAPhysicsList.reset(new G4EmDNAPhysics_option2(verboseLevel));
0215         fPhysDNAName = name;
0216     } 
0217     else if(name == "G4EmDNAPhysics_option3") 
0218     {
0219         fDNAPhysicsList.reset(new G4EmDNAPhysics_option3(verboseLevel));
0220         fPhysDNAName = name;
0221     } 
0222     else if(name == "G4EmDNAPhysics_option4") 
0223     {
0224         fDNAPhysicsList.reset(new G4EmDNAPhysics_option4(verboseLevel));
0225         fPhysDNAName = name;
0226     } 
0227     else if(name == "G4EmDNAPhysics_option5") 
0228     {
0229         fDNAPhysicsList.reset(new G4EmDNAPhysics_option5(verboseLevel));
0230         fPhysDNAName = name;
0231     }
0232     else if(name == "G4EmDNAPhysics_option6") 
0233     {
0234         fDNAPhysicsList.reset(new G4EmDNAPhysics_option6(verboseLevel));
0235         fPhysDNAName = name;
0236     } 
0237     else if(name == "G4EmDNAPhysics_option7") 
0238     {
0239         fDNAPhysicsList.reset(new G4EmDNAPhysics_option7(verboseLevel));
0240         fPhysDNAName = name;
0241     } 
0242     else if(name == "G4EmDNAPhysics_option8") 
0243     {
0244         fDNAPhysicsList.reset(new G4EmDNAPhysics_option8(verboseLevel));
0245         fPhysDNAName = name;
0246     } 
0247     else 
0248     {
0249         G4cout << "PhysicsList::RegisterConstructor: <" << name << ">"
0250                << " fails - name is not defined"
0251                << G4endl;    
0252     }
0253 }
0254 
0255 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0256 
0257 void PhysicsList::RegisterChemListConstructor(const G4String& name)
0258 {
0259     if(verboseLevel > 0) 
0260     {
0261         G4cout << "===== Register constructor for Chemitry ==== " << name << G4endl; 
0262     }
0263   
0264     if(name == "G4EmDNAChemistry_option2")
0265     {
0266         if ( fEmDNAChemistryList != nullptr) return;
0267         fEmDNAChemistryList.reset(new G4EmDNAChemistry_option2());
0268         fEmDNAChemistryList->SetVerboseLevel(verboseLevel);
0269         G4EmParameters::Instance()->SetTimeStepModel(G4ChemTimeStepModel::SBS);
0270         fChemListName = name;
0271     }
0272     else if(name == "G4EmDNAChemistry_option3") 
0273     {
0274         if ( fEmDNAChemistryList != nullptr) return;
0275         fEmDNAChemistryList.reset(new G4EmDNAChemistry_option3_Extended());
0276         fEmDNAChemistryList->SetVerboseLevel(verboseLevel);
0277         G4EmParameters::Instance()->SetTimeStepModel(G4ChemTimeStepModel::IRT_syn);
0278         fChemListName = name;
0279     }
0280     else 
0281     {
0282         G4ExceptionDescription msg;
0283         msg <<"ChemPhysicsList::RegisterChemListConstructor: <" << name << ">"
0284             <<" fails - name is not defined";
0285         G4Exception("ChemPhysicsList::RegisterChemListConstructor", "Phys_WrongName", 
0286         JustWarning, msg); 
0287     }
0288 }
0289 
0290 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0291 
0292 void PhysicsList::DefineCommands()
0293 {
0294     fMessenger = std::make_unique<G4GenericMessenger>(this,
0295                              "/dsbandrepair/phys/",
0296                              "cmd control");
0297     auto & fPhysListCmd = fMessenger->DeclareMethod("physicsList",
0298                                                  &PhysicsList::RegisterPhysicsList);
0299     fPhysListCmd.SetParameterName("physList",true);
0300     fPhysListCmd.SetDefaultValue("G4EmDNAPhysics_option2");
0301 
0302     auto & fChemListCmd = fMessenger->DeclareMethod("chemList",
0303                                                  &PhysicsList::RegisterChemListConstructor);
0304     fChemListCmd.SetParameterName("chemList",true);
0305     fChemListCmd.SetDefaultValue("G4EmDNAChemistry_option2");
0306 }
0307 
0308 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......