Back to home page

EIC code displayed by LXR

 
 

    


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

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 /// \file optical/wls/src/WLSMaterials.cc
0028 /// \brief Implementation of the WLSMaterials class
0029 //
0030 //
0031 #include "WLSMaterials.hh"
0032 
0033 #include "G4NistManager.hh"
0034 #include "G4SystemOfUnits.hh"
0035 
0036 WLSMaterials* WLSMaterials::fInstance = nullptr;
0037 
0038 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0039 
0040 WLSMaterials::WLSMaterials()
0041 {
0042   fNistMan = G4NistManager::Instance();
0043   fNistMan->SetVerbose(2);
0044 
0045   CreateMaterials();
0046 }
0047 
0048 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0049 
0050 WLSMaterials::~WLSMaterials()
0051 {
0052   delete fAir;
0053   delete fPMMA;
0054   delete fPethylene;
0055   delete fFPethylene;
0056   delete fPolystyrene;
0057   delete fSilicone;
0058   delete fCoating;
0059 }
0060 
0061 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0062 
0063 WLSMaterials* WLSMaterials::GetInstance()
0064 {
0065   if (!fInstance) {
0066     fInstance = new WLSMaterials();
0067   }
0068   return fInstance;
0069 }
0070 
0071 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0072 
0073 G4Material* WLSMaterials::GetMaterial(const G4String material)
0074 {
0075   G4Material* mat = fNistMan->FindOrBuildMaterial(material);
0076 
0077   if (!mat) mat = G4Material::GetMaterial(material);
0078   if (!mat) {
0079     G4ExceptionDescription ed;
0080     ed << "Material " << material << " not found!";
0081     G4Exception("WLSMaterials::GetMaterial", "", FatalException, ed);
0082   }
0083 
0084   return mat;
0085 }
0086 
0087 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0088 
0089 void WLSMaterials::CreateMaterials()
0090 {
0091   G4double density;
0092   G4int ncomponents;
0093   G4double fractionmass;
0094   std::vector<G4int> natoms;
0095   std::vector<G4double> fractionMass;
0096   std::vector<G4String> elements;
0097 
0098   // Materials Definitions
0099   // =====================
0100 
0101   //--------------------------------------------------
0102   // Vacuum
0103   //--------------------------------------------------
0104 
0105   fNistMan->FindOrBuildMaterial("G4_Galactic");
0106 
0107   //--------------------------------------------------
0108   // Air
0109   //--------------------------------------------------
0110 
0111   fAir = fNistMan->FindOrBuildMaterial("G4_AIR");
0112 
0113   //--------------------------------------------------
0114   // WLSfiber PMMA
0115   //--------------------------------------------------
0116 
0117   elements.push_back("C");
0118   natoms.push_back(5);
0119   elements.push_back("H");
0120   natoms.push_back(8);
0121   elements.push_back("O");
0122   natoms.push_back(2);
0123 
0124   density = 1.190 * g / cm3;
0125 
0126   fPMMA = fNistMan->ConstructNewMaterial("PMMA", elements, natoms, density);
0127 
0128   elements.clear();
0129   natoms.clear();
0130 
0131   //--------------------------------------------------
0132   // Cladding (polyethylene)
0133   //--------------------------------------------------
0134 
0135   elements.push_back("C");
0136   natoms.push_back(2);
0137   elements.push_back("H");
0138   natoms.push_back(4);
0139 
0140   density = 1.200 * g / cm3;
0141 
0142   fPethylene = fNistMan->ConstructNewMaterial("Pethylene", elements, natoms, density);
0143 
0144   elements.clear();
0145   natoms.clear();
0146 
0147   //--------------------------------------------------
0148   // Double Cladding (fluorinated polyethylene)
0149   //--------------------------------------------------
0150 
0151   elements.push_back("C");
0152   natoms.push_back(2);
0153   elements.push_back("H");
0154   natoms.push_back(4);
0155 
0156   density = 1.400 * g / cm3;
0157 
0158   fFPethylene = fNistMan->ConstructNewMaterial("FPethylene", elements, natoms, density);
0159 
0160   elements.clear();
0161   natoms.clear();
0162 
0163   //--------------------------------------------------
0164   // Polystyrene
0165   //--------------------------------------------------
0166 
0167   elements.push_back("C");
0168   natoms.push_back(8);
0169   elements.push_back("H");
0170   natoms.push_back(8);
0171 
0172   density = 1.050 * g / cm3;
0173 
0174   fPolystyrene = fNistMan->ConstructNewMaterial("Polystyrene", elements, natoms, density);
0175 
0176   elements.clear();
0177   natoms.clear();
0178 
0179   //--------------------------------------------------
0180   // Silicone (Template for Optical Grease)
0181   //--------------------------------------------------
0182 
0183   elements.push_back("C");
0184   natoms.push_back(2);
0185   elements.push_back("H");
0186   natoms.push_back(6);
0187 
0188   density = 1.060 * g / cm3;
0189 
0190   fSilicone = fNistMan->ConstructNewMaterial("Silicone", elements, natoms, density);
0191 
0192   elements.clear();
0193   natoms.clear();
0194 
0195   //--------------------------------------------------
0196   // Aluminium
0197   //--------------------------------------------------
0198 
0199   fNistMan->FindOrBuildMaterial("G4_Al");
0200 
0201   //--------------------------------------------------
0202   // TiO2
0203   //--------------------------------------------------
0204 
0205   elements.push_back("Ti");
0206   natoms.push_back(1);
0207   elements.push_back("O");
0208   natoms.push_back(2);
0209 
0210   density = 4.26 * g / cm3;
0211 
0212   G4Material* TiO2 = fNistMan->ConstructNewMaterial("TiO2", elements, natoms, density);
0213 
0214   elements.clear();
0215   natoms.clear();
0216 
0217   //--------------------------------------------------
0218   // Scintillator Coating - 15% TiO2 and 85% polystyrene by weight.
0219   //--------------------------------------------------
0220 
0221   density = 1.52 * g / cm3;
0222 
0223   fCoating = new G4Material("Coating", density, ncomponents = 2);
0224 
0225   fCoating->AddMaterial(TiO2, fractionmass = 15 * perCent);
0226   fCoating->AddMaterial(fPolystyrene, fractionmass = 85 * perCent);
0227 
0228   //
0229   // ------------ Generate & Add Material Properties Table ------------
0230   //
0231 
0232   std::vector<G4double> energy = {
0233     2.00 * eV, 2.03 * eV, 2.06 * eV, 2.09 * eV, 2.12 * eV, 2.15 * eV, 2.18 * eV, 2.21 * eV,
0234     2.24 * eV, 2.27 * eV, 2.30 * eV, 2.33 * eV, 2.36 * eV, 2.39 * eV, 2.42 * eV, 2.45 * eV,
0235     2.48 * eV, 2.51 * eV, 2.54 * eV, 2.57 * eV, 2.60 * eV, 2.63 * eV, 2.66 * eV, 2.69 * eV,
0236     2.72 * eV, 2.75 * eV, 2.78 * eV, 2.81 * eV, 2.84 * eV, 2.87 * eV, 2.90 * eV, 2.93 * eV,
0237     2.96 * eV, 2.99 * eV, 3.02 * eV, 3.05 * eV, 3.08 * eV, 3.11 * eV, 3.14 * eV, 3.17 * eV,
0238     3.20 * eV, 3.23 * eV, 3.26 * eV, 3.29 * eV, 3.32 * eV, 3.35 * eV, 3.38 * eV, 3.41 * eV,
0239     3.44 * eV, 3.47 * eV};
0240 
0241   std::vector<G4double> energySmall = {2.0 * eV, 3.47 * eV};
0242 
0243   //--------------------------------------------------
0244   // Air
0245   //--------------------------------------------------
0246 
0247   std::vector<G4double> refractiveIndex = {1.0, 1.0};
0248 
0249   auto mpt = new G4MaterialPropertiesTable();
0250   mpt->AddProperty("RINDEX", energySmall, refractiveIndex);
0251 
0252   fAir->SetMaterialPropertiesTable(mpt);
0253 
0254   //--------------------------------------------------
0255   //  PMMA for WLSfibers
0256   //--------------------------------------------------
0257 
0258   std::vector<G4double> refractiveIndexWLSfiber = {1.60, 1.60};
0259 
0260   std::vector<G4double> absWLSfiber = {
0261     5.40 * m, 5.40 * m, 5.40 * m, 5.40 * m, 5.40 * m, 5.40 * m, 5.40 * m, 5.40 * m, 5.40 * m,
0262     5.40 * m, 5.40 * m, 5.40 * m, 5.40 * m, 5.40 * m, 5.40 * m, 5.40 * m, 5.40 * m, 5.40 * m,
0263     5.40 * m, 5.40 * m, 5.40 * m, 5.40 * m, 5.40 * m, 5.40 * m, 5.40 * m, 5.40 * m, 5.40 * m,
0264     5.40 * m, 5.40 * m, 1.10 * m, 1.10 * m, 1.10 * m, 1.10 * m, 1.10 * m, 1.10 * m, 1.10 * m,
0265     1. * mm,  1. * mm,  1. * mm,  1. * mm,  1. * mm,  1. * mm,  1. * mm,  1. * mm,  1. * mm,
0266     1. * mm,  1. * mm,  1. * mm,  1. * mm,  1. * mm};
0267 
0268   std::vector<G4double> emissionFib = {0.05, 0.10, 0.30, 0.50, 0.75, 1.00, 1.50, 1.85, 2.30, 2.75,
0269                                        3.25, 3.80, 4.50, 5.20, 6.00, 7.00, 8.50, 9.50, 11.1, 12.4,
0270                                        12.9, 13.0, 12.8, 12.3, 11.1, 11.0, 12.0, 11.0, 17.0, 16.9,
0271                                        15.0, 9.00, 2.50, 1.00, 0.05, 0.00, 0.00, 0.00, 0.00, 0.00,
0272                                        0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00};
0273 
0274   // Add entries into properties table
0275   auto mptWLSfiber = new G4MaterialPropertiesTable();
0276   mptWLSfiber->AddProperty("RINDEX", energySmall, refractiveIndexWLSfiber);
0277   mptWLSfiber->AddProperty("WLSABSLENGTH", energy, absWLSfiber);
0278   mptWLSfiber->AddProperty("WLSCOMPONENT", energy, emissionFib);
0279   mptWLSfiber->AddConstProperty("WLSTIMECONSTANT", 0.5 * ns);
0280 
0281   fPMMA->SetMaterialPropertiesTable(mptWLSfiber);
0282 
0283   //--------------------------------------------------
0284   //  Polyethylene
0285   //--------------------------------------------------
0286 
0287   std::vector<G4double> refractiveIndexClad1 = {1.49, 1.49};
0288 
0289   std::vector<G4double> absClad = {20.0 * m, 20.0 * m};
0290 
0291   // Add entries into properties table
0292   auto mptClad1 = new G4MaterialPropertiesTable();
0293   mptClad1->AddProperty("RINDEX", energySmall, refractiveIndexClad1);
0294   mptClad1->AddProperty("ABSLENGTH", energySmall, absClad);
0295 
0296   fPethylene->SetMaterialPropertiesTable(mptClad1);
0297 
0298   //--------------------------------------------------
0299   // Fluorinated Polyethylene
0300   //--------------------------------------------------
0301 
0302   std::vector<G4double> refractiveIndexClad2 = {1.42, 1.42};
0303 
0304   // Add entries into properties table
0305   auto mptClad2 = new G4MaterialPropertiesTable();
0306   mptClad2->AddProperty("RINDEX", energySmall, refractiveIndexClad2);
0307   mptClad2->AddProperty("ABSLENGTH", energySmall, absClad);
0308 
0309   fFPethylene->SetMaterialPropertiesTable(mptClad2);
0310 
0311   //--------------------------------------------------
0312   // Silicone
0313   //--------------------------------------------------
0314 
0315   std::vector<G4double> refractiveIndexSilicone = {1.46, 1.46};
0316 
0317   // Add entries into properties table
0318   auto mptSilicone = new G4MaterialPropertiesTable();
0319   mptSilicone->AddProperty("RINDEX", energySmall, refractiveIndexSilicone);
0320   mptSilicone->AddProperty("ABSLENGTH", energySmall, absClad);
0321 
0322   fSilicone->SetMaterialPropertiesTable(mptSilicone);
0323 
0324   //--------------------------------------------------
0325   //  Polystyrene
0326   //--------------------------------------------------
0327 
0328   std::vector<G4double> refractiveIndexPS = {1.50, 1.50};
0329 
0330   std::vector<G4double> absPS = {2. * cm, 2. * cm};
0331 
0332   std::vector<G4double> scintilFast = {
0333     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0334     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0,
0335     1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0};
0336 
0337   // Add entries into properties table
0338   auto mptPolystyrene = new G4MaterialPropertiesTable();
0339   mptPolystyrene->AddProperty("RINDEX", energySmall, refractiveIndexPS);
0340   mptPolystyrene->AddProperty("ABSLENGTH", energySmall, absPS);
0341   mptPolystyrene->AddProperty("SCINTILLATIONCOMPONENT1", energy, scintilFast);
0342   mptPolystyrene->AddConstProperty("SCINTILLATIONYIELD", 10. / keV);
0343   mptPolystyrene->AddConstProperty("RESOLUTIONSCALE", 1.0);
0344   mptPolystyrene->AddConstProperty("SCINTILLATIONTIMECONSTANT1", 10. * ns);
0345 
0346   fPolystyrene->SetMaterialPropertiesTable(mptPolystyrene);
0347 
0348   // Set the Birks Constant for the Polystyrene scintillator
0349   fPolystyrene->GetIonisation()->SetBirksConstant(0.126 * mm / MeV);
0350 }