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
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
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
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
0075
0076 void PhysicsList::ConstructParticle()
0077 {
0078 if(fDNAPhysicsList != nullptr)
0079 {
0080 fDNAPhysicsList->ConstructParticle();
0081
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
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
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
0142
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
0164
0165
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
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
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
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