Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:22:03

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 // This example is provided by the Geant4-DNA collaboration
0027 // Any report or published results obtained using the Geant4-DNA software
0028 // shall cite the following Geant4-DNA collaboration publication:
0029 // Med. Phys. 37 (2010) 4692-4708
0030 // and papers
0031 // M. Batmunkh et al. J Radiat Res Appl Sci 8 (2015) 498-507
0032 // O. Belov et al. Physica Medica 32 (2016) 1510-1520
0033 // The Geant4-DNA web site is available at http://geant4-dna.org
0034 //
0035 // -------------------------------------------------------------------
0036 // November 2016
0037 // -------------------------------------------------------------------
0038 //
0039 /// \file DetectorConstruction.hh
0040 /// \brief Definition of the DetectorConstruction class
0041 
0042 #ifndef DetectorConstruction_h
0043 #define DetectorConstruction_h 1
0044 
0045 #include "G4Box.hh"
0046 #include "G4LogicalVolume.hh"
0047 #include "G4Material.hh"
0048 #include "G4NistManager.hh"
0049 #include "G4PVPlacement.hh"
0050 #include "G4Sphere.hh"
0051 #include "G4UnionSolid.hh"
0052 #include "G4UserLimits.hh"
0053 #include "G4VPhysicalVolume.hh"
0054 #include "G4VSolid.hh"
0055 #include "G4VUserDetectorConstruction.hh"
0056 #include "G4VisAttributes.hh"
0057 //
0058 #include "NeuronLoadDataFile.hh"
0059 
0060 #include "G4Ellipsoid.hh"
0061 #include "G4LogicalVolumeStore.hh"
0062 #include "G4Orb.hh"
0063 #include "G4PVParameterised.hh"
0064 #include "G4PhysicalVolumeStore.hh"
0065 #include "G4SolidStore.hh"
0066 #include "G4Tubs.hh"
0067 
0068 #include <vector>
0069 
0070 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0071 
0072 class G4Region;
0073 
0074 class DetectorConstruction : public G4VUserDetectorConstruction
0075 {
0076   public:
0077     DetectorConstruction();
0078     ~DetectorConstruction() override;
0079 
0080     G4VPhysicalVolume* Construct() override;
0081     G4Region* GetTargetRegion() const { return fpRegion; }
0082 
0083     NeuronLoadDataFile* GetNeuronLoadParamz() const { return fNeuronLoadParamz; };
0084     const G4VPhysicalVolume* GetsomaPV(G4int i) const { return fsomaPV[i]; };
0085     const G4VPhysicalVolume* GetdendritePV(G4int i) const { return fdendritePV[i]; };
0086     const G4VPhysicalVolume* GetaxonPV(G4int i) const { return faxonPV[i]; };
0087     G4Material* GetTargetMaterial() const { return fpWaterMaterial; };
0088 
0089     G4int GetnbSomacomp() const { return fnbSomacomp; }  //
0090     G4double GetMassSomacomp(G4int i) const { return fMassSomacomp[i]; }  //
0091     G4double GetMassSomaTot() const { return fMassSomaTot; }  //
0092     G4ThreeVector GetPosSomacomp(G4int i) const { return fPosSomacomp[i]; }  //
0093 
0094     G4int GetnbDendritecomp() const { return fnbDendritecomp; }  //
0095     G4double GetMassDendcomp(G4int i) const { return fMassDendcomp[i]; }  //
0096     G4double GetMassDendTot() const { return fMassDendTot; }  //
0097     G4ThreeVector GetPosDendcomp(G4int i) const { return fPosDendcomp[i]; }  //
0098     G4double GetDistADendSoma(G4int i) const { return fDistADendSoma[i]; }  //
0099     G4double GetDistBDendSoma(G4int i) const { return fDistBDendSoma[i]; }  //
0100 
0101     G4int GetnbAxoncomp() const { return fnbAxoncomp; }  //
0102     G4double GetMassAxoncomp(G4int i) const { return fMassAxoncomp[i]; }  //
0103     G4double GetMassAxonTot() const { return fMassAxonTot; }  //
0104     G4ThreeVector GetPosAxoncomp(G4int i) const { return fPosAxoncomp[i]; }  //
0105     G4double GetDistAxonsoma(G4int i) const { return fDistAxonsoma[i]; }  //
0106 
0107     G4double GetTotVolNeuron() const { return fTotVolNeuron; }
0108     G4double GetTotSurfNeuron() const { return fTotSurfNeuron; }
0109     G4double GetTotMassNeuron() const { return fTotMassNeuron; }  //
0110     G4double GetTotVolSlice() const { return fTotVolSlice; }
0111     G4double GetTotSurfSlice() const { return fTotSurfSlice; }
0112     G4double GetTotMassSlice() const { return fTotMassSlice; }  //
0113     G4double GetTotVolMedium() const { return fTotVolMedium; }
0114     G4double GetTotSurfMedium() const { return fTotSurfMedium; }  //
0115     G4double GetTotMassMedium() const { return fTotMassMedium; }  //
0116 
0117   private:
0118     void DefineMaterials();
0119 
0120     G4Material* fpWaterMaterial{nullptr};
0121     G4Material* fpWorldMaterial{nullptr};
0122     G4Region* fpRegion{nullptr};
0123 
0124     // For neuron constructions!
0125     NeuronLoadDataFile* fNeuronLoadParamz;
0126     G4bool fCheckOverlaps{false};
0127 
0128     std::vector<G4VSolid*> fsomaS;
0129     std::vector<G4VSolid*> fdendriteS;
0130     std::vector<G4VSolid*> faxonS;
0131     std::vector<G4LogicalVolume*> fsomaLV;
0132     std::vector<G4LogicalVolume*> fdendriteLV;
0133     std::vector<G4LogicalVolume*> faxonLV;
0134     std::vector<G4VPhysicalVolume*> fsomaPV;
0135     std::vector<G4VPhysicalVolume*> fdendritePV;
0136     std::vector<G4VPhysicalVolume*> faxonPV;
0137 
0138     G4VisAttributes* fSomaColour{nullptr};
0139     G4VisAttributes* fDendColour{nullptr};
0140     G4VisAttributes* fAxonColour{nullptr};
0141     G4VisAttributes* fSpineColour{nullptr};
0142     G4VisAttributes* fNeuronColour{nullptr};
0143 
0144     G4int fnbSomacomp{0};
0145     G4int fnbDendritecomp{0};
0146     G4int fnbAxoncomp{0};
0147 
0148     std::vector<G4ThreeVector> fPosSomacomp;
0149     std::vector<G4double> fMassSomacomp;
0150 
0151     std::vector<G4double> fDistADendSoma;
0152     std::vector<G4double> fDistBDendSoma;
0153     std::vector<G4double> fMassDendcomp;
0154     std::vector<G4ThreeVector> fPosDendcomp;
0155 
0156     std::vector<G4double> fDistAxonsoma;
0157     std::vector<G4double> fMassAxoncomp;
0158     std::vector<G4ThreeVector> fPosAxoncomp;
0159 
0160     G4double fMassSomaTot{0.0};
0161     G4double fMassDendTot{0.0};
0162     G4double fMassAxonTot{0.0};
0163 
0164     G4double fTotVolNeuron{0.0};
0165     G4double fTotSurfNeuron{0.0};
0166     G4double fTotMassNeuron{0.0};
0167     G4double fTotVolSlice{0.0};
0168     G4double fTotSurfSlice{0.0};
0169     G4double fTotMassSlice{0.0};
0170     G4double fTotVolMedium{0.0};
0171     G4double fTotSurfMedium{0.0};
0172     G4double fTotMassMedium{0.0};
0173 };
0174 
0175 #endif