Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-11 07:56:13

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 /// \file PhysGeoImport.hh
0027 /// \brief Definition of the PhysGeoImport class
0028 ///
0029 /// Definition of the plasmid load methods for the geometry
0030 
0031 
0032 // Authors: S. Meylan and C. Villagrasa (IRSN, France)
0033 // Update: H. Tran (IRSN, France) :20/12/2018
0034 //         J. Naoki D. Kondo (UCSF, US): 10/10/2021
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 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
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 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
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     // Materials
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 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0136 
0137 #endif