File indexing completed on 2026-06-11 07:56:13
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 #ifndef DNADAMAGE2_GeoImport_h
0038 #define DNADAMAGE2_GeoImport_h 1
0039
0040 #include "G4Box.hh"
0041 #include "G4Electron_aq.hh"
0042 #include "G4H2O.hh"
0043 #include "G4LogicalVolume.hh"
0044 #include "G4NistManager.hh"
0045 #include "G4Orb.hh"
0046 #include "G4PVPlacement.hh"
0047 #include "G4String.hh"
0048 #include "G4SubtractionSolid.hh"
0049 #include "G4SystemOfUnits.hh"
0050 #include "G4ThreeVector.hh"
0051 #include "G4VSolid.hh"
0052 #include "G4VisAttributes.hh"
0053
0054 #include <algorithm>
0055 #include <fstream>
0056 #include <map>
0057 #include <memory>
0058
0059 class G4VPhysicalVolume;
0060
0061
0062
0063 struct Molecule
0064 {
0065 Molecule(G4String name, G4int copyNumber, G4ThreeVector position, G4double radius,
0066 G4double waterRadius, std::string material, G4int strand)
0067 {
0068 fName = name;
0069 fMaterial = material;
0070 fCopyNumber = copyNumber;
0071 fPosition = position;
0072 fRadius = radius;
0073 fRadiusWater = waterRadius;
0074 fStrand = strand;
0075 }
0076
0077 G4String fName = "none";
0078 G4String fMaterial = "none";
0079
0080 G4int fCopyNumber = -1;
0081 G4int fStrand = -1;
0082
0083 G4ThreeVector fPosition = G4ThreeVector();
0084
0085 G4double fRadius = 1;
0086 G4double fRadiusWater = 1;
0087 };
0088
0089
0090
0091 class PhysGeoImport
0092 {
0093 public:
0094 PhysGeoImport();
0095 ~PhysGeoImport() = default;
0096
0097 G4LogicalVolume* CreateLogicVolumeXYZ(G4String fileName);
0098
0099 std::vector<G4String> GetMoleculesNames() { return fSampleDNANames; }
0100 std::vector<G4ThreeVector> GetMoleculesPositions() { return fSampleDNAPositions; }
0101 std::vector<std::vector<G4int>> GetMoleculesDetails() { return fSampleDNADetails; }
0102
0103 private:
0104 std::string fGeoName = "VoxelStraight";
0105
0106 std::map<G4String, G4double> fRadiusMap;
0107 std::map<G4String, G4double> fWaterRadiusMap;
0108
0109 std::vector<Molecule> fMolecules;
0110
0111
0112 G4Material* fpWater = nullptr;
0113 G4Material* fEnvelopeWater = nullptr;
0114
0115 void ReadFile(G4String fileName);
0116
0117 G4double fOffsetX = 0;
0118 G4double fOffsetY = 0;
0119 G4double fOffsetZ = 0;
0120 G4double fXMin = 1000;
0121 G4double fXMax = -1000;
0122 G4double fYMin = 1000;
0123 G4double fYMax = -1000;
0124 G4double fZMin = 1000;
0125 G4double fZMax = -1000;
0126 std::ofstream fOutDNA;
0127
0128 std::vector<G4ThreeVector> fVertexes;
0129
0130 std::vector<G4String> fSampleDNANames;
0131 std::vector<G4ThreeVector> fSampleDNAPositions;
0132 std::vector<std::vector<G4int>> fSampleDNADetails;
0133 };
0134
0135
0136
0137 #endif