Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-31 09:22:33

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 // The Geant4-DNA web site is available at http://geant4-dna.org
0031 // 
0032 // If you use this example, please cite the following publication:
0033 // Rad. Prot. Dos. 133 (2009) 2-11
0034 
0035 #ifndef CellParameterisation_H
0036 #define CellParameterisation_H 1
0037 
0038 #include "G4VPVParameterisation.hh"
0039 #include "G4VisAttributes.hh"
0040 
0041 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0042 
0043 class CellParameterisation : public G4VPVParameterisation
0044 { 
0045   public:
0046   
0047     explicit CellParameterisation
0048     (G4Material* nucleus1, G4Material* cytoplasm1,
0049      G4Material* nucleus2, G4Material* cytoplasm2,
0050      G4Material* nucleus3, G4Material* cytoplasm3
0051      );
0052 
0053     ~CellParameterisation() override;
0054    
0055     void ComputeTransformation (const G4int copyNo,G4VPhysicalVolume* physVol) const override;
0056     
0057     void ComputeDimensions(G4Box&, 
0058                   const G4int, 
0059                   const G4VPhysicalVolume* ) const override;
0060 
0061     void ComputeDimensions(G4Tubs &,
0062                                    const G4int,
0063                                    const G4VPhysicalVolume *) const override {}
0064 
0065     void ComputeDimensions(G4Trd &,
0066                                    const G4int,
0067                                    const G4VPhysicalVolume *) const override {}
0068     
0069     void ComputeDimensions(G4Trap &,
0070                                    const G4int,
0071                                    const G4VPhysicalVolume *) const override {}
0072     
0073     void ComputeDimensions(G4Cons &,
0074                                    const G4int,
0075                                    const G4VPhysicalVolume *) const override{}
0076 
0077     void ComputeDimensions(G4Sphere &,
0078                                    const G4int,
0079                                    const G4VPhysicalVolume *) const override{}
0080 
0081     void ComputeDimensions(G4Ellipsoid &,
0082                                    const G4int,
0083                                    const G4VPhysicalVolume *) const override{}
0084 
0085     void ComputeDimensions(G4Orb &,
0086                                    const G4int,
0087                                    const G4VPhysicalVolume *) const override{}
0088 
0089     void ComputeDimensions(G4Torus &,
0090                                    const G4int,
0091                                    const G4VPhysicalVolume *) const override{}
0092 
0093     void ComputeDimensions(G4Para &,
0094                                    const G4int,
0095                                    const G4VPhysicalVolume *) const override{}
0096 
0097     void ComputeDimensions(G4Polycone &,
0098                                    const G4int,
0099                                    const G4VPhysicalVolume *) const override{}
0100 
0101     void ComputeDimensions(G4Polyhedra &,
0102                                    const G4int,
0103                                    const G4VPhysicalVolume *) const override{}
0104 
0105     void ComputeDimensions(G4Hype &,
0106                                    const G4int,
0107                                    const G4VPhysicalVolume *) const override{}
0108 
0109     G4int GetNoBoxes() const {return fPhantomTotalPixels;}
0110 
0111     G4Material* ComputeMaterial(const G4int copyNo,
0112                                       G4VPhysicalVolume* physVol,
0113                                 const G4VTouchable*) override;
0114 
0115    // NEW
0116    
0117    G4int    GetPhantomTotalPixels()   const {return fPhantomTotalPixels;}  
0118    G4int    GetNucleusTotalPixels()   const {return fNucleusTotalPixels;}  
0119    G4int    GetCytoplasmTotalPixels() const {return fCytoplasmTotalPixels;}  
0120    G4double GetPixelSizeX()           const {return fDimCellBoxX;}  
0121    G4double GetPixelSizeY()           const {return fDimCellBoxY;}  
0122    G4double GetPixelSizeZ()           const {return fDimCellBoxZ;}  
0123    G4double GetCytoplasmMass()        const {return fCytoplasmMass;}  
0124    G4double GetNucleusMass()          const {return fNucleusMass;}  
0125 
0126    G4ThreeVector GetVoxelThreeVector(G4int i) const {return fMapCell[i];}
0127    G4double      GetMaterialVector(G4int i)   const {return fMaterial[i];}
0128    G4double      GetMassVector(G4int i)       const {return fMass[i];}
0129    G4int         GetTissueType(G4int i)       const {return fTissueType[i];}
0130 
0131    // SINGLETON
0132 
0133    static CellParameterisation * Instance()
0134    {
0135      return gInstance; 
0136    }
0137    
0138   private:
0139     static CellParameterisation* gInstance;
0140     
0141     G4Material * fNucleusMaterial1;
0142     G4Material * fCytoplasmMaterial1;
0143     G4Material * fNucleusMaterial2;
0144     G4Material * fCytoplasmMaterial2;
0145     G4Material * fNucleusMaterial3;
0146     G4Material * fCytoplasmMaterial3;
0147     
0148     G4VisAttributes * fNucleusAttributes1;
0149     G4VisAttributes * fCytoplasmAttributes1;
0150     G4VisAttributes * fNucleusAttributes2;
0151     G4VisAttributes * fCytoplasmAttributes2;
0152     G4VisAttributes * fNucleusAttributes3;
0153     G4VisAttributes * fCytoplasmAttributes3;
0154     
0155     G4ThreeVector * fMapCell;    // VOXEL COORDINATES
0156     
0157     G4double *      fMaterial;   // MATERIAL 
0158     G4double *      fMass;       // DENSITY REGION
0159     G4double fDimCellBoxX;
0160     G4double fDimCellBoxY;
0161     G4double fDimCellBoxZ;
0162     G4double fNucleusMass;
0163     G4double fCytoplasmMass;
0164     
0165     G4int *         fTissueType; // DENSITY REGION
0166     G4int fPhantomTotalPixels;
0167     G4int fNucleusTotalPixels;
0168     G4int fCytoplasmTotalPixels;      
0169 };
0170 #endif
0171 
0172