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