Geometry I Makoto Asai (SLAC) Geant4 Tutorial Course Geant4 v8.2p01.

Slides:



Advertisements
Similar presentations
Geant4 v9.2p02 Geometry I Makoto Asai (SLAC) Geant4 Tutorial Course.
Advertisements

CS447/ Realistic Rendering -- Solids Modeling -- Introduction to 2D and 3D Computer Graphics.
Makoto Asai (SLAC) Geant4 Tutorial Course
Geant4 v9.2p02 Primary Particle Makoto Asai (SLAC) Geant4 Tutorial Course.
Defining Material and Geometry Makoto Asai (SLAC) Geant4 Tutorial Course the 2nd Finnish Geant4 Workshop June , Helsinki Institute of Physics June.
Geant4 v9.4 Geometry II Makoto Asai (SLAC) Geant4 Tutorial Course.
Makoto Asai (SLAC) Geant4 Users SLAC Feb. 18 th, 2002 Getting Started.
2003 by Jim X. Chen: Introduction to Modeling Jim X. Chen George Mason University.
Geant4 v9.4 Geometry I Makoto Asai (SLAC) Geant4 Tutorial Course.
Makoto Asai (SLAC) Geant4 Tutorial Course
Detector Description Gabriele Cosmo, Geant4 Users’ Workshop Tutorial SLAC February 18-22, 2002.
Introduction and Getting Started ESA/ESTEC Makoto Asai (SLAC)
Makoto Asai (SLAC) Geant4 Users CERN Nov. 15 th, 2002 Customizing Run Management.
Makoto Asai (SLAC) Geant4 Users CERN Nov. 12 th, 2002 Detector Sensitivity.
Geant4 v9.4 Primary Particle Makoto Asai (SLAC) Geant4 Tutorial Course.
Makoto Asai (SLAC) Geant4 Users SLAC Feb. 18 th, 2002 Detector Sensitivity.
Nested Parameterization
Geant4 v9.3p01 Primary Particle Makoto Asai (SLAC) Geant4 Tutorial Course.
Geometry II Makoto Asai (SLAC) Geant4 Tutorial Course Geant4 v8.2p01.
Complex Model Construction Mortenson Chapter 11 Geometric Modeling
Some tips for geometries of medical applications Makoto Asai (SLAC)
Geometry 5 I.Hrivnacova¹, J.Apostolakis² ¹IPN, Orsay; ²CERN Cours Paris June 2007.
Detector Description – basic concepts The full set of lecture notes of this Geant4 Course is available at
Modeling and representation 1 – comparative review and polygon mesh models 2.1 Introduction 2.2 Polygonal representation of three-dimensional objects 2.3.
Geant4 Geometry – building your virtual experiment
Tabular Editors for Geant4 Geant4 Geometry Editor and Geant4 Physics Editor CHEP 2000 at Padova Hajime Yoshida Naruto University of Education.
Examples Development and application of CATIA-GDML geometry builder Introduction 1- Institute for Theoretical and Experimental Physics (ITEP), Moscow,
Geometry Detector geometry A detector geometry in Geant4 is made of a number of volumes. The largest volume is called the World volume. It must contain.
17-19 Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan 2007 Geant4 Collaboration.
17-19 Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan 2007 Geant4 Collaboration.
Maria Grazia Pia Detector Response Acknowledgements: A. Lechner, J. Apostolakis, M. Asai, G. Cosmo, A. Howard.
Darmstadt, 15. November 2015 Tobias Stockmanns, FZ Jülich1 A STEP to ROOT converter for the FairRoot framework ALICE-FAIR Computing Meeting, GSI,
User Application Luciano Pandola INFN-LNGS Partially based on a presentation by Maria Grazia Pia (INFN-Ge)
Detector Description – Part I Ivana Hrivnacova, IPN Orsay Tatiana Nikitina, CERN Aknowledgement: Slides by: J.Apostolakis, G.Cosmo, A. Lechner
Geometry 4 I.Hrivnacova IPN, Orsay Most slides thanks to M. Asai, SLAC Cours Paris June 2007.
Maria Grazia Pia INFN Genova Salamanca, July 2002
VMC workshop1 Ideas for G4 navigation interface using ROOT geometry A.Gheata ALICE offline week, 30 May 05.
BREPS & STEP what's up and coming... Gabriele Cosmo CERN - IT/ASD GEANT4 Workshop September, 20th 1999 ESTEC, Noordwijk, The Netherlands.
Detector Description – Part III Ivana Hrivnacova, IPN Orsay Tatiana Nikitina, CERN Aknowledgement: Slides by: J.Apostolakis, G.Cosmo, A. Lechner.
Geometrically Bounded Wireframe AIC (Part 510) Grouping of curves relevant for 3-dimensional wireframe modeling without topological constructs Elementary.
Outline  Developments/fixes in the last year  Introduced in release 9.6 and patches  Planned for release 10.0 and ongoing …  Currently under development.
Detector Description: Basics
Detector Description – basic concepts The full set of lecture notes of this Geant4 Course is available at
Makoto Asai (SLAC) Getting Started MGP: added class diagram of basic user application.
Read-out and detector response
Geometry 3 I.Hrivnacova IPN, Orsay Most slides thanks to M. Asai, SLAC Cours Paris June 2007.
Solid Modeling Dr. Scott Schaefer.
1 Exercises 0 Go inside the “hadrontherapy” directory: cd hadrontherapy Copy the Hadrontherapy example to your home folder: cp –r $G4INSTALL/examples/advanced/hadrontherapy.
Detector Description – Part I Ivana Hrivnacova, IPN Orsay Tatiana Nikitina, CERN Aknowledgement: Slides by: J.Apostolakis, G.Cosmo, A. Lechner
Geometry & Persistency Recent & ongoing developments
J. Apostolakis, M. Asai, G. Cosmo, A. Howard
Geant4: Detector description module
Detector Description - Advanced
Computer-Aided Design & Drafting
Detector Description – basic concepts
Detector Description - Advanced
Geant4: Detector description Gabriele Cosmo,
Basics of a user application
C++ for Geant4 users A collection of most useful and/or common features used in and to use Geant4 Marc Verderi LLR – Ecole polytechnique 14/11/2018 Marc.
Computer-Aided Design & Drafting
Read-out and detector response
Detector sensitivity Makoto Asai (SLAC Computing Services)
Read-out and detector response
User Application
The full set of lecture notes of this Geant4 Course is available at
Customizing Run Management
The full set of lecture notes of this Geant4 Course is available at
The full set of lecture notes of this Geant4 Course is available at
Geant4: Detector description module
GEANT4: Inner Poly Shield
Presentation transcript:

Geometry I Makoto Asai (SLAC) Geant4 Tutorial Course Geant4 v8.2p01

Geometry I - M.Asai (SLAC)2 Contents  Introduction  G4VUserDetectorConstruction class  Solid and shape  Logical volume

Introduction

Geometry I - M.Asai (SLAC)4 Detector geometry G4Box G4Tubs G4VSolid G4VPhysicalVolume G4Material G4VSensitiveDetector G4PVPlacement G4PVParameterised G4VisAttributes G4LogicalVolume   Three conceptual layers   G4VSolid -- shape, size   G4LogicalVolume -- daughter physical volumes, material, sensitivity, user limits, etc.   G4VPhysicalVolume -- position, rotation

Geometry I - M.Asai (SLAC)5 Define detector geometry  Basic strategy G4VSolid* pBoxSolid = new G4Box(“aBoxSolid”, new G4Box(“aBoxSolid”, 1.*m, 2.*m, 3.*m); 1.*m, 2.*m, 3.*m); G4LogicalVolume* pBoxLog = new G4LogicalVolume( pBoxSolid, new G4LogicalVolume( pBoxSolid, pBoxMaterial, “aBoxLog”, 0, 0, 0); pBoxMaterial, “aBoxLog”, 0, 0, 0); G4VPhysicalVolume* aBoxPhys = new G4PVPlacement( pRotation, new G4PVPlacement( pRotation, G4ThreeVector(posX, posY, posZ), G4ThreeVector(posX, posY, posZ), pBoxLog, “aBoxPhys”, pMotherLog, pBoxLog, “aBoxPhys”, pMotherLog, 0, copyNo); 0, copyNo);  A volume is placed in its mother volume. Position and rotation of the daughter volume is described with respect to the local coordinate system of the mother volume. The origin of mother volume’s local coordinate system is at the center of the mother volume.  Daughter volume cannot protrude from mother volume. Solid : shape and size Logical volume : + material, sensitivity, etc. Physical volume : + rotation and position

Geometry I - M.Asai (SLAC)6 Geometrical hierarchy  One logical volume can be placed more than once. One or more volumes can be placed to a mother volume.  Note that the mother-daughter relationship is an information of G4LogicalVolume.  If the mother volume is placed more than once, all daughters are by definition appear in all of mother physical volumes.  The world volume must be a unique physical volume which fully contains all the other volumes.  The world volume defines the. The origin of the global coordinate system is at the center of the world volume.  The world volume defines the global coordinate system. The origin of the global coordinate system is at the center of the world volume.  Position of a track is given with respect to the global coordinate system.

G4VUserDetectorConstruction

Geometry I - M.Asai (SLAC)8 User classes  main()  Geant4 does not provide main(). Note : classes written in yellow are mandatory.  Initialization classes  Use G4RunManager::SetUserInitialization() to define.  Invoked at the initialization  G4VUserDetectorConstruction  G4VUserPhysicsList  Action classes  Use G4RunManager::SetUserAction() to define.  Invoked during an event loop  G4VUserPrimaryGeneratorAction  G4UserRunAction  G4UserEventAction  G4UserStackingAction  G4UserTrackingAction  G4UserSteppingAction

Geometry I - M.Asai (SLAC)9 G4VUserDetectorConstruction Construct() should return the pointer of the world physical volume. The world physical volume represents all of your geometry setup.

Geometry I - M.Asai (SLAC)10 Your detector construction #ifndef MyDetctorConstruction_h #define MyDetctorConstruction_h 1 #include “G4VUserDetectorConstruction.hh” class MyDetctorConstruction : public G4VUserDetectorConstruction : public G4VUserDetectorConstruction{ public: public: G4VUserDetectorConstruction(); G4VUserDetectorConstruction(); virtual ~G4VUserDetectorConstruction(); virtual ~G4VUserDetectorConstruction(); virtual G4VPhysicalVolume* Construct(); virtual G4VPhysicalVolume* Construct(); public: public: // set/get methods if needed // set/get methods if needed private: private: // granular private methods if needed // granular private methods if needed // data members if needed // data members if needed};#endif

Geometry I - M.Asai (SLAC)11 Describe your detector  Derive your own concrete class from G4VUserDetectorConstruction abstract base class.  Implement the method Construct() 1)Construct all necessary materials 2)Define shapes/solids 3)Define logical volumes 4)Place volumes of your detector geometry 5)Associate (magnetic) field to geometry (optional) 6)Instantiate sensitive detectors / scorers and set them to corresponding volumes (optional) 7)Define visualization attributes for the detector elements (optional) 8)Define regions (optional)  Set your construction class to G4RunManager  It is suggested to modularize Construct() method w.r.t. each component or sub-detector for easier maintenance of your code.

Solid and shape

Geometry I - M.Asai (SLAC)13 G4VSolid  Abstract class. All solids in Geant4 are derived from it  It defines but does not implement all functions required to:  compute distances between the shape and a given point  check whether a point is inside the shape  compute the extent of the shape  compute the surface normal to the shape at a given point  User can create his/her own solid class

Geometry I - M.Asai (SLAC)14 Solids  Solids defined in Geant4:  CSG (Constructed Solid Geometry) solids  G4Box, G4Tubs, G4Cons, G4Trd, …  Analogous to simple GEANT3 CSG solids  Specific solids (CSG like)  G4Polycone, G4Polyhedra, G4Hype, …  BREP (Boundary REPresented) solids  G4BREPSolidPolycone, G4BSplineSurface, …  Any order surface  Boolean solids  G4UnionSolid, G4SubtractionSolid, …

Geometry I - M.Asai (SLAC)15 CSG: G4Box, G4Tubs G4Box(const G4String &pname, // name G4double half_x, // X half size G4double half_x, // X half size G4double half_y, // Y half size G4double half_y, // Y half size G4double half_z); // Z half size G4double half_z); // Z half size G4Tubs(const G4String &pname, // name G4double pRmin, // inner radius G4double pRmin, // inner radius G4double pRmax, // outer radius G4double pRmax, // outer radius G4double pDz, // Z half length G4double pDz, // Z half length G4double pSphi, // starting Phi G4double pSphi, // starting Phi G4double pDphi); // segment angle G4double pDphi); // segment angle

Geometry I - M.Asai (SLAC)16 Other CSG solids G4Cons G4Para (parallelepiped) G4Trd G4Trap G4Sphere G4Orb (full solid sphere) G4Torus Consult to Section of Geant4 Application Developers Guide for all available shapes. Section of Geant4 Application Developers Guide Section of Geant4 Application Developers Guide

Geometry I - M.Asai (SLAC)17 Specific CSG Solids: G4Polycone G4Polycone(const G4String& pName, G4double phiStart, G4double phiStart, G4double phiTotal, G4double phiTotal, G4int numRZ, G4int numRZ, const G4double r[], const G4double r[], const G4double z[]); const G4double z[]);  numRZ - numbers of corners in the r,z space  r, z - coordinates of corners

Geometry I - M.Asai (SLAC)18 Other Specific CSG solids G4Polyhedra G4EllipticalTube G4Ellipsoid G4EllipticalCone G4HypeG4Tet (tetrahedra) G4TwistedBox G4TwistedTrd G4TwistedTrap G4TwistedTubs Consult to Section of Geant4 Application Developers Guide for all available shapes. Section of Geant4 Application Developers Guide Section of Geant4 Application Developers Guide

Geometry I - M.Asai (SLAC)19 BREP Solids  BREP = Boundary REPresented Solid  Listing all its surfaces specifies a solid  e.g. 6 planes for a cube  Surfaces can be  planar, 2 nd or higher order  elementary BREPS  Splines, B-Splines, NURBS (Non-Uniform B-Splines) NURBS (Non-Uniform B-Splines)  advanced BREPS  Few elementary BREPS pre-defined  box, cons, tubs, sphere, torus, polycone, polyhedra  Advanced BREPS built through CAD systems

Geometry I - M.Asai (SLAC)20 Boolean Solids  Solids can be combined using boolean operations:  G4UnionSolid, G4SubtractionSolid, G4IntersectionSolid  Requires: 2 solids, 1 boolean operation, and an (optional) transformation for the 2 nd solid  2 nd solid is positioned relative to the coordinate system of the 1 st solid  Result of boolean operation becomes a solid. Thus the third solid can be combined to the resulting solid of first operation.  Solids to be combined can be either CSG or other Boolean solids.  Note: tracking cost for the navigation in a complex Boolean solid is proportional to the number of constituent CSG solids G4UnionSolidG4IntersectionSolid G4SubtractionSolid

Geometry I - M.Asai (SLAC)21 Boolean solid

Geometry I - M.Asai (SLAC)22 Boolean Solids - example G4VSolid* box = new G4Box(“Box",50*cm,60*cm,40*cm); G4VSolid* cylinder = new G4Tubs(“Cylinder”,0.,50.*cm,50.*cm,0.,2*M_PI*rad); = new G4Tubs(“Cylinder”,0.,50.*cm,50.*cm,0.,2*M_PI*rad); G4VSolid* union = new G4UnionSolid("Box+Cylinder", box, cylinder); = new G4UnionSolid("Box+Cylinder", box, cylinder); G4VSolid* subtract = new G4SubtractionSolid("Box-Cylinder", box, cylinder, = new G4SubtractionSolid("Box-Cylinder", box, cylinder, 0, G4ThreeVector(30.*cm,0.,0.)); 0, G4ThreeVector(30.*cm,0.,0.)); G4RotationMatrix* rm = new G4RotationMatrix(); rm->RotateX(30.*deg); G4VSolid* intersect = new G4IntersectionSolid("Box&&Cylinder", = new G4IntersectionSolid("Box&&Cylinder", box, cylinder, rm, G4ThreeVector(0.,0.,0.)); box, cylinder, rm, G4ThreeVector(0.,0.,0.));  The origin and the coordinates of the combined solid are the same as those of the first solid.

Geometry I - M.Asai (SLAC)23 Tessellated solids  G4TessellatedSolid (since 8.1)  Generic solid defined by a number of facets ( G4VFacet )  Facets can be triangular ( G4TriangularFacet ) or quadrangular ( G4QuadrangularFacet )  Constructs especially important for conversion of complex geometrical shapes imported from CAD systems  But can also be explicitly defined:  By providing the vertices of the facets in anti-clock wise order, in absolute or relative reference frame  GDML binding

A CAD imported assembly with tessellated solids - release 8.1

G4LogicalVolume

Geometry I - M.Asai (SLAC)26 G4LogicalVolume G4LogicalVolume(G4VSolid *pSolid, G4Material *pMaterial, G4Material *pMaterial, const G4String &name, const G4String &name, G4FieldManager *pFieldMgr=0, G4FieldManager *pFieldMgr=0, G4VSensitiveDetector *pSDetector=0, G4VSensitiveDetector *pSDetector=0, G4UserLimits *pULimits=0); G4UserLimits *pULimits=0);  Contains all information of volume except position and rotation  Shape and dimension (G4VSolid)  Material, sensitivity, visualization attributes  Position of daughter volumes  Magnetic field, User limits, Region  Physical volumes of same type can share the common logical volume object.  The pointers to solid must NOT be null.  The pointers to material must NOT be null for tracking geometry.  It is not meant to act as a base class.

Geometry I - M.Asai (SLAC)27 Computing volumes and weights  Geometrical volume of a generic solid or boolean composition can be computed from the solid: G4double GetCubicVolume(); G4double GetCubicVolume();  Exact volume is determinatively calculated for most of CSG solids, while estimation based on Monte Carlo integration is given for other solids.  Overall weight of a geometry setup (sub-geometry) can be computed from the logical volume: G4double GetMass(G4bool forced=false, G4bool propagate=true, G4Material* pMaterial=0); G4double GetMass(G4bool forced=false, G4bool propagate=true, G4Material* pMaterial=0);  The computation may require a considerable amount of time, depending on the complexity of the geometry.  The return value is cached and reused until forced =true.  Daughter volumes will be neglected if propagate =false.