Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:21:52

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 // Authors: S. Meylan and C. Villagrasa (IRSN, France)
0027 // Update: H. Tran (IRSN, France) :20/12/2018
0028 //         J. Naoki D. Kondo (UCSF, US): 10/10/2021
0029 //
0030 /// \file PhysGeoImport.hh
0031 /// \brief Definition of the plasmid load methods for the geometry
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 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
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 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
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     // Materials
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 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0132 
0133 #endif