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

Slides:



Advertisements
Similar presentations
Geant4 v9.2p02 Speed up Makoto Asai (SLAC) Geant4 Tutorial Course.
Advertisements

Use of G EANT 4 in CMS AIHENP’99 Crete, April 1999 Véronique Lefébure CERN EP/CMC.
Geant4 v9.2p02 Geometry I Makoto Asai (SLAC) Geant4 Tutorial Course.
Makoto Asai (SLAC) Geant4 Tutorial Course
Geant4 v9.2p02 Primary Particle Makoto Asai (SLAC) Geant4 Tutorial Course.
Geant4 v9.4 Geometry II Makoto Asai (SLAC) Geant4 Tutorial Course.
Detector Description Gabriele Cosmo, Geant4 Users’ Workshop Tutorial SLAC February 18-22, 2002.
Geant4 v9.4 Geometry I Makoto Asai (SLAC) Geant4 Tutorial Course.
Makoto Asai (SLAC) Geant4 Tutorial Course
Geometry I Makoto Asai (SLAC) Geant4 Tutorial Course Geant4 v8.2p01.
Geant4 v9.4 Primary Particle Makoto Asai (SLAC) Geant4 Tutorial Course.
Nested Parameterization
Geant4 v9.4 Geometry II Makoto Asai (SLAC) Geant4 Tutorial Course.
Geant4 v9.3p01 Primary Particle Makoto Asai (SLAC) Geant4 Tutorial Course.
Geometry II Makoto Asai (SLAC) Geant4 Tutorial Course Geant4 v8.2p01.
14 Overview of Geant4 Examples 2 nd Finnish Geant4 Workshop 6-7 June 2005 Dennis Wright (SLAC)
Recent and on-going developments in Kernel Makoto Asai (SLAC) 4 th Geant4 Space Users’ Workshop November 6 th, 2006.
Makoto Asai (SLAC) Geant4 Tutorial Course
Some tips for geometries of medical applications Makoto Asai (SLAC)
Witek Pokorski, Radovan Chytracek, Jeremy McCormick, Giovanni Santin
3-D Modeling Concepts V part 2.
V part 2 Obtained from a Guildford County workshop- Summer, 2014.
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
Geant4 Geometry – building your virtual experiment
Detector Description – advanced features The full set of lecture notes of this Geant4 Course is available at
In the G4/ROOT hierarchy there are three conceptual layers: - G4VSolid: shape, size - G4VSolid: shape, size - G4LogicalVolume: material, MF, sensitivity,
Detector Description – Part II Ivana Hrivnacova, IPN Orsay Tatiana Nikitina, CERN Aknowledgement: Slides by: J.Apostolakis, G.Cosmo, A. Lechner.
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.
W. Pokorski - EP/SFT Simulation Project1 GDML - recent developments Witek Pokorski
Detector Description: Basics
17-19 Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan 2007 Geant4 Collaboration.
Unit 6 3D Modeling Concepts
Geometry 4 I.Hrivnacova IPN, Orsay Most slides thanks to M. Asai, SLAC Cours Paris June 2007.
The GeoModel Toolkit for Detector Description Joe Boudreau Vakho Tsulaia University of Pittsburgh CHEP’04 Interlaken.
What is in my contribution area Nick Sinev, University of Oregon.
Detector Description – Part III Ivana Hrivnacova, IPN Orsay Tatiana Nikitina, CERN Aknowledgement: Slides by: J.Apostolakis, G.Cosmo, A. Lechner.
Detector Description: Basics
Geant4 release 5.1 summary Gabriele Cosmo EP/SFT.
Pedro Arce G4WS’10 October 6th, Voxelised geometries intersected with a volume Pedro Arce CIEMAT, Madrid 2010 Geant4 Workshop ESA, 4-8 October 2010.
Descriptive Geometry. Introduction  What is Descriptive Geometry? →It is the study of points, lines, and planes in space to determine their locations.
Maria Grazia Pia, INFN Genova and CERN1 Geant4 highlights of relevance for medical physics applications Maria Grazia Pia INFN Genova and CERN.
Geometry 3 I.Hrivnacova IPN, Orsay Most slides thanks to M. Asai, SLAC Cours Paris June 2007.
GEANT4 Geometry Status & Plans
1 Exercises 0 Go inside the “hadrontherapy” directory: cd hadrontherapy Copy the Hadrontherapy example to your home folder: cp –r $G4INSTALL/examples/advanced/hadrontherapy.
Computer – Aided Design Terminology You must have a generic understanding of commands and techniques which are used in a number of packages (YOU CANNOT.
Lesson Plan: Drafting and Design J6-2. What is 3D solid modeling? How do 3D solid modeling programs work?
3-D Modeling Concepts V part 2.
Muen Policy & Toolchain
Chapter 4 Creating Placed Features
3-D Modeling Concepts V part 2.
Detector Description - Advanced
Geant4 Geometry Speed-ups
A C++ generic model for the GLAST Geometric Description
Detector Description – advanced features
Sketching.
HEP detector description supporting the full experiment life cycle
Detector Description - Advanced
Detector Description – advanced features
Geometry checking tools
3-D Modeling Concepts V part B.
Read-out and detector response
The Hadrontherapy Geant4 advanced example
3-D Modeling Concepts V part 2.
Marc Verderi GEANT4 collaboration meeting 01/10/2002
Based on a presentation of M.Verderi
Presentation transcript:

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

Geometry III - M.Asai (SLAC)2 Contents  Divided volume  Geometry checking tools  Basics of Touchable  Region  GDML

Geometry III - M.Asai (SLAC)3 Physical volume  Various ways of placement  Simple placement volume  Parameterized volume  Replicated volume  Divided volume  Nested-parameterization volume  Reflected volume  Assembly volume  Detail is given in later talk.

Divided volume

Geometry III - M.Asai (SLAC)5 Parameterized Physical Volumes  User should implement a class derived from G4VPVParameterisation abstract base class and define following as a function of copy number  where it is positioned (transformation, rotation)  Optional:  the size of the solid (dimensions)  the type of the solid, material, sensitivity, vis attributes  All daughters must be fully contained in the mother.  Daughters should not overlap to each other.  Limitations:  Applies to simple CSG solids only  Granddaughter volumes allowed only for special cases  Consider parameterised volumes as “leaf” volumes  Typical use-cases  Complex detectors  with large repetition of volumes, regular or irregular  Medical applications  the material in animal tissue is measured as cubes with varying material

Geometry III - M.Asai (SLAC)6 Replicated Volumes  The mother volume is completely filled with replicas, all of which are the same size (width) and shape.  Replication may occur along:  Cartesian axes (X, Y, Z) – slices are considered perpendicular to the axis of replication  Coordinate system at the center of each replica  Radial axis (Rho) – cons/tubs sections centered on the origin and un-rotated  Coordinate system same as the mother  Phi axis (Phi) – phi sections or wedges, of cons/tubs form  Coordinate system rotated such as that the X axis bisects the angle made by each wedge a daughter logical volume to be replicated mother volume

Geometry III - M.Asai (SLAC)7G4PVDivision  G4PVDivision is a special kind of G4PVParameterised.  G4VPVParameterisation is automatically generated according to the parameters given in G4PVDivision.  G4PVDivision is similar to G4PVReplica but  It currently allows gaps in between mother and daughter volumes  We are extending G4PVDivision to allow gaps between daughters, and also gaps on side walls. We plan to release this extension in near future.  Shape of all daughter volumes must be same shape as the mother volume.  G4VSolid (to be assigned to the daughter logical volume) must be the same type, but different object.  Replication must be aligned along one axis.  If your geometry does not have gaps, use G4Replica.  For identical geometry, navigation of G4Replica is faster. mother volume

Geometry III - M.Asai (SLAC)8 nDivisions G4PVDivision - 1 G4PVDivision(const G4String& pName, G4LogicalVolume* pDaughterLogical, G4LogicalVolume* pDaughterLogical, G4LogicalVolume* pMotherLogical, G4LogicalVolume* pMotherLogical, const EAxis pAxis, const EAxis pAxis, const G4int nDivisions, // number of division is given const G4int nDivisions, // number of division is given const G4double offset); const G4double offset);  The size (width) of the daughter volume is calculated as ( (size of mother) - offset ) / nDivisions offset

Geometry III - M.Asai (SLAC)9 G4PVDivision - 2 G4PVDivision(const G4String& pName, G4LogicalVolume* pDaughterLogical, G4LogicalVolume* pDaughterLogical, G4LogicalVolume* pMotherLogical, G4LogicalVolume* pMotherLogical, const EAxis pAxis, const EAxis pAxis, const G4double width, // width of daughter volume is given const G4double width, // width of daughter volume is given const G4double offset); const G4double offset);  The number of daughter volumes is calculated as int( ( (size of mother) - offset ) / width )   As many daughters as width and offset allow offset width

Geometry III - M.Asai (SLAC)10 nDivisions width G4PVDivision - 3 G4PVDivision(const G4String& pName, G4LogicalVolume* pDaughterLogical, G4LogicalVolume* pDaughterLogical, G4LogicalVolume* pMotherLogical, G4LogicalVolume* pMotherLogical, const EAxis pAxis, const EAxis pAxis, const G4int nDivisions, const G4int nDivisions, const G4double width, // both number of division and width are given const G4double width, // both number of division and width are given const G4double offset); const G4double offset);  nDivisions daughters of width thickness offset

Geometry III - M.Asai (SLAC)11G4PVDivision  G4PVDivision currently supports following shapes / axes.  G4Box : kXAxis, kYAxis, kZAxis  G4Tubs : kRho, kPhi, kZAxis  G4Cons : kRho, kPhi, kZAxis  G4Trd : kXAxis, kYAxis, kZAxis  G4Para : kXAxis, kYAxis, kZAxis  G4Polycone : kRho, kPhi, kZAxis  kZAxis - the number of divisions has to be the same as solid sections, (i.e. numZPlanes-1), the width will not be taken into account.  G4Polyhedra : kRho, kPhi, kZAxis  kPhi - the number of divisions has to be the same as solid sides, (i.e. numSides), the width will not be taken into account.  kZAxis - the number of divisions has to be the same as solid sections, (i.e. numZPlanes-1), the width will not be taken into account.  In the case of division along kRho of G4Cons, G4Polycone, G4Polyhedra, if width is provided, it is taken as the width at the -Z radius; the width at other radii will be scaled to this one.

Geometry checking tools

Geometry III - M.Asai (SLAC)13 Debugging geometries  An protruding volume is a contained daughter volume which actually protrudes from its mother volume.  Volumes are also often positioned in a same volume with the intent of not provoking intersections between themselves. When volumes in a common mother actually intersect themselves are defined as overlapping.  Geant4 does not allow for malformed geometries, neither protruding nor overlapping.  The behavior of navigation is unpredictable for such cases.  The problem of detecting overlaps between volumes is bounded by the complexity of the solid models description.  Utilities are provided for detecting wrong positioning  Optional checks at construction  Kernel run-time commands  Graphical tools (DAVID, OLAP) protrudingoverlapping

Geometry III - M.Asai (SLAC)14 Optional checks at construction  Constructors of G4PVPlacement and G4PVParameterised have an optional argument “pSurfChk”. G4PVPlacement(G4RotationMatrix* pRot, const G4ThreeVector &tlate, G4LogicalVolume *pDaughterLogical, const G4String &pName, G4LogicalVolume *pMotherLogical, G4bool pMany, G4int pCopyNo, G4bool pSurfChk=false);  If this flag is true, overlap check is done at the construction.  Some number of points are randomly sampled on the surface of creating volume.  Each of these points are examined  If it is outside of the mother volume, or  If it is inside of already existing other volumes in the same mother volume.  This check requires lots of CPU time, but it is worth to try at least once when you implement your geometry of some complexity.

Geometry III - M.Asai (SLAC)15 Debugging run-time commands  Built-in run-time commands to activate verification tests for the user geometry are defined  to start verification of geometry for overlapping regions based on a standard grid setup, limited to the first depth level geometry/test/run or geometry/test/grid_test  applies the grid test to all depth levels (may require lots of CPU time!) geometry/test/recursive_test  shoots lines according to a cylindrical pattern geometry/test/cylinder_test  to shoot a line along a specified direction and position geometry/test/line_test  to specify position for the line_test geometry/test/position  to specify direction for the line_test geometry/test/direction

Geometry III - M.Asai (SLAC)16 Debugging run-time commands  Example layout: GeomTest: no daughter volume extending outside mother detected. GeomTest Error: Overlapping daughter volumes The volumes Tracker[0] and Overlap[0], The volumes Tracker[0] and Overlap[0], both daughters of volume World[0], both daughters of volume World[0], appear to overlap at the following points in global coordinates: (list truncated) appear to overlap at the following points in global coordinates: (list truncated) length (cm) start position (cm) end position (cm) length (cm) start position (cm) end position (cm) Which in the mother coordinate system are: length (cm) start position (cm) end position (cm) length (cm) start position (cm) end position (cm) Which in the coordinate system of Tracker[0] are: length (cm) start position (cm) end position (cm) length (cm) start position (cm) end position (cm) Which in the coordinate system of Overlap[0] are: length (cm) start position (cm) end position (cm) length (cm) start position (cm) end position (cm)

Geometry III - M.Asai (SLAC)17 Debugging tools: DAVID  DAVID is a graphical debugging tool for detecting potential intersections of volumes  Accuracy of the graphical representation can be tuned to the exact geometrical description.  physical-volume surfaces are automatically decomposed into 3D polygons  intersections of the generated polygons are parsed.  If a polygon intersects with another one, the physical volumes associated to these polygons are highlighted in color (red is the default).  DAVID can be downloaded from the Web as external tool for Geant4 

Geometry III - M.Asai (SLAC)18 Debugging tools: OLAP  Stand-alone batch application  Provided as extended example  Can be combined with a graphical environment and GUI

Geometry III - M.Asai (SLAC)19 Material scanner  Measures material thickness in units of geometrical length, radiation length and interaction length.  It can be region sensitive, so that you can measure the thickness of one particular region.  /control/matScan  scan - Start material scanning.  theta - Define theta range.  phi - Define phi range.  singleMeasure - Measure thickness for one particular direction.  eyePosition - Define the eye position.  regionSensitive - Set region sensitivity.  region - Define region name to be scanned.

Basics of Touchable

Geometry III - M.Asai (SLAC)21Touchable  Suppose a geometry is made of 4x5 voxels.  and it is implemented by two levels of replica.  In reality, there is only one physical volume object for each level. Its position is parameterized by its copy number.  To get the copy number of each level,  Use touchable to get the copy number of each level. CopyNo = 0 CopyNo = 1 CopyNo = 2 CopyNo =  G4VTouchable has a method GetCopyNumber(G4int nLevel=0)  nLevel = 0 : returns the copy number of the bottom level  nLevel = 1 : returns the copy number of the mother volume  nLevel = 2 : returns the copy number of the grandmother volume, etc.  A touchable object is associated with G4StepPoint, i.e. two points for a step.  Details of how to use a touchable will be given at Scoring II talk.

Region

Geometry III - M.Asai (SLAC)23 Region  A region may have its unique  Production thresholds (cuts)  If a region in the mass geometry does not have its own production thresholds, those of the default region are used (i.e., may not be those of the parent region).  User limits  Artificial limits affecting to the tracking, e.g. max step length, max number of steps, min kinetic energy left, etc.  You can set user limits directly to logical volume as well. If both logical volume and associated region have user limits, those of logical volume wins.  User region information  E.g. to implement a fast Boolean method to identify the nature of the region.  Fast simulation manager  Regional user stepping action (new with version 9.0)  Please note :  World logical volume is recognized as the default region. User is not allowed to define a region to the world logical volume.

Geometry III - M.Asai (SLAC)24 World Volume - Default Region Root logical volume  A logical volume can be a region. More than one logical volumes may belong to a region.  A region is a part of the geometrical hierarchy, i.e. a set of geometry volumes, typically of a sub-system.  A logical volume becomes a root logical volume once a region is assigned to it.  All daughter volumes belonging to the root logical volume share the same region, unless a daughter volume itself becomes to another root.  Important restriction :  No logical volume can be shared by more than one regions, regardless of root volume or not. Root logical - Region A Root logical - Region B

Geometry III - M.Asai (SLAC)25 G4Region  A region is instantiated and defined by G4Region* aRegion = new G4Region(“region_name”); aRegion->AddRootLogicalVolume(aLogicalVolume);   Region propagates down to all geometrical hierarchy until the bottom or another root logical volume.  Production thresholds (cuts) can be assigned to a region by G4Region* aRegion = G4RegionStore::GetInstance()->GetRegion = G4RegionStore::GetInstance()->GetRegion(“region_name”); G4ProductionCuts* cuts = new G4ProductionCuts; cuts->SetProductionCut(cutValue); aRegion->SetProductionCuts(cuts);

GDML

Geometry III - M.Asai (SLAC)27 GDML components  GDML is defined through XML Schema (XSD)  XSD = XML based alternative to Document Type Definition (DTD)  defines document structure and the list of legal elements  XSD are in XML -> they are extensible  GDML can be written by hand or generated automatically  'GDML writer' allows writing-out GDML file  GDML needs 'reader'  'GDML reader' creates 'in-memory' representation of the geometry description GDML Schema GDML file user application (1) GDML writer GDML reader user application (2)

Geometry III - M.Asai (SLAC)28 GDML Geant4 binding  package available from  latest release GDML_2_8_0 tested with G4.8.1.p01  autoconf/make based build system  requires XercesC parser (tested with versions and 2.7.0)  could be (in the future) integrated more with G4 distribution  optional package to be linked against during build  GDMLDetectorConstruction class provided  geometry exportation in GDML steered by UI command?

Geometry III - M.Asai (SLAC)29 CMS detector: G4->GDML->ROOT snapshot provided by R.Maunder thanks to Pedro Arce for help with running CMS simulation ~19000 physical volumes

Geometry III - M.Asai (SLAC)30 LHCb Detector: G4->GDML->ROOT snapshot provided by R.Maunder ~5000 physical volumes

Geometry III - M.Asai (SLAC)31 Using GDML with Geant4 to write: #include "WriterG4/G4GDMLWriter.h" G4GDMLWriter g4writer("GDMLSchema/gdml.xsd", "g4test.gdml"); g4writer.DumpGeometryInfo(g4worldvolume); to read: SAXProcessor sxp; sxp.Initialize(); ProcessingConfigurator config; config.SetURI( "g4test.gdml" ); sxp.Configure( &config ); sxp.Run() fWorld = (G4VPhysicalVolume *) GDMLProcessor::GetInstance()->GetWorldVolume(); instantiate GDML writer pass the 'top' volume to the writer instantiate and configure the processor get pointer to 'top' volume GDML example in examples/extended/gdml

Geometry III - M.Asai (SLAC)32 GDML processing - performance  GDML G4reader/G4writer (C++) tested on  complete LHCb and CMS geometries  parts of ATLAS geometry  problem with full ATLAS geometry - use of custom solids  for LHCb geometry (~5000 logical volumes)  writing out ~10 seconds (on P4 2.4GHz)  reading in ~ 5 seconds  file size ~2.7 Mb (~40k lines)  for CMS geometry (~19000 logical volumes)  writing out ~30 seconds  reading in ~15 seconds  file size ~7.9 Mb (~120k lines)

Geometry III - M.Asai (SLAC)33 GDML as primary geometry source  Linear Collider - Jeremy McCormick, SLAC  Linear Collider Detector Description (LCDD) extends GDML with Geant4-specific information (sensitive detectors, physics cuts, etc)  GDML/LCDD is generic and flexible  several different full detector design concepts, including SiD, GLD, and LDC, where simulated using the same application SiD GLD LDC

Geometry III - M.Asai (SLAC)34 GDML as primary geometry source  Space Research - Giovanni Santin, ESA  all geometry models for Geant4  component degradation studies (JWST, ConeXpress,...)  GRAS (Geant4 Radiation Analysis for Space)  enables flexible geometry configuration and changes  main candidate for CAD to G4 exchange format ConeXpress JWST NIRSpec

Geometry III - M.Asai (SLAC)35 GDML as primary geometry source  Anthropomorphic Phantom Project - Giorgio Guerrieri, Maria Grazia Pia, Susanna Guatelli, INFN  Modelization of the human body and anatomy for radioprotection studies  no hard-coded geometry, flexible configuration