Recent and on-going developments in Kernel Makoto Asai (SLAC) 4 th Geant4 Space Users’ Workshop...
-
date post
21-Dec-2015 -
Category
Documents
-
view
215 -
download
0
Transcript of Recent and on-going developments in Kernel Makoto Asai (SLAC) 4 th Geant4 Space Users’ Workshop...
Recent and on-goingRecent and on-goingdevelopmentsdevelopments
in Kernelin Kernel
Makoto Asai (SLAC)Makoto Asai (SLAC)
44thth Geant4 Space Users’ Geant4 Space Users’ WorkshopWorkshop
November 6November 6thth, 2006, 2006
Recent and on-going developments in kernel - M.Asai (SLAC)Recent and on-going developments in kernel - M.Asai (SLAC) 22
ContentsContents
New features in geometryNew features in geometry
New features in kernel and detector responsesNew features in kernel and detector responses
New Geant4 licenseNew Geant4 license
Planned new features in December releasePlanned new features in December release
Recent and coming releasesRecent and coming releases
Dec 16Dec 16thth, ’05 - Geant4 version 8.0 release, ’05 - Geant4 version 8.0 release
Feb 10Feb 10thth, ’06 - Geant4 8.0-patch01 release, ’06 - Geant4 8.0-patch01 release
June 30June 30thth, ’06 - Geant4 version 8.1 release, ’06 - Geant4 version 8.1 release
July 27July 27thth, ’06 - Geant4 8.1-patch01 release, ’06 - Geant4 8.1-patch01 release
Nov 10Nov 10thth, ’06 - Geant4 8.1-patch02 release (scheduled), ’06 - Geant4 8.1-patch02 release (scheduled)
Dec 15Dec 15thth, ’06 - Geant4 version 8.2 release (scheduled), ’06 - Geant4 version 8.2 release (scheduled)
New features in geometryNew features in geometryNew shapesNew shapes
New overlap checkingNew overlap checkingNested parameterized volumeNested parameterized volume
Tessellated solidTessellated solidGDMLGDML
Recent and on-going developments in kernel - M.Asai (SLAC)Recent and on-going developments in kernel - M.Asai (SLAC) 44
Geometry modeler - 8.0Geometry 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
Recent and on-going developments in kernel - M.Asai (SLAC)Recent and on-going developments in kernel - M.Asai (SLAC) 55
Detection of OverlapsDetection of Overlaps Existing techniques on Existing techniques on constructedconstructed geometry geometry
Grids overlap (built-in UI commands)Grids overlap (built-in UI commands) Uses solids response and trackingUses solids response and tracking
DAVID toolDAVID tool Using polyhedron graphical representationUsing polyhedron graphical representation
OLAP toolOLAP tool Verifying tracking response through raysVerifying tracking response through rays
Recent and on-going developments in kernel - M.Asai (SLAC)Recent and on-going developments in kernel - M.Asai (SLAC) 66
Detection of Overlaps - 2Detection of Overlaps - 2 Check overlaps at construction (since 8.0)Check overlaps at construction (since 8.0)
Applicable to placement and parameterized volumesApplicable to placement and parameterized volumes Applicable for assemblies and reflectionsApplicable for assemblies and reflections Verifies placement of a single volume against the existing Verifies placement of a single volume against the existing
placed volumesplaced volumes Activating a flag in the constructor, orActivating a flag in the constructor, or Using explicit Using explicit CheckOverlaps(int res=1000)CheckOverlaps(int res=1000) method method Generates Generates resres points on surface (1000 as default) points on surface (1000 as default)
Allows for easy checks for misalignmentsAllows for easy checks for misalignments
Recent and on-going developments in kernel - M.Asai (SLAC)Recent and on-going developments in kernel - M.Asai (SLAC) 77
Optional checks at constructionOptional checks at construction Constructors of Constructors of G4PVPlacementG4PVPlacement and and G4PVParameterisedG4PVParameterised have an have an
optional argument “pSurfChk”.optional argument “pSurfChk”.
G4PVPlacement(G4RotationMatrix* pRot,G4PVPlacement(G4RotationMatrix* pRot,const G4ThreeVector &tlate, const G4ThreeVector &tlate, G4LogicalVolume *pDaughterLogical, G4LogicalVolume *pDaughterLogical, const G4String &pName, const G4String &pName, G4LogicalVolume *pMotherLogical, G4LogicalVolume *pMotherLogical, G4bool pMany, G4int pCopyNo, G4bool pMany, G4int pCopyNo, G4bool pSurfChk=falseG4bool pSurfChk=false); );
If this flag is true, overlap check is done at the construction.If this flag is true, overlap check is done at the construction. Some number of points (default 1000) are randomly sampled on Some number of points (default 1000) are randomly sampled on
the surface of creating volume.the surface of creating volume. Each of these points are examinedEach of these points are examined
If it is outside of the mother volume, orIf it is outside of the mother volume, or If it is inside of already existing other volumes in the same If it is inside of already existing other volumes in the same
mother volume.mother volume. This check requires lots of CPU time, but it is worth to try at least once This check requires lots of CPU time, but it is worth to try at least once
when you implement your geometry of some complexity.when you implement your geometry of some complexity.
Recent and on-going developments in kernel - M.Asai (SLAC)Recent and on-going developments in kernel - M.Asai (SLAC) 88
Geometry modeler - 8.1Geometry modeler - 8.1 Extensions to G4AssemblyVolumeExtensions to G4AssemblyVolume
To support assemblies of assembliesTo support assemblies of assemblies To support reflected volumesTo support reflected volumes To allow for overlaps check at construction also for To allow for overlaps check at construction also for
reflectionsreflections To allow for access to constituent volumes To allow for access to constituent volumes
Nested parameterized volumes Special construction for multi-dimensional
parameterizations First implementation of tessellated solidsFirst implementation of tessellated solids
Volumes defined by triangular or Volumes defined by triangular or quadrangular facetsquadrangular facets
Allowing import/export of shapesAllowing import/export of shapeswith CAD systemwith CAD system
Recent and on-going developments in kernel - M.Asai (SLAC)Recent and on-going developments in kernel - M.Asai (SLAC) 99
Tessellated solidsTessellated solids G4TessellatedSolidG4TessellatedSolid (since 8.1) (since 8.1)
Generic solid defined by a number of facets (Generic solid defined by a number of facets (G4VFacetG4VFacet)) Facets can be triangular (Facets can be triangular (G4TriangularFacetG4TriangularFacet) or ) or
quadrangular (quadrangular (G4QuadrangularFacetG4QuadrangularFacet) ) Constructs especially important for conversion of complex Constructs especially important for conversion of complex
geometrical shapes imported from CAD systemsgeometrical shapes imported from CAD systems But can also be explicitly defined:But can also be explicitly defined:
By providing the vertices of the facets in By providing the vertices of the facets in anti-clock wiseanti-clock wise order, in order, in absoluteabsolute or or relativerelative reference frame reference frame
GDML bindingGDML binding
A CAD imported assemblywith tessellated solids - release 8.1
Recent and on-going developments in kernel - M.Asai (SLAC)Recent and on-going developments in kernel - M.Asai (SLAC) 1111
GDML - MotivationGDML - Motivation
initially developed as an alternative geometry description format for initially developed as an alternative geometry description format for Geant4Geant4 to move away from hard-coded geometryto move away from hard-coded geometry
to allow flexible geometry configuration without the need to to allow flexible geometry configuration without the need to recompilerecompile
now, playing also an important role of geometry interchange formatnow, playing also an important role of geometry interchange format application independentapplication independent
same GDML file can be used by several applicationsame GDML file can be used by several application possibility to export geometries from experiment-specific possibility to export geometries from experiment-specific
frameworksframeworks allows physics validation/comparison, visualization, debuggingallows physics validation/comparison, visualization, debugging
Recent and on-going developments in kernel - M.Asai (SLAC)Recent and on-going developments in kernel - M.Asai (SLAC) 1212
GDML componentsGDML components GDML is defined through XML Schema (XSD) GDML is defined through XML Schema (XSD)
XSD = XML based alternative to XSD = XML based alternative to Document Type Definition (DTD) Document Type Definition (DTD)
defines document structure and the list of defines document structure and the list of legal elementslegal elements
XSD are in XML -> they are extensibleXSD are in XML -> they are extensible
GDML can be written by hand or generated GDML can be written by hand or generated automatically automatically 'GDML writer' allows writing-out GDML file'GDML writer' allows writing-out GDML file
GDML needs 'reader'GDML needs 'reader' 'GDML reader' creates 'in-memory' 'GDML reader' creates 'in-memory'
representation of the geometry representation of the geometry descriptiondescription
GDMLSchema
GDML file
user application (1)
GDML writer
GDML reader
user application (2)
Recent and on-going developments in kernel - M.Asai (SLAC)Recent and on-going developments in kernel - M.Asai (SLAC) 1313
GDML Geant4 bindingGDML Geant4 binding package available from package available from www.cern.ch/gdmlwww.cern.ch/gdml
latest release GDML_2_8_0 tested with G4.8.1.p01latest release GDML_2_8_0 tested with G4.8.1.p01 autoconf/make based build systemautoconf/make based build system requires XercesC parser (tested with versions 2.3.0 and requires XercesC parser (tested with versions 2.3.0 and
2.7.0)2.7.0) could be (in the future) integrated more with G4 distributioncould be (in the future) integrated more with G4 distribution
optional package to be linked against during buildoptional package to be linked against during build GDMLDetectorConstruction class providedGDMLDetectorConstruction class provided geometry exportation in GDML steered by UI command?geometry exportation in GDML steered by UI command?
Recent and on-going developments in kernel - M.Asai (SLAC)Recent and on-going developments in kernel - M.Asai (SLAC) 1414
Modular geometry filesModular geometry files support for modular support for modular
GDML geometriesGDML geometries several standalone several standalone
GDML files can now GDML files can now be combined be combined together within together within another 'top level' another 'top level' GDML fileGDML file
GDML writer can now GDML writer can now split geometry in split geometry in modulesmodules
LHCb
HCal Ecal Muon ...
Module1 Module2 ...
NEW
Recent and on-going developments in kernel - M.Asai (SLAC)Recent and on-going developments in kernel - M.Asai (SLAC) 1515
CAD(STEP) -> GDML converterCAD(STEP) -> GDML converter
ST - ViewerAn interactive tool for viewing
3D CAD information
STEP filesST – Viewer uses an internalfile format (.geom & .tree)
to store geometry info
STEPGDMLLibrary functions created
to convert STEP filesinto 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
Recent and on-going developments in kernel - M.Asai (SLAC)Recent and on-going developments in kernel - M.Asai (SLAC) 1616
CMS detector: G4->GDML->ROOTCMS detector: G4->GDML->ROOT
snapshot provided by R.Maunder
thanks to Pedro Arce for help with running CMS
simulation
~19000 physical volumes
Recent and on-going developments in kernel - M.Asai (SLAC)Recent and on-going developments in kernel - M.Asai (SLAC) 1717
LHCb Detector: G4->GDML->ROOTLHCb Detector: G4->GDML->ROOT
snapshot provided by R.Maunder
~5000 physical volumes
Recent and on-going developments in kernel - M.Asai (SLAC)Recent and on-going developments in kernel - M.Asai (SLAC) 1818
Using GDML with Geant4Using GDML with Geant4to write:to write:
#include "WriterG4/G4GDMLWriter.h"#include "WriterG4/G4GDMLWriter.h"
G4GDMLWriter g4writer("GDMLSchema/gdml.xsd", "g4test.gdml");G4GDMLWriter g4writer("GDMLSchema/gdml.xsd", "g4test.gdml");
g4writer.DumpGeometryInfo(g4worldvolume);g4writer.DumpGeometryInfo(g4worldvolume);
to read:to read:
SAXProcessor sxp;SAXProcessor sxp;sxp.Initialize();sxp.Initialize();ProcessingConfigurator config;ProcessingConfigurator config;config.SetURI( "g4test.gdml" );config.SetURI( "g4test.gdml" );sxp.Configure( &config );sxp.Configure( &config );
sxp.Run()sxp.Run()
fWorld = (G4VPhysicalVolume *)fWorld = (G4VPhysicalVolume *)GDMLProcessor::GetInstance()->GetWorldVolume();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
Recent and on-going developments in kernel - M.Asai (SLAC)Recent and on-going developments in kernel - M.Asai (SLAC) 1919
GDML processing - performanceGDML processing - performance GDML G4reader/G4writer (C++) tested on GDML G4reader/G4writer (C++) tested on
complete LHCb and CMS geometriescomplete LHCb and CMS geometries parts of ATLAS geometryparts of ATLAS geometry
problem with full ATLAS geometry - use of custom problem with full ATLAS geometry - use of custom solidssolids
for LHCb geometry for LHCb geometry (~5000 logical volumes)(~5000 logical volumes) writing out ~10 seconds (on P4 2.4GHz)writing out ~10 seconds (on P4 2.4GHz) reading in ~ 5 secondsreading in ~ 5 seconds file size ~2.7 Mb (~40k lines)file size ~2.7 Mb (~40k lines)
for CMS geometry for CMS geometry (~19000 logical volumes)(~19000 logical volumes) writing out ~30 secondswriting out ~30 seconds reading in ~15 secondsreading in ~15 seconds file size ~7.9 Mb (~120k lines)file size ~7.9 Mb (~120k lines)
Recent and on-going developments in kernel - M.Asai (SLAC)Recent and on-going developments in kernel - M.Asai (SLAC) 2020
GDML as primary geometry sourceGDML as primary geometry source Linear Collider - Jeremy McCormick, SLACLinear Collider - Jeremy McCormick, SLAC
Linear Collider Detector Description (LCDD) Linear Collider Detector Description (LCDD) extends GDML with Geant4-specific information extends GDML with Geant4-specific information (sensitive detectors, physics cuts, etc)(sensitive detectors, physics cuts, etc)
GDML/LCDD is generic and flexibleGDML/LCDD is generic and flexible several different full detector design several different full detector design
concepts, including SiD, GLD, and LDC, concepts, including SiD, GLD, and LDC, where simulated using the same applicationwhere simulated using the same application
SiD
GLDLDC
Recent and on-going developments in kernel - M.Asai (SLAC)Recent and on-going developments in kernel - M.Asai (SLAC) 2121
GDML as primary geometry sourceGDML as primary geometry source Space Research - Giovanni Space Research - Giovanni
Santin, ESASantin, ESA all geometry models for all geometry models for
Geant4Geant4 component degradation component degradation
studies (JWST, studies (JWST, ConeXpress,...)ConeXpress,...)
GRAS (Geant4 Radiation GRAS (Geant4 Radiation Analysis for Space)Analysis for Space)
enables flexible geometry enables flexible geometry configuration and changesconfiguration and changes
main candidate for CAD to main candidate for CAD to G4 exchange formatG4 exchange format
ConeXpress
JWST NIRSpec
Recent and on-going developments in kernel - M.Asai (SLAC)Recent and on-going developments in kernel - M.Asai (SLAC) 2222
GDML as primary geometry sourceGDML as primary geometry source Anthropomorphic Phantom Anthropomorphic Phantom
Project - Giorgio Guerrieri, Project - Giorgio Guerrieri, Maria Grazia Pia, Susanna Maria Grazia Pia, Susanna Guatelli, INFNGuatelli, INFN Modelization of the Modelization of the
human body and human body and anatomy for anatomy for radioprotection studiesradioprotection studies
no hard-coded geometry, no hard-coded geometry, flexible configurationflexible configuration
Recent and on-going developments in kernel - M.Asai (SLAC)Recent and on-going developments in kernel - M.Asai (SLAC) 2323
GDML future developmentGDML future development auxiliary information associated to specific auxiliary information associated to specific
volumes sometimes neededvolumes sometimes needed sensitive detector namessensitive detector names visualisation attributesvisualisation attributes magnetic field, etcmagnetic field, etc
added optional (auxiliary) element to volume:added optional (auxiliary) element to volume:volume name="VeloSensors" >volume name="VeloSensors" >
<materialref ref="Silicon" /><materialref ref="Silicon" />
<solidref ref="detectorRUnion" /><solidref ref="detectorRUnion" />
<auxiliary auxtype="sensdet" auxvalue="veloSD"/><auxiliary auxtype="sensdet" auxvalue="veloSD"/>
</volume></volume>
Will be in next GDML release
New features inNew features inkernelkernelandand
detector responsesdetector responses
Material scannerMaterial scanner
ScorersScorers
Detector filtersDetector filters
Recent and on-going developments in kernel - M.Asai (SLAC)Recent and on-going developments in kernel - M.Asai (SLAC) 2525
Material scannerMaterial scanner Measures material thickness in units of geometrical length, radiation Measures material thickness in units of geometrical length, radiation
length and interaction length.length and interaction length.
It can be region sensitive, so that you can measure the thickness It can be region sensitive, so that you can measure the thickness
of one particular region.of one particular region.
/control/matScan/control/matScan
scan - Start material scanning.scan - Start material scanning.
theta - Define theta range.theta - Define theta range.
phi - Define phi range.phi - Define phi range.
singleMeasure - Measure thickness for one particular direction.singleMeasure - Measure thickness for one particular direction.
eyePosition - Define the eye position.eyePosition - Define the eye position.
regionSensitive - Set region sensitivity.regionSensitive - Set region sensitivity.
region - Define region name to be scanned.region - Define region name to be scanned.
Recent and on-going developments in kernel - M.Asai (SLAC)Recent and on-going developments in kernel - M.Asai (SLAC) 2626
Class diagramClass diagramG4LogicalVolume
G4VSensitiveDetector
G4MultiFunctionalDetectoruserSensitiveDetector
G4Event
G4HCofThisEvent
G4VHitsCollectionG4THitsCollection
G4THitsMap
userHitsCollectionor userHitsMap
G4VHit
userHit
G4VPrimitiveSensitivity
Concrete class provided by G4Abstract base class provided by G4Template class provided by G4
User’s class
G4PSDoseScorer hits map
has
kind of
G4PSDoseScorer hits mapG4PSDoseScorer hits map
G4PSDoseScorer hits mapG4PSDoseScorer hits map
0..1
n
1
n
n
n
n
1
Recent and on-going developments in kernel - M.Asai (SLAC)Recent and on-going developments in kernel - M.Asai (SLAC) 2727
G4MultiFunctionalDetectorG4MultiFunctionalDetector G4MultiFunctionalDetectorG4MultiFunctionalDetector is a concrete class derived from is a concrete class derived from
G4VSensitiveDetector. It should be set to a logical volume as a kind of G4VSensitiveDetector. It should be set to a logical volume as a kind of
sensitive detector.sensitive detector.
It takes arbitrary number of It takes arbitrary number of G4VPrimitiveSensitivityG4VPrimitiveSensitivity classes. By classes. By
registering G4VPrimitiveSensitivity classes, you can define the scoring registering G4VPrimitiveSensitivity classes, you can define the scoring
detector of your need.detector of your need.
Each G4VPrimitiveSensitivity class accumulates Each G4VPrimitiveSensitivity class accumulates one physics one physics
quantityquantity for each physical volume. for each physical volume.
For example, G4PSDoseScorer (a concrete class of For example, G4PSDoseScorer (a concrete class of
G4VPrimitiveSensitivity provided by Geant4) accumulates dose for G4VPrimitiveSensitivity provided by Geant4) accumulates dose for
each cell.each cell.
By using G4MultiFunctionalDetector and provided concrete By using G4MultiFunctionalDetector and provided concrete
G4VPrimitiveSensitivity classes, you are freed from implementing G4VPrimitiveSensitivity classes, you are freed from implementing
sensitive detector and hit classes.sensitive detector and hit classes.
Recent and on-going developments in kernel - M.Asai (SLAC)Recent and on-going developments in kernel - M.Asai (SLAC) 2828
Sensitive detector vs. primitive Sensitive detector vs. primitive scorerscorer
Sensitive detectorSensitive detector You have to implement your You have to implement your
own detector and hit classes.own detector and hit classes. One hit class can contain many One hit class can contain many
quantities. A hit can be made quantities. A hit can be made for each individual step, or for each individual step, or accumulate quantities.accumulate quantities.
Basically one hits collection is Basically one hits collection is made per one detector.made per one detector.
Hits collection is relatively Hits collection is relatively compact. compact.
Primitive scorerPrimitive scorer Many scorers are provided by Many scorers are provided by
Geant4. You can add your own.Geant4. You can add your own. Each scorer accumulates one Each scorer accumulates one
quantity for an event. quantity for an event.
G4MultiFunctionalDetector G4MultiFunctionalDetector creates many collections creates many collections (maps), i.e. one collection per (maps), i.e. one collection per one scorer.one scorer.
Keys of maps are redundant for Keys of maps are redundant for scorers of same volume.scorers of same volume.
I would suggest to :I would suggest to : Use primitive scorers Use primitive scorers
if you are if you are notnot interested in recording each individual step interested in recording each individual step butbut accumulating some physics quantities for an event or a run, andaccumulating some physics quantities for an event or a run, and
if you do if you do notnot have to have too many scorers. have to have too many scorers. Otherwise, consider implementing your own sensitive detector.Otherwise, consider implementing your own sensitive detector.
Recent and on-going developments in kernel - M.Asai (SLAC)Recent and on-going developments in kernel - M.Asai (SLAC) 2929
Hits collection, hits mapHits collection, hits map G4G4VVHitsCollection is the common abstract base class of both HitsCollection is the common abstract base class of both
G4THitsCollectionG4THitsCollection and and G4THitsMapG4THitsMap.. G4THitsCollectionG4THitsCollection is a is a template vector classtemplate vector class to store pointers of objects to store pointers of objects
of one concrete hit class type.of one concrete hit class type. A hit class (deliverable of G4VHit abstract base class) should have A hit class (deliverable of G4VHit abstract base class) should have
its own identifier (e.g. cell ID).its own identifier (e.g. cell ID). In other words, G4THitsCollection requires you to implement your hit In other words, G4THitsCollection requires you to implement your hit
class.class. G4THitsMapG4THitsMap is a is a template map classtemplate map class so that it stores keys (typically cell so that it stores keys (typically cell
ID, i.e. copy number of the volume) with pointers of objects of one type.ID, i.e. copy number of the volume) with pointers of objects of one type. Objects may not be those of hit class.Objects may not be those of hit class.
All of currently provided scorer classes use G4THitsMap with All of currently provided scorer classes use G4THitsMap with
simple double.simple double. Since G4THitsMap is a template, it can be used by your sensitive Since G4THitsMap is a template, it can be used by your sensitive
detector class to store hits. detector class to store hits.
Recent and on-going developments in kernel - M.Asai (SLAC)Recent and on-going developments in kernel - M.Asai (SLAC) 3030
List of provided primitive scorersList of provided primitive scorers Concrete Primitive Scorers ( See Application Developers Guide 4.4.6 )Concrete Primitive Scorers ( See Application Developers Guide 4.4.6 )
Track lengthTrack length G4PSTrackLength, G4PSPassageTrackLengthG4PSTrackLength, G4PSPassageTrackLength
Deposited energyDeposited energy G4PSEnergyDepsit, G4PSDoseDepositG4PSEnergyDepsit, G4PSDoseDeposit
Current/FluxCurrent/Flux G4PSFlatSurfaceCurrent, G4PSFlatSurfaceCurrent,
G4PSSphereSurfaceCurrent,G4PSPassageCurrent, G4PSFlatSurfaceFlux, G4PSSphereSurfaceCurrent,G4PSPassageCurrent, G4PSFlatSurfaceFlux, G4PSCellFlux, G4PSPassageCellFluxG4PSCellFlux, G4PSPassageCellFlux
OthersOthers G4PSMinKinEAtGeneration, G4PSNofSecondary, G4PSNofStepG4PSMinKinEAtGeneration, G4PSNofSecondary, G4PSNofStep
angle
V : Volume
L : Total step length in the cell.
SurfaceCurrent SurfaceCurrent ::
Count Count number of number of injecting injecting particles particles at defined at defined surface.surface.
SurfaceFlux :SurfaceFlux :Sum up Sum up 1/cos(angle) of 1/cos(angle) of injecting injecting particlesparticlesat defined at defined surfacesurface
CellFlux :CellFlux :Sum of L / V of Sum of L / V of injecting particles injecting particles in the geometrical in the geometrical cell.cell.
Recent and on-going developments in kernel - M.Asai (SLAC)Recent and on-going developments in kernel - M.Asai (SLAC) 3131
Keys of G4THitsMapKeys of G4THitsMap All provided primitive scorer classes use All provided primitive scorer classes use G4THitsMap<G4double>G4THitsMap<G4double>.. By default, the copy number is taken from the physical volume to which By default, the copy number is taken from the physical volume to which
G4MultiFunctionalDetector is assigned.G4MultiFunctionalDetector is assigned. If the physical volume is placed only once, but its (grand-)mother If the physical volume is placed only once, but its (grand-)mother
volume is replicated, use the second argument of the constructor of the volume is replicated, use the second argument of the constructor of the
primitive scorer to indicate the level where the copy number should be primitive scorer to indicate the level where the copy number should be
taken.taken.
e.g. G4PSCellFlux(G4Steing name, e.g. G4PSCellFlux(G4Steing name, G4int depth=0G4int depth=0))
See See
exampleN07exampleN07
If your indexing scheme is more complicated (e.g. utilizing copy If your indexing scheme is more complicated (e.g. utilizing copy
numbers of more than one hierarchies), you can override the virtual numbers of more than one hierarchies), you can override the virtual
method method GetIndex()GetIndex() provided for all the primitive scorers. provided for all the primitive scorers.
CopyNo0
Copy No0
CopyNo0
Copy No0
CopyNo0
Copy No0
Copy No 0 Copy No 1 Copy No 2
Scorer A
Scorer B
Key should be taken from upper geometry hierarchy
Recent and on-going developments in kernel - M.Asai (SLAC)Recent and on-going developments in kernel - M.Asai (SLAC) 3232
For example…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 !
Recent and on-going developments in kernel - M.Asai (SLAC)Recent and on-going developments in kernel - M.Asai (SLAC) 3333
G4VSDFilterG4VSDFilter 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
G4PSDoseScorerG4PSDoseScorer
G4PSDoseScorerG4PSDoseScorer
G4PSDoseScorer
G4VSDFilter
G4SDParticleFilterG4SDParticleFilter
userFilter
G4SDParticleFilterG4SDParticleFilter
G4SDParticleFilterG4SDParticleFilter
Recent and on-going developments in kernel - M.Asai (SLAC)Recent and on-going developments in kernel - M.Asai (SLAC) 3434
List of provided filter classesList of provided filter classes G4SDChargedFilter, G4SDNeutralFilterG4SDChargedFilter, G4SDNeutralFilter
Accept only charged/neutral tracks, respectivelyAccept only charged/neutral tracks, respectively G4SDKineticEnergyFilterG4SDKineticEnergyFilter
Accepts tracks within the defined range of kinetic energyAccepts tracks within the defined range of kinetic energy G4SDParticleFilterG4SDParticleFilter
Accepts tracks of registered particle typesAccepts tracks of registered particle types G4SDParticleWithEnergyFilterG4SDParticleWithEnergyFilter
Accepts tracks of registered particle types within the defined range Accepts tracks of registered particle types within the defined range of kinetic energyof kinetic energy
G4VSDFilterG4VSDFilter Abstract base class which you can use to make your own filterAbstract base class which you can use to make your own filterclass G4VSDFilter { public: G4VSDFilter(G4String name); virtual ~G4VSDFilter(); public: virtual G4bool Accept(const G4Step*) const = 0;…
Recent and on-going developments in kernel - M.Asai (SLAC)Recent and on-going developments in kernel - M.Asai (SLAC) 3535
For example…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);
}
New Geant4 licenseNew Geant4 license
The New Geant4 License
•Makes clear the user’s Makes clear the user’s wide-ranging freedom to wide-ranging freedom to use, extend or redistribute use, extend or redistribute Geant4, even as part of Geant4, even as part of some for-profit venture.some for-profit venture.
•The license was released The license was released along with the latest along with the latest Geant4 release 8.1.Geant4 release 8.1.
•Simple enough that you Simple enough that you can read and understand can read and understand it.it.
In response to user requests for clarification of Geant4’s In response to user requests for clarification of Geant4’s distribution policy, the collaboration recently announced a new distribution policy, the collaboration recently announced a new license.license.
•http://geant4.web.cern.cn/geant4/license/http://geant4.web.cern.cn/geant4/license/
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 [email protected]. 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.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 1,2 and 3) Tell the world who the software came from, and don’t claim you are us.you are us.
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 4) If you choose to give it away free to everyone, we can have it for free too.free too.
5) You can’t patent the parts we did.5) You can’t patent the parts we did.
The New Geant4 License
6. DISCLAIMERTHIS 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 LIABILITYTHE 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.We don’t claim that it works, and we’re not responsible if it doesn’t.
The New Geant4 License
•Through the generous Through the generous support of many support of many governments and governments and institutions, you, the institutions, you, the community, have already community, have already paid for Geant4.paid for Geant4.
•We, the Geant4 We, the Geant4 collaboration, want you to collaboration, want you to enjoy the software and enjoy the software and use it where ever you can.use it where ever you can.
That’s it.That’s it.
•http://geant4.web.cern.cn/geant4/license/http://geant4.web.cern.cn/geant4/license/
Planned new featuresPlanned new featuresin December releasein December release
Parallel navigationParallel navigation
Recent and on-going developments in kernel - M.Asai (SLAC)Recent and on-going developments in kernel - M.Asai (SLAC) 4343
Parallel navigationParallel navigation Occasionally, it is not straightforward to define sensitivity, importance or Occasionally, it is not straightforward to define sensitivity, importance or
envelope to be assigned to volumes in the mass geometry.envelope to be assigned to volumes in the mass geometry. Typically a geometry built machinery by CAD, GDML, DICOM, etc. has Typically a geometry built machinery by CAD, GDML, DICOM, etc. has
this difficulty.this difficulty. New parallel navigation functionality allows the user to define more than New parallel navigation functionality allows the user to define more than
one worlds simultaneously.one worlds simultaneously. New G4CoupledTransportation process sees all worlds simultaneously.New G4CoupledTransportation process sees all worlds simultaneously.
G4CoupledTransportation will be renamed to G4Transportation G4CoupledTransportation will be renamed to G4Transportation
later.later. A step is limited not only by the boundary of the mass geometry but A step is limited not only by the boundary of the mass geometry but
also by the boundaries of parallel geometries. also by the boundaries of parallel geometries. Materials, production thresholds and EM field are used only from the Materials, production thresholds and EM field are used only from the
mass geometry.mass geometry. In a parallel world, the user can define volumes in arbitrary manner In a parallel world, the user can define volumes in arbitrary manner
with sensitivity, regions with shower parameterization, and/or with sensitivity, regions with shower parameterization, and/or
importance field for biasing. importance field for biasing. Volumes in different worlds may overlap.Volumes in different worlds may overlap.
comingsoon
Recent and on-going developments in kernel - M.Asai (SLAC)Recent and on-going developments in kernel - M.Asai (SLAC) 4444
Parallel navigationParallel navigation In the current version, we have already had several ways of utilizing a 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 concept of parallel world. But the usages are quite different to each
other.other.
Ghost volume for shower parameterization assigned to Ghost volume for shower parameterization assigned to
G4GlobalFastSimulationManagerG4GlobalFastSimulationManager
Readout geometry assigned to G4VSensitiveDetectorReadout geometry assigned to G4VSensitiveDetector
Importance field geometry for geometry importance biasing Importance field geometry for geometry importance biasing
assigned to importance biasing processassigned to importance biasing process
Scoring geometry assigned to scoring processScoring geometry assigned to scoring process
We will merge all of them into common parallel world scheme.We will merge all of them into common parallel world scheme.
Readout geometry for sensitive detector will be kept for backward Readout geometry for sensitive detector will be kept for backward
compatibility.compatibility.
Other current “parallel world schemes” will become obsolete. Other current “parallel world schemes” will become obsolete.
comingsoon
Recent and on-going developments in kernel - M.Asai (SLAC)Recent and on-going developments in kernel - M.Asai (SLAC) 4545
Parallel navigationParallel navigation G4VUserParrallelWorld is the new base class where the user G4VUserParrallelWorld is the new base class where the user
implements a parallel world.implements a parallel world.
The world physical volume of the parallel world is provided by The world physical volume of the parallel world is provided by
G4RunManager as a clone of the mass geometry.G4RunManager as a clone of the mass geometry.
All UserParallelWorlds must be registered to All UserParallelWorlds must be registered to
UserDetectorConstruction.UserDetectorConstruction.
Each parallel world has its dedicated G4Navigator object, that is Each parallel world has its dedicated G4Navigator object, that is
automatically assigned when it is constructed.automatically assigned when it is constructed.
Though all worlds will be comprehensively taken care by Though all worlds will be comprehensively taken care by
G4(Coupled)Transportation process for their navigations, each parallel G4(Coupled)Transportation process for their navigations, each parallel
world must have its own process to achieve its purpose.world must have its own process to achieve its purpose.
For example, in case the user defines a sensitive detector to a For example, in case the user defines a sensitive detector to a
parallel world, a process dedicated to this world is responsible to parallel world, a process dedicated to this world is responsible to
invoke this detector. G4SteppingManager sees only the detectors invoke this detector. G4SteppingManager sees only the detectors
in the mass geometry. We will provide such process classes and in the mass geometry. We will provide such process classes and
some examples.some examples.
comingsoon