Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:16:57

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 //   Author:           Mathieu Fontaine, Rachid Mazini
0027 //                     fontaine@lps.umontreal.ca  Rachid.Mazini@cern.ch
0028 //
0029 //   Language:         C++
0030 //   Tested on:        g++
0031 //   Prerequisites:    None
0032 //   Purpose:          This is the place, where all the materials get defined.
0033 //                     Instead of coding those materials locally, where they
0034 //                     are needed, it is much easier to maintain, if we keep
0035 //                     all materials for a detector component in one place.
0036 //                     Everybody who needs some of these parameters, can
0037 //                     query the FCALMaterialConsultant.
0038 //                 --> This class is made a singleton by making the
0039 //                     constructor private and hiding it behind the
0040 //                     construct() method, which creates a first instance
0041 //                     if it does not exist. This is to prevent multiple
0042 //                     copies of this consultant with potentially different
0043 //                     contents (once the data is loaded from files and/or
0044 //                     can be changed by user interaction).
0045 //                 --> The method Material is provided to access to the data
0046 //                     stored, a routine ShowMeAllYouKnow can be queried to
0047 //                     dump the entire knowledge of this consultant.
0048 //
0049 //                   * Ideas on how the theFCALMaterialConsultant pointer
0050 //                     is made static are borrowed from G4VisManager.
0051 //
0052 //----------------------------------------------------------------------------------
0053 
0054 #include "FCALMaterialConsultant.hh"
0055 
0056 #include "globals.hh"
0057 #include "G4PhysicalConstants.hh"
0058 #include "G4SystemOfUnits.hh"
0059 
0060 FCALMaterialConsultant *FCALMaterialConsultant::theFCALMaterialConsultant = NULL;
0061 
0062 FCALMaterialConsultant::FCALMaterialConsultant()
0063 {
0064   G4double a,z,density,fractionmass;
0065   G4String name,symbol;
0066   G4int nel,natoms;
0067 
0068   //------------
0069   // elements
0070   //------------
0071 
0072   a=1.01*g/mole;
0073   elH=new G4Element(name="Hydrogen",symbol="H2",z=1.,a);
0074 
0075   a=2.01*g/mole;
0076   elD=new G4Element(name="Deuterium",symbol="D",z=1.,a);
0077 
0078   a=4.*g/mole;
0079   elHe=new G4Element(name="Helium",symbol="He",z=2.,a);
0080 
0081   a=6.94*g/mole;
0082   elLi=new G4Element(name="Lithium",symbol="Li",z=3.,a);
0083 
0084   a=9.01*g/mole;
0085   elBe=new G4Element(name="Berillium",symbol="Be",z=4.,a);
0086 
0087   a=12.01*g/mole;
0088   elC=new G4Element(name="Carbon",symbol="C",z=6.,a);
0089 
0090   a=14.01*g/mole;
0091   elN=new G4Element(name="Nitrogen",symbol="N2",z=7.,a);
0092 
0093   a=16.*g/mole;
0094   elO=new G4Element(name="Oxygen",symbol="O2",z=8.,a);
0095 
0096   a=20.18*g/mole;
0097   elNe=new G4Element(name="Neon",symbol="Ne",z=10.,a);
0098 
0099   a=22.99*g/mole;
0100   elNa=new G4Element(name="Sodium",symbol="Na",z=11.,a);
0101 
0102   a=26.98*g/mole;
0103   elAl=new G4Element(name="Aluminium",symbol="Al",z=13.,a);
0104 
0105   a=28.085*g/mole;
0106   elSi=new G4Element(name="Silicon",symbol="Si",z=14.,a);
0107 
0108   a=40.08*g/mole;
0109   elCa=new G4Element(name="Calcium",symbol="Ca",z=20.,a);
0110 
0111   a=55.850*g/mole;
0112   elFe=new G4Element(name="Iron",symbol="Fe",z=26.,a);
0113 
0114   a=63.54*g/mole;
0115   elCu=new G4Element(name="Copper",symbol="Cu",z=29.,a);
0116 
0117   a=183.85*g/mole;
0118   elW=new G4Element(name="Tungstenm",symbol="W",z=74.,a);
0119 
0120   a=207.19*g/mole;
0121   elPb=new G4Element(name="Lead",symbol="Pb",z=82.,a);
0122 
0123   a=238.03*g/mole;
0124   elU=new G4Element(name="Uranium",symbol="U",z=92.,a);
0125 
0126 
0127   //-------------------
0128   // simple materials
0129   //-------------------
0130 
0131   density = 2.7*g/cm3;
0132   a = 26.98*g/mole;
0133   Aluminium = new G4Material(name="Aluminium",z=13.,a,density);
0134   
0135   density = 7.87*g/cm3;
0136   a = 55.85*g/mole;
0137   Iron = new G4Material(name="Iron",z=26.,a,density);
0138 
0139   density = 8.96*g/cm3;
0140   a = 63.54*g/mole;
0141   Copper = new G4Material(name="Copper",z=29.,a,density);
0142 
0143   density = 19.3*g/cm3;
0144   a = 183.85*g/mole;
0145   Tungsten = new G4Material(name="Tungsten",z=74.,a,density);
0146 
0147   density = 11.35*g/cm3;
0148   a = 207.19*g/mole;
0149   Lead = new G4Material(name="Lead",z=82.,a,density);
0150 
0151   density = 1.4*g/cm3;
0152   a = 39.95*g/mole;
0153   LiquidArgon = new G4Material(name="LiquidArgon",z=18.,a,density);
0154 
0155   density = 0.002*g/cm3;
0156   a = 39.95*g/mole;
0157   ArgonGas = new G4Material(name="ArgonGas",z=18.,a,density);
0158 
0159   density = 8.96*g/cm3;
0160   a = 58.69*g/mole;
0161   Nickel = new G4Material(name="Nickel",z=28.,a,density);
0162 
0163   
0164   //------------------
0165   // mixtures
0166   //------------------
0167 
0168   density = 1.290*mg/cm3;
0169   Air = new G4Material(name="Air",density, nel=2);
0170   Air->AddElement(elN, 0.7);
0171   Air->AddElement(elO, 0.3);
0172 
0173   RhoaCell = Air;
0174 
0175 
0176   density              = 1.e-5*g/cm3;
0177   G4double pressure    = 2.e-2*bar;
0178   G4double temperature = STP_Temperature;         //from PhysicalConstants.h
0179   Vacuum = new G4Material(name="Vacuum", density, nel=1,
0180               kStateGas,temperature,pressure);
0181   Vacuum->AddMaterial(Air, fractionmass=1.);
0182 
0183 
0184   density = 0.002*g/cm3;
0185   CO2 = new G4Material(name="CO2",density,nel=2);
0186   CO2->AddElement(elC, natoms=1);
0187   CO2->AddElement(elO, natoms=2);
0188 
0189   density = 1.42*g/cm3;
0190   Kapton = new G4Material(name="Kapton",density, nel=4);
0191   Kapton->AddElement(elH, fractionmass = 0.0273);
0192   Kapton->AddElement(elC, fractionmass = 0.7213);
0193   Kapton->AddElement(elN, fractionmass = 0.0765);
0194   Kapton->AddElement(elO, fractionmass = 0.1749);
0195 
0196   density = 1.032*g/cm3;
0197   Polystyrene = new G4Material(name="Polystyrene",density,nel=2);
0198   Polystyrene->AddElement(elC, natoms=8);
0199   Polystyrene->AddElement(elH, natoms=8);
0200 
0201   density = 5.185*g/cm3;
0202   FCAL1CuArKap = new G4Material(name="FCAL1CuArKap",density,nel=3);
0203   FCAL1CuArKap->AddMaterial(Copper, fractionmass = 0.864);
0204   FCAL1CuArKap->AddMaterial(Kapton, fractionmass = 0.068);
0205   FCAL1CuArKap->AddMaterial(LiquidArgon, fractionmass = 0.068);
0206 
0207   density = 8.701*g/cm3;
0208   FCAL1CuAr = new G4Material(name="FCAL1CuAr",density,nel=2);
0209   FCAL1CuAr->AddMaterial(Copper, fractionmass = 0.994); 
0210   FCAL1CuAr->AddMaterial(LiquidArgon, fractionmass = 0.006);
0211 
0212   density = 5.185*g/cm3;
0213   FCAL2CuArKap = new G4Material(name="FCAL2CuArKap",density,nel=3);
0214   FCAL2CuArKap->AddMaterial(Copper, fractionmass = 0.864);
0215   FCAL2CuArKap->AddMaterial(Kapton, fractionmass = 0.068);
0216   FCAL2CuArKap->AddMaterial(LiquidArgon, fractionmass = 0.068);
0217 
0218   density = 18.6*g/cm3;
0219   FCAL2WFeNi = new G4Material(name="FCAL2WFeNi",density,nel=3);
0220   FCAL2WFeNi->AddMaterial(Tungsten, fractionmass = 0.97);
0221   FCAL2WFeNi->AddMaterial(Iron, fractionmass = 0.01);
0222   FCAL2WFeNi->AddMaterial(Nickel, fractionmass = 0.02);
0223   
0224   density = 15.366*g/cm3;
0225   FCAL2WFeNiCuAr = new G4Material(name="FCAL2WFeNiCuAr",density,nel=3);
0226   FCAL2WFeNiCuAr->AddMaterial(FCAL2WFeNi, fractionmass = 0.913);
0227   FCAL2WFeNiCuAr->AddMaterial(Copper, fractionmass = 0.077);
0228   FCAL2WFeNiCuAr->AddMaterial(LiquidArgon, fractionmass = 0.01);
0229 
0230   density = 0.002*g/cm3;
0231   MWPCArCO2 = new G4Material(name="MWPCArCO2",density,nel=2);
0232   MWPCArCO2->AddMaterial(CO2, fractionmass = 0.2);
0233   MWPCArCO2->AddMaterial(ArgonGas, fractionmass = 0.8);
0234 
0235 
0236   // must  check recipe for concrete
0237 
0238   density = 2.5*g/cm3;
0239   ShieldingConcrete = new G4Material(name="ShieldingConcrete",density,nel=6);
0240   ShieldingConcrete->AddElement(elO, fractionmass = 0.52);
0241   ShieldingConcrete->AddElement(elSi, fractionmass = 0.325);
0242   ShieldingConcrete->AddElement(elCa, fractionmass = 0.06);
0243   ShieldingConcrete->AddElement(elNa, fractionmass = 0.015);
0244   ShieldingConcrete->AddElement(elFe, fractionmass = 0.04);
0245   ShieldingConcrete->AddElement(elAl, fractionmass = 0.04);
0246 
0247   // must have the right composition for stainless steel
0248 
0249   density = 8.96*g/cm3;
0250   StainlessSteel = new G4Material(name="StainlessSteel",density,nel=1);
0251   StainlessSteel->AddElement(elO, fractionmass = 1.);
0252 
0253 }
0254 
0255 FCALMaterialConsultant * FCALMaterialConsultant::GetInstance()
0256 {
0257   if (theFCALMaterialConsultant == NULL) {
0258     theFCALMaterialConsultant = new FCALMaterialConsultant();
0259   }
0260   return theFCALMaterialConsultant;
0261 }
0262 
0263 G4Material * FCALMaterialConsultant::Material(G4String what)
0264 {
0265   G4Material* material = 0;
0266   if(what == "Air")               material = Air;
0267   if(what == "Vacuum")            material = Vacuum;
0268   if(what == "LiquidArgon")       material = LiquidArgon;
0269   if(what == "Aluminium")         material = Aluminium;
0270   if(what == "Iron")              material = Iron;
0271   if(what == "Copper")            material = Copper;
0272   if(what == "Tungsten")          material = Tungsten;
0273   if(what == "Lead")              material = Lead;
0274   if(what == "CO2")               material = CO2;
0275   if(what == "ArgonGas")          material = ArgonGas;
0276   if(what == "ShieldingConcrete") material = ShieldingConcrete;
0277   if(what == "Polystyrene")       material = Polystyrene;
0278   if(what == "StainlessSteel")    material = StainlessSteel;
0279   if(what == "Nickel")            material = Nickel;
0280   if(what == "FCAL1CuArKap")      material = FCAL1CuArKap;
0281   if(what == "FCAL1CuAr")         material = FCAL1CuAr;
0282   if(what == "FCAL2CuArKap")      material = FCAL2CuArKap;
0283   if(what == "FCAL2WFeNi")        material = FCAL2WFeNi;
0284   if(what == "FCAL2WFeNiCuAr")    material = FCAL2WFeNiCuAr;
0285   if(what == "MWPCArCO2")         material = MWPCArCO2;
0286   if(what == "RhoaCell")          material = RhoaCell;
0287 
0288   return material;
0289 }
0290