Presentation is loading. Please wait.

Presentation is loading. Please wait.

Geant4 Event Biasing Jane Tinslay, SLAC May 2007, Geant4 v8.2.p01.

Similar presentations


Presentation on theme: "Geant4 Event Biasing Jane Tinslay, SLAC May 2007, Geant4 v8.2.p01."— Presentation transcript:

1 Geant4 Event Biasing Jane Tinslay, SLAC May 2007, Geant4 v8.2.p01

2 Jane Tinslay, SLAC2 Outline Introduction Built in biasing options Primary particle biasing Radioactive decay biasing Mars hadronic leading particle biasing General hadronic leading particle biasing Hadronic cross section biasing Geometrical biasing Importance sampling Weight windows & weight cutoff User defined biasing G4WrapperProcess Uniform bremsstrahlung splitting example Recent developments Summary

3 Jane Tinslay, SLAC3 Introduction What is analogue simulation ? Sample using natural probability distribution, N(x) Predicts mean with correct fluctuations Can be inefficient for certain applications What is non-analogue/event biased simulation ? Cheat - apply artificial biasing probability distribution, B(x) in place of natural one, N(x) B(x) enhances production of whatever it is that is interesting To get meaningful results, must apply a weight correction Predicts same analogue mean with smaller variance Increases efficiency of the Monte Carlo Doesn’t predict correct fluctuations Should be used with care

4 Jane Tinslay, SLAC4 Geant4 simulation: Analogue == regular processing Non-analogue/event biased simulation == manipulated processes and/or process list I.e, manipulate processing to effectively apply B(x) in place of N(x) Geant4 provides Several built-in general use biasing techniques Utility class, G4WrapperProcess to support user defined biasing Expect biasing to be used by experienced users Should understand what a particular biasing technique does, it’s constraints and side effects Understand how processing works in Geant4

5 Jane Tinslay, SLAC5 Built in Biasing Options Biasing TechniqueFirst Release Version Primary particle biasing3.0 Radioactive decay biasing3.0 Mars hadronic leading particle biasing 4.0 General hadronic lead particle biasing 4.3 Hadronic cross section biasing4.3 Geometrical Importance sampling5.0 Geometrical weight window and weight cutoff 5.2

6 Jane Tinslay, SLAC6 Primary Particle Biasing Use case: Increase number of high energy particles in cosmic ray spectrum Increase number of primary particles generated in a particular phase space region of interest Weight of primary particle modified as appropriate General implementation provided by G4GeneralParticleSource class Bias position, angular and energy distributions

7 Jane Tinslay, SLAC7 G4GeneralParticleSource is a concrete implementation of G4VPrimaryGenerator Instantiate G4GeneralParticleSource in your G4VUserPrimaryGeneratorAction class Configure biasing to be applied to sampling distributions through interactive commands

8 Jane Tinslay, SLAC8 Online documentation & examples http://reat.space.qinetiq.com/gps/ Geant4 examples: examples/extended/eventgenerator/exgps

9 Jane Tinslay, SLAC9 Radioactive Decay Biasing G4RadioactiveDecay simulates decay of radioactive nuclei Implements the following biasing methods Increase sampling rate of radioculides within observation times User defined probability distribution function Nuclear splitting Parent nuclide is split into user defined number of nuclides Branching ratio biasing For a particular decay mode, sample branching ratios with equal probability

10 Jane Tinslay, SLAC10 G4RadioactiveDecay is a process Register with process manager Biasing can be controlled in compiled code or through interactive commands

11 Jane Tinslay, SLAC11 Online documentation & examples http://reat.space.qinetiq.com/septimess/exrdm/ Geant4 examples: examples/extended/radioactivedecay/exrdm

12 Jane Tinslay, SLAC12 Mars Hadronic Leading Particle Biasing Inclusive event generator for hadron(photon) interactions with nuclei Translated from Mars13(98) version of Mars code system http://www-ap.fnal.gov/MARS Useful for punch through studies Generates fixed number of particles at each vertex with appropriate weights assigned Valid with energies < 5GeV with  +,  -, K+, K-, K0L, K0S, proton, neutron, anti-proton, gamma

13 Jane Tinslay, SLAC13 To use, create a G4Mars5GeV object and register with inelastic process More examples provided in the LHEP_LEAD, LHEP_LEAD_HP etc physics lists Depreciated

14 Jane Tinslay, SLAC14 General Hadronic Leading Particle Biasing Built in utility for hadronic processes Implemented in G4HadLeadBias class Keep only the most important part of the event, and representative tracks of given particle types Keep track with highest energy I.e, the leading particle Of the remaining tracks, select one from each of the following types if they exist: Baryon’s,  0 ’s, mesons, leptons Apply appropriate weight To activate, set SwitchLeadBiasOn environment variable

15 Jane Tinslay, SLAC15 Hadronic Cross Section Biasing Built in cross section biasing in hadronics for PhotoInelastic, ElectronNuclear and PositronNuclear processes Artificially enchance/reduce cross section of a process Useful for studying Thin layer interactions Thick layer shielding

16 Jane Tinslay, SLAC16 Hadronic cross section biasing controlled through BiasCrossSectionByFactor method in G4HadronicProcess More details at http://www.triumf.ca/geant4- 03/talks/03-Wednesday-AM-1/03- J.Wellisch/biasing.hadronics.pdf

17 Jane Tinslay, SLAC17 Geometrical Biasing Geometry based biasing implemented within common framework in Geant4 Importance sampling Weight windows Weight cutoff Process based approach Process list is modified behind the scenes to apply biasing Implements own scoring scheme Depreciated - future releases will use scorers Applicable in mass or parallel geometries Define physical volumes named cells Limitations with biasing parallel geometries Can’t bias in fields or with charged particles Improved in future releases using new general parallel navigation Currently in Beta stage

18 Jane Tinslay, SLAC18 Importance Sampling Aim Increase number of particles in geometries that are interesting or important Decrease number of particles in geometries that are not so interesting or important Method Divide mass or parallel geometries up into importance cells Assign an importance value to each cell Importance value reflects the relative importance of that cell When a particle crosses a boundary between two importance cells, apply biasing algorithm based on relative importance between two cells Either split(duplicate) track, or play Russian Roulette (kill track with certain probability)

19 Jane Tinslay, SLAC19 Default algorithm When crossing from cell A with importance I A, to cell B with importance I B, define relative importance R If R = 1 continue transport If R < 1 play Russian Roulette Reduce # tracks when passing from more important to less important cell Kill tracks with probability 1-R If R > 1 split track Increase # tracks when passing from less important to more important cell Split into R dupicate tracks Apply appropriate weights

20 Jane Tinslay, SLAC20 Importance Cell Example Splitting IAIA I B = 2*I A w’ = w/2 w w’ = 2ww ww’ = 0 (killed) Russian Roulette

21 Jane Tinslay, SLAC21 Weight Window Weight based enhancement to importance sampling Particles either split or Russian Roulette played based on space-energy cells User defines a weight window for each space cell, and optionally for different energies Can help control weight fluctuations introduced by other variance reduction techniques

22 Jane Tinslay, SLAC22 User defines Lower weight bound Upper weight factor Survival weight factor Upper weight bound = lower weight bound * upper weight factor Survival weight bound = lower weight bound * survival weight factor

23 Jane Tinslay, SLAC23 Samplers Samples (G4VSampler) are user tools which setup the geometrical biasing Handles process list manipulation behind the scenes Two samplers provided with Geant4 distribution G4MassGeometrySampler Biasing in mass geometry G4ParallelGeometrySampler Biasing in parallel geometry Samplers provide methods for configuring Importance sampling Weight window Weight roulette Scoring Each particle type that is geometrically biased should have its own sampler

24 Jane Tinslay, SLAC24 G4VSampler Structure Use the prepare and configure methods of G4VSampler to prepare biasing

25 Jane Tinslay, SLAC25 Importance Sampling Configuration 1)Prepare a collection of cells Importance value - volume associations 2)Create, prepare & configure sampler

26 Jane Tinslay, SLAC26 Weight Window Configuration 1)Prepare a collection of volume-weight windows 2)Assign a lower weight bound and upper energy bound to a volume 3)Create, prepare & configure sampler

27 Jane Tinslay, SLAC27 Biasing Example B01 examples/extended/biasing/B01 Study punch through of 10 MeV neutrons incident upon thick concrete cylinder Demonstrates importance sampling & weight windows technique in mass geometry Geometry consists of an 80 cm high concrete cylinder divided into 18 slabs Importance value for slab n = 2 n

28 Jane Tinslay, SLAC28 Analogue SimulationImportance Sampled 1 2n2n 8 4 2 Example B01 - 10 MeV neutrons, thick concrete cylinder

29 Jane Tinslay, SLAC29 Geometrical Biasing Documentation Detailed examples can be found at examples/advanced/Tiara examples/extended/biasing Documentation on all geometrical biasing techniques at http://geant4.web.cern.ch/geant4/UserDocumentation/UsersGuid es/ForApplicationDeveloper/html/ch03s07.html

30 Jane Tinslay, SLAC30 User Defined Biasing: G4WrapperProcess Implement user defined biasing through G4WrapperProcess A process itself, I.e, inherits from G4VProcess Wraps an existing process By default, function calls are forwarded to existing process Non-invasive way to manipulate the behaviour of a process To use: Subclass G4WrapperProcess and override appropriate methods, e.g, PostStepDoIt Register sublcass with process manager in place of existing process Register existing process with G4WrapperProcess

31 Jane Tinslay, SLAC31 G4WrapperProcess Structure

32 Jane Tinslay, SLAC32 Example: Uniform Bremsstrahlung Splitting In this example, only interesting in scoring bremsstrahlung photons Want to increase Monte Carlo efficiency by reducing computing time spent tracking electrons Example of biasing through enhancing production of secondaries

33 Jane Tinslay, SLAC33 When a bremsstrahlung interaction occurs: Instead of sampling photon energy & angular distributions just once, sample N times to generate N unique secondaries Multiple secondary generation termed “splitting” in this case Not to be confused with importance sample splitting, where N identical copies are created Electron energy reduced by energy of just one photon Remove bias introduced in photon energy and angular distributions by assigning a statistical weight to each secondary N = splitting factor (# of secondary photons)

34 Jane Tinslay, SLAC34 Implementation 1)Create user class inheriting from G4WrapperProcess 2)Override PostStepDoIt method of G4WrapperProcess

35 Jane Tinslay, SLAC35 3)Implement overridden PostStepDoIt method 4)Register wrapped process with process manager

36 Jane Tinslay, SLAC36 Splitting factor = 100No splitting Scoring Geometry Uniform Bremsstrahlung Splitting

37 Jane Tinslay, SLAC37 Recent Developments http://geant4.slac.stanford.edu/EBMS/

38 Jane Tinslay, SLAC38 Three components Scoring for biasing : Tsukasa Aso (TNCMT) Geometrical based biasing : Alex Howard (CERN) Physics based biasing : Jane Tinslay (SLAC) Evaluate current status of each component Identify missing functionality Comparisons with other Monte Carlo codes (eg, EGS family, MCNP, Penelope, Fluka) Investigate interaction between components Work plan developed with short, medium and long term goals

39 Jane Tinslay, SLAC39 Workshop Brief Summary & Work Plan Detailed summary and work plan at http://geant4.slac.stanford.edu/EBMS/material/Sum mary_EBminiworkshop.ppt Geometrical biasing Updated to use parallel navigation developments With release v9.0 should be able to do full geometrical biasing in parallel worlds At the moment limited to neutrals Biasing examples to be updated Producing validation examples Scoring for biasing Use in place of depreciated G4VScorer used in geometrical biasing Development of new scorers

40 Jane Tinslay, SLAC40

41 Jane Tinslay, SLAC41 Physics biasing Existing physics based biasing fragmented Identify missing biasing methods & variations between methods in other Monte Carlo codes Implicit capture General cross section biasing Interaction forcing Path length biasing Advanced bremsstrahlung splitting Leading particle biasing Look at developing dedicated framework to provide general physics biasing in analogy with geometrical biasing Manipulating physics processes/lists

42 Jane Tinslay, SLAC42 Summary Number of popular event biasing techinques built into Geant4 User defined biasing supported through G4WrapperProcess Ongoing developments aim to improve exiting Geant4 biasing, and provide new event biasing and scoring methods Documentation at http://geant4.web.cern.ch/geant4/UserDocumentation/UsersGuid es/ForApplicationDeveloper/html/ch03s07.html


Download ppt "Geant4 Event Biasing Jane Tinslay, SLAC May 2007, Geant4 v8.2.p01."

Similar presentations


Ads by Google