Presentation is loading. Please wait.

Presentation is loading. Please wait.

Recent and on-going developments in Kernel Makoto Asai (SLAC) 4 th Geant4 Space Users’ Workshop November 6 th, 2006.

Similar presentations


Presentation on theme: "Recent and on-going developments in Kernel Makoto Asai (SLAC) 4 th Geant4 Space Users’ Workshop November 6 th, 2006."— Presentation transcript:

1 Recent and on-going developments in Kernel Makoto Asai (SLAC) 4 th Geant4 Space Users’ Workshop November 6 th, 2006

2 Recent and on-going developments in kernel - M.Asai (SLAC)2  Contents  New features in geometry  New features in kernel and detector responses  New Geant4 license  Planned new features in December release  Recent and coming releases  Dec 16 th, ’05 - Geant4 version 8.0 release  Feb 10 th, ’06 - Geant4 8.0-patch01 release  June 30 th, ’06 - Geant4 version 8.1 release  July 27 th, ’06 - Geant4 8.1-patch01 release  Nov 10 th, ’06 - Geant4 8.1-patch02 release (scheduled)  Dec 15 th, ’06 - Geant4 version 8.2 release (scheduled)

3 New features in geometry New shapes New overlap checking Nested parameterized volume Tessellated solid GDML

4 Recent and on-going developments in kernel - M.Asai (SLAC)4 Geometry modeler - 8.0   New shapes:   Ellipsoid, elliptical cone, tetrahedra   Generation of random points on surfaces   For all combination of solids, including Boolean operations   Detection of overlaps at placement/construction of volumes   Activated optionally in the constructor or on-demand afterwards

5 Recent and on-going developments in kernel - M.Asai (SLAC)5 Detection of Overlaps  Existing techniques on constructed geometry  Grids overlap (built-in UI commands)  Uses solids response and tracking  DAVID tool  Using polyhedron graphical representation  OLAP tool  Verifying tracking response through rays

6 Recent and on-going developments in kernel - M.Asai (SLAC)6 Detection of Overlaps - 2  Check overlaps at construction (since 8.0)  Applicable to placement and parameterized volumes  Applicable for assemblies and reflections  Verifies placement of a single volume against the existing placed volumes  Activating a flag in the constructor, or  Using explicit CheckOverlaps(int res=1000) method  Generates res points on surface (1000 as default)  Allows for easy checks for misalignments

7 Recent and on-going developments in kernel - M.Asai (SLAC)7 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 (default 1000) 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.

8 Recent and on-going developments in kernel - M.Asai (SLAC)8 Geometry modeler - 8.1  Extensions to G4AssemblyVolume  To support assemblies of assemblies  To support reflected volumes  To allow for overlaps check at construction also for reflections  To allow for access to constituent volumes   Nested parameterized volumes   Special construction for multi-dimensional parameterizations  First implementation of tessellated solids  Volumes defined by triangular or quadrangular facets  Allowing import/export of shapes with CAD system

9 Recent and on-going developments in kernel - M.Asai (SLAC)9 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

10 A CAD imported assembly with tessellated solids - release 8.1

11 Recent and on-going developments in kernel - M.Asai (SLAC)11 GDML - Motivation  initially developed as an alternative geometry description format for Geant4  to move away from hard-coded geometry  to allow flexible geometry configuration without the need to recompile  now, playing also an important role of geometry interchange format  application independent  same GDML file can be used by several application  possibility to export geometries from experiment-specific frameworks  allows physics validation/comparison, visualization, debugging

12 Recent and on-going developments in kernel - M.Asai (SLAC)12 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)

13 Recent and on-going developments in kernel - M.Asai (SLAC)13 GDML Geant4 binding  package available from www.cern.ch/gdml www.cern.ch/gdml  latest release GDML_2_8_0 tested with G4.8.1.p01  autoconf/make based build system  requires XercesC parser (tested with versions 2.3.0 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?

14 Recent and on-going developments in kernel - M.Asai (SLAC)14 Modular geometry files  support for modular GDML geometries  several standalone GDML files can now be combined together within another 'top level' GDML file  GDML writer can now split geometry in modules LHCb HCalEcalMuon... Module1Module2... NEW

15 Recent and on-going developments in kernel - M.Asai (SLAC)15 CAD(STEP) -> GDML converter ST - Viewer An interactive tool for viewing 3D CAD information STEP files ST – Viewer uses an internal file format (.geom &.tree) to store geometry info STEPGDML Library functions created to convert STEP files into GDML files GDML Output File Equivalent to the original STEP file Contains only tessellated solids 'first order' approach to use CAD geometries for Geant4 simulation NEW

16 Recent and on-going developments in kernel - M.Asai (SLAC)16 CMS detector: G4->GDML->ROOT snapshot provided by R.Maunder thanks to Pedro Arce for help with running CMS simulation ~19000 physical volumes

17 Recent and on-going developments in kernel - M.Asai (SLAC)17 LHCb Detector: G4->GDML->ROOT snapshot provided by R.Maunder ~5000 physical volumes

18 Recent and on-going developments in kernel - M.Asai (SLAC)18 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

19 Recent and on-going developments in kernel - M.Asai (SLAC)19 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)

20 Recent and on-going developments in kernel - M.Asai (SLAC)20 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

21 Recent and on-going developments in kernel - M.Asai (SLAC)21 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

22 Recent and on-going developments in kernel - M.Asai (SLAC)22 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

23 Recent and on-going developments in kernel - M.Asai (SLAC)23 GDML future development  auxiliary information associated to specific volumes sometimes needed  sensitive detector names  visualisation attributes  magnetic field, etc  added optional (auxiliary) element to volume: volume name="VeloSensors" > </volume> Will be in next GDML release

24 New features in kernel and detector responses Material scanner Scorers Detector filters

25 Recent and on-going developments in kernel - M.Asai (SLAC)25 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.

26 Recent and on-going developments in kernel - M.Asai (SLAC)26 Class diagram G4LogicalVolume G4VSensitiveDetector G4MultiFunctionalDetector userSensitiveDetector G4Event G4HCofThisEvent G4VHitsCollection G4THitsCollection G4THitsMap userHitsCollection or userHitsMap G4VHit userHit G4VPrimitiveSensitivity Concrete class provided by G4 Abstract base class provided by G4 Template class provided by G4 User’s class G4PSDoseScorerhits map has kind of G4PSDoseScorerhits mapG4PSDoseScorerhits mapG4PSDoseScorerhits mapG4PSDoseScorerhits map 0..1 n 1 n n n n 1

27 Recent and on-going developments in kernel - M.Asai (SLAC)27 G4MultiFunctionalDetector  G4MultiFunctionalDetector is a concrete class derived from G4VSensitiveDetector. It should be set to a logical volume as a kind of sensitive detector.  It takes arbitrary number of G4VPrimitiveSensitivity classes. By registering G4VPrimitiveSensitivity classes, you can define the scoring detector of your need.  Each G4VPrimitiveSensitivity class accumulates one physics quantity for each physical volume.  For example, G4PSDoseScorer (a concrete class of G4VPrimitiveSensitivity provided by Geant4) accumulates dose for each cell.  By using G4MultiFunctionalDetector and provided concrete G4VPrimitiveSensitivity classes, you are freed from implementing sensitive detector and hit classes.

28 Recent and on-going developments in kernel - M.Asai (SLAC)28 Sensitive detector vs. primitive scorer Sensitive detector  You have to implement your own detector and hit classes.  One hit class can contain many quantities. A hit can be made for each individual step, or accumulate quantities.  Basically one hits collection is made per one detector.  Hits collection is relatively compact. Primitive scorer  Many scorers are provided by Geant4. You can add your own.  Each scorer accumulates one quantity for an event.  G4MultiFunctionalDetector creates many collections (maps), i.e. one collection per one scorer.  Keys of maps are redundant for scorers of same volume. I would suggest to :  Use primitive scorers  if you are not interested in recording each individual step but accumulating some physics quantities for an event or a run, and  if you do not have to have too many scorers.  Otherwise, consider implementing your own sensitive detector.

29 Recent and on-going developments in kernel - M.Asai (SLAC)29 Hits collection, hits map  G4VHitsCollection is the common abstract base class of both G4THitsCollection and G4THitsMap.  G4THitsCollection is a template vector class to store pointers of objects of one concrete hit class type.  A hit class (deliverable of G4VHit abstract base class) should have its own identifier (e.g. cell ID).  In other words, G4THitsCollection requires you to implement your hit class.  G4THitsMap is a template map class so that it stores keys (typically cell ID, i.e. copy number of the volume) with pointers of objects of one type.  Objects may not be those of hit class.  All of currently provided scorer classes use G4THitsMap with simple double.  Since G4THitsMap is a template, it can be used by your sensitive detector class to store hits.

30 Recent and on-going developments in kernel - M.Asai (SLAC)30 List of provided primitive scorers  Concrete Primitive Scorers ( See Application Developers Guide 4.4.6 )  Track length  G4PSTrackLength, G4PSPassageTrackLength  Deposited energy  G4PSEnergyDepsit, G4PSDoseDeposit  Current/Flux  G4PSFlatSurfaceCurrent, G4PSSphereSurfaceCurrent,G4PSPassageCurrent, G4PSFlatSurfaceFlux, G4PSCellFlux, G4PSPassageCellFlux  Others  G4PSMinKinEAtGeneration, G4PSNofSecondary, G4PSNofStep angle V : Volume L : Total step length in the cell. SurfaceCurrent : Count number of injecting particles at defined surface. SurfaceFlux : Sum up 1/cos(angle) of injecting particles at defined surface CellFlux : Sum of L / V of injecting particles in the geometrical cell.

31 Recent and on-going developments in kernel - M.Asai (SLAC)31 Keys of G4THitsMap  All provided primitive scorer classes use G4THitsMap.  By default, the copy number is taken from the physical volume to which G4MultiFunctionalDetector is assigned.  If the physical volume is placed only once, but its (grand-)mother volume is replicated, use the second argument of the constructor of the primitive scorer to indicate the level where the copy number should be taken. e.g. G4PSCellFlux(G4Steing name, G4int depth=0) See exampleN07  If your indexing scheme is more complicated (e.g. utilizing copy numbers of more than one hierarchies), you can override the virtual method GetIndex() provided for all the primitive scorers. CopyNo 0 Copy No 0 CopyNo 0 Copy No 0 CopyNo 0 Copy No 0 Copy No 0 Copy No 1Copy No 2 Scorer A Scorer B Key should be taken from upper geometry hierarchy

32 Recent and on-going developments in kernel - M.Asai (SLAC)32 For example… MyDetectorConstruction::Construct() { … G4LogicalVolume* myCellLog = new G4LogicalVolume(…); G4VPhysicalVolume* myCellPhys = new G4PVParametrised(…); G4MultiFunctionalDetector* myScorer = new G4MultiFunctionalDetector(“myCellScorer”); G4SDManager::GetSDMpointer()->AddNewDetector(myScorer); myCellLog->SetSensitiveDetector(myScorer); G4VPrimitiveSensitivity* totalSurfFlux = new G4PSFlatSurfaceFlux(“TotalSurfFlux”); myScorer->Register(totalSurfFlux); G4VPrimitiveSensitivity* totalDose = new G4PSDoseDeposit(“TotalDose”); myScorer->Register(totalDose); } No need of implementing sensitive detector !

33 Recent and on-going developments in kernel - M.Asai (SLAC)33 G4VSDFilter   G4VSDFilter can be attached to G4VSensitiveDetector and/or G4VPrimitiveSensitivity to define which kinds of tracks are to be scored.   E.g., surface flux of protons can be scored by G4PSFlatSurfaceFlux with a filter that accepts protons only. G4VSensitiveDetector G4MultiFunctionalDetectoruserSensitiveDetector G4VPrimitiveSensitivity G4PSDoseScorer G4VSDFilter G4SDParticleFilter userFilter G4SDParticleFilter

34 Recent and on-going developments in kernel - M.Asai (SLAC)34 List of provided filter classes  G4SDChargedFilter, G4SDNeutralFilter  Accept only charged/neutral tracks, respectively  G4SDKineticEnergyFilter  Accepts tracks within the defined range of kinetic energy  G4SDParticleFilter  Accepts tracks of registered particle types  G4SDParticleWithEnergyFilter  Accepts tracks of registered particle types within the defined range of kinetic energy  G4VSDFilter  Abstract base class which you can use to make your own filter class G4VSDFilter { public: G4VSDFilter(G4String name); virtual ~G4VSDFilter(); public: virtual G4bool Accept(const G4Step*) const = 0; …

35 Recent and on-going developments in kernel - M.Asai (SLAC)35 For example… MyDetectorConstruction::Construct() { … G4LogicalVolume* myCellLog = new G4LogicalVolume(…); G4VPhysicalVolume* myCellPhys = new G4PVParametrised(…); G4MultiFunctionalDetector* myScorer = new G4MultiFunctionalDetector(“myCellScorer”); G4SDManager::GetSDMpointer()->AddNewDetector(myScorer); myCellLog->SetSensitiveDetector(myScorer); G4VPrimitiveSensitivity* totalSurfFlux = new G4PSFlatSurfaceFlux(“TotalSurfFlux”); myScorer->Register(totalSurfFlux); G4VPrimitiveSensitivity* protonSufFlux = new G4PSFlatSurfaceFlux(“ProtonSurfFlux”); G4VSDFilter* protonFilter = new G4SDParticleFilter(“protonFilter”); protonFilter->Add(“proton”); protonSurfFlux->SetFilter(protonFilter); myScorer->Register(protonSurfFlux); }

36 New Geant4 license

37 The New Geant4 License Makes clear the user ’ s wide- ranging freedom to use, extend or redistribute Geant4, even as part of some for- profit venture. Makes clear the user ’ s wide- ranging freedom to use, extend or redistribute Geant4, even as part of some for- profit venture. The license was released along with the latest Geant4 release 8.1. The license was released along with the latest Geant4 release 8.1. Simple enough that you can read and understand it. Simple enough that you can read and understand it. In response to user requests for clarification of Geant4 ’ s distribution policy, the collaboration recently announced a new license. http://geant4.web.cern.cn/geant4/license/ http://geant4.web.cern.cn/geant4/license/ http://geant4.web.cern.cn/geant4/license/

38 The New Geant4 License Installation, use, reproduction, display, modification and redistribution of this software, with or without modification, in source and binary forms, are permitted on a non- exclusive basis. Any exercise of rights by you under this license is subject to the following conditions: 1. Redistributions of this software, in whole or in part, with or without modification, must reproduce the above copyright notice and these license conditions in this software, the user documentation and any other materials provided with the redistributed software. 2. The user documentation, if any, included with a redistribution, must include the following notice: "This product includes software developed by Members of the Geant4 Collaboration ( http://cern.ch/geant4 )." If that is where third-party acknowledgments normally appear, this acknowledgment must be reproduced in the modified version of this software itself. 3. The names "Geant4” and “The Geant4 toolkit” may not be used to endorse or promote software, or products derived therefrom, except with prior written permission by license@geant4.org. If this software is redistributed in modified form, the name and reference of the modified version must be clearly distinguishable from that of this software. License has 8 points. The points are written clearly and simply. 1,2 and 3) Tell the world who the software came from, and don ’ t claim you are us.

39 The New Geant4 License 4. You are under no obligation to provide anyone with any modifications of this software that you may develop, including but not limited to bug fixes, patches, upgrades or other enhancements or derivatives of the features, functionality or performance of this software. However, if you publish or distribute your modifications without contemporaneously requiring users to enter into a separate written license agreement, then you are deemed to have granted all Members and all Copyright Holders of the Geant4 Collaboration a license to your modifications, including modifications protected by any patent owned by you, under the conditions of this license. 5. You may not include this software in whole or in part in any patent or patent application in respect of any modification of this software developed by you. 4) If you choose to give it away free to everyone, we can have it for free too. 5) You can ’ t patent the parts we did.

40 The New Geant4 License 6. DISCLAIMER THIS SOFTWARE IS PROVIDED BY THE MEMBERS AND COPYRIGHT HOLDERS OF THE GEANT4 COLLABORATION AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY, OF SATISFACTORY QUALITY, AND FITNESS FOR A PARTICULAR PURPOSE OR USE ARE DISCLAIMED. THE MEMBERS OF THE GEANT4 COLLABORATION AND CONTRIBUTORS MAKE NO REPRESENTATION THAT THE SOFTWARE AND MODIFICATIONS THEREOF, WILL NOT INFRINGE ANY PATENT, COPYRIGHT, TRADE SECRET OR OTHER PROPRIETARY RIGHT. 7. LIMITATION OF LIABILITY THE MEMBERS AND COPYRIGHT HOLDERS OF THE GEANT4 COLLABORATION AND CONTRIBUTORS SHALL HAVE NO LIABILITY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, CONSEQUENTIAL, EXEMPLARY, OR PUNITIVE DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, LOSS OF USE, DATA OR PROFITS, OR BUSINESS INTERRUPTION, HOWEVER CAUSED AND ON ANY THEORY OF CONTRACT, WARRANTY, TORT (INCLUDING NEGLIGENCE), PRODUCT LIABILITY OR OTHERWISE, ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 8. This license shall terminate with immediate effect and without notice if you fail to comply with any of the terms of this license, or if you institute litigation against any Member or Copyright Holder of the Geant4 Collaboration with regard to this software. We don ’ t claim that it works, and we ’ re not responsible if it doesn ’ t.

41 The New Geant4 License Through the generous support of many governments and institutions, you, the community, have already paid for Geant4. Through the generous support of many governments and institutions, you, the community, have already paid for Geant4. We, the Geant4 collaboration, want you to enjoy the software and use it where ever you can. We, the Geant4 collaboration, want you to enjoy the software and use it where ever you can. That ’ s it. http://geant4.web.cern.cn/geant4/license/ http://geant4.web.cern.cn/geant4/license/ http://geant4.web.cern.cn/geant4/license/

42 Planned new features in December release Parallel navigation

43 Recent and on-going developments in kernel - M.Asai (SLAC)43 Parallel navigation  Occasionally, it is not straightforward to define sensitivity, importance or envelope to be assigned to volumes in the mass geometry.  Typically a geometry built machinery by CAD, GDML, DICOM, etc. has this difficulty.  New parallel navigation functionality allows the user to define more than one worlds simultaneously.  New G4CoupledTransportation process sees all worlds simultaneously.  G4CoupledTransportation will be renamed to G4Transportation later.  A step is limited not only by the boundary of the mass geometry but also by the boundaries of parallel geometries.  Materials, production thresholds and EM field are used only from the mass geometry.  In a parallel world, the user can define volumes in arbitrary manner with sensitivity, regions with shower parameterization, and/or importance field for biasing.  Volumes in different worlds may overlap. coming soon

44 Recent and on-going developments in kernel - M.Asai (SLAC)44 Parallel navigation  In the current version, we have already had several ways of utilizing a concept of parallel world. But the usages are quite different to each other.  Ghost volume for shower parameterization assigned to G4GlobalFastSimulationManager  Readout geometry assigned to G4VSensitiveDetector  Importance field geometry for geometry importance biasing assigned to importance biasing process  Scoring geometry assigned to scoring process  We will merge all of them into common parallel world scheme.  Readout geometry for sensitive detector will be kept for backward compatibility.  Other current “parallel world schemes” will become obsolete. coming soon

45 Recent and on-going developments in kernel - M.Asai (SLAC)45 Parallel navigation  G4VUserParrallelWorld is the new base class where the user implements a parallel world.  The world physical volume of the parallel world is provided by G4RunManager as a clone of the mass geometry.  All UserParallelWorlds must be registered to UserDetectorConstruction.  Each parallel world has its dedicated G4Navigator object, that is automatically assigned when it is constructed.  Though all worlds will be comprehensively taken care by G4(Coupled)Transportation process for their navigations, each parallel world must have its own process to achieve its purpose.  For example, in case the user defines a sensitive detector to a parallel world, a process dedicated to this world is responsible to invoke this detector. G4SteppingManager sees only the detectors in the mass geometry. We will provide such process classes and some examples. coming soon


Download ppt "Recent and on-going developments in Kernel Makoto Asai (SLAC) 4 th Geant4 Space Users’ Workshop November 6 th, 2006."

Similar presentations


Ads by Google