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