Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /geant4/examples/advanced/dna/cellularPhantom/include/CellParameterisation.hh was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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 // -----------------------------------------------------------------------------
0027 //       MONTE CARLO SIMULATION OF REALISTIC GEOMETRY FROM MICROSCOPES IMAGES
0028 //
0029 // Authors and contributors:
0030 // P. Barberet (a), S. Incerti (a), N. H. Tran (a), L. Morelli (a,b)
0031 //
0032 // a) University of Bordeaux, CNRS, LP2i, UMR5797, Gradignan, France
0033 // b) Politecnico di Milano, Italy
0034 //
0035 // If you use this code, please cite the following publication:
0036 // P. Barberet et al.,
0037 // "Monte-Carlo dosimetry on a realistic cell monolayer
0038 // geometry exposed to alpha particles."
0039 // Ph. Barberet et al 2012 Phys. Med. Biol. 57 2189
0040 // doi: 110.1088/0031-9155/57/8/2189
0041 // -----------------------------------------------------------------------------
0042 
0043 #ifndef CellParameterisation_H
0044 #define CellParameterisation_H 1
0045 
0046 #include "G4VPVParameterisation.hh"
0047 #include "G4VPhysicalVolume.hh"
0048 #include "G4LogicalVolume.hh"
0049 #include "G4VisAttributes.hh"
0050 #include "G4SystemOfUnits.hh"
0051 
0052 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0053 
0054 class CellParameterisation : public G4VPVParameterisation
0055 {
0056   public:
0057 
0058     explicit CellParameterisation
0059       (G4String fileName,
0060        G4Material *RedMat, G4Material *GreenMat, G4Material *BlueMat,
0061        G4double shiftX, G4double shiftY, G4double shiftZ);
0062 
0063     ~CellParameterisation() override;
0064 
0065     void ComputeTransformation
0066       (const G4int copyNo, G4VPhysicalVolume *physVol) const override;
0067 
0068     G4Material *ComputeMaterial (const G4int copyNo,
0069                                        G4VPhysicalVolume *physVol,
0070                                  const G4VTouchable *) override;
0071 
0072     inline auto GetPhantomTotalPixels() const { return fPhantomTotalPixels; }
0073 
0074     inline auto GetRedTotalPixels() const { return fRedTotalPixels; }
0075     inline auto GetGreenTotalPixels() const { return fGreenTotalPixels; }
0076     inline auto GetBlueTotalPixels() const { return fBlueTotalPixels; }
0077 
0078     inline auto GetPixelSizeX() const { return fDimCellBoxX; }
0079     inline auto GetPixelSizeY() const { return fDimCellBoxY; }
0080     inline auto GetPixelSizeZ() const { return fDimCellBoxZ; }
0081 
0082     inline auto GetRedMass() const { return fRedMass; }
0083     inline auto GetGreenMass() const { return fGreenMass; }
0084     inline auto GetBlueMass() const { return fBlueMass; }
0085 
0086     //inline auto GetVoxelThreeVector(G4int i) const { return fMapCell[i]; }
0087     //inline auto GetVoxelThreeVectorPixel(G4int i) const { return fMapCellPxl[i]; }
0088     inline auto GetVoxelThreeVectorOriginal(G4int i) const { return fMapCellOriginal[i]; }
0089 
0090     inline auto GetMaterial(G4int i) const { return fMaterial[i]; }
0091 
0092     // Singleton
0093     static CellParameterisation *Instance()
0094     {
0095       return gInstance;
0096     }
0097 
0098   private:
0099 
0100     void Initialize(const G4String&);
0101 
0102     static CellParameterisation *gInstance;
0103 
0104     G4double fDimCellBoxX = 0;
0105     G4double fDimCellBoxY = 0;
0106     G4double fDimCellBoxZ = 0;
0107 
0108     G4double fSizeRealX = 0;
0109     G4double fSizeRealY = 0;
0110     G4double fSizeRealZ = 0;
0111 
0112     G4Material *fRedMaterial = nullptr;
0113     G4Material *fGreenMaterial = nullptr;
0114     G4Material *fBlueMaterial = nullptr;
0115 
0116     G4double fShiftX = 0.;
0117     G4double fShiftY = 0.;
0118     G4double fShiftZ = 0.;
0119 
0120     G4VisAttributes *fRedAttributes = nullptr;
0121     G4VisAttributes *fGreenAttributes = nullptr;
0122     G4VisAttributes *fBlueAttributes = nullptr;
0123 
0124     G4ThreeVector *fMapCell = nullptr; // VOXEL COORDINATES
0125     G4ThreeVector *fMapCellPxl = nullptr;// VOXEL COORDINATES IN PIXEL, NO SHIFT
0126     G4ThreeVector *fMapCellOriginal = nullptr; // VOXEL COORDINATES (original space)
0127 
0128     G4int    *fMaterial = nullptr; // MATERIAL
0129 
0130     G4int fPhantomTotalPixels = 0;
0131     G4int fRedTotalPixels = 0;
0132     G4int fGreenTotalPixels = 0;
0133     G4int fBlueTotalPixels = 0;
0134 
0135     G4double fRedMass = 0.;
0136     G4double fGreenMass = 0.;
0137     G4double fBlueMass = 0.;
0138 
0139     char fRealUnit;
0140 
0141     G4double fOffsetX = 0.;
0142     G4double fOffsetY = 0.;
0143     G4double fOffsetZ = 0.;
0144 };
0145 
0146 #endif