Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 // Authors: J. Naoki D. Kondo (UCSF, US) : 10/ << 26 // Authors: J. Naoki D. Kondo (UCSF, US) : 10/10/2021 27 // J. Ramos-Mendez and B. Faddegon (U 27 // J. Ramos-Mendez and B. Faddegon (UCSF, US) 28 // 28 // 29 /// \file PhysGeoImport.cc 29 /// \file PhysGeoImport.cc 30 /// \brief Implementation of the plasmid load 30 /// \brief Implementation of the plasmid load methods for the geometry 31 31 32 #include "PhysGeoImport.hh" 32 #include "PhysGeoImport.hh" 33 << 34 #include "G4DNAChemistryManager.hh" 33 #include "G4DNAChemistryManager.hh" 35 #include "G4Ellipsoid.hh" << 36 #include "G4VPhysicalVolume.hh" 34 #include "G4VPhysicalVolume.hh" >> 35 #include "G4Ellipsoid.hh" 37 #include "Randomize.hh" 36 #include "Randomize.hh" 38 37 39 //....oooOO0OOooo........oooOO0OOooo........oo 38 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo..... 40 39 41 PhysGeoImport::PhysGeoImport() {} << 40 PhysGeoImport::PhysGeoImport() >> 41 {} 42 42 43 //....oooOO0OOooo........oooOO0OOooo........oo 43 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo..... 44 44 45 G4LogicalVolume* PhysGeoImport::CreateLogicVol << 45 G4LogicalVolume* PhysGeoImport::CreateLogicVolumeXYZ(G4String fileName) { 46 { << 46 G4NistManager * man = G4NistManager::Instance(); 47 G4NistManager* man = G4NistManager::Instance << 48 fEnvelopeWater = man->FindOrBuildMaterial("G 47 fEnvelopeWater = man->FindOrBuildMaterial("G4_WATER"); 49 fpWater = << 48 fpWater = man->BuildMaterialWithNewDensity("G4_WATER_MODIFIED", 50 man->BuildMaterialWithNewDensity("G4_WATER << 49 "G4_WATER",1.0*g/cm/cm/cm); 51 50 52 ReadFile(fileName); 51 ReadFile(fileName); 53 52 54 G4double des1 = 1.1344640137963142; 53 G4double des1 = 1.1344640137963142; 55 G4double des2 = des1 + (CLHEP::pi * .5); << 54 G4double des2 = des1 + (CLHEP::pi*.5); 56 G4double ang = 0.6283185307179586; 55 G4double ang = 0.6283185307179586; 57 G4double bet1 = 0.6283185307179586 * 2; 56 G4double bet1 = 0.6283185307179586 * 2; 58 G4double posi = 1.0471975511965976; 57 G4double posi = 1.0471975511965976; 59 G4double sep = .1 * angstrom; << 58 G4double sep = .1*angstrom; 60 // Geometries Sizes << 59 //Geometries Sizes 61 G4double PxRs = 2.9389169420478556 * angstro << 60 G4double PxRs = 2.9389169420478556 * angstrom; 62 G4double PyRs = 2.9389169420478556 * angstro 61 G4double PyRs = 2.9389169420478556 * angstrom; 63 G4double PzRs = 2.9389169420478556 * angstro 62 G4double PzRs = 2.9389169420478556 * angstrom; 64 G4double PxYs = 2.7 * angstrom; 63 G4double PxYs = 2.7 * angstrom; 65 G4double PyYs = 2.7 * angstrom; 64 G4double PyYs = 2.7 * angstrom; 66 G4double PzYs = 2.7 * angstrom; 65 G4double PzYs = 2.7 * angstrom; 67 G4double PxBp = 2.45 * angstrom; 66 G4double PxBp = 2.45 * angstrom; 68 G4double PyBp = 2.45 * angstrom; 67 G4double PyBp = 2.45 * angstrom; 69 G4double PzBp = 2.45 * angstrom; 68 G4double PzBp = 2.45 * angstrom; >> 69 70 70 71 G4double xin = -170 * angstrom; 71 G4double xin = -170 * angstrom; 72 G4double yin = -170 * angstrom; 72 G4double yin = -170 * angstrom; 73 G4double zin = -170 * angstrom; 73 G4double zin = -170 * angstrom; 74 G4double xfn = 170 * angstrom; << 74 G4double xfn = 170 * angstrom; 75 G4double yfn = 170 * angstrom; << 75 G4double yfn = 170 * angstrom; 76 G4double zfn = 170 * angstrom; << 76 G4double zfn = 170 * angstrom; 77 77 78 G4int nVertex = fVertexes.size(); 78 G4int nVertex = fVertexes.size(); 79 79 80 // Envelope 80 // Envelope 81 81 82 std::string boxNameSolid = fGeoName + "_soli 82 std::string boxNameSolid = fGeoName + "_solid"; 83 G4Box* box_solid = << 83 G4Box* box_solid = new G4Box(boxNameSolid, 0.5*(fXMax-fXMin)+0.5*3.4*nm, 84 new G4Box(boxNameSolid, 0.5 * (fXMax - fXM << 84 0.5*(fYMax-fYMin)+0.5*3.4*nm, 85 0.5 * (fYMax - fYMin) + 0.5 * 3. << 85 0.5*(fZMax-fZMin)+0.5*3.4*nm); 86 << 86 87 G4String boxNameLogic = fGeoName + "_logic"; << 87 G4String boxNameLogic = fGeoName + "_logic"; 88 G4LogicalVolume* box_logic = << 88 G4LogicalVolume* box_logic = new G4LogicalVolume(box_solid, 89 new G4LogicalVolume(box_solid, fEnvelopeWa << 89 fEnvelopeWater, 90 << 90 boxNameLogic, 0,0,0); 91 // Desoxyribose << 91 92 << 92 //Desoxyribose 93 G4Ellipsoid* RSolidSugar = new G4Ellipsoid(" << 93 94 G4LogicalVolume* RSugar = new G4LogicalVolum << 94 G4Ellipsoid *RSolidSugar = new G4Ellipsoid("sdeoxyribose", >> 95 PxRs, >> 96 PyRs, >> 97 PzRs, -PzRs, .445*PzRs); >> 98 G4LogicalVolume* RSugar = new G4LogicalVolume(RSolidSugar, >> 99 fpWater, >> 100 "ldeoxyribose", >> 101 0,0,0); 95 G4VisAttributes* MyVisAtt_Rs = new G4VisAttr 102 G4VisAttributes* MyVisAtt_Rs = new G4VisAttributes(G4Colour(G4Colour::Red())); 96 MyVisAtt_Rs->SetForceSolid(true); 103 MyVisAtt_Rs->SetForceSolid(true); 97 RSugar->SetVisAttributes(MyVisAtt_Rs); 104 RSugar->SetVisAttributes(MyVisAtt_Rs); 98 105 99 // Phosphoric Acid << 106 //Phosphoric Acid 100 << 101 G4Ellipsoid* YSolidSugar = new G4Ellipsoid(" << 102 107 103 G4LogicalVolume* YSugar = new G4LogicalVolum << 108 G4Ellipsoid *YSolidSugar = new G4Ellipsoid("sphosphate", >> 109 PxYs, >> 110 PyYs, >> 111 PzYs, >> 112 -PzYs, >> 113 .9 * angstrom); >> 114 >> 115 G4LogicalVolume* YSugar = new G4LogicalVolume(YSolidSugar, >> 116 fpWater, >> 117 "lphosphate", >> 118 0,0,0); 104 G4VisAttributes* MyVisAtt_Ys = new G4VisAttr 119 G4VisAttributes* MyVisAtt_Ys = new G4VisAttributes(G4Colour(G4Colour::Yellow())); 105 MyVisAtt_Ys->SetForceSolid(true); 120 MyVisAtt_Ys->SetForceSolid(true); 106 YSugar->SetVisAttributes(MyVisAtt_Ys); 121 YSugar->SetVisAttributes(MyVisAtt_Ys); 107 122 108 // Base Pairs << 123 //Base Pairs 109 124 110 G4Ellipsoid* Base1a = new G4Ellipsoid("BaseP << 125 G4Ellipsoid* Base1a = new G4Ellipsoid("BasePair1a", 111 G4LogicalVolume* BaseP1a = new G4LogicalVolu << 126 PxBp, >> 127 PyBp, >> 128 PzBp, >> 129 -PzBp, >> 130 1.15 * angstrom); >> 131 G4LogicalVolume* BaseP1a = new G4LogicalVolume(Base1a, fpWater, "BasePair1a", 0,0,0); 112 G4VisAttributes* MyVisAtt_Bp1a = new G4VisAt 132 G4VisAttributes* MyVisAtt_Bp1a = new G4VisAttributes(G4Colour(G4Colour::Green())); 113 MyVisAtt_Bp1a->SetForceSolid(true); 133 MyVisAtt_Bp1a->SetForceSolid(true); 114 BaseP1a->SetVisAttributes(MyVisAtt_Bp1a); 134 BaseP1a->SetVisAttributes(MyVisAtt_Bp1a); 115 135 116 G4Ellipsoid* Base1b = new G4Ellipsoid("BaseP << 136 G4Ellipsoid* Base1b= new G4Ellipsoid("BasePair1b", 117 G4LogicalVolume* BaseP1b = new G4LogicalVolu << 137 PxBp, >> 138 PyBp, >> 139 PzBp, >> 140 1.15 * angstrom, >> 141 PzBp); >> 142 G4LogicalVolume* BaseP1b = new G4LogicalVolume(Base1b, fpWater, "BasePair1b", 0,0,0); 118 143 119 G4VisAttributes* MyVisAtt_Bp1b = new G4VisAt 144 G4VisAttributes* MyVisAtt_Bp1b = new G4VisAttributes(G4Colour(G4Colour::Green())); 120 MyVisAtt_Bp1b->SetForceSolid(true); 145 MyVisAtt_Bp1b->SetForceSolid(true); 121 BaseP1b->SetVisAttributes(MyVisAtt_Bp1b); 146 BaseP1b->SetVisAttributes(MyVisAtt_Bp1b); 122 147 123 G4int index = 0; << 148 G4int index = 0; 124 G4double cAngle = 0; 149 G4double cAngle = 0; 125 G4double pi = CLHEP::pi; << 150 G4double pi = CLHEP::pi; 126 for (int vertex = 0; vertex < nVertex - 1; v << 151 for (int vertex = 0; vertex < nVertex - 1; vertex++ ) { 127 xin = fVertexes[vertex][0] - fOffsetX; << 152 xin = fVertexes[vertex][0]-fOffsetX; 128 yin = fVertexes[vertex][1] - fOffsetY; << 153 yin = fVertexes[vertex][1]-fOffsetY; 129 zin = fVertexes[vertex][2] - fOffsetZ; << 154 zin = fVertexes[vertex][2]-fOffsetZ; 130 xfn = fVertexes[vertex + 1][0] - fOffsetX; << 155 xfn = fVertexes[vertex+1][0]-fOffsetX; 131 yfn = fVertexes[vertex + 1][1] - fOffsetY; << 156 yfn = fVertexes[vertex+1][1]-fOffsetY; 132 zfn = fVertexes[vertex + 1][2] - fOffsetZ; << 157 zfn = fVertexes[vertex+1][2]-fOffsetZ; 133 << 158 134 G4double phi0 = << 159 G4double phi0 = std::atan2(zfn-zin,std::sqrt(((xfn-xin)*(xfn-xin))+ 135 std::atan2(zfn - zin, std::sqrt(((xfn - << 160 ((yfn-yin)*(yfn-yin)))); 136 G4double theta0 = std::atan2(xfn - xin, yf << 161 G4double theta0 = std::atan2(xfn-xin,yfn-yin); 137 G4double lenght = std::sqrt(((xfn - xin) * << 162 G4double lenght = std::sqrt(((xfn-xin)*(xfn-xin))+ 138 + ((zfn - zin) << 163 ((yfn-yin)*(yfn-yin))+ 139 G4double dl = 1.0 / (lenght / (3.4 * angst << 164 ((zfn-zin)*(zfn-zin))); 140 G4int nChain = (fVertexes[vertex] - fVerte << 165 G4double dl = 1.0 / (lenght / (3.4*angstrom)); >> 166 G4int nChain = (fVertexes[vertex] - fVertexes[vertex+1]).mag() / (0.34 * nm); 141 167 142 for (G4int nseg = 0; nseg < nChain; nseg++ << 168 for (G4int nseg = 0; nseg < nChain ; nseg++) { 143 cAngle += ang; 169 cAngle += ang; 144 170 145 G4double theta = cAngle; 171 G4double theta = cAngle; 146 G4double x1 = 0; 172 G4double x1 = 0; 147 G4double y1 = 0; 173 G4double y1 = 0; 148 G4double z1 = ((2 * PzBp) + PzRs + sep); << 174 G4double z1 = ((2*PzBp) + PzRs + sep); 149 175 150 G4double x2 = 0; << 176 G4double x2 = 0; 151 G4double y2 = 0; << 177 G4double y2 = 0; 152 G4double z2 = ((2 * PzBp) + PzRs + sep); << 178 G4double z2 = ((2*PzBp) + PzRs + sep); 153 179 154 G4ThreeVector plus2 = G4ThreeVector(0, 0 << 180 G4ThreeVector plus2 = G4ThreeVector(0,0,(.5 * PzRs) + PzYs); 155 plus2.rotateX(-des1); 181 plus2.rotateX(-des1); 156 plus2.rotateZ(-posi); 182 plus2.rotateZ(-posi); 157 183 158 G4ThreeVector plus2alt = G4ThreeVector(0 << 184 G4ThreeVector plus2alt = G4ThreeVector(0,0,(.5 * PzRs) + PzYs); 159 plus2alt.rotateX(-des1); 185 plus2alt.rotateX(-des1); 160 plus2alt.rotateZ(posi); 186 plus2alt.rotateZ(posi); 161 187 162 G4double x3 = 0; 188 G4double x3 = 0; 163 G4double y3 = 0; 189 G4double y3 = 0; 164 G4double z3 = PzBp + sep; 190 G4double z3 = PzBp + sep; 165 191 166 G4ThreeVector position1i = G4ThreeVector << 192 G4ThreeVector position1i = G4ThreeVector(x1,y1,z1); 167 G4ThreeVector position2i = G4ThreeVector << 193 G4ThreeVector position2i = G4ThreeVector(x2,y2,z2)+plus2; 168 G4ThreeVector position2ialt = G4ThreeVec << 194 G4ThreeVector position2ialt = G4ThreeVector(x2,y2,-z2)-plus2alt; 169 G4ThreeVector position3i = G4ThreeVector << 195 G4ThreeVector position3i = G4ThreeVector(x3,y3,z3); 170 196 171 position1i.rotateY(theta); 197 position1i.rotateY(theta); 172 position2i.rotateY(theta); 198 position2i.rotateY(theta); 173 position2ialt.rotateY(theta); 199 position2ialt.rotateY(theta); 174 position3i.rotateY(theta); 200 position3i.rotateY(theta); 175 201 176 G4double x = dl * nseg * (xfn - xin) + x << 202 G4double x = dl*nseg*(xfn-xin)+xin; 177 G4double y = dl * nseg * (yfn - yin) + y << 203 G4double y = dl*nseg*(yfn-yin)+yin; 178 G4double z = dl * nseg * (zfn - zin) + z << 204 G4double z = dl*nseg*(zfn-zin)+zin; 179 205 180 position1i.rotateX(phi0); 206 position1i.rotateX(phi0); 181 position2i.rotateX(phi0); 207 position2i.rotateX(phi0); 182 position2ialt.rotateX(phi0); 208 position2ialt.rotateX(phi0); 183 position3i.rotateX(phi0); 209 position3i.rotateX(phi0); 184 210 185 position1i.rotateZ(-theta0); 211 position1i.rotateZ(-theta0); 186 position2i.rotateZ(-theta0); 212 position2i.rotateZ(-theta0); 187 position2ialt.rotateZ(-theta0); 213 position2ialt.rotateZ(-theta0); 188 position3i.rotateZ(-theta0); 214 position3i.rotateZ(-theta0); 189 215 190 G4double yrot1 = theta; 216 G4double yrot1 = theta; 191 G4double xrot1 = -des1; 217 G4double xrot1 = -des1; 192 G4RotationMatrix rotm1 = G4RotationMatri 218 G4RotationMatrix rotm1 = G4RotationMatrix(); 193 rotm1.rotateX(xrot1); 219 rotm1.rotateX(xrot1); 194 rotm1.rotateZ(-posi); 220 rotm1.rotateZ(-posi); 195 rotm1.rotateY(yrot1); 221 rotm1.rotateY(yrot1); 196 rotm1.rotateX(phi0); 222 rotm1.rotateX(phi0); 197 rotm1.rotateZ(-theta0); 223 rotm1.rotateZ(-theta0); 198 G4ThreeVector position1 = position1i + G << 224 G4ThreeVector position1 = position1i + G4ThreeVector(x,y,z); 199 G4Transform3D transform1(rotm1, position 225 G4Transform3D transform1(rotm1, position1); 200 << 226 201 G4double yrot1alt = theta + pi; 227 G4double yrot1alt = theta + pi; 202 G4double xrot1alt = des1; 228 G4double xrot1alt = des1; 203 G4RotationMatrix rotm1alt = G4RotationMa 229 G4RotationMatrix rotm1alt = G4RotationMatrix(); 204 rotm1alt.rotateX(xrot1alt); 230 rotm1alt.rotateX(xrot1alt); 205 rotm1alt.rotateZ(-posi); 231 rotm1alt.rotateZ(-posi); 206 rotm1alt.rotateY(yrot1alt); 232 rotm1alt.rotateY(yrot1alt); 207 rotm1alt.rotateX(phi0); 233 rotm1alt.rotateX(phi0); 208 rotm1alt.rotateZ(-theta0); 234 rotm1alt.rotateZ(-theta0); 209 G4ThreeVector position1alt = -position1i << 235 G4ThreeVector position1alt = -position1i + G4ThreeVector(x,y,z); 210 G4Transform3D transform1alt(rotm1alt, po << 236 G4Transform3D transform1alt(rotm1alt,position1alt); 211 237 212 G4double yrot2 = theta; 238 G4double yrot2 = theta; 213 G4double xrot2 = -des2; 239 G4double xrot2 = -des2; 214 G4RotationMatrix rotm2 = G4RotationMatri 240 G4RotationMatrix rotm2 = G4RotationMatrix(); 215 rotm2.rotateX(xrot2); 241 rotm2.rotateX(xrot2); 216 rotm2.rotateY(yrot2 - bet1 + 0.872664625 242 rotm2.rotateY(yrot2 - bet1 + 0.8726646259971648); 217 rotm2.rotateX(phi0); 243 rotm2.rotateX(phi0); 218 rotm2.rotateZ(-theta0); 244 rotm2.rotateZ(-theta0); 219 G4ThreeVector position2 = position2i + G << 245 G4ThreeVector position2 = position2i + G4ThreeVector(x,y,z); 220 G4Transform3D transform2(rotm2, position << 246 G4Transform3D transform2(rotm2,position2); 221 247 222 G4double yrot2alt = theta + pi; 248 G4double yrot2alt = theta + pi; 223 G4double xrot2alt = des2; 249 G4double xrot2alt = des2; 224 G4RotationMatrix rotm2alt = G4RotationMa 250 G4RotationMatrix rotm2alt = G4RotationMatrix(); 225 rotm2alt.rotateX(xrot2alt); 251 rotm2alt.rotateX(xrot2alt); 226 rotm2alt.rotateY(yrot2alt + bet1 - 0.872 252 rotm2alt.rotateY(yrot2alt + bet1 - 0.8726646259971648); 227 rotm2alt.rotateX(phi0); 253 rotm2alt.rotateX(phi0); 228 rotm2alt.rotateZ(-theta0); 254 rotm2alt.rotateZ(-theta0); 229 G4ThreeVector position2alt = position2ia << 255 G4ThreeVector position2alt = position2ialt + G4ThreeVector(x,y,z); 230 G4Transform3D transform2alt(rotm2alt, po << 256 G4Transform3D transform2alt(rotm2alt,position2alt); 231 257 232 G4double yrot3 = theta; 258 G4double yrot3 = theta; 233 G4RotationMatrix rotm3 = G4RotationMatri 259 G4RotationMatrix rotm3 = G4RotationMatrix(); 234 rotm3.rotateX(-pi / 2); << 260 rotm3.rotateX(-pi/2); 235 rotm3.rotateZ(-ang); 261 rotm3.rotateZ(-ang); 236 rotm3.rotateY(yrot3); 262 rotm3.rotateY(yrot3); 237 rotm3.rotateX(phi0); 263 rotm3.rotateX(phi0); 238 rotm3.rotateZ(-theta0); 264 rotm3.rotateZ(-theta0); 239 G4ThreeVector position3 = position3i + G << 265 G4ThreeVector position3 = position3i + G4ThreeVector(x,y,z); 240 G4Transform3D transform3(rotm3, position << 266 G4Transform3D transform3(rotm3,position3); 241 267 242 G4double yrot3alt = theta + pi; 268 G4double yrot3alt = theta + pi; 243 G4RotationMatrix rotm3alt = G4RotationMa 269 G4RotationMatrix rotm3alt = G4RotationMatrix(); 244 rotm3alt.rotateX(pi / 2); << 270 rotm3alt.rotateX(pi/2); 245 rotm3alt.rotateZ(-ang); 271 rotm3alt.rotateZ(-ang); 246 rotm3alt.rotateY(yrot3alt); 272 rotm3alt.rotateY(yrot3alt); 247 rotm3alt.rotateX(phi0); 273 rotm3alt.rotateX(phi0); 248 rotm3alt.rotateZ(-theta0); 274 rotm3alt.rotateZ(-theta0); 249 G4ThreeVector position3alt = -position3i << 275 G4ThreeVector position3alt = -position3i + G4ThreeVector(x,y,z); 250 G4Transform3D transform3alt(rotm3alt, po << 276 G4Transform3D transform3alt(rotm3alt,position3alt); 251 << 252 new G4PVPlacement(transform1, RSugar, "d << 253 << 254 new G4PVPlacement(transform1alt, RSugar, << 255 << 256 new G4PVPlacement(transform3, BaseP1a, " << 257 << 258 new G4PVPlacement(transform3alt, BaseP1a << 259 << 260 new G4PVPlacement(transform2, YSugar, "p << 261 277 262 new G4PVPlacement(transform2alt, YSugar, << 278 >> 279 new G4PVPlacement(transform1, >> 280 RSugar, >> 281 "deoxyribose1", >> 282 box_logic, >> 283 false, >> 284 index, >> 285 false); >> 286 >> 287 new G4PVPlacement(transform1alt, >> 288 RSugar, >> 289 "deoxyribose2", >> 290 box_logic, >> 291 false, >> 292 index, >> 293 false); >> 294 >> 295 new G4PVPlacement(transform3, >> 296 BaseP1a, >> 297 "BasePair1", >> 298 box_logic, >> 299 false, >> 300 index, >> 301 false); >> 302 >> 303 new G4PVPlacement(transform3alt, >> 304 BaseP1a, >> 305 "BasePair2", >> 306 box_logic, >> 307 false, >> 308 index, >> 309 false); >> 310 >> 311 new G4PVPlacement(transform2, >> 312 YSugar, >> 313 "phosphate1", >> 314 box_logic, >> 315 false, >> 316 index, >> 317 false); >> 318 >> 319 new G4PVPlacement(transform2alt, >> 320 YSugar, >> 321 "phosphate2", >> 322 box_logic, >> 323 false, >> 324 index, >> 325 false); 263 326 264 G4ThreeVector Deoxy1 = position1; 327 G4ThreeVector Deoxy1 = position1; 265 G4ThreeVector Deoxy2 = position1alt; 328 G4ThreeVector Deoxy2 = position1alt; 266 329 267 fSampleDNAPositions.push_back(Deoxy1); 330 fSampleDNAPositions.push_back(Deoxy1); 268 fSampleDNAPositions.push_back(Deoxy2); 331 fSampleDNAPositions.push_back(Deoxy2); 269 fSampleDNANames.push_back("Deoxyribose") 332 fSampleDNANames.push_back("Deoxyribose"); 270 fSampleDNANames.push_back("Deoxyribose") 333 fSampleDNANames.push_back("Deoxyribose"); 271 fSampleDNADetails.push_back({-1, index, << 334 fSampleDNADetails.push_back({-1,index,1}); 272 fSampleDNADetails.push_back({-1, index, << 335 fSampleDNADetails.push_back({-1,index,2}); 273 336 274 index++; 337 index++; >> 338 275 } 339 } 276 } 340 } 277 341 278 return box_logic; 342 return box_logic; 279 } 343 } 280 344 281 //....oooOO0OOooo........oooOO0OOooo........oo 345 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo..... 282 346 283 void PhysGeoImport::ReadFile(G4String fileName << 347 void PhysGeoImport::ReadFile(G4String fileName) { 284 { << 285 G4double x, y, z; 348 G4double x, y, z; 286 fXMin = 1 * mm, fYMin = 1 * mm, fZMin = 1 * << 349 fXMin = 1*mm, fYMin = 1*mm, fZMin = 1*mm; 287 fXMax = -1 * mm, fYMax = -1 * mm, fZMax = -1 << 350 fXMax =-1*mm, fYMax =-1*mm, fZMax =-1*mm; 288 std::ifstream plasmidFile(fileName); 351 std::ifstream plasmidFile(fileName); 289 while (true) { << 352 while(true) { 290 plasmidFile >> x >> y >> z; 353 plasmidFile >> x >> y >> z; 291 if (!plasmidFile.good()) break; << 354 if ( !plasmidFile.good() ) break; 292 x *= nm; 355 x *= nm; 293 y *= nm; 356 y *= nm; 294 z *= nm; 357 z *= nm; 295 fVertexes.push_back(G4ThreeVector(x, y, z) 358 fVertexes.push_back(G4ThreeVector(x, y, z)); 296 if (fXMin > x) fXMin = x; << 359 if ( fXMin > x ) fXMin = x; 297 if (fXMax < x) fXMax = x; << 360 if ( fXMax < x ) fXMax = x; 298 if (fYMin > y) fYMin = y; << 361 if ( fYMin > y ) fYMin = y; 299 if (fYMax < y) fYMax = y; << 362 if ( fYMax < y ) fYMax = y; 300 if (fZMin > z) fZMin = z; << 363 if ( fZMin > z ) fZMin = z; 301 if (fZMax < z) fZMax = z; << 364 if ( fZMax < z ) fZMax = z; 302 } 365 } 303 plasmidFile.close(); 366 plasmidFile.close(); 304 fOffsetX = (fXMin + fXMax) * 0.5; << 367 fOffsetX = (fXMin + fXMax)*0.5; 305 fOffsetY = (fYMin + fYMax) * 0.5; << 368 fOffsetY = (fYMin + fYMax)*0.5; 306 fOffsetZ = (fZMin + fZMax) * 0.5; << 369 fOffsetZ = (fZMin + fZMax)*0.5; 307 370 308 std::vector<G4ThreeVector> VertRed; 371 std::vector<G4ThreeVector> VertRed; 309 for (size_t i = 0; i < fVertexes.size(); i++ << 372 for(size_t i = 0; i < fVertexes.size(); i++) { 310 if (i % 15 == 0) VertRed.push_back(fVertex << 373 if (i % 15 == 0) >> 374 VertRed.push_back(fVertexes[i]); 311 } 375 } 312 376 313 VertRed.push_back(fVertexes[0]); 377 VertRed.push_back(fVertexes[0]); 314 378 315 fVertexes = VertRed; 379 fVertexes = VertRed; 316 } 380 } 317 381 318 //....oooOO0OOooo........oooOO0OOooo........oo 382 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo..... 319 383