Back to home page

EIC code displayed by LXR

 
 

    


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

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