Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:20:50

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 electromagnetic/TestEm10/src/Materials.cc
0028 /// \brief Implementation of the Materials class
0029 //
0030 //
0031 //
0032 //      GEANT 4 class
0033 //
0034 //      History: based on object model of
0035 //       Materials
0036 //     Originally Created in Test30 by Vladimir Ivanchenko, 12 March 2002
0037 //
0038 //    Modified for Test by V. Grichine, 29 Jan 2006
0039 //    is filled with XTR related materials, plastics, gas mixtures, etc
0040 
0041 #include "Materials.hh"
0042 
0043 #include "G4Material.hh"
0044 #include "G4MaterialTable.hh"
0045 #include "G4SystemOfUnits.hh"
0046 #include "G4UnitsTable.hh"
0047 
0048 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0049 
0050 Materials* Materials::fgInstance = 0;
0051 
0052 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0053 
0054 Materials* Materials::GetInstance()
0055 {
0056   if (!fgInstance) {
0057     fgInstance = new Materials();
0058   }
0059   return fgInstance;
0060 }
0061 
0062 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0063 
0064 Materials::Materials()
0065 {
0066   fgInstance = this;
0067   Initialise();
0068 }
0069 
0070 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0071 
0072 Materials::~Materials() {}
0073 
0074 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0075 
0076 void Materials::Initialise()
0077 {
0078   G4String name, symbol;
0079   G4double a, z;
0080   G4double density, fractionmass;
0081   G4int nel, ncomponents;
0082 
0083   // define Elements
0084 
0085   a = 1.01 * g / mole;
0086   G4Element* elH = new G4Element(name = "Hydrogen", symbol = "H", z = 1., a);
0087 
0088   a = 6.94 * g / mole;
0089   G4Element* elLi = new G4Element(name = "Lithium", symbol = "Li", z = 3., a);
0090 
0091   a = 9.01 * g / mole;
0092   G4Element* elBe = new G4Element(name = "Berillium", symbol = "Be", z = 4., a);
0093 
0094   a = 12.01 * g / mole;
0095   G4Element* elC = new G4Element(name = "Carbon", symbol = "C", z = 6., a);
0096 
0097   a = 14.01 * g / mole;
0098   G4Element* elN = new G4Element(name = "Nitrogen", symbol = "N", z = 7., a);
0099 
0100   a = 16.00 * g / mole;
0101   G4Element* elO = new G4Element(name = "Oxygen", symbol = "O", z = 8., a);
0102 
0103   a = 39.948 * g / mole;
0104   G4Element* elAr = new G4Element(name = "Argon", symbol = "Ar", z = 18., a);
0105 
0106   /*
0107   a = 131.29*g/mole;
0108   G4Element* elXe = new G4Element(name="Xenon", symbol="Xe", z=54., a);
0109 
0110   a = 19.00*g/mole;
0111   G4Element* elF  = new G4Element(name="Fluorine", symbol="F", z=9., a);
0112   */
0113 
0114   //////////////
0115   //
0116   // Detector windows, electrodes
0117   // Al for electrodes
0118 
0119   density = 2.700 * g / cm3;
0120   a = 26.98 * g / mole;
0121   new G4Material(name = "Al", z = 13., a, density);
0122 
0123   /////////
0124   //
0125   // Materials for popular X-ray TR radiators
0126   //
0127 
0128   // TRT_CH2
0129 
0130   density = 0.935 * g / cm3;
0131   G4Material* TRT_CH2 = new G4Material(name = "TRT_CH2", density, nel = 2);
0132   TRT_CH2->AddElement(elC, 1);
0133   TRT_CH2->AddElement(elH, 2);
0134 
0135   // Radiator
0136 
0137   density = 0.059 * g / cm3;
0138   G4Material* Radiator = new G4Material(name = "Radiator", density, nel = 2);
0139   Radiator->AddElement(elC, 1);
0140   Radiator->AddElement(elH, 2);
0141 
0142   // Carbon Fiber
0143 
0144   density = 0.145 * g / cm3;
0145   G4Material* CarbonFiber = new G4Material(name = "CarbonFiber", density, nel = 1);
0146   CarbonFiber->AddElement(elC, 1);
0147 
0148   // Lithium
0149 
0150   density = 0.534 * g / cm3;
0151   G4Material* Li = new G4Material(name = "Li", density, nel = 1);
0152   Li->AddElement(elLi, 1);
0153 
0154   // Beryllium
0155 
0156   density = 1.848 * g / cm3;
0157   G4Material* Be = new G4Material(name = "Be", density, nel = 1);
0158   Be->AddElement(elBe, 1);
0159 
0160   // Mylar
0161 
0162   density = 1.39 * g / cm3;
0163   G4Material* Mylar = new G4Material(name = "Mylar", density, nel = 3);
0164   Mylar->AddElement(elO, 2);
0165   Mylar->AddElement(elC, 5);
0166   Mylar->AddElement(elH, 4);
0167 
0168   // Kapton Dupont de Nemur (density: 1.396-1.430, get middle )
0169 
0170   density = 1.413 * g / cm3;
0171   G4Material* Kapton = new G4Material(name = "Kapton", density, nel = 4);
0172   Kapton->AddElement(elO, 5);
0173   Kapton->AddElement(elC, 22);
0174   Kapton->AddElement(elN, 2);
0175   Kapton->AddElement(elH, 10);
0176 
0177   // Kapton (polyimide) ??? since = Mylar C5H4O2
0178 
0179   // density = 1.39*g/cm3;
0180   // G4Material* kapton = new G4Material(name="kapton", density, nel=3);
0181   // Kapton->AddElement(elO,2);
0182   // Kapton->AddElement(elC,5);
0183   // Kapton->AddElement(elH,4);
0184 
0185   // Polypropelene
0186 
0187   G4Material* CH2 = new G4Material("CH2", 0.91 * g / cm3, 2);
0188   CH2->AddElement(elH, 2);
0189   CH2->AddElement(elC, 1);
0190 
0191   ////////////////////////////
0192   //
0193   // Noble gases , STP conditions
0194 
0195   // Helium as detector gas, STP
0196 
0197   density = 0.178 * mg / cm3;
0198   a = 4.0026 * g / mole;
0199   G4Material* He = new G4Material(name = "He", z = 2., a, density);
0200 
0201   // Neon as detector gas, STP
0202 
0203   density = 0.900 * mg / cm3;
0204   a = 20.179 * g / mole;
0205   new G4Material(name = "Ne", z = 10., a, density);
0206 
0207   // Argon as detector gas, STP
0208 
0209   density = 1.7836 * mg / cm3;  // STP
0210   G4Material* Argon = new G4Material(name = "Argon", density, ncomponents = 1);
0211   Argon->AddElement(elAr, 1);
0212 
0213   // Krypton as detector gas, STP
0214 
0215   density = 3.700 * mg / cm3;
0216   a = 83.80 * g / mole;
0217   G4Material* Kr = new G4Material(name = "Kr", z = 36., a, density);
0218 
0219   // Xenon as detector gas, STP
0220 
0221   density = 5.858 * mg / cm3;
0222   a = 131.29 * g / mole;
0223   G4Material* Xe = new G4Material(name = "Xenon", z = 54., a, density);
0224 
0225   /////////////////////////////////
0226   //
0227   // Hydrocarbones, metane and others
0228 
0229   // Metane, STP
0230 
0231   density = 0.7174 * mg / cm3;
0232   G4Material* metane = new G4Material(name = "CH4", density, nel = 2);
0233   metane->AddElement(elC, 1);
0234   metane->AddElement(elH, 4);
0235 
0236   // Propane, STP
0237 
0238   density = 2.005 * mg / cm3;
0239   G4Material* propane = new G4Material(name = "C3H8", density, nel = 2);
0240   propane->AddElement(elC, 3);
0241   propane->AddElement(elH, 8);
0242 
0243   // iso-Butane (methylpropane), STP
0244 
0245   density = 2.67 * mg / cm3;
0246   G4Material* isobutane = new G4Material(name = "isoC4H10", density, nel = 2);
0247   isobutane->AddElement(elC, 4);
0248   isobutane->AddElement(elH, 10);
0249 
0250   /////////////////////////
0251   //
0252   // Molecular gases
0253 
0254   // Carbon dioxide, STP
0255 
0256   density = 1.977 * mg / cm3;
0257   G4Material* CO2 =
0258     new G4Material(name = "CO2", density, nel = 2, kStateGas, 273.15 * kelvin, 1. * atmosphere);
0259   CO2->AddElement(elC, 1);
0260   CO2->AddElement(elO, 2);
0261 
0262   // Carbon dioxide, STP
0263 
0264   density = 1.977 * 273. * mg / cm3 / 293.;
0265   G4Material* CarbonDioxide = new G4Material(name = "CO2_2", density, nel = 2);
0266   CarbonDioxide->AddElement(elC, 1);
0267   CarbonDioxide->AddElement(elO, 2);
0268 
0269   // Nitrogen, STP
0270 
0271   density = 1.25053 * mg / cm3;  // STP
0272   G4Material* Nitrogen = new G4Material(name = "N2", density, ncomponents = 1);
0273   Nitrogen->AddElement(elN, 2);
0274 
0275   // Oxygen, STP
0276 
0277   density = 1.4289 * mg / cm3;  // STP
0278   G4Material* Oxygen = new G4Material(name = "O2", density, ncomponents = 1);
0279   Oxygen->AddElement(elO, 2);
0280 
0281   /* *****************************
0282   density = 1.25053*mg/cm3;       // STP
0283   a = 14.01*g/mole ;       // get atomic weight !!!
0284   //  a = 28.016*g/mole;
0285   G4Material* N2  = new G4Material(name="Nitrogen", z= 7.,a,density) ;
0286 
0287   density = 1.25053*mg/cm3;       // STP
0288   G4Material* anotherN2 = new G4Material(name="anotherN2", density,ncomponents=2);
0289   anotherN2->AddElement(elN, 1);
0290   anotherN2->AddElement(elN, 1);
0291 
0292   // air made from oxigen and nitrogen only
0293 
0294   density = 1.290*mg/cm3;  // old air from elements
0295   G4Material* air = new G4Material(name="air"  , density, ncomponents=2);
0296   air->AddElement(elN, fractionmass=0.7);
0297   air->AddElement(elO, fractionmass=0.3);
0298   ******************************************** */
0299 
0300   // Dry Air (average composition with Ar), STP
0301 
0302   density = 1.2928 * mg / cm3;  // STP
0303   G4Material* Air = new G4Material(name = "Air", density, ncomponents = 3);
0304   Air->AddMaterial(Nitrogen, fractionmass = 0.7557);
0305   Air->AddMaterial(Oxygen, fractionmass = 0.2315);
0306   Air->AddMaterial(Argon, fractionmass = 0.0128);
0307 
0308   ////////////////////////////////////////////////////////////////////////////
0309   //
0310   // MWPC mixtures
0311 
0312   // 85% Xe + 15% CO2, STP
0313 
0314   density = 4.9 * mg / cm3;
0315   G4Material* Xe15CO2 = new G4Material(name = "Xe15CO2", density, ncomponents = 2);
0316   Xe15CO2->AddMaterial(Xe, fractionmass = 0.979);
0317   Xe15CO2->AddMaterial(CarbonDioxide, fractionmass = 0.021);
0318 
0319   // 80% Xe + 20% CO2, STP
0320 
0321   density = 5.0818 * mg / cm3;
0322   G4Material* Xe20CO2 = new G4Material(name = "Xe20CO2", density, ncomponents = 2);
0323   Xe20CO2->AddMaterial(Xe, fractionmass = 0.922);
0324   Xe20CO2->AddMaterial(CarbonDioxide, fractionmass = 0.078);
0325 
0326   // 70% Xe + 27% CO2 + 3% O2, 20 1 atm ATLAS straw tube mixture
0327 
0328   density = 4.358 * mg / cm3;
0329   G4Material* Xe27CO23O2 = new G4Material(name = "Xe27CO23O2", density, ncomponents = 3);
0330   Xe27CO23O2->AddMaterial(Xe, fractionmass = 0.87671);
0331   Xe27CO23O2->AddMaterial(CarbonDioxide, fractionmass = 0.11412);
0332   Xe27CO23O2->AddMaterial(Oxygen, fractionmass = 0.00917);
0333 
0334   // 80% Kr + 20% CO2, STP
0335 
0336   density = 3.601 * mg / cm3;
0337   G4Material* Kr20CO2 = new G4Material(name = "Kr20CO2", density, ncomponents = 2);
0338   Kr20CO2->AddMaterial(Kr, fractionmass = 0.89);
0339   Kr20CO2->AddMaterial(CarbonDioxide, fractionmass = 0.11);
0340 
0341   // Xe + 55% He + 15% CH4 ; NIM A294 (1990) 465-472; STP
0342 
0343   density = 1.963 * 273. * mg / cm3 / 293.;
0344   G4Material* Xe55He15CH4 = new G4Material(name = "Xe55He15CH4", density, ncomponents = 3);
0345   Xe55He15CH4->AddMaterial(Xe, 0.895);
0346   Xe55He15CH4->AddMaterial(He, 0.050);
0347   Xe55He15CH4->AddMaterial(metane, 0.055);
0348 
0349   // 90% Xe + 10% CH4, STP ; NIM A248 (1986) 379-388
0350 
0351   density = 5.344 * mg / cm3;
0352   G4Material* Xe10CH4 = new G4Material(name = "Xe10CH4", density, ncomponents = 2);
0353   Xe10CH4->AddMaterial(Xe, fractionmass = 0.987);
0354   Xe10CH4->AddMaterial(metane, fractionmass = 0.013);
0355 
0356   // 95% Xe + 5% CH4, STP ; NIM A214 (1983) 261-268
0357 
0358   density = 5.601 * mg / cm3;
0359   G4Material* Xe5CH4 = new G4Material(name = "Xe5CH4", density, ncomponents = 2);
0360   Xe5CH4->AddMaterial(Xe, fractionmass = 0.994);
0361   Xe5CH4->AddMaterial(metane, fractionmass = 0.006);
0362 
0363   // 80% Xe + 20% CH4, STP ; NIM A253 (1987) 235-244
0364 
0365   density = 4.83 * mg / cm3;
0366   G4Material* Xe20CH4 = new G4Material(name = "Xe20CH4", density, ncomponents = 2);
0367   Xe20CH4->AddMaterial(Xe, fractionmass = 0.97);
0368   Xe20CH4->AddMaterial(metane, fractionmass = 0.03);
0369 
0370   // 93% Ar + 7% CH4, STP ; NIM 107 (1973) 413-422
0371 
0372   density = 1.709 * mg / cm3;
0373   G4Material* Ar7CH4 = new G4Material(name = "Ar7CH4", density, ncomponents = 2);
0374   Ar7CH4->AddMaterial(Argon, fractionmass = 0.971);
0375   Ar7CH4->AddMaterial(metane, fractionmass = 0.029);
0376 
0377   // 93% Kr + 7% CH4, STP ; NIM 107 (1973) 413-422
0378 
0379   density = 3.491 * mg / cm3;
0380   G4Material* Kr7CH4 = new G4Material(name = "Kr7CH4", density, ncomponents = 2);
0381   Kr7CH4->AddMaterial(Kr, fractionmass = 0.986);
0382   Kr7CH4->AddMaterial(metane, fractionmass = 0.014);
0383 
0384   // 0.5*(95% Xe + 5% CH4)+0.5*(93% Ar + 7% CH4), STP ; NIM A214 (1983) 261-268
0385 
0386   density = 3.655 * mg / cm3;
0387   G4Material* XeArCH4 = new G4Material(name = "XeArCH4", density, ncomponents = 2);
0388   XeArCH4->AddMaterial(Xe5CH4, fractionmass = 0.766);
0389   XeArCH4->AddMaterial(Ar7CH4, fractionmass = 0.234);
0390 
0391   // Silicon as detector material
0392 
0393   density = 2.330 * g / cm3;
0394   a = 28.09 * g / mole;
0395   new G4Material(name = "Si", z = 14., a, density);
0396 
0397   /*
0398   G4Material* ma;
0399   ma  = new G4Material("H",     1.,  1.0*g/mole, 1.*g/cm3);
0400   ma  = new G4Material("D",     1.,  2.0*g/mole, 1.*g/cm3);
0401   ma  = new G4Material("Li",    3.,  6.941*g/mole, 1.*g/cm3);
0402   ma  = new G4Material("Be",    4.,  9.01*g/mole, 1.848*g/cm3);
0403   ma  = new G4Material("C",     6.,  12.00*g/mole, 2.0*g/cm3);
0404         ma  = new G4Material("Graphite",6., 12.00*g/mole, 2.265*g/cm3 );
0405   ma->SetChemicalFormula("Graphite");
0406   ma  = new G4Material("Al",    13.,  26.98*g/mole,  2.7 *g/cm3);
0407         ma  = new G4Material("Si",    14.,  29.055*g/mole, 2.33*g/cm3);
0408         ma  = new G4Material("LAr",   18.,  39.95*g/mole,  1.393*g/cm3);
0409         ma  = new G4Material("Zr",    40.,  91.224*g/mole, 4.0*g/cm3);
0410         ma  = new G4Material("LXe",   54., 131.29*g/mole,  3.02*g/cm3);
0411         ma  = new G4Material("Fe",    26.,  55.85*g/mole,  7.87*g/cm3);
0412         ma  = new G4Material("Ni",    29.,  58.6934*g/mole,  8.00*g/cm3);
0413         ma  = new G4Material("Cu",    29.,  63.55*g/mole,  8.96*g/cm3);
0414         ma  = new G4Material("Au",    79., 196.97*g/mole, 19.32*g/cm3);
0415         ma  = new G4Material("Ta",    73., 180.9479*g/mole, 16.67*g/cm3);
0416         ma  = new G4Material("W",     74., 183.85*g/mole, 19.30*g/cm3);
0417         ma  = new G4Material("Pb",    82., 207.19*g/mole, 11.35*g/cm3);
0418         ma  = new G4Material("Bi",    83., 208.98*g/mole, 12.*g/cm3);
0419         ma  = new G4Material("U",     92., 238.03*g/mole, 18.95*g/cm3);
0420 
0421   G4Element*   H  = new G4Element ("Hydrogen", "H",   1. ,  1.01*g/mole);
0422   G4Element*   N  = new G4Element ("Nitrigen", "N",   7. , 14.00*g/mole);
0423   G4Element*   O  = new G4Element ("Oxygen"  , "O",   8. , 16.00*g/mole);
0424   G4Element*   C  = new G4Element ("Carbon"  , "C",   6. , 12.00*g/mole);
0425   G4Element*  Cs  = new G4Element ("Cesium"  , "Cs", 55. , 132.905*g/mole);
0426   G4Element*   I  = new G4Element ("Iodide"  , "I",  53. , 126.9044*g/mole);
0427 
0428   ma = new G4Material("O2", 8., 16.00*g/mole, 1.1*g/cm3);
0429   ma->SetChemicalFormula("O_2");
0430   ma = new G4Material ("Water" , 1.*g/cm3, 2);
0431   ma->AddElement(H,2);
0432   ma->AddElement(O,1);
0433   ma->SetChemicalFormula("H_2O");
0434   ma = new G4Material ("Ethane" , 0.4241*g/cm3, 2);
0435   ma->AddElement(H,6);
0436   ma->AddElement(C,2);
0437   ma->SetChemicalFormula("C_2H_6");
0438   ma = new G4Material ("CsI" , 4.53*g/cm3, 2);
0439   ma->AddElement(Cs,1);
0440   ma->AddElement(I,1);
0441   ma->SetChemicalFormula("CsI");
0442   ma = new G4Material("Air"  , 1.290*mg/cm3, 2);
0443         // use fraction in mass
0444   ma->AddElement(N, 0.7);
0445   ma->AddElement(O, 0.3);
0446   */
0447 }
0448 
0449 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0450 
0451 G4Material* Materials::GetMaterial(const G4String& name)
0452 {
0453   //  const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable();
0454 
0455   G4Material* ma = G4Material::GetMaterial(name);
0456 
0457   G4cout << "Material is selected: " << ma->GetName() << G4endl;
0458   return ma;
0459 }