Skip to content

Commit 5d16656

Browse files
Jose Ramos MendezJose Ramos Mendez
Jose Ramos Mendez
authored and
Jose Ramos Mendez
committed
First implementation of process for interactions with Gold
And code cleaning new file: examples/processes/GoldNanoParticle.txt modified: geometry/dna/TsPlasmidSupercoiled/TsIRTPlasmidSupercoiled.cc modified: geometry/sampling/TsRandomCylindersInComponent.cc modified: primary/TsGeneratorUniformlyRandomAtVolume.cc modified: processes/TsEmDNAChemistryExtended.cc modified: processes/TsEmDNAPhysics.cc deleted: processes/TsEmDNAPhysics_opt1.cc deleted: processes/TsEmDNAPhysics_opt1.hh modified: processes/TsEmStandardPhysics_option4.cc modified: processes/TsIRTConfiguration.cc modified: scorers/TsScoreDNADamageWithIRT.cc modified: scorers/TsScoreWithIRTCummulative.cc
1 parent a1b1e84 commit 5d16656

12 files changed

+752
-1287
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Test for using electron/photon interactions in Gold material
2+
# Note: Only electron and photon interactions are supported.
3+
4+
Ts/UseQt = "True"
5+
6+
s:Gr/view/Type = "OpenGL"
7+
Ge/World/HLX = 400 nm
8+
Ge/World/HLY = 400 nm
9+
Ge/World/HLZ = 400 nm
10+
Ge/World/Material = "G4_WATER"
11+
12+
s:Ge/MyBox/Type = "TsSphere"
13+
s:Ge/MyBox/Material = "G4_Au"
14+
s:Ge/MyBox/Parent = "World"
15+
d:Ge/MyBox/RMax = 150 nm
16+
s:Ge/MyBox/Color = "Yellow"
17+
18+
# It requires a region (use lower-case)
19+
s:Ge/MyBox/AssignToRegionNamed = "nanoparticle"
20+
21+
# Active the physics in region
22+
sv:Ph/Default/Modules = 1 "TsEmDNAPhysics"
23+
b:Ph/Default/PhysicsForGold/Active = "True"
24+
s:Ph/Default/PhysicsForGold/Region = Ge/MyBox/AssignToRegionNamed
25+
26+
# Set a beam, zero radius and zero divergence
27+
s:So/Demo/BeamParticle = "e-"
28+
s:So/Demo/BeamPositionDistribution = "None"
29+
s:So/Demo/BeamAngularDistribution = "None"
30+
d:So/Demo/BeamEnergy = 20 keV
31+
u:So/Demo/BeamEnergySpread = 0
32+
i:So/Demo/NumberOfHistoriesInRun = 10
33+
34+
s:Gr/ViewA/Type = "OpenGL"
35+
d:Gr/ViewA/Theta = 90 deg
36+
d:Gr/ViewA/Phi = 0 deg
37+
u:Gr/ViewA/Zoom = 2.
38+
39+
# Good practice, report the simulation time
40+
b:Ts/ShowCPUTime = "True"
41+

geometry/dna/TsPlasmidSupercoiled/TsIRTPlasmidSupercoiled.cc

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -163,22 +163,22 @@ G4LogicalVolume* TsIRTPlasmidSupercoiled::CreateLogicVolume(G4String, G4int copy
163163
G4int copyNum = fMolecules[i].fCopyNumber;
164164

165165
if ( solidPhosphate || solidPurinePyrimidine || solidDeoxyribose || solidHistone ) {
166-
if ( name.contains("phosphate") && solidPhosphate ) {
166+
if ( G4StrUtil::contains(name,"phosphate") && solidPhosphate ) {
167167
phosphate = new G4Orb("phosphate", radius);
168168
wphosphate = new G4Orb("wphosphate", waterRadius);
169169
solidPhosphate = false;
170170
G4cout << "#### Built phosphate" << G4endl;
171-
} else if ( name.contains("base") && solidPurinePyrimidine ) {
171+
} else if ( G4StrUtil::contains(name,"base") && solidPurinePyrimidine ) {
172172
purineAndPyrimidine = new G4Orb("purineandpyrimidine", radius);
173173
wpurineAndPyrimidine = new G4Orb("wpurineandpyrimidine", waterRadius);
174174
solidPurinePyrimidine = false;
175175
G4cout << "#### Built purines and pyrimidines" << G4endl;
176-
} else if ( name.contains("deoxyribose") && solidDeoxyribose ) {
176+
} else if ( G4StrUtil::contains(name, "deoxyribose") && solidDeoxyribose ) {
177177
deoxyribose = new G4Orb("deoxyribose", radius);
178178
wdeoxyribose = new G4Orb("wdeoxyribose", waterRadius);
179179
solidDeoxyribose = false;
180180
G4cout << "#### Built deoxyriboses" << G4endl;
181-
} else if ( name.contains("histone") && solidHistone ) {
181+
} else if ( G4StrUtil::contains(name, "histone") && solidHistone ) {
182182
histone = new G4Orb("histone", radius);
183183
solidHistone = false;
184184
}
@@ -192,11 +192,11 @@ G4LogicalVolume* TsIRTPlasmidSupercoiled::CreateLogicVolume(G4String, G4int copy
192192
if(waterRadius > (0 + tol)*nm)
193193
{
194194
G4String nameWaterSolid = name+"_waterShell";
195-
if ( name.contains("phosphate") ) {
195+
if ( G4StrUtil::contains(name, "phosphate") ) {
196196
moleculeWaterCut_solid = CreateCutSolid(wphosphate, fMolecules[i], fMolecules, false);
197-
} else if ( name.contains("base") ) {
197+
} else if ( G4StrUtil::contains(name, "base") ) {
198198
moleculeWaterCut_solid = CreateCutSolid(wpurineAndPyrimidine, fMolecules[i], fMolecules, false);
199-
} else if ( name.contains("deoxyribose") ) {
199+
} else if ( G4StrUtil::contains(name, "deoxyribose") ) {
200200
moleculeWaterCut_solid = CreateCutSolid(wdeoxyribose, fMolecules[i], fMolecules, false);
201201
}
202202

@@ -213,13 +213,13 @@ G4LogicalVolume* TsIRTPlasmidSupercoiled::CreateLogicVolume(G4String, G4int copy
213213
G4String nameLogic = name;
214214
G4LogicalVolume* molecule_logic = 0;
215215

216-
if ( name.contains("phosphate") ) {
216+
if ( G4StrUtil::contains(name,"phosphate") ) {
217217
moleculeCut_solid = CreateCutSolid(phosphate, fMolecules[i], fMolecules, true);
218-
} else if ( name.contains("base") ) {
218+
} else if ( G4StrUtil::contains(name,"base") ) {
219219
moleculeCut_solid = CreateCutSolid(purineAndPyrimidine, fMolecules[i], fMolecules, true);
220-
} else if ( name.contains("deoxyribose") ) {
220+
} else if ( G4StrUtil::contains(name,"deoxyribose") ) {
221221
moleculeCut_solid = CreateCutSolid(deoxyribose, fMolecules[i], fMolecules, true);
222-
} else if ( name.contains("histone") ) {
222+
} else if ( G4StrUtil::contains(name,"histone") ) {
223223
moleculeCut_solid = CreateCutSolid(histone, fMolecules[i], fMolecules, true);
224224
}
225225

geometry/sampling/TsRandomCylindersInComponent.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@ TsVGeometryComponent(pM, eM, mM, gM, parentComponent, parentVolume, name)
5555
fTHL = fPm->GetDoubleParameter(GetFullParmName("Cylinders/HL"), "Length");
5656

5757
fEnvelopeType = fPm->GetStringParameter(GetFullParmName("EnvelopeShape"));
58-
fEnvelopeType.toLower();
59-
if ( fEnvelopeType.contains("tssphere") ) {
58+
G4StrUtil::to_lower(fEnvelopeType);
59+
if ( G4StrUtil::contains(fEnvelopeType,"tssphere") ) {
6060
fRMax = fPm->GetDoubleParameter(GetFullParmName("RMax"), "Length");
61-
} else if (fEnvelopeType.contains("tsbox")) {
61+
} else if (G4StrUtil::contains(fEnvelopeType,"tsbox")) {
6262
fHLX = fPm->GetDoubleParameter(GetFullParmName("HLX"), "Length");
6363
fHLY = fPm->GetDoubleParameter(GetFullParmName("HLY"), "Length");
6464
fHLZ = fPm->GetDoubleParameter(GetFullParmName("HLZ"), "Length");
65-
} else if ( fEnvelopeType.contains("tscylinder")) {
65+
} else if ( G4StrUtil::contains(fEnvelopeType,"tscylinder")) {
6666
fRMax = fPm->GetDoubleParameter(GetFullParmName("RMax"), "Length");
6767
fHL = fPm->GetDoubleParameter(GetFullParmName("HL"), "Length");
6868
} else {
@@ -90,12 +90,12 @@ G4VPhysicalVolume* TsRandomCylindersInComponent::Construct()
9090
BeginConstruction();
9191

9292
G4double extensionX, extensionY, extensionZ;
93-
if ( fEnvelopeType.contains("tssphere" ) ) {
93+
if ( G4StrUtil::contains(fEnvelopeType,"tssphere" ) ) {
9494
fEnvelope = new G4Orb(fName, fRMax);
9595
extensionX = 2.0 * fRMax;
9696
extensionY = extensionX;
9797
extensionZ = extensionY;
98-
} else if ( fEnvelopeType.contains("tscylinder")) {
98+
} else if ( G4StrUtil::contains(fEnvelopeType,"tscylinder")) {
9999
fEnvelope = new G4Tubs(fName, 0.0, fRMax, fHL, 0.0, 360.0*deg);
100100
extensionX = 2.0 * fRMax;
101101
extensionY = extensionX;

primary/TsGeneratorUniformlyRandomAtVolume.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ void TsGeneratorUniformlyRandomAtVolume::ResolveParameters() {
4848
G4String generateOn = "volume";
4949
if ( fPm->ParameterExists(GetFullParmName("DistributePrimariesAtVolumeRegion")))
5050
generateOn = fPm->GetStringParameter(GetFullParmName("DistributePrimariesAtVolumeRegion"));
51-
generateOn.toLower();
51+
G4StrUtil::to_lower(generateOn);
5252

5353
if ( generateOn != "volume" && generateOn != "surface" ) {
5454
G4cerr << "Topas is exiting due to a serious error in source setup." << G4endl;
@@ -61,7 +61,7 @@ void TsGeneratorUniformlyRandomAtVolume::ResolveParameters() {
6161
fTheDirection = "isotropic";
6262
if ( fPm->ParameterExists(GetFullParmName("DirectPrimariesTo")))
6363
fTheDirection = fPm->GetStringParameter(GetFullParmName("DirectPrimariesTo"));
64-
fTheDirection.toLower();
64+
G4StrUtil::to_lower(fTheDirection);
6565

6666
if ( fTheDirection != "inside" && ( fTheDirection != "outside" && fTheDirection != "isotropic")) {
6767
G4cerr << "Topas is exiting due to a serious error in source setup." << G4endl;

processes/TsEmDNAChemistryExtended.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ void TsEmDNAChemistryExtended::DefineParameters()
140140
"must match with " + GetFullParmName("DiffusionCoefficients/Values"));
141141

142142
for ( int i = 0; i < nbOfMolecules; i++ ) {
143-
molecules[i].toLower();
143+
G4StrUtil::to_lower(molecules[i]);
144144
if ( !MoleculeExists(molecules[i]) ) {
145145
Quit(GetFullParmName("DiffusionCoefficients/Molecules"), "\n--- Molecule: " + molecules[i] + " was not found in database");
146146
} else if ( molecules[i] == "water" ) {
@@ -164,7 +164,7 @@ void TsEmDNAChemistryExtended::DefineParameters()
164164
"must match with " + GetFullParmName("Radii/Values"));
165165

166166
for ( int i = 0; i < nbOfMolecules; i++ ) {
167-
molecules[i].toLower();
167+
G4StrUtil::to_lower(molecules[i]);
168168
if ( !MoleculeExists(molecules[i]) ) {
169169
Quit(GetFullParmName("Radii/Molecules"), "\n--- Molecule: " + molecules[i] + " was not found in database");
170170
} else if ( molecules[i] == "water" ) {
@@ -197,8 +197,8 @@ void TsEmDNAChemistryExtended::DefineParameters()
197197
std::vector<G4String> reactors;
198198
std::vector<G4String> products;
199199

200-
reactorA.toLower();
201-
reactorB.toLower();
200+
G4StrUtil::to_lower(reactorA);
201+
G4StrUtil::to_lower(reactorB);
202202
if ( !MoleculeExists(reactorA) )
203203
Quit(parName, "\n--- Molecule: " + reactorA + " was not found in database");
204204

@@ -209,7 +209,7 @@ void TsEmDNAChemistryExtended::DefineParameters()
209209
reactors.push_back(fExistingMolecules[reactorB]);
210210

211211
for ( int j = 0; j < nbOfProduct; j++ ) {
212-
product[j].toLower();
212+
G4StrUtil::to_lower(product[j]);
213213
if ( product[j] == "none" ) // Note on comparison of strings: See comment on ConstructReactionTable()
214214
products.push_back("none");
215215
else if ( product[j] == "water") {
@@ -242,7 +242,7 @@ void TsEmDNAChemistryExtended::DefineParameters()
242242
G4int nbOfScavenged = fPm->GetVectorLength(GetFullParmName("Scavenger/Molecules"));
243243
for ( int i = 0; i < nbOfScavenged; i++ ) {
244244
G4String aName = scavengedMolecules[i];
245-
aName.toLower();
245+
G4StrUtil::to_lower(aName);
246246
if ( !MoleculeExists(aName) ) {
247247
Quit(GetFullParmName("Scavenger/Molecules"), "\n--- Molecule name " + aName + " was not found");
248248
}

0 commit comments

Comments
 (0)