File indexing completed on 2026-09-17 08:31:48
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
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046 #include "PhysicsList.hh"
0047
0048 #include "G4EmDNAChemistry.hh"
0049 #include "G4EmDNAChemistryForPlasmids.hh"
0050 #include "G4EmDNAChemistry_option1.hh"
0051 #include "G4EmDNAChemistry_option2.hh"
0052 #include "G4EmDNAChemistry_option3.hh"
0053 #include "G4EmDNAPhysics.hh"
0054 #include "G4EmDNAPhysics_option1.hh"
0055 #include "G4EmDNAPhysics_option2.hh"
0056 #include "G4EmDNAPhysics_option3.hh"
0057 #include "G4EmDNAPhysics_option4.hh"
0058 #include "G4EmDNAPhysics_option5.hh"
0059 #include "G4EmDNAPhysics_option6.hh"
0060 #include "G4EmDNAPhysics_option7.hh"
0061 #include "G4EmDNAPhysics_option8.hh"
0062 #include "G4EmParameters.hh"
0063 #include "G4PhysicsConstructorRegistry.hh"
0064 #include "G4SystemOfUnits.hh"
0065
0066 #include <memory>
0067
0068
0069
0070 PhysicsList::PhysicsList() : G4VModularPhysicsList()
0071 {
0072 G4double currentDefaultCut = 1. * nanometer;
0073
0074 G4ProductionCutsTable::GetProductionCutsTable()->SetEnergyRange(100 * eV, 1 * GeV);
0075 SetDefaultCutValue(currentDefaultCut);
0076 SetVerboseLevel(1);
0077
0078 RegisterPhysicsConstructor("G4EmDNAPhysics_option2");
0079 RegisterChemistryConstructor("G4EmDNAChemistryForPlasmids");
0080
0081 fpPhysicsUI = new G4UIcmdWithAString("/physics/SetPhysics", this);
0082 fpPhysicsUI->AvailableForStates(G4State_PreInit);
0083
0084 fpChemistryUI = new G4UIcmdWithAString("/physics/SetChemistry", this);
0085 fpChemistryUI->AvailableForStates(G4State_PreInit);
0086
0087 fpDMSOUI = new G4UIcmdWithADouble("/chem/scavenger/DMSO", this);
0088 fpDMSOUI->AvailableForStates(G4State_PreInit);
0089
0090 fpOxygenUI = new G4UIcmdWithADouble("/chem/scavenger/Oxygen", this);
0091 fpOxygenUI->AvailableForStates(G4State_PreInit);
0092 }
0093
0094
0095
0096 void PhysicsList::ConstructParticle()
0097 {
0098 if (fEmDNAPhysicsList != nullptr) {
0099 fEmDNAPhysicsList->ConstructParticle();
0100 }
0101 if (fEmDNAChemistryList != nullptr) {
0102 fEmDNAChemistryList->ConstructParticle();
0103 }
0104 }
0105
0106
0107
0108 void PhysicsList::ConstructProcess()
0109 {
0110 AddTransportation();
0111 if (fEmDNAPhysicsList != nullptr) {
0112 fEmDNAPhysicsList->ConstructProcess();
0113 }
0114 if (fEmDNAChemistryList != nullptr) {
0115 fEmDNAChemistryList->ConstructProcess();
0116 }
0117 }
0118
0119
0120
0121 void PhysicsList::RegisterPhysicsConstructor(const G4String& name)
0122 {
0123 if (name == fPhysDNAName) {
0124 return;
0125 }
0126 if (verboseLevel > 0) {
0127 G4cout << "===== Register Physics constructor ==== " << name << G4endl;
0128 }
0129 if (name == "G4EmDNAPhysics") {
0130 delete fEmDNAPhysicsList;
0131 fEmDNAPhysicsList = new G4EmDNAPhysics(verboseLevel);
0132 fPhysDNAName = name;
0133 }
0134 else if (name == "G4EmDNAPhysics_option1") {
0135 delete fEmDNAPhysicsList;
0136 fEmDNAPhysicsList = new G4EmDNAPhysics_option1(verboseLevel);
0137 fPhysDNAName = name;
0138 }
0139 else if (name == "G4EmDNAPhysics_option2") {
0140 delete fEmDNAPhysicsList;
0141 fEmDNAPhysicsList = new G4EmDNAPhysics_option2(verboseLevel);
0142 fPhysDNAName = name;
0143 }
0144 else if (name == "G4EmDNAPhysics_option3") {
0145 delete fEmDNAPhysicsList;
0146 fEmDNAPhysicsList = new G4EmDNAPhysics_option3(verboseLevel);
0147 fPhysDNAName = name;
0148 }
0149 else if (name == "G4EmDNAPhysics_option4") {
0150 delete fEmDNAPhysicsList;
0151 fEmDNAPhysicsList = new G4EmDNAPhysics_option4(verboseLevel);
0152 fPhysDNAName = name;
0153 }
0154 else if (name == "G4EmDNAPhysics_option5") {
0155 delete fEmDNAPhysicsList;
0156 fEmDNAPhysicsList = new G4EmDNAPhysics_option5(verboseLevel);
0157 fPhysDNAName = name;
0158 }
0159 else if (name == "G4EmDNAPhysics_option6") {
0160 delete fEmDNAPhysicsList;
0161 fEmDNAPhysicsList = new G4EmDNAPhysics_option6(verboseLevel);
0162 fPhysDNAName = name;
0163 }
0164 else if (name == "G4EmDNAPhysics_option7") {
0165 delete fEmDNAPhysicsList;
0166 fEmDNAPhysicsList = new G4EmDNAPhysics_option7(verboseLevel);
0167 fPhysDNAName = name;
0168 }
0169 else if (name == "G4EmDNAPhysics_option8") {
0170 delete fEmDNAPhysicsList;
0171 fEmDNAPhysicsList = new G4EmDNAPhysics_option8(verboseLevel);
0172 fPhysDNAName = name;
0173 }
0174 else {
0175 G4cout << "PhysicsList::RegisterPhysicsConstructor: <" << name << ">"
0176 << " fails - name is not defined" << G4endl;
0177 }
0178 }
0179
0180
0181
0182 void PhysicsList::RegisterChemistryConstructor(const G4String& name)
0183 {
0184 if (verboseLevel > 0) {
0185 G4cout << "===== Register Chemistry constructor ==== " << name << G4endl;
0186 }
0187 if (name == "G4EmDNAChemistry") {
0188 delete fEmDNAChemistryList;
0189 fEmDNAChemistryList = new G4EmDNAChemistry();
0190 fEmDNAChemistryList->SetVerboseLevel(verboseLevel);
0191 fChemDNAName = name;
0192 }
0193 else if (name == "G4EmDNAChemistry_option1") {
0194 delete fEmDNAChemistryList;
0195 fEmDNAChemistryList = new G4EmDNAChemistry_option1();
0196 fEmDNAChemistryList->SetVerboseLevel(verboseLevel);
0197 fChemDNAName = name;
0198 }
0199 else if (name == "G4EmDNAChemistry_option2") {
0200 delete fEmDNAChemistryList;
0201 fEmDNAChemistryList = new G4EmDNAChemistry_option2();
0202 fEmDNAChemistryList->SetVerboseLevel(verboseLevel);
0203 fChemDNAName = name;
0204 }
0205 else if (name == "G4EmDNAChemistry_option3") {
0206 delete fEmDNAChemistryList;
0207 fEmDNAChemistryList = new G4EmDNAChemistry_option3();
0208 fEmDNAChemistryList->SetVerboseLevel(verboseLevel);
0209 fChemDNAName = name;
0210 }
0211 else if (name == "G4EmDNAChemistryForPlasmids") {
0212 delete fEmDNAChemistryList;
0213 fEmDNAChemistryList = new G4EmDNAChemistryForPlasmids(fDMSO, fOxygen);
0214 fEmDNAChemistryList->SetVerboseLevel(verboseLevel);
0215 fChemDNAName = name;
0216 }
0217 else {
0218 G4cout << "PhysicsList::RegisterChemistryConstructor: <" << name << ">"
0219 << " fails - name is not defined" << G4endl;
0220 }
0221 }
0222
0223
0224
0225 void PhysicsList::SetNewValue(G4UIcommand* command, G4String newValue)
0226 {
0227 if (command == fpPhysicsUI) {
0228 RegisterPhysicsConstructor(newValue);
0229 }
0230
0231 if (command == fpChemistryUI) {
0232 RegisterChemistryConstructor(newValue);
0233 }
0234
0235 if (command == fpDMSOUI) {
0236 fDMSO = fpDMSOUI->GetNewDoubleValue(newValue);
0237 }
0238
0239 else if (command == fpOxygenUI) {
0240 fOxygen = fpOxygenUI->GetNewDoubleValue(newValue);
0241 }
0242 }
0243
0244