defining defining material and geometry material and
play

Defining Defining Material and Geometry Material and Geometry - PowerPoint PPT Presentation

Defining Defining Material and Geometry Material and Geometry Makoto Asai (SLAC Computing Services) Makoto Asai (SLAC Computing Services) Geant4 Tutorial Course @ Fermi Lab Geant4 Tutorial Course @ Fermi Lab th , 2003 October 27 th October


  1. Defining Defining Material and Geometry Material and Geometry Makoto Asai (SLAC Computing Services) Makoto Asai (SLAC Computing Services) Geant4 Tutorial Course @ Fermi Lab Geant4 Tutorial Course @ Fermi Lab th , 2003 October 27 th October 27 , 2003

  2. Contents Contents � G4VUserDetectorConstruction class G4VUserDetectorConstruction class � � Material Material � � Solid and volume Solid and volume � � Various ways of placement Various ways of placement � � Visualization attributes Visualization attributes � � Defining a field Defining a field � � Geometry optimization (" Geometry optimization ("voxelization voxelization") ") � � Geometry checking tools Geometry checking tools � Defining material and geometry - - M.Asai (SLAC) M.Asai (SLAC) - - Oct.27, 2003 @ Fermi Lab Oct.27, 2003 @ Fermi Lab 2 Defining material and geometry 2

  3. G4VUserDetectorConstruction G4VUserDetectorConstruction

  4. Describe your detector Describe your detector Derive your own concrete class from G4VUserDetectorConstruction G4VUserDetectorConstruction Derive your own concrete class from � � abstract base class. abstract base class. Implementing the method Construct() Implementing the method Construct() � � 1) 1) Construct all necessary materials Construct all necessary materials 2) Define shapes/solids required to describe the geometry 2) Define shapes/solids required to describe the geometry 3) Construct and place volumes of your detector geometry 3) Construct and place volumes of your detector geometry 4) Instantiate sensitive detectors and set them to corresponding 4) Instantiate sensitive detectors and set them to corresponding volumes volumes 5) 5) Associate magnetic field to detector Associate magnetic field to detector 6) Define visualization attributes for the detector elements 6) Define visualization attributes for the detector elements 7) Define regions 7) Define regions Set your construction class to G4RunManager Set your construction class to G4RunManager � � Modularize it w.r.t Modularize it w.r.t. each detector component or sub . each detector component or sub- -detector for easier detector for easier � � maintenance of your code maintenance of your code Defining material and geometry - - M.Asai (SLAC) M.Asai (SLAC) - - Oct.27, 2003 @ Fermi Lab Oct.27, 2003 @ Fermi Lab 4 Defining material and geometry 4

  5. Definition of material Definition of material

  6. Definition of Materials Definition of Materials � Different kinds of materials can be described: Different kinds of materials can be described: � � isotopes isotopes < - -> > G4Isotope < G4Isotope � � elements elements < - < -> > G4Element G4Element � � molecules, compounds and mixtures < molecules, compounds and mixtures < - -> G4Material > G4Material � � Attributes associated to G4Material: Attributes associated to G4Material: � � temperature, pressure, state, density temperature, pressure, state, density � � Single element material Single element material � double density = 1.390*g/cm3; double density = 1.390*g/cm3; double a = 39.95*g/mole; double a = 39.95*g/mole; G4Material* lAr lAr = = G4Material* new G4Material G4Material("liquidArgon",z=18.,a,density); ("liquidArgon",z=18.,a,density); new � Prefer low Prefer low- -density material to vacuum density material to vacuum � Defining material and geometry - - M.Asai (SLAC) M.Asai (SLAC) - - Oct.27, 2003 @ Fermi Lab Oct.27, 2003 @ Fermi Lab 6 Defining material and geometry 6

  7. Material: molecule Material: molecule � A Molecule is made of several elements (composition by A Molecule is made of several elements (composition by number of number of � atoms) atoms ) a = 1.01*g/mole; a = 1.01*g/mole; G4Element* elH elH = G4Element* = new G4Element G4Element("Hydrogen",symbol="H",z=1.,a); ("Hydrogen",symbol="H",z=1.,a); new a = 16.00*g/mole; a = 16.00*g/mole; G4Element* elO elO = G4Element* = new G4Element G4Element("Oxygen",symbol="O",z=8.,a); ("Oxygen",symbol="O",z=8.,a); new density = 1.000*g/cm3; density = 1.000*g/cm3; G4Material* H2O = G4Material* H2O = new G4Material G4Material("Water",density,ncomp=2); ("Water",density,ncomp=2); new H2O- -> >AddElement AddElement(elH (elH, , natoms natoms= =2 2); ); H2O H2O- H2O -> >AddElement AddElement(elO (elO, , natoms natoms= =1 1); ); Defining material and geometry - - M.Asai (SLAC) M.Asai (SLAC) - - Oct.27, 2003 @ Fermi Lab Oct.27, 2003 @ Fermi Lab 7 Defining material and geometry 7

  8. Material: compound Material: compound � Compound: composition by Compound: composition by fraction of mass fraction of mass � a = 14.01*g/mole; a = 14.01*g/mole; G4Element* elN G4Element* elN = = new G4Element G4Element(name="Nitrogen",symbol="N",z= 7.,a); (name="Nitrogen",symbol="N",z= 7.,a); new a = 16.00*g/mole; a = 16.00*g/mole; G4Element* elO elO = G4Element* = new G4Element new G4Element(name="Oxygen",symbol="O",z= 8.,a); (name="Oxygen",symbol="O",z= 8.,a); density = 1.290*mg/cm3; density = 1.290*mg/cm3; G4Material* Air = G4Material* Air = new G4Material G4Material(name=" (name="Air",density,ncomponents Air",density,ncomponents=2); =2); new Air- Air -> >AddElement AddElement(elN (elN, , 70.0* 70.0*perCent perCent); ); Air- -> >AddElement AddElement(elO (elO, , 30.0* 30.0*perCent perCent); ); Air Defining material and geometry - - M.Asai (SLAC) M.Asai (SLAC) - - Oct.27, 2003 @ Fermi Lab Oct.27, 2003 @ Fermi Lab 8 Defining material and geometry 8

  9. Material: mixture Material: mixture � Composition of compound materials Composition of compound materials � G4Element* elC elC = …; // define “carbon” element G4Element* = …; // define “carbon” element G4Material* SiO2 = …; // define “quartz” material G4Material* SiO2 = …; // define “quartz” material G4Material* H2O = …; // define “water” material G4Material* H2O = …; // define “water” material density = 0.200*g/cm3; density = 0.200*g/cm3; G4Material* Aerog G4Material* Aerog = = new G4Material("Aerogel",density,ncomponents=3 ncomponents=3); ); new G4Material("Aerogel",density, Aerog- -> >AddMaterial AddMaterial(SiO2,fractionmass=62.5* (SiO2,fractionmass=62.5*perCent perCent); ); Aerog Aerog- -> >AddMaterial AddMaterial(H2O , (H2O ,fractionmass fractionmass=37.4* =37.4*perCent perCent); ); Aerog Aerog- -> >AddElement AddElement ( (elC elC , ,fractionmass fractionmass= 0.1* = 0.1*perCent perCent); ); Aerog Defining material and geometry - - M.Asai (SLAC) M.Asai (SLAC) - - Oct.27, 2003 @ Fermi Lab Oct.27, 2003 @ Fermi Lab 9 Defining material and geometry 9

  10. Solid and shape Solid and shape

  11. G4VSolid G4VSolid � Abstract class. All solids in Abstract class. All solids in � Geant4 derive from it Geant4 derive from it � It defines but does not It defines but does not � implement all functions required implement all functions required to: to: � compute distances between compute distances between � the shape and a given point the shape and a given point � check whether a point is check whether a point is � inside the shape inside the shape � compute the extent of the compute the extent of the � shape shape � compute the surface normal compute the surface normal � to the shape at a given point to the shape at a given point � User can create his/her own User can create his/her own � solid class solid class 29 Defining material and geometry - - M.Asai (SLAC) M.Asai (SLAC) - - Oct.27, 2003 @ Fermi Lab Oct.27, 2003 @ Fermi Lab 11 Defining material and geometry 11

  12. Solids Solids � Solids defined in Geant4: Solids defined in Geant4: � � CSG (Constructed Solid Geometry) solids CSG (Constructed Solid Geometry) solids � … � G4Box, G4Tubs, G4Cons, G4Trd, G4Box, G4Tubs, G4Cons, G4Trd, … � � Analogous to simple GEANT3 CSG solids Analogous to simple GEANT3 CSG solids � � Specific solids (CSG like) Specific solids (CSG like) � … � G4Polycone, G4Polyhedra, G4Hype, G4Polycone, G4Polyhedra, G4Hype, … � � BREP (Boundary BREP (Boundary REPresented REPresented) solids ) solids � … � G4BREPSolidPolycone, G4BSplineSurface, G4BREPSolidPolycone, G4BSplineSurface, … � � Any order surface Any order surface � � Boolean solids Boolean solids � … � G4UnionSolid, G4SubtractionSolid, G4UnionSolid, G4SubtractionSolid, … � � STEP interface STEP interface � � to import BREP solid models from CAD to import BREP solid models from CAD � systems - - STEP compliant solid modeler STEP compliant solid modeler systems 30 Defining material and geometry - - M.Asai (SLAC) M.Asai (SLAC) - - Oct.27, 2003 @ Fermi Lab Oct.27, 2003 @ Fermi Lab 12 Defining material and geometry 12

Recommend


More recommend