Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-23 08:30:08

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 DetectorConstruction.hh
0027 /// \brief Definition of the DetectorConstruction class
0028 
0029 #ifndef DetectorConstruction_h
0030 #define DetectorConstruction_h 1
0031 
0032 #include "G4OpticalSurface.hh"
0033 #include "G4RunManager.hh"
0034 #include "G4VUserDetectorConstruction.hh"
0035 #include "globals.hh"
0036 
0037 #include <CLHEP/Units/SystemOfUnits.h>
0038 
0039 class DetectorMessenger;
0040 
0041 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0042 
0043 class DetectorConstruction : public G4VUserDetectorConstruction
0044 {
0045   public:
0046     DetectorConstruction();
0047     ~DetectorConstruction() override;
0048 
0049     G4VPhysicalVolume* Construct() override;
0050 
0051     G4VPhysicalVolume* GetTank() { return fTank; }
0052     G4double GetTankXSize() { return fTank_x; }
0053 
0054     G4OpticalSurface* GetSurface(void) { return fSurface; }
0055 
0056     void SetSurfaceFinish(const G4OpticalSurfaceFinish finish)
0057     {
0058       fSurface->SetFinish(finish);
0059       G4RunManager::GetRunManager()->GeometryHasBeenModified();
0060     }
0061     G4OpticalSurfaceFinish GetSurfaceFinish() { return fSurface->GetFinish(); }
0062 
0063     void SetSurfaceType(const G4SurfaceType type)
0064     {
0065       fSurface->SetType(type);
0066       G4RunManager::GetRunManager()->GeometryHasBeenModified();
0067     }
0068 
0069     void SetSurfaceModel(const G4OpticalSurfaceModel model)
0070     {
0071       fSurface->SetModel(model);
0072       G4RunManager::GetRunManager()->GeometryHasBeenModified();
0073     }
0074     G4OpticalSurfaceModel GetSurfaceModel() { return fSurface->GetModel(); }
0075 
0076     void SetSurfaceSigmaAlpha(G4double v);
0077     void SetSurfacePolish(G4double v);
0078 
0079     void AddTankMPV(const G4String& prop, G4MaterialPropertyVector* mpv);
0080     void AddTankMPC(const G4String& prop, G4double v);
0081     G4MaterialPropertiesTable* GetTankMaterialPropertiesTable() { return fTankMPT; }
0082 
0083     void AddWorldMPV(const G4String& prop, G4MaterialPropertyVector* mpv);
0084     void AddWorldMPC(const G4String& prop, G4double v);
0085     G4MaterialPropertiesTable* GetWorldMaterialPropertiesTable() { return fWorldMPT; }
0086 
0087     void AddSurfaceMPV(const G4String& prop, G4MaterialPropertyVector* mpv);
0088     void AddSurfaceMPC(const G4String& prop, G4double v);
0089     G4MaterialPropertiesTable* GetSurfaceMaterialPropertiesTable() { return fSurfaceMPT; }
0090 
0091     void SetWorldMaterial(const G4String&);
0092     G4Material* GetWorldMaterial() const { return fWorldMaterial; }
0093     void SetTankMaterial(const G4String&);
0094     G4Material* GetTankMaterial() const { return fTankMaterial; }
0095 
0096   private:
0097     G4double fExpHall_x = 10. * CLHEP::m;
0098     G4double fExpHall_y = 10. * CLHEP::m;
0099     G4double fExpHall_z = 10. * CLHEP::m;
0100 
0101     G4VPhysicalVolume* fTank = nullptr;
0102 
0103     G4double fTank_x = 1. * CLHEP::m;
0104     G4double fTank_y = 1. * CLHEP::m;
0105     G4double fTank_z = 1. * CLHEP::m;
0106 
0107     G4LogicalVolume* fWorld_LV = nullptr;
0108     G4LogicalVolume* fTank_LV = nullptr;
0109 
0110     G4Material* fWorldMaterial = nullptr;
0111     G4Material* fTankMaterial = nullptr;
0112 
0113     G4OpticalSurface* fSurface = nullptr;
0114 
0115     DetectorMessenger* fDetectorMessenger = nullptr;
0116 
0117     G4MaterialPropertiesTable* fTankMPT = nullptr;
0118     G4MaterialPropertiesTable* fWorldMPT = nullptr;
0119     G4MaterialPropertiesTable* fSurfaceMPT = nullptr;
0120 };
0121 
0122 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0123 
0124 #endif /*DetectorConstruction_h*/