Geant4 KISTI Tutorial Marc Verderi LLR – Ecole polytechnique October 2012 Event Biasing 01/11/2012 MARC VERDERI - LLR ECOLE POLYTECHNIQUE - GEANT4 KISTI.

Slides:



Advertisements
Similar presentations
Radioactivity.
Advertisements

Lectures 6&7: Variance Reduction Techniques
Other GEANT4 capabilities Event biasing Parameterisation (fast simulation) Persistency Parallelisation and integration in a distributed computing environment.
Physics Lists from a pedestrian ESA/ESTEC G4 meeting, october 2010 Plenary Session VI : “New physics model development and physics list” Marc Verderi LLR,
Using FLUKA to study Radiation Fields in ERL Components Jason E. Andrews, University of Washington Vaclav Kostroun, Mentor.
Pedro Arce Point detector scoring 1 Point detector scoring in GEANT4 Pedro Arce, (CIEMAT) Miguel Embid (CIEMAT) Juan Ignacio Lagares (CIEMAT) Geant4 Event.
© Copyright QinetiQ 2006 G4 C-S Biasing Based on the G4WrapperProcess Fan Lei Geant4 Biasing Mini Workshop, SLAC 21 March 2007.
Statistics.
Adapted from G G Daquino, Geant4 Workshop, Catania, 5 Oct 2004 Event Biasing in G4: Why and what? Key User Requirements J. Apostolakis, CERN 19 March 2007.
Alex Howard - Event Biasing Mini-Workshop - SLAC Geometrical Event biasing and Variance Reduction – Talk 2 Alex Howard, CERN Event Biasing Mini-Workshop,
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.
Interaction Forcing Overview Jane Tinslay, SLAC March 2007.
Leading Particle Biasing Overview Jane Tinslay, SLAC March 2007.
CMS Full Simulation for Run-2 M. Hildrith, V. Ivanchenko, D. Lange CHEP'15 1.
P HI T S Advanced Lecture (II): variance reduction techniques to improve efficiency of calculation Multi-Purpose Particle and Heavy Ion Transport code.
1 Stratified sampling This method involves reducing variance by forcing more order onto the random number stream used as input As the simplest example,
1 Geant4 Physics Based Event Biasing Jane Tinslay, SLAC March 2007, Geant4 v8.2p01.
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.
Lecture 12 Monte Carlo Simulations Useful web sites:
Sergey Ananko Saint-Petersburg State University Department of Physics
Progress on generic biasing Marc Verderi LLR – Ecole polytechnique Geant4 Collaboration Meeting Seville September 2013.
Marc Verderi - IN2P3 SLAC User's Workshop.1 Introduction G EANT4 has been designed to allow users to implement new processes the kernel will treat as any.
Using FLUKA for radioactive waste zoning L. Nicolas, FLUKA meeting, March
Other GEANT4 capabilities Event biasing Parameterisation (fast simulation) Scoring Persistency Parallelisation and integration in a distributed computing.
Geant4 Acceptance Suite for Key Observables CHEP06, T.I.F.R. Mumbai, February 2006 J. Apostolakis, I. MacLaren, J. Apostolakis, I. MacLaren, P. Mendez.
Optimizing DHCAL single particle energy resolution Lei Xia Argonne National Laboratory 1 LCWS 2013, Tokyo, Japan November , 2013.
Implementing a dual readout calorimeter in SLIC and testing Geant4 Physics Hans Wenzel Fermilab Friday, 2 nd October 2009 ALCPG 2009.
Advanced Variance Reduction Strategies for Optimizing Mesh Tallies in MAVRIC Douglas E. Peplow, Edward D. Blakeman, and John C. Wagner Nuclear Science.
Optimizing DHCAL single particle energy resolution Lei Xia 1 CALICE Meeting LAPP, Annecy, France September 9 – 11, 2013.
Planned Geant4 developments for LLR Marc Verderi Laboratoire Leprince-Ringuet, École polytechnique Annecy ATF-2 meeting October 2006.
DHCAL - Resolution (S)DHCAL Meeting January 15, 2014 Lyon, France Burak Bilki, José Repond and Lei Xia Argonne National Laboratory.
Profiling study of Geant4-GATE VRTs discussion Nicolas Karakatsanis Alexander Howard Geant4 Users Workshop Medical/GATE Parallel Session 13 th September.
Normalisation modelling sources Geant4 tutorial Paris, 4-8 June 2007 Giovanni Santin ESA / ESTEC Rhea System SA.
Geant4 Event Biasing Marc Verderi, LLR (Heavily copied from Jane Tinslay, SLAC) June 2007.
Progress on generic biasing Marc Verderi LLR – Ecole polytechnique Geant4 Collaboration Meeting Seville September 2013.
Radiation Shielding and Reactor Criticality Fall 2012 By Yaohang Li, Ph.D.
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,
Section 1Nuclear Changes Section 1: What is Radioactivity?
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.
Generating Primary Particles Each Geant4 Event starts with generation of one or multiple primary particles It is up to the user to define primary particle.
Lesson 4: Computer method overview
Spacecraft Environment & Protection Group GEANT4 Workshop, Noordwijk, Sep 1999 Radioactive Decay Process and Data P Truscott and F Lei Space Department.
G4GeneralParticleSource Class: Developed by ESA as the space radiation environment is often quite complex in energy and angular distribution, and requires.
Cosmic rays at sea level. There is in nearby interstellar space a flux of particles—mostly protons and atomic nuclei— travelling at almost the speed of.
Alex Howard, ETH, Zurich 13 th September 2012, 17 th Collaboration Meeting, Chartres 1 Geometrical Event Biasing Facility Alex Howard ETH, Zurich Geometrical.
Particles And Nuclear Equations Mr. ShieldsRegents Chemistry U02 L02.
Bremsstrahlung Splitting Overview Jane Tinslay, SLAC March 2007.
Nuclear Changes Reactions of Unstable or Changeable Nuclei.
Nuclear Chemistry. Chemical ReactionsNuclear Reactions - Occur when bonds are broken or formed -Occur when the nucleus emits particles or rays -Atoms.
Parallel session 8B summary Event Biasing Marc Verderi LLR, Ecole polytechnique Friday 14 th September Chartres.
Workshop On Nuclear Data for Advanced Reactor Technologies, ICTP , A. Borella1 Monte Carlo methods.
Alex Howard, CERN - Event Biasing Overview – Hebden Bridge 13 th September Event biasing and Variance Reduction Alex Howard, CERN Event Biasing.
A. Dokhane, PHYS487, KSU, 2008 Chapter1- Neutron Reactions 1 NEWS Lecture1: Chapter 0 is already on my Website.
Marina Golubeva, Alexander Ivashkin Institute for Nuclear Research RAS, Moscow AGeV simulations with Geant4 and Shield Geant4 with Dpmjet-2.5 interface.
G. Cowan Lectures on Statistical Data Analysis Lecture 5 page 1 Statistical Data Analysis: Lecture 5 1Probability, Bayes’ theorem 2Random variables and.
Physics II : processes Paris Geant4 Tutorial 5 June 2007 Marc Verderi Ecole Polytechnique - LLR.
Geant4 KISTI Tutorial Marc Verderi LLR – Ecole polytechnique October 2012 Physics II: Overview, Processes, Production Threshold.
Status of Biasing: - Generic Biasing & - Reverse Monte Carlo
Other GEANT4 capabilities
variance reduction techniques to improve efficiency of calculation A
variance reduction techniques to improve efficiency of calculation B
variance reduction techniques to improve efficiency of calculation A
Other GEANT4 capabilities
G4GeneralParticleSource Class:
Marc Verderi GEANT4 collaboration meeting 01/10/2002
Lesson 4: Application to transport distributions
Presentation transcript:

Geant4 KISTI Tutorial Marc Verderi LLR – Ecole polytechnique October 2012 Event Biasing 01/11/2012 MARC VERDERI - LLR ECOLE POLYTECHNIQUE - GEANT4 KISTI TUTORIAL 1

›There are simulation problems in which what we are interesting in is rare –Occurrence is low because of the physics, or because of the setup, etc. –What we are interested in is what we want to “tally” –We need to tally something rare ›Examples of such problems are: –Estimating the efficiency of a shield ›Only a tiny fraction of the incident flux exits the shield ›Almost all the CPU is spent simulating what happens inside the shield ›While we primarily want to tally the exiting flux –Obtaining the response of a very thin detector ›For example to obtain the response to neutrons ›Most of them do not interact in ›We want to tally the effect of neutrons in the detector –Estimating the dose in a very small part of a big setup ›For example an electronic chip in a satellite ›Most of the time is spent simulating showers that do not contribute to the dose ›While we want to tally this dose ›An “analog” (usual) simulation is very inefficient in addressing these problems. Introduction detector Thick shield 01/11/2012 MARC VERDERI - LLR ECOLE POLYTECHNIQUE - GEANT4 KISTI TUTORIAL 2

01/11/2012 MARC VERDERI - LLR ECOLE POLYTECHNIQUE - GEANT4 KISTI TUTORIAL 3 What is « event biasing » ? Track i, weight i

01/11/2012 MARC VERDERI - LLR ECOLE POLYTECHNIQUE - GEANT4 KISTI TUTORIAL 4 ›In an « importance sampling » technique, the analog pdfs (probability density function) are replaced by biased ones: ›The weight, for some value x, is then the ratio of the analog over the biased distribution values, at x Importance Sampling x analog pdf(x) biased pdf(x) x Phase space region of interest analog-pdf(x) w(x) = biased-pdf(x)

01/11/2012 MARC VERDERI - LLR ECOLE POLYTECHNIQUE - GEANT4 KISTI TUTORIAL 5 ›In splitting, the physical distributions are unchanged, but a « splitting » occurs at some places when particles go into the direction of where the tally is to be made –In above example, particles moving toward exit are cloned ›cloning is basically compensating for the physical absorption in shielding. –When cloning happens, clones receive a weight ½ (here) of the initial track ›Splitting comes together with « killing » or « Russian Roulette » –In above example, particles moving back are killed with a (here) probabilty ½ and, if it survives, its weight is multiplied by 2 (here). Splitting Incident flux Exiting flux, tallied Splitting by 2 (here)

Present Geant4 Biasing Options 01/11/2012 MARC VERDERI - LLR ECOLE POLYTECHNIQUE - GEANT4 KISTI TUTORIAL 6

›The General Particle Source (GPS) allows to bias the particle source: –Position –Angular Distribution –Energy Distribution ›This is an « importance sampling » biasing –The physical distributions are replaced by biased ones ›Primary particles are given a weight that is the ratio of analog / biased probabilities –In the simulation, all daughter, gran-daughter,… particles from the primary inherit the weight of this primary Primary Particle Biasing 01/11/2012 MARC VERDERI - LLR ECOLE POLYTECHNIQUE - GEANT4 KISTI TUTORIAL 7

›Cross-section Biasing: –Possibility to enhance a (low) cross-section ›This an « importance sampling » approach –Available for photon inelastic, electron & positron nuclear processes Options In Hadronic (1) //init reaction model G4ElectroNuclearReaction* theElectroReaction = new G4ElectroNuclearReaction(); //create process and register model G4ElectronNuclearProcess theElectronNuclearProcess; theElectronNuclearProcess.RegisterMe(theElectroReaction); //apply biasing theElectronNuclearProcess.BiasCrossSectionByFactor(100); //register process pManager->AddDiscreteProcess(&theElectronNuclearProcess); 01/11/2012 MARC VERDERI - LLR ECOLE POLYTECHNIQUE - GEANT4 KISTI TUTORIAL 8

01/11/2012 MARC VERDERI - LLR ECOLE POLYTECHNIQUE - GEANT4 KISTI TUTORIAL 9 ›Leading Particle Biasing: –It is a technique used for estimating the penetration of particles in a shield –Instead of simulating the full shower, only keep: ›The most energetic particle ›And one particle of each species –This is a « killing » - based biaising (say an « anti-splitting » technique) ›Radioactive decay (from Dennis presentation) –Enhance particular decay within a given time window –Sample all decay modes with equal probabilities –Split parent nuclide in a user defined number of copies, letting the decay go –Enhance emission in a particular direction Options In Hadronic (2)

›This an other technique for shield studies ›Attach « importance » to cells in geometry –If a track moves from importances « 4 » to « 8 » (here): ›it is splitted in 2 = 8/4 copies ›each copy having a weight = ½ of the incoming track –If a track moves the other way, from importance « 8 » to « 4 » ›it is killed with a probability ½ – This is the « Russian Roulette » ›If particle survives, its weight is multiplied by 2 (here) Geometry based splitting Splitting 48 Killing x … … 01/11/2012 MARC VERDERI - LLR ECOLE POLYTECHNIQUE - GEANT4 KISTI TUTORIAL 10

›Cell (G4GeometryCell) and Importance (G4IStore) declarations: //define importance cells G4GeometryCell* cellA = new G4GeometryCell(my_G4PhysicalVolume_A); G4GeometryCell* cellB = new G4GeometryCell(my_G4PhysicalVolume_B); //create importance store and add cells to it G4IStore* myStore = new G4IStore(my_worldPhysicalVolume); myStore->AddImportancegeometryCell(G4double importance=1, cellA); myStore->AddImportancegeometryCell(G4double importance=2, cellB); ›Configure information collection (G4CellScorer), in volumes of the tracking geometry, and specify the splitting algorithm: //create and initialize sampler G4MassGeometrySampler mySampler = new G4MassGeometrySampler(“e+“); mySampler->PrepareScoring(new G4CellScorer); mySampler->PrepareImportanceSampling(myStore, new G4ImportanceAlgorithm()); mySampler->Configure(); ›Configuration can be made different, if needed, starting from the base classes: – G4VSampler, G4VIStore, G4VScorer, G4VImportanceAlgorithm ›Scorers can also be attached to volumes in a parallel geometry. The G4VSampler implementation G4ParallelGeometrySampler(…) allows this. Geometry based splitting 01/11/2012 MARC VERDERI - LLR ECOLE POLYTECHNIQUE - GEANT4 KISTI TUTORIAL 11

01/11/2012 MARC VERDERI - LLR ECOLE POLYTECHNIQUE - GEANT4 KISTI TUTORIAL 12 See: geant4/examples/extended/biasing/B01

01/11/2012 MARC VERDERI - LLR ECOLE POLYTECHNIQUE - GEANT4 KISTI TUTORIAL 13 ›This is a « splitting & killing » technique, to avoid having –Too high weight tracks at some point ›As this makes the convergence of the estimated quantities difficult ›Tracks with weight above some value are splitted –Too low weight tracks ›As these are essentially a waste of time ›Tracks below some value are « Russian roulette »’d ›This can be configured per cell and per energy. ›See: geant4/examples/extended/biasing/B01 Weight Window Technique

01/11/2012 MARC VERDERI - LLR ECOLE POLYTECHNIQUE - GEANT4 KISTI TUTORIAL 14 Reverse Monte Carlo Extended source (Sky) ›Simulation in which particles go back in time ! ›Useful in case of small device to be simulated in a big environment –Requested by ESA, for dose study in electronic chips in satellites ›Simulation starts with the red track –So-called “adjoint” track –Going back in time –Increasing in energy –Up to reaching the extended source ›If track energy < high energy limit of the sky source spectrum –Proceed with a usual “forward” simulation (green track) ›When many track simulated, adjust adjoint track weights so that energy spectrum of adjoint particle matches sky source spectrum –This provides the weight of the green tracks ›Dose in chip can then be computed, accounting for the forward track contribution, with the proper weight. ›See: geant4/examples/extended/biasing/ReverseMC01 Adjoint track Forward (normal) track

›G4WrapperProcess can be used to implement user defined event biasing ›G4WrapperProcess, which is a process itself, wraps an existing process ›All function calls forwarded to wrapped process ›Needed steps: 1.Create derived class inheriting from G4WrapperProcess 2.Override only the methods to be modified, e.g., PostStepDoIt() 3.Register this class in place of the original 4.Finally, register the original (wrapped) process with user class User defined biasing 01/11/2012 MARC VERDERI - LLR ECOLE POLYTECHNIQUE - GEANT4 KISTI TUTORIAL 15

›Bremstralhung splitting is a technique used for example in medical applications: –Radio-therapy with photon beam generated by bremstralhung –Interest is in generated photons, not in the electron  enhance photon production ›At a point bremstralhung reaction is repeated N times, with the same initial electron –All bremstralhung photons are given a weight 1/N – The electron continues with one of the state among the N ones generated G4VParticleChange* myWrappedProc::PostStepDoIt(const G4Track& track, const G4Step& step) { G4double weight = track.GetWeight()/fNSplit;... std::vector secondaries(fNSplit); // Secondary store // Loop over wrapped PSDI method to generate multiple secondaries for (G4int i=0; i<fNSplit; i++) { particleChange = pRegProcess->PostStepDoIt(track, step); assert (0 != particleChange); particleChange->SetVerboseLevel(0); // Save the secondaries generated on this cycle for (G4int j=0; j GetNumberOfSecondaries(); j++) { secondaries.push_back (new G4Track(*(particleChange->GetSecondary(j)))); } // -- and then pass these secondaries to the particle change… } Example with brem. splitting 01/11/2012 MARC VERDERI - LLR ECOLE POLYTECHNIQUE - GEANT4 KISTI TUTORIAL 16

›Note: in 9.6, a built-in brem. splitting option will be proposed. Example with a brem. splitting 01/11/2012 MARC VERDERI - LLR ECOLE POLYTECHNIQUE - GEANT4 KISTI TUTORIAL 17

Options to come 01/11/2012 MARC VERDERI - LLR ECOLE POLYTECHNIQUE - GEANT4 KISTI TUTORIAL 18

01/11/2012 MARC VERDERI - LLR ECOLE POLYTECHNIQUE - GEANT4 KISTI TUTORIAL 19 ›Not present for now are techniques in which the usual interaction exponential law has to be replaced by something else in the tracking ›This includes: –Forced interaction: ›Useful in the thin detector case –Force a free flight ›Prevent interaction to occur (that’s easy) ›But not only: gets the weight for this ›Punch through studies –So-called exponential transform ›Cross-section replaced by an other one, direction dependent for example ›And also, not present are techniques in which the physical laws describing the final state are changed –Ie change final state angular distribution, etc. What is not present (but is planned) detector

Convergence: a word of caution 01/11/2012 MARC VERDERI - LLR ECOLE POLYTECHNIQUE - GEANT4 KISTI TUTORIAL 20

Convergence ›Ensuring convergence is an issue in biasing: –The fact that not all events have a weight « 1 » in a biased simulation is a source of pitfall –Should be careful to not be « victim » of an apparent, but wrong, convergence ›A « toy » example of bad sampling: 01/11/2012 MARC VERDERI - LLR ECOLE POLYTECHNIQUE - GEANT4 KISTI TUTORIAL 21

Convergence ›Ensuring convergence is an issue in biasing: –The fact that not all events have a weight « 1 » in a biased simulation is a source of pitfall –Should be careful to not be « victim » of an apparent, but wrong, convergence ›A « toy » example of bad sampling: 01/11/2012 MARC VERDERI - LLR ECOLE POLYTECHNIQUE - GEANT4 KISTI TUTORIAL 22

100k events 01/11/2012 MARC VERDERI - LLR ECOLE POLYTECHNIQUE - GEANT4 KISTI TUTORIAL 23

10M events 01/11/2012 MARC VERDERI - LLR ECOLE POLYTECHNIQUE - GEANT4 KISTI TUTORIAL 24

01/11/2012 MARC VERDERI - LLR ECOLE POLYTECHNIQUE - GEANT4 KISTI TUTORIAL 25 ›Our deliberately chosen bad sampling is instructive: –We have a wide variety of weights ›Many tiny ones – Waste of time to determine the mean value ›Few huge ones – Responsible for jumps ›Such problem –if can not be improved- could at least be alleviated with a weight window technique – In a real problem (useless here in our toy problem) –We have huge weights from time to time ›These are not wrong ! ›Temptation would be to “dismiss” these events ›But in our case, these events bring down the mean value to the correct value ›These are not wrong, but their presence is a sign of a bad sampling –We observe monotonic increase of the mean value ›We are sampling only “one side” of the problem ›Convergence criteria have been established in other packages –Like MCNP ›You are invited at staying critical when using such biasing techniques. Some qualitative observations

›Biasing techniques can provide very large acceleration factors to certain simulation problems. –Problems in which we need to tally rare events ›Geant4 proposes biasing options on –Primary source (GPS), leading particle, cross-section (had), radioactive decay, splitting with importance in geometry, weight window, user biasing with G4WrapperProcess, and soon bremstralhung splitting –And is developing others (forced interaction, forced flight) ›Biasing techniques have to be handled with care ! –Be critical on convergence ! ›But these techniques are nevertheless unique in helping in addressing rare event simulation problems. Conclusion 01/11/2012 MARC VERDERI - LLR ECOLE POLYTECHNIQUE - GEANT4 KISTI TUTORIAL 26

More… About biasied vs analog pdf in Importance Sampling 01/11/2012 MARC VERDERI - LLR ECOLE POLYTECHNIQUE - GEANT4 KISTI TUTORIAL 27

x analog pdf(x) biased pdf(x) analog-pdf(x) w(x) = biased-pdf(x) x Unrecoverable region => remaining biais Waste of time: w = 0 always 01/11/2012 MARC VERDERI - LLR ECOLE POLYTECHNIQUE - GEANT4 KISTI TUTORIAL 28