Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 // << 27 /// \file optical/LXe/src/LXeDetectorConstruct 26 /// \file optical/LXe/src/LXeDetectorConstruction.cc 28 /// \brief Implementation of the LXeDetectorCo 27 /// \brief Implementation of the LXeDetectorConstruction class 29 // 28 // 30 // 29 // 31 #include "LXeDetectorConstruction.hh" 30 #include "LXeDetectorConstruction.hh" 32 << 33 #include "LXeDetectorMessenger.hh" << 34 #include "LXeMainVolume.hh" << 35 #include "LXePMTSD.hh" 31 #include "LXePMTSD.hh" 36 #include "LXeScintSD.hh" 32 #include "LXeScintSD.hh" >> 33 #include "LXeDetectorMessenger.hh" >> 34 #include "LXeMainVolume.hh" 37 #include "LXeWLSSlab.hh" 35 #include "LXeWLSSlab.hh" 38 36 39 #include "G4Box.hh" << 37 #include "G4SDManager.hh" 40 #include "G4GeometryManager.hh" << 38 #include "G4RunManager.hh" 41 #include "G4LogicalBorderSurface.hh" 39 #include "G4LogicalBorderSurface.hh" 42 #include "G4LogicalSkinSurface.hh" 40 #include "G4LogicalSkinSurface.hh" 43 #include "G4LogicalVolume.hh" << 44 #include "G4LogicalVolumeStore.hh" << 45 #include "G4Material.hh" << 46 #include "G4MaterialTable.hh" << 47 #include "G4OpticalSurface.hh" 41 #include "G4OpticalSurface.hh" 48 #include "G4PVPlacement.hh" << 42 #include "G4MaterialTable.hh" 49 #include "G4PhysicalConstants.hh" << 43 #include "G4VisAttributes.hh" 50 #include "G4PhysicalVolumeStore.hh" << 44 #include "G4Material.hh" 51 #include "G4RunManager.hh" << 45 #include "G4Box.hh" 52 #include "G4SDManager.hh" << 46 #include "G4Tubs.hh" 53 #include "G4SolidStore.hh" << 54 #include "G4Sphere.hh" 47 #include "G4Sphere.hh" 55 #include "G4SystemOfUnits.hh" << 48 #include "G4LogicalVolume.hh" 56 #include "G4ThreeVector.hh" 49 #include "G4ThreeVector.hh" 57 #include "G4Tubs.hh" << 50 #include "G4PVPlacement.hh" 58 #include "G4UImanager.hh" << 59 #include "G4VisAttributes.hh" << 60 #include "globals.hh" 51 #include "globals.hh" >> 52 #include "G4SolidStore.hh" >> 53 #include "G4LogicalVolumeStore.hh" >> 54 #include "G4PhysicalVolumeStore.hh" >> 55 #include "G4GeometryManager.hh" >> 56 #include "G4UImanager.hh" >> 57 #include "G4PhysicalConstants.hh" >> 58 #include "G4SystemOfUnits.hh" 61 59 62 G4bool LXeDetectorConstruction::fSphereOn = tr 60 G4bool LXeDetectorConstruction::fSphereOn = true; 63 61 64 //....oooOO0OOooo........oooOO0OOooo........oo 62 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 65 63 66 LXeDetectorConstruction::LXeDetectorConstructi 64 LXeDetectorConstruction::LXeDetectorConstruction() >> 65 : fLXe_mt(NULL), fMPTPStyrene(NULL) 67 { 66 { >> 67 fExperimentalHall_box = NULL; >> 68 fExperimentalHall_log = NULL; >> 69 fExperimentalHall_phys = NULL; >> 70 >> 71 fLXe = fAl = fAir = fVacuum = fGlass = NULL; >> 72 fPstyrene = fPMMA = fPethylene1 = fPethylene2 = NULL; >> 73 >> 74 fN = fO = fC = fH = NULL; >> 75 >> 76 fUpdated = false; >> 77 68 SetDefaults(); 78 SetDefaults(); 69 DefineMaterials(); << 79 70 fDetectorMessenger = new LXeDetectorMessenge 80 fDetectorMessenger = new LXeDetectorMessenger(this); 71 } 81 } 72 82 73 //....oooOO0OOooo........oooOO0OOooo........oo 83 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 74 84 75 LXeDetectorConstruction::~LXeDetectorConstruct << 85 LXeDetectorConstruction::~LXeDetectorConstruction() {} 76 { << 77 delete fMainVolume; << 78 delete fLXe_mt; << 79 delete fDetectorMessenger; << 80 delete fMPTPStyrene; << 81 } << 82 86 83 //....oooOO0OOooo........oooOO0OOooo........oo 87 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 84 88 85 void LXeDetectorConstruction::DefineMaterials( << 89 void LXeDetectorConstruction::DefineMaterials(){ 86 { << 87 G4double a; // atomic mass 90 G4double a; // atomic mass 88 G4double z; // atomic number 91 G4double z; // atomic number 89 G4double density; 92 G4double density; 90 93 91 G4int polyPMMA = 1; 94 G4int polyPMMA = 1; 92 G4int nC_PMMA = 3 + 2 * polyPMMA; << 95 G4int nC_PMMA = 3+2*polyPMMA; 93 G4int nH_PMMA = 6 + 2 * polyPMMA; << 96 G4int nH_PMMA = 6+2*polyPMMA; 94 97 95 G4int polyeth = 1; 98 G4int polyeth = 1; 96 G4int nC_eth = 2 * polyeth; << 99 G4int nC_eth = 2*polyeth; 97 G4int nH_eth = 4 * polyeth; << 100 G4int nH_eth = 4*polyeth; 98 101 99 //***Elements 102 //***Elements 100 fH = new G4Element("H", "H", z = 1., a = 1.0 << 103 fH = new G4Element("H", "H", z=1., a=1.01*g/mole); 101 fC = new G4Element("C", "C", z = 6., a = 12. << 104 fC = new G4Element("C", "C", z=6., a=12.01*g/mole); 102 fN = new G4Element("N", "N", z = 7., a = 14. << 105 fN = new G4Element("N", "N", z=7., a= 14.01*g/mole); 103 fO = new G4Element("O", "O", z = 8., a = 16. << 106 fO = new G4Element("O" , "O", z=8., a= 16.00*g/mole); 104 107 105 //***Materials 108 //***Materials 106 // Liquid Xenon << 109 //Liquid Xenon 107 fLXe = new G4Material("LXe", z = 54., a = 13 << 110 fLXe = new G4Material("LXe",z=54.,a=131.29*g/mole,density=3.020*g/cm3); 108 // Aluminum << 111 //Aluminum 109 fAl = new G4Material("Al", z = 13., a = 26.9 << 112 fAl = new G4Material("Al",z=13.,a=26.98*g/mole,density=2.7*g/cm3); 110 // Vacuum << 113 //Vacuum 111 fVacuum = new G4Material("Vacuum", z = 1., a << 114 fVacuum = new G4Material("Vacuum",z=1.,a=1.01*g/mole, 112 kStateGas, 0.1 * ke << 115 density=universe_mean_density,kStateGas,0.1*kelvin, 113 // Air << 116 1.e-19*pascal); 114 fAir = new G4Material("Air", density = 1.29 << 117 //Air 115 fAir->AddElement(fN, 70 * perCent); << 118 fAir = new G4Material("Air", density= 1.29*mg/cm3, 2); 116 fAir->AddElement(fO, 30 * perCent); << 119 fAir->AddElement(fN, 70*perCent); 117 // Glass << 120 fAir->AddElement(fO, 30*perCent); 118 fGlass = new G4Material("Glass", density = 1 << 121 //Glass 119 fGlass->AddElement(fC, 91.533 * perCent); << 122 fGlass = new G4Material("Glass", density=1.032*g/cm3,2); 120 fGlass->AddElement(fH, 8.467 * perCent); << 123 fGlass->AddElement(fC,91.533*perCent); 121 // Polystyrene << 124 fGlass->AddElement(fH,8.467*perCent); 122 fPstyrene = new G4Material("Polystyrene", de << 125 //Polystyrene >> 126 fPstyrene = new G4Material("Polystyrene", density= 1.03*g/cm3, 2); 123 fPstyrene->AddElement(fC, 8); 127 fPstyrene->AddElement(fC, 8); 124 fPstyrene->AddElement(fH, 8); 128 fPstyrene->AddElement(fH, 8); 125 // Fiber(PMMA) << 129 //Fiber(PMMA) 126 fPMMA = new G4Material("PMMA", density = 119 << 130 fPMMA = new G4Material("PMMA", density=1190*kg/m3,3); 127 fPMMA->AddElement(fH, nH_PMMA); << 131 fPMMA->AddElement(fH,nH_PMMA); 128 fPMMA->AddElement(fC, nC_PMMA); << 132 fPMMA->AddElement(fC,nC_PMMA); 129 fPMMA->AddElement(fO, 2); << 133 fPMMA->AddElement(fO,2); 130 // Cladding(polyethylene) << 134 //Cladding(polyethylene) 131 fPethylene1 = new G4Material("Pethylene1", d << 135 fPethylene1 = new G4Material("Pethylene1", density=1200*kg/m3,2); 132 fPethylene1->AddElement(fH, nH_eth); << 136 fPethylene1->AddElement(fH,nH_eth); 133 fPethylene1->AddElement(fC, nC_eth); << 137 fPethylene1->AddElement(fC,nC_eth); 134 // Double cladding(flourinated polyethylene) << 138 //Double cladding(flourinated polyethylene) 135 fPethylene2 = new G4Material("Pethylene2", d << 139 fPethylene2 = new G4Material("Pethylene2", density=1400*kg/m3,2); 136 fPethylene2->AddElement(fH, nH_eth); << 140 fPethylene2->AddElement(fH,nH_eth); 137 fPethylene2->AddElement(fC, nC_eth); << 141 fPethylene2->AddElement(fC,nC_eth); 138 << 142 139 //***Material properties tables 143 //***Material properties tables 140 144 141 std::vector<G4double> lxe_Energy = {7.0 * eV << 145 const G4int lxenum = 3; >> 146 G4double lxe_Energy[lxenum] = { 7.0*eV , 7.07*eV, 7.14*eV }; 142 147 143 std::vector<G4double> lxe_SCINT = {0.1, 1.0, << 148 G4double lxe_SCINT[lxenum] = { 0.1, 1.0, 0.1 }; 144 std::vector<G4double> lxe_RIND = {1.59, 1.57 << 149 G4double lxe_RIND[lxenum] = { 1.59 , 1.57, 1.54 }; 145 std::vector<G4double> lxe_ABSL = {35. * cm, << 150 G4double lxe_ABSL[lxenum] = { 35.*cm, 35.*cm, 35.*cm}; 146 fLXe_mt = new G4MaterialPropertiesTable(); 151 fLXe_mt = new G4MaterialPropertiesTable(); 147 fLXe_mt->AddProperty("SCINTILLATIONCOMPONENT << 152 fLXe_mt->AddProperty("FASTCOMPONENT", lxe_Energy, lxe_SCINT, lxenum); 148 fLXe_mt->AddProperty("SCINTILLATIONCOMPONENT << 153 fLXe_mt->AddProperty("SLOWCOMPONENT", lxe_Energy, lxe_SCINT, lxenum); 149 fLXe_mt->AddProperty("RINDEX", lxe_Energy, l << 154 fLXe_mt->AddProperty("RINDEX", lxe_Energy, lxe_RIND, lxenum); 150 fLXe_mt->AddProperty("ABSLENGTH", lxe_Energy << 155 fLXe_mt->AddProperty("ABSLENGTH", lxe_Energy, lxe_ABSL, lxenum); 151 fLXe_mt->AddConstProperty("SCINTILLATIONYIEL << 156 fLXe_mt->AddConstProperty("SCINTILLATIONYIELD",12000./MeV); 152 fLXe_mt->AddConstProperty("RESOLUTIONSCALE", << 157 fLXe_mt->AddConstProperty("RESOLUTIONSCALE",1.0); 153 fLXe_mt->AddConstProperty("SCINTILLATIONTIME << 158 fLXe_mt->AddConstProperty("FASTTIMECONSTANT",20.*ns); 154 fLXe_mt->AddConstProperty("SCINTILLATIONTIME << 159 fLXe_mt->AddConstProperty("SLOWTIMECONSTANT",45.*ns); 155 fLXe_mt->AddConstProperty("SCINTILLATIONYIEL << 160 fLXe_mt->AddConstProperty("YIELDRATIO",1.0); 156 fLXe_mt->AddConstProperty("SCINTILLATIONYIEL << 157 fLXe->SetMaterialPropertiesTable(fLXe_mt); 161 fLXe->SetMaterialPropertiesTable(fLXe_mt); 158 162 159 // Set the Birks Constant for the LXe scinti 163 // Set the Birks Constant for the LXe scintillator 160 fLXe->GetIonisation()->SetBirksConstant(0.12 << 161 164 162 std::vector<G4double> glass_AbsLength = {420 << 165 fLXe->GetIonisation()->SetBirksConstant(0.126*mm/MeV); 163 auto glass_mt = new G4MaterialPropertiesTabl << 166 164 glass_mt->AddProperty("ABSLENGTH", lxe_Energ << 167 G4double glass_RIND[lxenum]={1.49,1.49,1.49}; 165 glass_mt->AddProperty("RINDEX", "Fused Silic << 168 G4double glass_AbsLength[lxenum]={420.*cm,420.*cm,420.*cm}; >> 169 G4MaterialPropertiesTable *glass_mt = new G4MaterialPropertiesTable(); >> 170 glass_mt->AddProperty("ABSLENGTH",lxe_Energy,glass_AbsLength,lxenum); >> 171 glass_mt->AddProperty("RINDEX",lxe_Energy,glass_RIND,lxenum); 166 fGlass->SetMaterialPropertiesTable(glass_mt) 172 fGlass->SetMaterialPropertiesTable(glass_mt); 167 173 168 auto vacuum_mt = new G4MaterialPropertiesTab << 174 G4double vacuum_Energy[lxenum]={2.0*eV,7.0*eV,7.14*eV}; 169 vacuum_mt->AddProperty("RINDEX", "Air"); << 175 G4double vacuum_RIND[lxenum]={1.,1.,1.}; >> 176 G4MaterialPropertiesTable *vacuum_mt = new G4MaterialPropertiesTable(); >> 177 vacuum_mt->AddProperty("RINDEX", vacuum_Energy, vacuum_RIND,lxenum); 170 fVacuum->SetMaterialPropertiesTable(vacuum_m 178 fVacuum->SetMaterialPropertiesTable(vacuum_mt); 171 fAir->SetMaterialPropertiesTable(vacuum_mt); << 179 fAir->SetMaterialPropertiesTable(vacuum_mt);//Give air the same rindex 172 << 173 std::vector<G4double> wls_Energy = {2.00 * e << 174 180 175 std::vector<G4double> rIndexPstyrene = {1.5, << 181 const G4int wlsnum = 4; 176 std::vector<G4double> absorption1 = {2. * cm << 182 G4double wls_Energy[] = {2.00*eV,2.87*eV,2.90*eV,3.47*eV}; 177 std::vector<G4double> scintilFast = {0.0, 0. << 183 >> 184 G4double rIndexPstyrene[wlsnum]={ 1.5, 1.5, 1.5, 1.5}; >> 185 G4double absorption1[wlsnum]={2.*cm, 2.*cm, 2.*cm, 2.*cm}; >> 186 G4double scintilFast[wlsnum]={0.00, 0.00, 1.00, 1.00}; 178 fMPTPStyrene = new G4MaterialPropertiesTable 187 fMPTPStyrene = new G4MaterialPropertiesTable(); 179 fMPTPStyrene->AddProperty("RINDEX", wls_Ener << 188 fMPTPStyrene->AddProperty("RINDEX",wls_Energy,rIndexPstyrene,wlsnum); 180 fMPTPStyrene->AddProperty("ABSLENGTH", wls_E << 189 fMPTPStyrene->AddProperty("ABSLENGTH",wls_Energy,absorption1,wlsnum); 181 fMPTPStyrene->AddProperty("SCINTILLATIONCOMP << 190 fMPTPStyrene->AddProperty("FASTCOMPONENT",wls_Energy, scintilFast,wlsnum); 182 fMPTPStyrene->AddConstProperty("SCINTILLATIO << 191 fMPTPStyrene->AddConstProperty("SCINTILLATIONYIELD",10./keV); 183 fMPTPStyrene->AddConstProperty("RESOLUTIONSC << 192 fMPTPStyrene->AddConstProperty("RESOLUTIONSCALE",1.0); 184 fMPTPStyrene->AddConstProperty("SCINTILLATIO << 193 fMPTPStyrene->AddConstProperty("FASTTIMECONSTANT", 10.*ns); 185 fPstyrene->SetMaterialPropertiesTable(fMPTPS 194 fPstyrene->SetMaterialPropertiesTable(fMPTPStyrene); 186 195 187 // Set the Birks Constant for the Polystyren 196 // Set the Birks Constant for the Polystyrene scintillator 188 fPstyrene->GetIonisation()->SetBirksConstant << 189 197 190 std::vector<G4double> AbsFiber = {9.0 * m, 9 << 198 fPstyrene->GetIonisation()->SetBirksConstant(0.126*mm/MeV); 191 std::vector<G4double> EmissionFib = {1.0, 1. << 199 192 auto fiberProperty = new G4MaterialPropertie << 200 G4double RefractiveIndexFiber[wlsnum]={ 1.60, 1.60, 1.60, 1.60}; 193 fiberProperty->AddProperty("RINDEX", "PMMA") << 201 G4double AbsFiber[wlsnum]={9.00*m,9.00*m,0.1*mm,0.1*mm}; 194 fiberProperty->AddProperty("WLSABSLENGTH", w << 202 G4double EmissionFib[wlsnum]={1.0, 1.0, 0.0, 0.0}; 195 fiberProperty->AddProperty("WLSCOMPONENT", w << 203 G4MaterialPropertiesTable* fiberProperty = new G4MaterialPropertiesTable(); 196 fiberProperty->AddConstProperty("WLSTIMECONS << 204 fiberProperty->AddProperty("RINDEX",wls_Energy,RefractiveIndexFiber,wlsnum); >> 205 fiberProperty->AddProperty("WLSABSLENGTH",wls_Energy,AbsFiber,wlsnum); >> 206 fiberProperty->AddProperty("WLSCOMPONENT",wls_Energy,EmissionFib,wlsnum); >> 207 fiberProperty->AddConstProperty("WLSTIMECONSTANT", 0.5*ns); 197 fPMMA->SetMaterialPropertiesTable(fiberPrope 208 fPMMA->SetMaterialPropertiesTable(fiberProperty); 198 209 199 std::vector<G4double> RefractiveIndexClad1 = << 210 G4double RefractiveIndexClad1[wlsnum]={ 1.49, 1.49, 1.49, 1.49}; 200 auto clad1Property = new G4MaterialPropertie << 211 G4MaterialPropertiesTable* clad1Property = new G4MaterialPropertiesTable(); 201 clad1Property->AddProperty("RINDEX", wls_Ene << 212 clad1Property->AddProperty("RINDEX",wls_Energy,RefractiveIndexClad1,wlsnum); 202 clad1Property->AddProperty("ABSLENGTH", wls_ << 213 clad1Property->AddProperty("ABSLENGTH",wls_Energy,AbsFiber,wlsnum); 203 fPethylene1->SetMaterialPropertiesTable(clad 214 fPethylene1->SetMaterialPropertiesTable(clad1Property); 204 215 205 std::vector<G4double> RefractiveIndexClad2 = << 216 G4double RefractiveIndexClad2[wlsnum]={ 1.42, 1.42, 1.42, 1.42}; 206 auto clad2Property = new G4MaterialPropertie << 217 G4MaterialPropertiesTable* clad2Property = new G4MaterialPropertiesTable(); 207 clad2Property->AddProperty("RINDEX", wls_Ene << 218 clad2Property->AddProperty("RINDEX",wls_Energy,RefractiveIndexClad2,wlsnum); 208 clad2Property->AddProperty("ABSLENGTH", wls_ << 219 clad2Property->AddProperty("ABSLENGTH",wls_Energy,AbsFiber,wlsnum); 209 fPethylene2->SetMaterialPropertiesTable(clad 220 fPethylene2->SetMaterialPropertiesTable(clad2Property); 210 } 221 } 211 222 212 //....oooOO0OOooo........oooOO0OOooo........oo 223 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 213 224 214 G4VPhysicalVolume* LXeDetectorConstruction::Co << 225 G4VPhysicalVolume* LXeDetectorConstruction::Construct(){ >> 226 DefineMaterials(); >> 227 return ConstructDetector(); >> 228 } >> 229 >> 230 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... >> 231 >> 232 G4VPhysicalVolume* LXeDetectorConstruction::ConstructDetector() 215 { 233 { 216 // The experimental hall walls are all 1m aw << 234 //The experimental hall walls are all 1m away from housing walls 217 G4double expHall_x = fScint_x + fD_mtl + 1. << 235 G4double expHall_x = fScint_x+fD_mtl+1.*m; 218 G4double expHall_y = fScint_y + fD_mtl + 1. << 236 G4double expHall_y = fScint_y+fD_mtl+1.*m; 219 G4double expHall_z = fScint_z + fD_mtl + 1. << 237 G4double expHall_z = fScint_z+fD_mtl+1.*m; 220 << 221 // Create experimental hall << 222 fExperimentalHall_box = new G4Box("expHall_b << 223 fExperimentalHall_log = new G4LogicalVolume( << 224 fExperimentalHall_phys = new G4PVPlacement(n << 225 " << 226 << 227 fExperimentalHall_log->SetVisAttributes(G4Vi << 228 << 229 // Place the main volume << 230 if (fMainVolumeOn) { << 231 fMainVolume = << 232 new LXeMainVolume(nullptr, G4ThreeVector << 233 } << 234 238 235 // Place the WLS slab << 239 //Create experimental hall 236 if (fWLSslab) { << 240 fExperimentalHall_box 237 G4VPhysicalVolume* slab = << 241 = new G4Box("expHall_box",expHall_x,expHall_y,expHall_z); 238 new LXeWLSSlab(nullptr, G4ThreeVector(0. << 242 fExperimentalHall_log = new G4LogicalVolume(fExperimentalHall_box, 239 fExperimentalHall_log, fa << 243 fVacuum,"expHall_log",0,0,0); >> 244 fExperimentalHall_phys = new G4PVPlacement(0,G4ThreeVector(), >> 245 fExperimentalHall_log,"expHall",0,false,0); 240 246 241 // Surface properties for the WLS slab << 247 fExperimentalHall_log->SetVisAttributes(G4VisAttributes::Invisible); 242 auto scintWrap = new G4OpticalSurface("Sci << 243 248 244 new G4LogicalBorderSurface("ScintWrap", sl << 249 //Place the main volume >> 250 if(fMainVolume){ >> 251 new LXeMainVolume(0,G4ThreeVector(),fExperimentalHall_log,false,0,this); >> 252 } 245 253 >> 254 //Place the WLS slab >> 255 if(fWLSslab){ >> 256 G4VPhysicalVolume* slab = new LXeWLSSlab(0,G4ThreeVector(0.,0., >> 257 -fScint_z/2.-fSlab_z-1.*cm), >> 258 fExperimentalHall_log,false,0, >> 259 this); >> 260 >> 261 //Surface properties for the WLS slab >> 262 G4OpticalSurface* scintWrap = new G4OpticalSurface("ScintWrap"); >> 263 >> 264 new G4LogicalBorderSurface("ScintWrap", slab, >> 265 fExperimentalHall_phys, >> 266 scintWrap); >> 267 246 scintWrap->SetType(dielectric_metal); 268 scintWrap->SetType(dielectric_metal); 247 scintWrap->SetFinish(polished); 269 scintWrap->SetFinish(polished); 248 scintWrap->SetModel(glisur); 270 scintWrap->SetModel(glisur); 249 271 250 std::vector<G4double> pp = {2.0 * eV, 3.5 << 272 const G4int num = 2; 251 std::vector<G4double> reflectivity = {1.0, << 252 std::vector<G4double> efficiency = {0.0, 0 << 253 273 254 auto scintWrapProperty = new G4MaterialPro << 274 G4double pp[num] = {2.0*eV, 3.5*eV}; >> 275 G4double reflectivity[num] = {1., 1.}; >> 276 G4double efficiency[num] = {0.0, 0.0}; >> 277 >> 278 G4MaterialPropertiesTable* scintWrapProperty >> 279 = new G4MaterialPropertiesTable(); 255 280 256 scintWrapProperty->AddProperty("REFLECTIVI << 281 scintWrapProperty->AddProperty("REFLECTIVITY",pp,reflectivity,num); 257 scintWrapProperty->AddProperty("EFFICIENCY << 282 scintWrapProperty->AddProperty("EFFICIENCY",pp,efficiency,num); 258 scintWrap->SetMaterialPropertiesTable(scin 283 scintWrap->SetMaterialPropertiesTable(scintWrapProperty); 259 } 284 } 260 285 261 return fExperimentalHall_phys; 286 return fExperimentalHall_phys; 262 } 287 } 263 288 264 //....oooOO0OOooo........oooOO0OOooo........oo 289 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 265 290 266 void LXeDetectorConstruction::ConstructSDandFi << 291 void LXeDetectorConstruction::SetDimensions(G4ThreeVector dims){ 267 { << 292 this->fScint_x=dims[0]; 268 if (!fMainVolume) return; << 293 this->fScint_y=dims[1]; 269 << 294 this->fScint_z=dims[2]; 270 // PMT SD << 295 fUpdated=true; 271 << 272 LXePMTSD* pmt = fPmt_SD.Get(); << 273 if (!pmt) { << 274 // Created here so it exists as pmts are b << 275 G4cout << "Construction /LXeDet/pmtSD" << << 276 auto pmt_SD = new LXePMTSD("/LXeDet/pmtSD" << 277 fPmt_SD.Put(pmt_SD); << 278 << 279 pmt_SD->InitPMTs(); << 280 pmt_SD->SetPmtPositions(fMainVolume->GetPm << 281 } << 282 else { << 283 pmt->InitPMTs(); << 284 pmt->SetPmtPositions(fMainVolume->GetPmtPo << 285 } << 286 G4SDManager::GetSDMpointer()->AddNewDetector << 287 // sensitive detector is not actually on the << 288 // processHits gets done manually by the ste << 289 // It is used to detect when photons hit and << 290 // boundary to the photocathode (which doesn << 291 // logical volume. << 292 // It does however need to be attached to so << 293 // reset at the begining of events << 294 << 295 SetSensitiveDetector(fMainVolume->GetLogPhot << 296 << 297 // Scint SD << 298 << 299 if (!fScint_SD.Get()) { << 300 G4cout << "Construction /LXeDet/scintSD" < << 301 auto scint_SD = new LXeScintSD("/LXeDet/sc << 302 fScint_SD.Put(scint_SD); << 303 } << 304 G4SDManager::GetSDMpointer()->AddNewDetector << 305 SetSensitiveDetector(fMainVolume->GetLogScin << 306 } << 307 << 308 //....oooOO0OOooo........oooOO0OOooo........oo << 309 << 310 void LXeDetectorConstruction::SetDimensions(G4 << 311 { << 312 fScint_x = dims[0]; << 313 fScint_y = dims[1]; << 314 fScint_z = dims[2]; << 315 G4RunManager::GetRunManager()->ReinitializeG << 316 } 296 } 317 << 297 318 //....oooOO0OOooo........oooOO0OOooo........oo 298 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 319 299 320 void LXeDetectorConstruction::SetHousingThickn << 300 void LXeDetectorConstruction::SetHousingThickness(G4double d_mtl){ 321 { << 301 this->fD_mtl=d_mtl; 322 fD_mtl = d_mtl; << 302 fUpdated=true; 323 G4RunManager::GetRunManager()->ReinitializeG << 324 } 303 } 325 304 326 //....oooOO0OOooo........oooOO0OOooo........oo 305 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 327 306 328 void LXeDetectorConstruction::SetNX(G4int nx) << 307 void LXeDetectorConstruction::SetNX(G4int nx){ 329 { << 308 this->fNx=nx; 330 fNx = nx; << 309 fUpdated=true; 331 G4RunManager::GetRunManager()->ReinitializeG << 332 } 310 } 333 311 334 //....oooOO0OOooo........oooOO0OOooo........oo 312 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 335 313 336 void LXeDetectorConstruction::SetNY(G4int ny) << 314 void LXeDetectorConstruction::SetNY(G4int ny){ 337 { << 315 this->fNy=ny; 338 fNy = ny; << 316 fUpdated=true; 339 G4RunManager::GetRunManager()->ReinitializeG << 340 } 317 } 341 318 342 //....oooOO0OOooo........oooOO0OOooo........oo 319 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 343 320 344 void LXeDetectorConstruction::SetNZ(G4int nz) << 321 void LXeDetectorConstruction::SetNZ(G4int nz){ 345 { << 322 this->fNz=nz; 346 fNz = nz; << 323 fUpdated=true; 347 G4RunManager::GetRunManager()->ReinitializeG << 348 } 324 } 349 325 350 //....oooOO0OOooo........oooOO0OOooo........oo 326 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 351 327 352 void LXeDetectorConstruction::SetPMTRadius(G4d << 328 void LXeDetectorConstruction::SetPMTRadius(G4double outerRadius_pmt){ 353 { << 329 this->fOuterRadius_pmt=outerRadius_pmt; 354 fOuterRadius_pmt = outerRadius_pmt; << 330 fUpdated=true; 355 G4RunManager::GetRunManager()->ReinitializeG << 356 } 331 } 357 332 358 //....oooOO0OOooo........oooOO0OOooo........oo 333 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 359 334 360 void LXeDetectorConstruction::SetDefaults() << 335 void LXeDetectorConstruction::SetDefaults(){ 361 { << 336 //Resets to default values 362 // Resets to default values << 337 fD_mtl=0.0635*cm; 363 fD_mtl = 0.0635 * cm; << 364 338 365 fScint_x = 17.8 * cm; << 339 fScint_x = 17.8*cm; 366 fScint_y = 17.8 * cm; << 340 fScint_y = 17.8*cm; 367 fScint_z = 22.6 * cm; << 341 fScint_z = 22.6*cm; 368 342 369 fNx = 2; 343 fNx = 2; 370 fNy = 2; 344 fNy = 2; 371 fNz = 3; 345 fNz = 3; 372 346 373 fOuterRadius_pmt = 2.3 * cm; << 347 fOuterRadius_pmt = 2.3*cm; 374 348 375 fSphereOn = true; 349 fSphereOn = true; 376 fRefl = 1.0; << 350 fRefl=1.0; 377 351 378 fNfibers = 15; << 352 fNfibers=15; 379 fWLSslab = false; << 353 fWLSslab=false; 380 fMainVolumeOn = true; << 354 fMainVolume=true; 381 fMainVolume = nullptr; << 355 fSlab_z=2.5*mm; 382 fSlab_z = 2.5 * mm; << 383 356 384 G4UImanager::GetUIpointer()->ApplyCommand("/ << 357 G4UImanager::GetUIpointer() >> 358 ->ApplyCommand("/LXe/detector/scintYieldFactor 1."); 385 359 386 if (fLXe_mt) fLXe_mt->AddConstProperty("SCIN << 360 if(fLXe_mt)fLXe_mt->AddConstProperty("SCINTILLATIONYIELD",12000./MeV); 387 if (fMPTPStyrene) fMPTPStyrene->AddConstProp << 361 if(fMPTPStyrene)fMPTPStyrene->AddConstProperty("SCINTILLATIONYIELD",10./keV); 388 } << 389 362 390 //....oooOO0OOooo........oooOO0OOooo........oo << 363 fUpdated=true; 391 << 392 void LXeDetectorConstruction::SetSphereOn(G4bo << 393 { << 394 fSphereOn = b; << 395 G4RunManager::GetRunManager()->ReinitializeG << 396 } 364 } 397 365 398 //....oooOO0OOooo........oooOO0OOooo........oo 366 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 399 367 400 void LXeDetectorConstruction::SetHousingReflec << 368 void LXeDetectorConstruction::UpdateGeometry(){ 401 { << 402 fRefl = r; << 403 G4RunManager::GetRunManager()->ReinitializeG << 404 } << 405 369 406 //....oooOO0OOooo........oooOO0OOooo........oo << 370 // clean-up previous geometry >> 371 G4GeometryManager::GetInstance()->OpenGeometry(); 407 372 408 void LXeDetectorConstruction::SetWLSSlabOn(G4b << 373 G4PhysicalVolumeStore::GetInstance()->Clean(); 409 { << 374 G4LogicalVolumeStore::GetInstance()->Clean(); 410 fWLSslab = b; << 375 G4SolidStore::GetInstance()->Clean(); 411 G4RunManager::GetRunManager()->ReinitializeG << 376 G4LogicalSkinSurface::CleanSurfaceTable(); 412 } << 377 G4LogicalBorderSurface::CleanSurfaceTable(); >> 378 G4SurfaceProperty::CleanSurfacePropertyTable(); 413 379 414 //....oooOO0OOooo........oooOO0OOooo........oo << 380 //define new one >> 381 G4RunManager::GetRunManager()->DefineWorldVolume(ConstructDetector()); >> 382 G4RunManager::GetRunManager()->GeometryHasBeenModified(); 415 383 416 void LXeDetectorConstruction::SetMainVolumeOn( << 384 fUpdated=false; 417 { << 418 fMainVolumeOn = b; << 419 G4RunManager::GetRunManager()->ReinitializeG << 420 } 385 } 421 386 422 //....oooOO0OOooo........oooOO0OOooo........oo 387 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 423 388 424 void LXeDetectorConstruction::SetNFibers(G4int << 389 void LXeDetectorConstruction::SetMainScintYield(G4double y){ 425 { << 390 fLXe_mt->AddConstProperty("SCINTILLATIONYIELD",y/MeV); 426 fNfibers = n; << 427 G4RunManager::GetRunManager()->ReinitializeG << 428 } 391 } 429 392 430 //....oooOO0OOooo........oooOO0OOooo........oo 393 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 431 << 394 432 void LXeDetectorConstruction::SetMainScintYiel << 395 void LXeDetectorConstruction::SetWLSScintYield(G4double y){ 433 { << 396 fMPTPStyrene->AddConstProperty("SCINTILLATIONYIELD",y/MeV); 434 fLXe_mt->AddConstProperty("SCINTILLATIONYIEL << 435 } 397 } 436 << 437 //....oooOO0OOooo........oooOO0OOooo........oo << 438 << 439 void LXeDetectorConstruction::SetWLSScintYield << 440 { << 441 fMPTPStyrene->AddConstProperty("SCINTILLATIO << 442 } << 443 << 444 //....oooOO0OOooo........oooOO0OOooo........oo << 445 << 446 void LXeDetectorConstruction::SetSaveThreshold << 447 { << 448 // Sets the save threshold for the random nu << 449 // photons generated in an event is lower th << 450 // this event in a file called run###evt###. << 451 << 452 fSaveThreshold = save; << 453 G4RunManager::GetRunManager()->SetRandomNumb << 454 } << 455 << 456 //....oooOO0OOooo........oooOO0OOooo........oo << 457 398