Other GEANT4 capabilities Event biasing Parameterisation (fast simulation) Scoring Persistency Parallelisation and integration in a distributed computing.

Slides:



Advertisements
Similar presentations
Lectures 6&7: Variance Reduction Techniques
Advertisements

Geant4 v9.2p02 Speed up Makoto Asai (SLAC) Geant4 Tutorial Course.
Other GEANT4 capabilities Event biasing Parameterisation (fast simulation) Persistency Parallelisation and integration in a distributed computing environment.
Geant4 v9.2p02 Scoring I Makoto Asai (SLAC) Geant4 Tutorial Course.
Scoring I Makoto Asai (SLAC) Geant4 Tutorial Course Geant4 v8.2p01.
2006/11/10 Pasadena GEANT4-SPENVIS, Tsukasa Aso, TNCMT 1 Scorer and Sensitive Detector Filter Tsukasa Aso Toyama National College of Maritime Technology,
Makoto Asai (SLAC) Geant4 Users SLAC Feb. 18 th, 2002 Getting Started.
Improvements of sampling and scoring ( User Requirements: Scoring for event biasing options) Tsukasa Aso, Toyama National College of Maritime Technology,
Cross Section Biasing & Path Length Biasing Jane Tinslay, SLAC March 2007.
14 User Documents and Examples I SLAC Geant4 Tutorial 3 November 2009 Dennis Wright Geant4 V9.2.p02.
Alex Howard - Event Biasing Mini-Workshop - SLAC Geometrical Event biasing and Variance Reduction – Talk 2 Alex Howard, CERN Event Biasing Mini-Workshop,
Makoto Asai (SLAC) Geant4 Users SLAC Feb. 18 th, 2002 Getting Started.
Highlights of latest developments ESA/ESTEC Makoto Asai (SLAC)
Makoto Asai (SLAC) Geant4 Users SLAC Feb. 20th, 2002 Stack management, Digitization and Pile-up.
Geant4 Event Biasing Jane Tinslay, SLAC May 2007, Geant4 v8.2.p01.
J. Tinslay 1, B. Faddegon 2, J. Perl 1 and M. Asai 1 (1) Stanford Linear Accelerator Center, Menlo Park, CA, (2) UC San Francisco, San Francisco, CA Verification.
1 Work Plan/Summary I By 25 th May 2007… Class clean-up – biasing and scoring… What to remove? (for v9.0) –Biasing VScorer and associated classes (in transportation.
Makoto Asai (SLAC) Geant4 Tutorial Course
Geant4 v9.3 Scoring II Makoto Asai (SLAC) Geant4 Tutorial Course.
P HI T S Advanced Lecture (II): variance reduction techniques to improve efficiency of calculation Multi-Purpose Particle and Heavy Ion Transport code.
Makoto Asai (SLAC) Geant4 Users CERN Nov. 13th, 2002 Stack management, Digitization and Pile-up.
Alex Howard, CERN - Event Biasing Overview – Hebden Bridge 12 th September Event biasing – An Overview Alex Howard, CERN Event Biasing Overview.
Variance reduction A primer on simplest techniques.
17-19 Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan 2007 Geant4 Japan.
Evaluation of G4 Releases in CMS (Sub-detector Studies) Software used Electrons in Tracker Photons in the Electromagnetic Calorimeter Pions in the Calorimeter.
Gamma calorimeter for R3B: first simulation results INDEX ● The calGamma Geant4 simulation ( a short introduction ) ● Crystal and geometry selection: –
R 3 B Gamma Calorimeter Agenda. ● Introduction ● Short presentation on the first ● Task definition for R&D period ( )
User Documents and Examples I Sébastien Incerti Slides thanks to Dennis Wrigth, SLAC.
Implementing a dual readout calorimeter in SLIC and testing Geant4 Physics Hans Wenzel Fermilab Friday, 2 nd October 2009 ALCPG 2009.
Physics I: Physics Lists Geant4 Tutorial at Jefferson Lab 10 July 2012 Dennis Wright (SLAC) Geant4 9.6 beta.
Maria Grazia Pia Detector Response Acknowledgements: A. Lechner, J. Apostolakis, M. Asai, G. Cosmo, A. Howard.
Geant4 Event Biasing Marc Verderi, LLR (Heavily copied from Jane Tinslay, SLAC) June 2007.
Computing Performance Recommendations #13, #14. Recommendation #13 (1/3) We recommend providing a simple mechanism for users to turn off “irrelevant”
IEEE Nuclear Science Symposium and Medical Imaging Conference Short Course The Geant4 Simulation Toolkit Sunanda Banerjee (Saha Inst. Nucl. Phys., Kolkata,
17-19 Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan 2007 Geant4 Collaboration.
Alex Howard - Event Biasing Geant4 Users - Lisbon Event biasing and Variance Reduction - Geometrical Alex Howard, CERN Geant4 Users Workshop, Lisbon.
Alex Howard, ETH, Zurich 13 th September 2012, 17 th Collaboration Meeting, Chartres 1 Geometrical Event Biasing Facility Alex Howard ETH, Zurich Geometrical.
Bremsstrahlung Splitting Overview Jane Tinslay, SLAC March 2007.
CBM ECAL simulation status Prokudin Mikhail ITEP.
Run and Event G4Run and G4RunManager In Geant4, the Run is the largest unit of simulation and it consist of a series of events Within a Run, the detector.
Bartol Flux Calculation presented by Giles Barr, Oxford ICRR-Kashiwa December 2004.
Makoto Asai (SLAC) Getting Started MGP: added class diagram of basic user application.
Alex Howard, CERN - Event Biasing Overview – Hebden Bridge 13 th September Event biasing and Variance Reduction Alex Howard, CERN Event Biasing.
Radiation study of the TPC electronics Georgios Tsiledakis, GSI.
1 Giuseppe G. Daquino 26 th January 2005 SoFTware Development for Experiments Group Physics Department, CERN Background radiation studies using Geant4.
Read-out and detector response
MONTE CARLO TRANSPORT SIMULATION Panda Computing Week 2012, Torino.
Geant4 KISTI Tutorial Marc Verderi LLR – Ecole polytechnique October 2012 Event Biasing 01/11/2012 MARC VERDERI - LLR ECOLE POLYTECHNIQUE - GEANT4 KISTI.
Interaction with the Geant4 kernel
Biasing and scoring
J. Apostolakis, M. Asai, G. Cosmo, A. Howard
Other GEANT4 capabilities
variance reduction techniques to improve efficiency of calculation A
Status of Biasing Development
Interaction with the Geant4 kernel
Neutron and Photon Backscattering from the ILC Beam Dump
User Documents and Examples I
variance reduction techniques to improve efficiency of calculation B
Biasing and scoring
variance reduction techniques to improve efficiency of calculation A
G.A.P.Cirrone, S.E.Mazzaglia - INFN/LNS, Italy
Physics I: Physics Lists
Read-out and detector response
Other GEANT4 capabilities
Read-out and detector response
Makoto Asai (SLAC) Geant4 Tutorial Course
The n-3He Simulation Using Geant4
Makoto Asai (SLAC) Geant4 Tutorial Course
Kernel Author: Makoto Asai.
Simulation in Experiments searching for rare events
Presentation transcript:

Other GEANT4 capabilities Event biasing Parameterisation (fast simulation) Scoring Persistency Parallelisation and integration in a distributed computing environment } Alex Howard } Susanna Guatelli

Ackowledgements Most of this material has been provided by Makoto Asai, Tsukasa Aso and Jane Tinslay – SLAC 2006 course

Fast simulation parameterisation The parameterisation process produces a direct detector response, from the knowledge of particle and volume properties –hits, digis, reconstructed-like objects (tracks, clusters etc.) Great flexibility by detector –activate fast /full simulation by detector example: full simulation for inner detectors, fast simulation for calorimeters by geometry region –activate fast /full simulation by geometry region example: fast simulation in central areas and full simulation near cracks by particle type –activate fast /full simulation by particle type example: in e.m. calorimeter, e/  parameterisation + full simulation of hadrons –parallel geometries –parallel geometries in fast/full simulation example: inner and outer tracking detectors distinct in full simulation, but handled together in fast simulation fullfast Geant4 allows to perform full and fast simulation in the same environment

Event biasing Geant4 provides facilities for event biasing The effect consists in producing a small number of secondaries, which are artificially recognized as a huge number of particles by their statistical weights Event biasing can be used, for instance, for the transportation of slow neutrons or in the radioactive decay simulation Various variance reduction techniques available

Event biasing techniques Production cuts / threshold –This is a biasing technique – most popular for many applications Geometry based biasing –Importance weighting for volume/region –Duplication or sudden death of tracks Leading particle biasing –Taking only the most energetic (or most important) secondary Primary event biasing –Biasing primary events and/or primary particles in terms of type of event, momentum distribution, etc. Forced interaction –Force a particular interaction, e.g. within a volume Enhanced process or channel –Increasing cross section for a process Physics based biasing –Biasing secondary production in terms of particle type, momentum distribution, cross- section, etc. => Weight on track / event.

Current features in Geant4 Partial MARS migration –n, p, pi, K (< 5 GeV) –Since Geant4 0.0 General particle source module –Primary particle biasing –Since Geant4 3.0 Radioactive decay module –Physics process biasing in terms of decay products and momentum distribution –Since Geant4 3.0 Geometry based biasing –Weight associating with real volume or artificial volume –Since Geant4 4.2 –Weight cutoff and weight window  Since Geant4 5.2 Hadronic process module –Cross-section biasing (PhotoInelactic,ElectronNuclear,PositronNuclear) –Leading particle biasing for hadronic processes  Since Geant4 7.0

Leading particle biasing Simulating a full shower is an expensive calculation Instead of generating a full shower, trace only the most energetic secondary –Other secondary particles are immediately killed before being stacked –Convenient way to roughly estimate, e.g. the thickness of a shield –Physical quantities such as energy are not conserved for each event

Geometric Biasing * Importance sampling technique * Weight window technique The purpose of geometry based event biasing is to save computing time by sampling less often the particle histories entering “less important” geometry regions, and more often in more “important” regions.

Variance Reduction Use variance reduction techniques to reduce computing time taken to calculate a result with a given variance Want to increase efficiency of the Monte Carlo Measure of efficiency is given by  s = variance on calculated quantitiy  T = computing time

Remove bias introduced from generating multiple secondaries by assigning a statistical weight to each secondary  N = number of secondary photons  Preserves photon energy and angluar distributions Currently, no default bremsstrahlung splitting in Geant4 toolkit User can implement bremsstrahlung splitting by –Directly modifying bremsstrahlung source code –Using G4WrapperProcess  May be slightly less efficient  Less invasive  Easier to implement 10

Importance sampling technique Importance sampling acts on particles crossing boundaries between “importance cells”. The action taken depends on the importance value assigned to the cell. In general, a track is played either split or Russian roulette at the geometrical boundary depending on the importance value assigned to the cell. I=1I=2 Survival probability (P) is defined by the ratio of importance value. P = I post / I pre The track weight is changed to W/P. X Splitting a track ( P > 1 ) –E.g. creating two particles with half the ‘ weight ’ if it moves into volume with double importance value. W=1 W=0.5 Russian-roulette (P < 1 ) in opposite direction –E.g. Kill particles according to the survival probability (1 - P). W=0.5 W=1 P = 0.5 P = 2

Geometrical importance biasing Define importance for each geometrical region Duplicate a track with half (or relative) weight if it goes toward more important region Russian-roulette in another direction Scoring particle flux with weights –at the surface of volumes I = 1.0I = 2.0 W=1.0 W=0.5 P = 0.5

13 Importance biasing Importance biasing Analogue simulation Importance biasing 10 MeV neutron in thick concrete cylinder

Examples/extended/biasing

Biasing example B01 Shows the importance sampling in the mass (tracking) geometry Option to show weight window 10 MeV neutron shielding by cylindrical thick concrete material Geometry –80 cm high concrete cylinder divided into 18 slabs –Importance values assigned to 18 concrete slabs in the DetectorConstruction for simplicity. –The G4Scorer is used for the checking result  Top level class uses the framework provided for scoring. Air ……….. 2 n

Flux multiplied by Kinetic energy of particle (MeV)

Example B02 B02 example for showing –importance sampling in a parallel geometry –a customized scoring making use of the scoring framework. –Mass geometry consists of a 180 cm high simple bulk concrete cylinder –A parallel geometry is created to hold importance values for slabs of width 10cm and for scoring.  Note: The parallel world volume must overlap the mass world volume  The radii of the slabs is larger than the radius of the concrete cylinder in the mass geometry.  The importance value is assigned to each ‘ G4GeometryCell ’ Pairs of G4GeometryCell and importance values are stored in the importance store, G4IStore. –The scoring uses the G4CellSCorer and one customized scorer for the last slab. –It can be built and run using the PI implementation of AIDA  For this see –At the end a histogram called “ b02.hbook" is created.

Example B03 Uses Geant4 importance sampling and scoring through python. It creates a simple histogram. It demonstrates how to use a customized scorer and importance sampling in combination with a scripting language, python. Geant4 code is executed from a python session. –Note: the swig package is used to create python shadow classes and to generate the code necessary to use the Geant4 libraries from a python session. It can be built and run using the PI implementation of AIDA –For this see At the end a histogram called "trackentering.hbook" is created.

SCORING examples/extended/runAndEvent/RE02

Extract useful information Given geometry, physics and primary track generation, Geant4 does proper physics simulation “ silently ”. –You have to add a bit of code to extract information useful to you. There are two ways: –Use user hooks (G4UserTrackingAction, G4UserSteppingAction, etc.)  You have full access to almost all information  Straight-forward, but do-it-yourself –Use Geant4 scoring functionality  Assign G4VSensitiveDetector to a volume  Hit is a snapshot of the physical interaction of a track or an accumulation of interactions of tracks in the sensitive (or interested) part of your detector.  Hits collection is automatically stored in G4Event object, and automatically accumulated if user-defined Run object is used.  Use user hooks (G4UserEventAction, G4UserRunAction) to get event / run summary

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 !

A tip for scoring For scoring purposes, you need to accumulate a physical quantity (e.g. energy deposition of a step) for entire run of many events. In such a case, do NOT sum up individual energy deposition of each step directly to a variable for entire run. –Compared to the total sum for entire run, each energy deposition of single step is too tiny. Rounding error problem may easily happen.  Total energy deposition of 1 million events of 1 GeV incident particle ends up to 1 PeV (10 15 eV), while energy deposition of each single step is O(1 keV) or even smaller. Create your own Run class derived from G4Run, and implement RecordEvent(const G4Event*) virtual method. Here you can get all output of the event so that you can accumulate the sum of an event to a variable for entire run. –RecordEvent(const G4Event*) is automatically invoked by G4RunManager. –Your run class object should be instantiated in GenerateRun() method of your UserRunAction.

G4VPrimitiveScorer –G4VPrimitiveScorer is an abstract base class representing a class to be registered to G4MultiFunctionalDetector.  Geant4 provides concrete primitive scorer classes such as dose scoring, surface flux counting, etc. Of course, users can develop his/her own primitive scorer classes.  Primitive scorers are designed to score one kind of quantity and generates one hits collection per event. The name of hits collection is automatically assigned as /. The hits collection is maintained by G4HCofThisEvent object with a unique collection ID number which is assigned by G4SDManager. Each primitive scorer object must be instantiated with a unique name among primitive scorers registered in a G4MultiFunctionalDetector object. A primitive scorer object must not be shared by more than one G4MultiFunctionalDetector object. Otherwise, the results are mixed together.

List of concrete primitive scorer Concrete Primitive Scorers ( See Application Developers Guide ) –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.

Summary Geant4 offers the possibility to improve computing performance via fast simulation and biasing A number of biasing techniques are available but are the user’s responsibility to use the results correctly Scoring is implemented with a degree of flexibility to reduce hits collection and persistency whilst offering convenience of keeping tallies of common qualities A number of examples are available within the $G4INSTALL/examples/extended source tree See documentation for more details