1 Geant4 Physics Based Event Biasing Jane Tinslay, SLAC March 2007, Geant4 v8.2p01.

Slides:



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

Stefan Roesler SC-RP/CERN on behalf of the CERN-SLAC RP Collaboration
Other GEANT4 capabilities Event biasing Parameterisation (fast simulation) Persistency Parallelisation and integration in a distributed computing environment.
Using FLUKA to study Radiation Fields in ERL Components Jason E. Andrews, University of Washington Vaclav Kostroun, Mentor.
Geant4 v9.2p02 Primary Particle Makoto Asai (SLAC) Geant4 Tutorial Course.
Implicit Capture Overview Jane Tinslay, SLAC March 2007.
Primary particle generation Makoto Asai (SLAC) Geant4 Users CERN Nov. 12 th, 2002.
Primary particle generation Makoto Asai (SLAC) Geant4 Users SLAC Feb. 18 th, 2002.
Cross Section Biasing & Path Length Biasing Jane Tinslay, SLAC March 2007.
Geant4 v9.4 Primary Particle Makoto Asai (SLAC) Geant4 Tutorial Course.
© Copyright QinetiQ 2006 G4 C-S Biasing Based on the G4WrapperProcess Fan Lei Geant4 Biasing Mini Workshop, SLAC 21 March 2007.
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,
Highlights of latest developments ESA/ESTEC Makoto Asai (SLAC)
Geant4 v9.3p01 Primary Particle Makoto Asai (SLAC) Geant4 Tutorial Course.
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.
Interaction Forcing Overview Jane Tinslay, SLAC March 2007.
Leading Particle Biasing Overview Jane Tinslay, SLAC March 2007.
1 BaBar Collaboration Randall Sobie Institute for Particle Physics University of Victoria.
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.
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.
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.
Adding a new process CERN User’s Workshop 13 November 2002 V.Ivanchenko, CERN, Budker Institute for Nuclear Physics Based on presentation of M.Verderi.
Other GEANT4 capabilities Event biasing Parameterisation (fast simulation) Scoring Persistency Parallelisation and integration in a distributed computing.
Geant4 Electromagnetic Physics Introduction V.Ivanchenko, M.Maire, M.Verderi  Process interface  Physics categories  Electromagnetic physics  PhysicsList.
Profiling study of Geant4-GATE VRTs discussion Nicolas Karakatsanis Alexander Howard Geant4 Users Workshop Medical/GATE Parallel Session 13 th September.
User Documents and Examples II Geant4 Tutorial at Marshall Space Flight Center 18 April 2012 Dennis Wright (SLAC) Geant4 V9.5.
Geant4 Event Biasing Marc Verderi, LLR (Heavily copied from Jane Tinslay, SLAC) June 2007.
Extending the Bertini Cascade Model to Kaons Dennis H. Wright (SLAC) Monte Carlo April 2005.
1 A Bayesian statistical method for particle identification in shower counters IX International Workshop on Advanced Computing and Analysis Techniques.
1 Physics I: Physics Lists Paris Geant4 Tutorial 4 June 2007 Marc Verderi Laboratoire Leprince-Ringuet (Heavily copied from D. Wright) Geant4 V8.3.
Computing Performance Recommendations #13, #14. Recommendation #13 (1/3) We recommend providing a simple mechanism for users to turn off “irrelevant”
1 Status and Plans for Geant4 Physics Linear Collider Simulation Workshop III 2-5 June 2004 Dennis Wright (SLAC)
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.
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.
Spacecraft Environment & Protection Group GEANT4 Workshop, Noordwijk, Sep 1999 Radioactive Decay Process and Data P Truscott and F Lei Space Department.
Release Validation J. Apostolakis, M. Asai, G. Cosmo, S. Incerti, V. Ivantchenko, D. Wright for Geant4 12 January 2009.
G4GeneralParticleSource Class: Developed by ESA as the space radiation environment is often quite complex in energy and angular distribution, and requires.
Latifa Elouadrhiri Jefferson Lab Hall B 12 GeV Upgrade Drift Chamber Review Jefferson Lab March 6- 8, 2007 CLAS12 Drift Chambers Simulation and Event Reconstruction.
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.
Interactions of Hadrons and Hadronic Showers
Validation of EM Part of Geant4
Event Analysis for the Gamma-ray Large Area Space Telescope Robin Morris, RIACS Johann Cohen-Tanugi SLAC.
V.Ivanchenko Salamanca1 Geant4: Electromagnetic Processes 1  Introduction  Interfaces  PhysicsList  Optical process.
Alex Howard, CERN - Event Biasing Overview – Hebden Bridge 13 th September Event biasing and Variance Reduction Alex Howard, CERN Event Biasing.
Geant4 Training 2003 Primary Particle Generation The full set of lecture notes of this Geant4 Course is available at
Report from the Geant4 Radioactive Decay Mini-workshop on 3-4 March 2015 Dennis Wright 25 March 2015.
New approach of Geant4 Low Energy EM models (from version 9.3) Luciano Pandola INFN, Laboratori del Gran Sasso MaGe Joint Workshop, Munich, January 2010.
Geant4 KISTI Tutorial Marc Verderi LLR – Ecole polytechnique October 2012 Event Biasing 01/11/2012 MARC VERDERI - LLR ECOLE POLYTECHNIQUE - GEANT4 KISTI.
Alex Howard, ETHZ – Biasing Requirements – SLAC 21 st September Biasing Requirements and Interfaces Alex Howard ETH, Zurich Biasing Space User Requirements.
E. Mendoza, D.Cano-Ott Nuclear Innovation Unit (CIEMAT)
Biasing and scoring
Status of Biasing: - Generic Biasing & - Reverse Monte Carlo
variance reduction techniques to improve efficiency of calculation A
variance reduction techniques to improve efficiency of calculation B
Biasing and scoring
Primary Particle Generation
Primary Particle Generation
Other GEANT4 capabilities
Hadronic Physics in Geant4
G4GeneralParticleSource Class:
Geant4: Electromagnetic Physics 4 V.Ivanchenko, BINP & CERN
Primary particle Makoto Asai (SLAC Computing Services)
Presentation transcript:

1 Geant4 Physics Based Event Biasing Jane Tinslay, SLAC March 2007, Geant4 v8.2p01

Jane Tinslay, SLAC2 Outline Introduction Variance reduction Built in biasing options G4WrapperProcess Primary particle biasing Radioactive decay biasing Leading particle biasing Cross section biasing Bremsstrahlung splitting example Summary

Jane Tinslay, SLAC3 Introduction Event biasing(variance reduction) techniques are important for many applications Geant4 is a toolkit  Users are free to implement their own biasing techniques Geant4 provides the following features to support event biasing  Some built in biasing techniques of general use with related examples  A utility class, G4WrapperProcess, to support user defined biasing

Jane Tinslay, SLAC4 Variance Reduction Variance reduction techniques are used to reduce computing time taken to calculate a result with a given variance  Want to increase efficiency of the Monte Carlo  Measure of efficiency given by s = variance on calculated quantity T = computing time

Jane Tinslay, SLAC5 When using a variance reduction technique, generally want to apply our own probability distribution, p’(x) in place of the natural one, p(x)  p’(x) enhances the production of whatever it is that were interested in Basically bypassing the full, slow, analogue simulation To get meaningful results, must apply a weight correction to correct for the fact that we’re not using the natural distribution:  Preserves natural energy, angular distributions etc In general, all x values in the p(x) distribution should be possible in the p’(x) distribution

Jane Tinslay, SLAC6 Built in Biasing Options Primary particle biasing  Since v3.0 Radioactive decay biasing  Since v3.0 Leading particle biasing - Hadronic  Partial MARS migration n, p, , K (<5 GeV)  Since v4.0  General lead particle biasing  Since v4.3 Cross section biasing - Hadronic  Since v4.3 Geometry based biasing(see talk by Alex Howard)  Importance sampling  Since v5.0  Weight cutoff and weight window  Since v5.2

Jane Tinslay, SLAC7 G4WrapperProcess G4WrapperProcess can be used to implement user defined event biasing  Is 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 modify behaviour of an existing process To use:  Subclass G4WrapperProcess and override appropriate methods, eg PostStepDoit  Register subclass with process manager in place of existing process  Register existing process with G4WrapperProcess

Jane Tinslay, SLAC8 G4WrapperProcess structure class G4WrapperProcess : public G4VProcess { G4VProcess* pRegProcess; … inline void G4WrapperProcess::RegisterProcess(G4VProcess* process) { pRegProcess=process; … } … inline G4VParticleChange* G4WrapperProcess::PostStepDoIt(const G4Track& track, const G4Step& stepData) { return pRegProcess->PostStepDoIt(track, stepData); } class G4WrapperProcess : public G4VProcess { G4VProcess* pRegProcess; … inline void G4WrapperProcess::RegisterProcess(G4VProcess* process) { pRegProcess=process; … } … inline G4VParticleChange* G4WrapperProcess::PostStepDoIt(const G4Track& track, const G4Step& stepData) { return pRegProcess->PostStepDoIt(track, stepData); }

Jane Tinslay, SLAC9 void MyPhysicsList::ConstructProcess() { … G4LowEnergyBremsstrahlung* bremProcess = new G4LowEnergyBremsstrahlung(); MyWrapperProcess* wrapper = new MyWrapperProcess(); wrapper->RegisterProcess(bremProcess); processManager->AddProcess(wrapper, -1, -1, 3); } void MyPhysicsList::ConstructProcess() { … G4LowEnergyBremsstrahlung* bremProcess = new G4LowEnergyBremsstrahlung(); MyWrapperProcess* wrapper = new MyWrapperProcess(); wrapper->RegisterProcess(bremProcess); processManager->AddProcess(wrapper, -1, -1, 3); } class MyWrapperProcess : public G4WrapperProcess { … G4VParticleChange* PostStepDoIt(const G4Track& track, const G4Step& step) { // Do something interesting } class MyWrapperProcess : public G4WrapperProcess { … G4VParticleChange* PostStepDoIt(const G4Track& track, const G4Step& step) { // Do something interesting } Example:

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

Jane Tinslay, SLAC11 G4GeneralParticleSource is a concrete implementation of G4VPrimaryGenerator  Instantiate G4GeneralParticleSource in your G4VUserPrimaryGeneratorAction class  Configure biasing to be applied to sampling distributions through interactive commands MyPrimaryGeneratorAction::MyPrimaryGeneratorAction() { generator = new G4GeneralParticleSource; } void MyPrimaryGeneratorAction::GeneratePrimaries(G4Event*anEvent){ generator->GeneratePrimaryVertex(anEvent); } MyPrimaryGeneratorAction::MyPrimaryGeneratorAction() { generator = new G4GeneralParticleSource; } void MyPrimaryGeneratorAction::GeneratePrimaries(G4Event*anEvent){ generator->GeneratePrimaryVertex(anEvent); }

Jane Tinslay, SLAC12 Extensive documentation at  Examples also distributed with Geant4  examples/extended/eventgenerator/exgps Online manual Detailed examples online

Jane Tinslay, SLAC13 Radioactive Decay Biasing G4RadioactiveDecay simulates decay of radioactive nuclei Implements the following biasing methods  Increase sampling rate of radionuclides 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

Jane Tinslay, SLAC14 G4RadioactiveDecay is a process  Register with process manager  Biasing can be controlled in compiled code or through interactive commands void MyPhysicsList::ConstructProcess() { … G4RadioactiveDecay* theRadioactiveDecay = new G4RadioactiveDecay(); G4ProcessManager* pmanager = … pmanager ->AddProcess(theRadioactiveDecay); … } void MyPhysicsList::ConstructProcess() { … G4RadioactiveDecay* theRadioactiveDecay = new G4RadioactiveDecay(); G4ProcessManager* pmanager = … pmanager ->AddProcess(theRadioactiveDecay); … }

Jane Tinslay, SLAC15 Extensive documentation at   Example at examples/extended/ radioactivedecay/exrdm

Jane Tinslay, SLAC16 Leading Particle Biasing - EM In analogue approach to electromagnetic shower simulation, each shower followed to completion Applications where high energy particles initiate electromagnetic showers may spend a significant amount of time in shower simulation  Computing time increases linearly with energy Leading particle biasing may significantly reduce computing time for suitable applications. Useful for:  Estimating shower punch through  Reducing time taken to simulate showers resulting from  0 s in hadronic cascades for example

Jane Tinslay, SLAC17 Most important processes contributing to EM shower development at high energies are bremsstrahlung and pair production  Two secondaries produced in each interaction Leading particle biasing involves selecting one of the secondaries with a probability proportional to secondary energy  Highest energy secondary which contributes to most to the total energy deposition preferentially selected  Lower energy secondary selected some of the time  Remaining secondary killed  Weight surviving secondary Use G4WrapperProcess class described previously useful for to implement user defined leading particle biasing

Jane Tinslay, SLAC18 Leading Particle biasing - Hadronic Useful for punch through studies G4Mars5Gev  Inclusive event generator for hadron(photon) interactions with nuclei  Translated from Mars13(98) version of MARS code system  MARS is a particle simulation Monte Carlo  More details on MARS at  Generates fixed number of particles at each vertex with appropriate weights assigned  Valid with energies E< 5 GeV with the following particle types   +,  -, K+, K-, K0L, K0S, proton, neutron, anti-proton, gamma

Jane Tinslay, SLAC19 To use, create a G4Mars5GeV object and register with an appropriate inelastic process: More examples provided in the LHEP_LEAD, LHEP_LEAD_HP, QGSC_LEAD, QGSC_LEAD_HP physics lists Documentation:  http: //geant4.web.cern.ch/geant4/support/proc_mod_catalo g/models/hadronic/LeadParticleBias.html void MyPhysicsList::ConstructProcess() { … G4Mars5Gev* leadModel = new G4Mars5GeV(); G4ProtonInelasticProcess* inelProcess = new G4ProtonInelasticProcess(); inelProcess->RegisterMe(leadModel); processManager->AdddiscreteProcess(inelProcess); } void MyPhysicsList::ConstructProcess() { … G4Mars5Gev* leadModel = new G4Mars5GeV(); G4ProtonInelasticProcess* inelProcess = new G4ProtonInelasticProcess(); inelProcess->RegisterMe(leadModel); processManager->AdddiscreteProcess(inelProcess); }

Jane Tinslay, SLAC20 G4HadLeadBias  Built in utility for hadronic processes disabled by default  Keep only the most important part of the event and representative tracks of given particle type 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: Baryons,  0 ’s, mesons, leptons Apply appropriate weight  Set SwitchLeadBiasOn environmental variable to activate

Jane Tinslay, SLAC21 Cross Section Biasing Artificially enhance/reduce cross section of a process Useful for studying  Thin layer interactions  Thick layer shielding Built in cross section biasing in hadronics for PhotoInelastic, ElectronNuclear and PositronNuclear processes User can implement cross section biasing for other processes through G4WrapperProcess  Documentation at Wednesday-AM-1/05-F.Lei/

Jane Tinslay, SLAC22 Built in hadronic cross section biasing controlled through BiasCrossSectionByFactor method in G4HadronicProcess More details at  1/03-J.Wellisch/biasing.hadronics.pdf void MyPhysicsList::ConstructProcess() { … G4ElectroNuclearReaction * theElectroReaction = new G4ElectroNuclearReaction; G4ElectronNuclearProcess theElectronNuclearProcess; theElectronNuclearProcess.RegisterMe(theElectroReaction); theElectronNuclearProcess.BiasCrossSectionByFactor(100); pManager->AddDiscreteProcess(&theElectronNuclearProcess); … } void MyPhysicsList::ConstructProcess() { … G4ElectroNuclearReaction * theElectroReaction = new G4ElectroNuclearReaction; G4ElectronNuclearProcess theElectronNuclearProcess; theElectronNuclearProcess.RegisterMe(theElectroReaction); theElectronNuclearProcess.BiasCrossSectionByFactor(100); pManager->AddDiscreteProcess(&theElectronNuclearProcess); … }

Jane Tinslay, SLAC23 Example of biasing through enhancing production of secondaries Aim to increase Monte Carlo efficiency by reducing computing time spent tracking electrons  In this case only interested in scoring photons Enhance photon production by applying splitting when a bremsstrahlung interaction occurs  Instead of sampling photon energy & angular distributions just once, sample them N times  Creates N unique secondaries  Different splitting method compared to importance sampling where N identical copies are created Uniform Bremsstrahlung Splitting

Jane Tinslay, SLAC24 Electron energy is reduced by energy of just one photon  Energy is not conserved per event, although is conserved on average As usual, remove bias introduced by generating multiple secondaries by assigning a statistical weight to each secondary  N = number of secondary photons  Preserves correct photon energy and angular distributions No default bremsstrahlung splitting in Geant4 toolkit User can implement bremsstrahlung splitting through G4WrapperProcess

Jane Tinslay, SLAC25 Example Implementation Create BremSplittingProcess class  Inherit from G4WrapperProcess  Override PostStepDoIt method of G4WrapperProcess  Introduce splitting configuration parameters class BremSplittingProcess : public G4WrapperProcess { // Override PostStepDoIt method G4VParticleChange* PostStepDoIt(const G4Track& track, const G4Step& step); static void SetNSplit(G4int); static void SetIsActive(G4bool); … // Data members static G4int fNSplit; static G4bool fActive; }; class BremSplittingProcess : public G4WrapperProcess { // Override PostStepDoIt method G4VParticleChange* PostStepDoIt(const G4Track& track, const G4Step& step); static void SetNSplit(G4int); static void SetIsActive(G4bool); … // Data members static G4int fNSplit; static G4bool fActive; };

Jane Tinslay, SLAC26 G4VParticleChange* BremSplittingProcess::PostStepDoIt(const G4Track& track, const G4Step& step) { … G4double weight = track.GetWeight()/fNSplit; std::vector secondaries; // Secondary store // Loop over PostStepDoIt method to generate multiple secondaries. for (i=0; i<fNSplit; i++) { particleChange = pRegProcess->PostStepDoIt(track, step); assert (0 != particleChange); G4int j(0); for (j=0; j GetNumberOfSecondaries(); j++) { secondaries.push_back(new G4Track(*(particleChange->GetSecondary(j)))); } particleChange->SetNumberOfSecondaries(secondaries.size()); particleChange->SetSecondaryWeightByProcess(true); std::vector ::iterator iter = secondaries.begin(); // Add all secondaries while (iter != secondaries.end()) { G4Track* myTrack = *iter; myTrack->SetWeight(weight); particleChange->AddSecondary(myTrack); iter++; } … return particleChange; } G4VParticleChange* BremSplittingProcess::PostStepDoIt(const G4Track& track, const G4Step& step) { … G4double weight = track.GetWeight()/fNSplit; std::vector secondaries; // Secondary store // Loop over PostStepDoIt method to generate multiple secondaries. for (i=0; i<fNSplit; i++) { particleChange = pRegProcess->PostStepDoIt(track, step); assert (0 != particleChange); G4int j(0); for (j=0; j GetNumberOfSecondaries(); j++) { secondaries.push_back(new G4Track(*(particleChange->GetSecondary(j)))); } particleChange->SetNumberOfSecondaries(secondaries.size()); particleChange->SetSecondaryWeightByProcess(true); std::vector ::iterator iter = secondaries.begin(); // Add all secondaries while (iter != secondaries.end()) { G4Track* myTrack = *iter; myTrack->SetWeight(weight); particleChange->AddSecondary(myTrack); iter++; } … return particleChange; }

Jane Tinslay, SLAC27 Finally, register BremSplittingProcess with electron process manager Use same procedure to implement Russian Roulette + bremsstrahlung splitting void MyPhysicsList::ConstructProcess() { … G4LowEnergyBremsstrahlung* bremProcess = new G4LowEnergyBremsstrahlung(); BremSplittingProcess* bremSplitting = new BremSplittingProcess(); bremSplitting->RegisterProcess(bremProcess); pmanager->AddProcess(bremSplitting,-1,-1, 3); … } void MyPhysicsList::ConstructProcess() { … G4LowEnergyBremsstrahlung* bremProcess = new G4LowEnergyBremsstrahlung(); BremSplittingProcess* bremSplitting = new BremSplittingProcess(); bremSplitting->RegisterProcess(bremProcess); pmanager->AddProcess(bremSplitting,-1,-1, 3); … }

Jane Tinslay, SLAC28 Splitting factor = 100No splitting Scoring Geometry Example demonstrating uniform bremsstrahlung splitting

Jane Tinslay, SLAC29 Summary Presented a number of physics based event biasing techniques  Some biasing options are implemented in Geant4 for general use  Others need to be implemented by user