Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:21: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 SAXSDetectorConstruction.hh
0027 /// \brief Implementation of the SAXSDetectorConstruction class
0028 //
0029 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0030 
0031 #ifndef SAXSDetectorConstruction_h
0032 #  define SAXSDetectorConstruction_h 1
0033 #endif
0034 
0035 #include "SAXSDetectorConstructionMessenger.hh"
0036 
0037 #include "G4Box.hh"
0038 #include "G4Element.hh"
0039 #include "G4ElementTable.hh"
0040 #include "G4ExtendedMaterial.hh"
0041 #include "G4LogicalVolume.hh"
0042 #include "G4Material.hh"
0043 #include "G4MaterialTable.hh"
0044 #include "G4NistManager.hh"
0045 #include "G4RunManager.hh"
0046 #include "G4Tubs.hh"
0047 #include "G4VPhysicalVolume.hh"
0048 #include "G4VUserDetectorConstruction.hh"
0049 #include "globals.hh"
0050 
0051 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0052 
0053 /// Detector construction.
0054 
0055 class SAXSDetectorConstruction : public G4VUserDetectorConstruction
0056 {
0057   public:
0058     SAXSDetectorConstruction();
0059     ~SAXSDetectorConstruction();
0060 
0061     void DefineMaterials();
0062     void SetGeometricalVariables();
0063 
0064     virtual G4VPhysicalVolume* Construct();
0065 
0066     G4LogicalVolume* GetSensitiveVolume() const { return fSensitiveVolume; }
0067     G4LogicalVolume* GetPhantom() const { return fPhantomLogic; }
0068 
0069   protected:
0070     G4LogicalVolume* fSensitiveVolume;
0071 
0072   private:
0073     virtual void ConstructSDandField();
0074 
0075     SAXSDetectorConstructionMessenger* fMessenger;
0076 
0077     G4bool fIWantSlits;
0078 
0079     //-----------------definition of Volumes-------------------
0080     // World
0081     G4Box* fWorldSolid;
0082     G4LogicalVolume* fWorldLogic;
0083     G4VPhysicalVolume* fWorldPhysical;
0084 
0085     // Phantom
0086     G4LogicalVolume* fPhantomLogic;
0087     G4VPhysicalVolume* fPhantomPhysical;
0088     G4Material* fPhantomMaterial;
0089     G4int fPhantomMaterialIndex;
0090 
0091     // Slits
0092     G4LogicalVolume* fSlit1Logic;
0093     G4LogicalVolume* fSlit2Logic;
0094     G4LogicalVolume* fSlit3Logic;
0095     G4LogicalVolume* fSlit4Logic;
0096     G4VPhysicalVolume* fSlit1Physical;
0097     G4VPhysicalVolume* fSlit2Physical;
0098     G4VPhysicalVolume* fSlit3Physical;
0099     G4VPhysicalVolume* fSlit4Physical;
0100 
0101     // Detector
0102     G4LogicalVolume* fDetectorLogic;
0103     G4VPhysicalVolume* fDetectorPhysical;
0104 
0105     // Shielding
0106     G4LogicalVolume* fShieldingLogic;
0107     G4VPhysicalVolume* fShieldingPhysical;
0108     G4LogicalVolume* fShieldingBackLogic;
0109     G4VPhysicalVolume* fShieldingBackPhysical;
0110 
0111     //--------------------definition of Materials--------------
0112     // materials for MIFF study
0113     G4Material* fFat;
0114     G4Material* fWater;
0115     G4Material* fBoneMatrix;
0116     G4Material* fMineral;
0117     G4Material* fMedMat;
0118     G4Material* fPMMA;
0119     G4Material* fAdipose;
0120     G4Material* fGlandular;
0121     G4Material* fBreast5050;
0122     G4Material* fcarcinoma;
0123     G4Material* fLexan;
0124     G4Material* fKapton;
0125     G4Material* fNylon;
0126     G4Material* fPolyethylene;
0127     G4Material* fPolystyrene;
0128     G4Material* fGrayMatter;
0129     G4Material* fWhiteMatter;
0130     G4Material* fbeefBlood;
0131     G4Material* fFormaline;
0132     G4Material* fAcetone;
0133     G4Material* fHperoxide;
0134     G4Material* fCIRS3070;
0135     G4Material* fCIRS5050;
0136     G4Material* fCIRS7030;
0137     G4Material* fRMI454;
0138     G4Material* fBone;
0139     G4Material* ffatLowX;
0140     G4Material* fbonematrixLowX;
0141     G4Material* fdryBoneLowX;
0142     G4Material* fliver;
0143     G4Material* fkidney;
0144 
0145     // custom material
0146     G4ExtendedMaterial* fCustomMat;
0147     G4double fCustomMatDensity;
0148     G4double fCustomMatHmassfract;
0149     G4double fCustomMatCmassfract;
0150     G4double fCustomMatNmassfract;
0151     G4double fCustomMatOmassfract;
0152     G4double fCustomMatNamassfract;
0153     G4double fCustomMatPmassfract;
0154     G4double fCustomMatSmassfract;
0155     G4double fCustomMatClmassfract;
0156     G4double fCustomMatKmassfract;
0157     G4double fCustomMatCamassfract;
0158     G4String fCustomMatFF;
0159 
0160     // definitions of variables for MedMat composition
0161     G4double fComp0, fComp1, fComp2, fComp3;
0162 
0163     // other materials
0164     G4Material* fAir;
0165     G4Material* fTungsten;
0166     G4Material* fLead;
0167     G4Material* fGe;
0168 
0169     //-------------definition of Geometrical Variables---------
0170     // World
0171     G4double fWorldSize;
0172 
0173     // Phantom
0174     G4double fPhantomDiameter;
0175     G4double fPhantomHeight;
0176     G4double fPhantomZ;
0177 
0178     // setup angle (rad)
0179     G4double fthetaSetup;
0180 
0181     // Slits
0182     G4double fSlitSize;
0183     G4double fSlit1Thickness;
0184     G4double fSlit2Thickness;
0185     G4double fSlit3Thickness;
0186     G4double fSlit4Thickness;
0187     G4double fSlit1SampleDistance;  // center-center
0188     G4double fSlit2SampleDistance;
0189     G4double fSlit3SampleDistance;
0190     G4double fSlit4SampleDistance;
0191     G4double fSlit1xAperture;
0192     G4double fSlit2xAperture;
0193     G4double fSlit3xAperture;
0194     G4double fSlit4xAperture;
0195     G4double fSlit1yAperture;
0196     G4double fSlit2yAperture;
0197     G4double fSlit3yAperture;
0198     G4double fSlit4yAperture;
0199 
0200     // Detector
0201     G4double fDetectorThickness;
0202     G4double fDetectorSize;
0203     G4double fDetectorSampleDistance;  // center-center
0204 
0205     // Shielding
0206     G4double fShieldingThickness;
0207 
0208     //-------------set methods for the messenger---------------
0209   public:
0210     void SetCustomMatFF(const G4String& ffname) { fCustomMatFF = ffname; }
0211 
0212     void SetCustomMatDensity(G4double csd) { fCustomMatDensity = csd; }
0213     void SetCustomMatHmassfract(G4double csHmf) { fCustomMatHmassfract = csHmf; }
0214     void SetCustomMatCmassfract(G4double csCmf) { fCustomMatCmassfract = csCmf; }
0215     void SetCustomMatNmassfract(G4double csNmf) { fCustomMatNmassfract = csNmf; }
0216     void SetCustomMatOmassfract(G4double csOmf) { fCustomMatOmassfract = csOmf; }
0217     void SetCustomMatNamassfract(G4double csNamf) { fCustomMatNamassfract = csNamf; }
0218     void SetCustomMatPmassfract(G4double csPmf) { fCustomMatPmassfract = csPmf; }
0219     void SetCustomMatSmassfract(G4double csSmf) { fCustomMatSmassfract = csSmf; }
0220     void SetCustomMatClmassfract(G4double csClmf) { fCustomMatClmassfract = csClmf; }
0221     void SetCustomMatKmassfract(G4double csKmf) { fCustomMatKmassfract = csKmf; }
0222     void SetCustomMatCamassfract(G4double csCamf) { fCustomMatCamassfract = csCamf; }
0223 
0224     void SetPhantomMaterial(G4int mat) { fPhantomMaterialIndex = mat; }
0225 
0226     void SetPhantomDiameter(G4double diam) { fPhantomDiameter = diam; }
0227     void SetPhantomHeight(G4double ht) { fPhantomHeight = ht; }
0228     void SetPhantomZ(G4double PhZ) { fPhantomZ = PhZ; }
0229 
0230     void SetComp0(G4double c0) { fComp0 = c0; }
0231     void SetComp1(G4double c1) { fComp1 = c1; }
0232     void SetComp2(G4double c2) { fComp2 = c2; }
0233     void SetComp3(G4double c3) { fComp3 = c3; }
0234 
0235     void SetThetaSetup(G4double theta) { fthetaSetup = theta; }
0236 
0237     void SetSlits(G4bool bslits) { fIWantSlits = bslits; }
0238     void SetSlit1Thickness(G4double sl1th) { fSlit1Thickness = sl1th; }
0239     void SetSlit2Thickness(G4double sl2th) { fSlit2Thickness = sl2th; }
0240     void SetSlit3Thickness(G4double sl3th) { fSlit3Thickness = sl3th; }
0241     void SetSlit4Thickness(G4double sl4th) { fSlit4Thickness = sl4th; }
0242     void SetSlit1SampleDistance(G4double slSampleDist1) { fSlit1SampleDistance = slSampleDist1; }
0243     void SetSlit2SampleDistance(G4double slSampleDist2) { fSlit2SampleDistance = slSampleDist2; }
0244     void SetSlit3SampleDistance(G4double slSampleDist3) { fSlit3SampleDistance = slSampleDist3; }
0245     void SetSlit4SampleDistance(G4double slSampleDist4) { fSlit4SampleDistance = slSampleDist4; }
0246     void SetSlit1xAperture(G4double aperture1x) { fSlit1xAperture = aperture1x; }
0247     void SetSlit2xAperture(G4double aperture2x) { fSlit2xAperture = aperture2x; }
0248     void SetSlit3xAperture(G4double aperture3x) { fSlit3xAperture = aperture3x; }
0249     void SetSlit4xAperture(G4double aperture4x) { fSlit4xAperture = aperture4x; }
0250     void SetSlit1yAperture(G4double aperture1y) { fSlit1yAperture = aperture1y; }
0251     void SetSlit2yAperture(G4double aperture2y) { fSlit2yAperture = aperture2y; }
0252     void SetSlit3yAperture(G4double aperture3y) { fSlit3yAperture = aperture3y; }
0253     void SetSlit4yAperture(G4double aperture4y) { fSlit4yAperture = aperture4y; }
0254 
0255     void SetDetectorSize(G4double detSize) { fDetectorSize = detSize; }
0256     void SetDetectorThickness(G4double detTh) { fDetectorThickness = detTh; }
0257     void SetDetectorSampleDistance(G4double detDist) { fDetectorSampleDistance = detDist; }
0258 };
0259 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......