Geant4: Electromagnetic Physics 4 V.Ivanchenko, BINP & CERN

Slides:



Advertisements
Similar presentations
IEEE Nuclear Science Symposium and Medical Imaging Conference Short Course The Geant4 Simulation Toolkit Sunanda Banerjee (Saha Inst. Nucl. Phys., Kolkata,
Advertisements

Development of an Interface for Using EGS4 Physics Processes in Geant4 K.Murakami (KEK) 27/Mar./
Makoto Asai (SLAC) Geant4 Users SLAC Feb. 18 th, 2002 Getting Started.
Hadronic and Electromagnetic Physics: special applications V.Ivanchenko BINP, Novosibirsk, Russia & CERN, Geneve, Switzerland.
© Copyright QinetiQ 2006 G4 C-S Biasing Based on the G4WrapperProcess Fan Lei Geant4 Biasing Mini Workshop, SLAC 21 March 2007.
Collaboration Diagrams. Example Building Collaboration Diagrams.
Makoto Asai (SLAC) Geant4 Users SLAC Feb. 18 th, 2002 Getting Started.
Makoto Asai (SLAC) Geant4 Users SLAC Feb. 20th, 2002 Stack management, Digitization and Pile-up.
Chapter 11 Operating Systems
Makoto Asai (SLAC) Geant4 Users CERN Nov. 13th, 2002 Stack management, Digitization and Pile-up.
1 Geant4 Physics Based Event Biasing Jane Tinslay, SLAC March 2007, Geant4 v8.2p01.
Stopping Power The linear stopping power S for charged particles in a given absorber is simply defined as the differential energy loss for that particle.
Inheritance. Types of Inheritance Implementation inheritance means that a type derives from a base type, taking all the base type’s member fields and.
1 Classes- Inheritance Multiple Inheritance It is possible to derive a new class from more than one base class. This is called Multiple Inheritance. Under.
Geant4: Electromagnetic Processes 2 V.Ivanchenko, BINP & CERN
Particles and Processes The full set of lecture notes of this Geant4 Course is available at
IEEE Nuclear Science Symposium and Medical Imaging Conference Short Course The Geant4 Simulation Toolkit Sunanda Banerjee (Saha Inst. Nucl. Phys., Kolkata,
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.
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.
Geant4 Electromagnetic Physics Introduction V.Ivanchenko, M.Maire, M.Verderi  Process interface  Physics categories  Electromagnetic physics  PhysicsList.
Object Oriented Programming with C++/ Session 6 / 1 of 44 Multiple Inheritance and Polymorphism Session 6.
Maria Grazia Pia Detector Response Acknowledgements: A. Lechner, J. Apostolakis, M. Asai, G. Cosmo, A. Howard.
Progress on generic biasing Marc Verderi LLR – Ecole polytechnique Geant4 Collaboration Meeting Seville September 2013.
Geant4 internal Classes and Objects Gunter Folger / CERN Geant4 course, Annecy 2008 User Action & Information Classes.
Abstract ClassestMyn1 Abstract Classes Virtual functions in a base class must be defined unless they are declared to be pure virtual (abstract) functions.
User Application Luciano Pandola INFN-LNGS Partially based on a presentation by Maria Grazia Pia (INFN-Ge)
Gaudi Framework Tutorial, April Algorithm Tools: what they are, how to write them, how to use them.
17-19 Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan 2007 Geant4 Collaboration.
Geant4 internal Classes and Objects Geant4 Users’ Tutorial February 2010 Gunter Folger / CERN User Action & Information Classes.
Physics processes in general SLAC User’s Workshop February 18 – Marc Verderi Ecole Polytechnique - LLR.
CBM Software Meeting 1 CBM Simulation & Analysis Framework Geant3 / Gean4 configuration M. Al-Turany, D. Bertini.
Basics of Primary Particle Generation and Tracking Makoto Asai (SLAC) Geant4 Tutorial CERN May 25-27, 2005 May 2005, Geant4 v7.0p01.
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.
Detector Description – Part III Ivana Hrivnacova, IPN Orsay Tatiana Nikitina, CERN Aknowledgement: Slides by: J.Apostolakis, G.Cosmo, A. Lechner.
V.Ivanchenko Salamanca1 Geant4: Hadronic Processes 1  Cross sections  Secondary generators  Nuclear interactions at rest  CHIPS model.
V.Ivanchenko Salamanca1 Geant4: Electromagnetic Processes 1  Introduction  Interfaces  PhysicsList  Optical process.
Geant4 internal Classes and Objects Gunter Folger / CERN MC-PAD, DESY/Hamburg January 2010 User Action & Information Classes.
Physics II : processes Paris Geant4 Tutorial 5 June 2007 Marc Verderi Ecole Polytechnique - LLR.
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.
Maria Grazia Pia Retrieving information from kernel Acknowledgements: A. Lechner, J. Apostolakis, M. Asai, G. Cosmo, A. Howard.
Geant4 KISTI Tutorial Marc Verderi LLR – Ecole polytechnique October 2012 Physics II: Overview, Processes, Production Threshold.
Interaction with the Geant4 kernel
Particles and Processes
Inheritance and Polymorphism
Interaction with the Geant4 kernel
Review: Two Programming Paradigms
Inheritance AKEEL AHMED.
Particles and Processes
C++ for Geant4 users A collection of most useful and/or common features used in and to use Geant4 Marc Verderi LLR – Ecole polytechnique 14/11/2018 Marc.
Geant4:User Actions and Analysis
Geant4 introduction 2008/03/18 Nobu Katayama KEK
Primary Particle Generation
Particles and Processes
Primary Particle Generation
A shortcut to the tracking
Polymorphism Polymorphism
Model Approach for Standard EM Physics
Geant4: Electromagnetic Processes 2
Hadronic Physics in Geant4
Virtual Functions Polymorphism is supported by C++ both at compile time and at run time. Compile-time polymorphism is achieved by overloading functions.
Particles and Processes
Today’s Objectives 10-Jul-2006 Announcements Quiz #3
Kernel Author: Makoto Asai.
Introduction to physics and processes
Decay Process Makoto Asai (SLAC)
Jim Fawcett CSE687 – Object Oriented Design Spring 2014
Monte Carlo /12/25.
C++ Object Oriented 1.
Particles and Processes
Presentation transcript:

Geant4: Electromagnetic Physics 4 V.Ivanchenko, BINP & CERN Process interface for developers Conception of interaction lengths Interaction with G4 kernel Examples V.Ivanchenko 01.09.03 Physics processes

G4VProcess interface overview There are 7 types of processes with predefined interfaces: ContinuousProcess ContinuouesDiscreteProcess DiscreteProcess RestContinuouesDiscreteProcess RestContinuouesProcess RestDiscreteProcess RestProcess All processes inherit from base class G4VProcess Standard interface: a process provides Interaction Lenths, StepLimits, and DoIt methods Processes active AlongStep, PostStep, AtRest V.Ivanchenko 01.09.03 Physics processes

G4VProcess interface G4VProcess defines 6 pure virtual methods: AtRestGetPhysicalInteractionLength(….) AtRestDoIt(…) AlongStepGetPhysicalInteractionLength(…) AlongStepDoIt(…) PostStepGetPhysicalInteractionLength(…) PostStepDoIt(…) There are also other virtual methods: IsApplicable( const G4ParticleDefinition&) BuildPhysicsTable( const G4ParticleDefinition&) …. G4VProcess defined in source/processes/management V.Ivanchenko 01.09.03 Physics processes

Number of interaction length G4VProcess and derived classes implement a scheme based on the « number of interaction length » to define the time/space point of the interaction and to choose the process of interaction assumed for the processes dealing with the exponential law At the beginning of the tracking the process is given a sampled value « number of interaction lenght » Nint At the beginning of each step The (concrete) process evaluates the current « mean free path » lfree, given the current material; The « true path length » the process allows to the particle before the interaction occurs is then: Nintlfree ; This value is returned by GetPhysicalInteractionLength; V.Ivanchenko 01.09.03 Physics processes

Number of interaction length Then the step occurs with the actual step length Lstep value; At the beginning of the new step: If the process has limited the previous step (ie its interaction occured), it gets a new Nint value; Otherwise, the process converts back Lstep into a number of « consumed » interaction length, which is substracted to its Nint amount; Please review for example G4VDiscreteProcess; Note that all related methods are virtual, allowing to redefine them, if needed. V.Ivanchenko 01.09.03 Physics processes

Example: G4VDiscreteProcess inline G4double G4VDiscreteProcess::PostStepGetPhysicalInteractionLength( const G4Track& track, G4double previousStepSize, G4ForceCondition* condition) { if ( (previousStepSize <=0.0) || (theNumberOfInteractionLengthLeft<=0.0)) { // beginning of tracking (or just after DoIt of this process) ResetNumberOfInteractionLengthLeft() } else { //subtract NumberOfInteractionLengthLeft SubtractNumberOfInteractionLengthLeft(previousStepSize); if(theNumberOfInteractionLengthLeft<perMillion) theNumberOfInteractionLengthLeft=0.; } //get mean free path currentInteractionLength = GetMeanFreePath(track, previousStepSize, condition) G4double value = theNumberOfInteractionLengthLeft*currentInteractionLengt; return value; V.Ivanchenko 01.09.03 Physics processes

Some advices Do not overwrite GPIL virtual functions if it is possible! Try to use one of 7 predefined interfaces In these interfaces the accurate control on interaction length is provided for you V.Ivanchenko 01.09.03 Physics processes

Interfaces to be used protected: // For all processes virtual G4double GetMeanFreePath( const G4Track& track, G4double previousStepSize, G4ForceCondition* condition ) = 0; // For continuous processes virtual G4double GetContinuousStepLimit( const G4Track& track, G4double previousStepSize, G4double currentMinimumStep, G4ForceCondition* condition ) = 0; V.Ivanchenko 01.09.03 Physics processes

When process is active? All Continuous processes are invocated at each step of the particle If Discrete or Rest process limits the step then it is invocated To help to activate Rest or Discrete process at each step one should use G4ForceCondition V.Ivanchenko 01.09.03 Physics processes

G4ForceConditions GetPhysicalInteractionLength methods involve G4ForceCondition & G4GPILSelection; These are two enumerations: They define signals, that processes send to the stepping, to require the treatment they wish from the stepping; Involve  « delicate » aspects; Defined in source/track; V.Ivanchenko 01.09.03 Physics processes

G4ForceConditions G4ForceCondition (AtRest and PostStep) defines requests for treatment of the DoIt methods. It can take the values: NotForced: Usual case  : the DoIt method is invoked if the related GetPhysicalInteractionLength has limited the step Forced: The related DoIt is applied is particle is not killed Conditionally: The PostStepDoIt is applied if the AlongStep has limited the step ExclusivelyForced: Only the PostStepDoIt of the process is applied: all other AlongStep and PostStep are ignored StronglyForced: The related DoIt is applied in any case V.Ivanchenko 01.09.03 Physics processes

G4GPILSelection More delicate… G4GPILSelection (AlongStep) defines requests for the treatment of the GetPhysicalInteractionLength methods. It can takes the values: CandidateForSelection: usual case  : the process will be « declared » to have limited the step if it returns the smallest length; NotCandidateForSelection: the process will not be « declared » to have limited the step, even if it returns the smallest lenght; In practice, only the multiple-scattering makes use of the « NotCandidateForSelection » signal up to now V.Ivanchenko 01.09.03 Physics processes

Examples of processes G4hIonisation – notForced ContinuousDiscrete G4Decay – notForced RestDiscrete G4Cherenkov – Continuous G4Scintillation – Forced RestDiscrete G4MuonMinusCaptureAtRest – Rest G4ProtonInelasticProcess – notForced Discrete V.Ivanchenko 01.09.03 Physics processes

DoIt signature virtual G4VParticleChange* AtRestDoIt( const G4Track& track, const G4Step& step ) = 0; virtual G4VParticleChange* AlongStepDoIt( const G4Track& track, const G4Step& step ) = 0; virtual G4VParticleChange* PostStepDoIt( const G4Track& track, const G4Step& step ) = 0; V.Ivanchenko 01.09.03 Physics processes

DoIt signature All DoIt methods have the same signature: They receive const G4Track and G4Step It is not allowed to change directly the track, nor the step They return a G4VParticleChange: This G4VParticleChange returns the changes of the track to the stepping Not the « delta »! It is assumed to create of secondary G4Track Need to be familiar with, to implement a process ; V.Ivanchenko 01.09.03 Physics processes

G4VParticleChange G4VParticleChange is defined in source/track It defines the virtual methods: virtual G4Step* UpdateStepForAtRest(G4Step*); virtual G4Step* UpdateStepForAlongStep(G4Step*); virtual G4Step* UpdateStepForPostStep(G4Step*); Which are used to communicate the changes to be applied on the primary; They return the G4Step after having updated it; Each concrete G4VParticleChange should modify only the necessary members of the G4Step; Can be relevant if your G4VParticleChange is often used; V.Ivanchenko 01.09.03 Physics processes

G4VParticleChange To create secondaries by the process, the following methods have to be used: void SetNumberOfSecondaries(G4int); To declare the maximum number of secondaries which will be created by the process; void AddSecondary(G4Track* aSecondary); Which has to be called for each secondary created; G4VParticleChange has a method Initialize(const G4Track&) which is used to initialize the members which will be changed by the process V.Ivanchenko 01.09.03 Physics processes

G4TrackStatus fAlive, // Continue the tracking G4TrackStatus defines the possible status a track can undertake; It is needed when writing a process: fAlive, // Continue the tracking fStopButAlive, // Invoke active rest physics processes and // and kill the current track afterward fStopAndKill, // Kill the current track fKillTrackAndSecondaries, // Kill the current track and also // associated secondaries. fSuspend, // Suspend the current track fPostponeToNextEvent // Postpones the tracking of thecurrent // track to the next event. V.Ivanchenko 01.09.03 Physics processes

Example with G4GammaConversion (1) Example with G4GammaConversion, which uses a particle change defined in the base class G4VDiscreteProcess; G4VParticleChange* G4GammaConversion::PostStepDoIt( const G4Track& aTrack, const G4Step& aStep) { aParticleChange.Initialize(aTrack); //Does the physics… aParticleChange.SetNumberOfSecondaries(2) ; //… G4double localEnergyDeposit = 0.; if (ElectKineEnergy > fminimalEnergy) { //… // create G4DynamicParticle object for the particle1 G4DynamicParticle* aParticle1= new G4DynamicParticle( G4Electron::Electron(), ElectDirection, ElectKineEnergy); aParticleChange.AddSecondary(aParticle1); } else { localEnergyDeposit += ElectKineEnergy;} V.Ivanchenko 01.09.03 Physics processes

Example with G4GammaConversion (2) // the e+ is always created (even with Ekine=0) for further annihilation. //… if (PositKineEnergy < fminimalEnergy) { localEnergyDeposit += PositKineEnergy; PositKineEnergy = 0.;} //… // create G4DynamicParticle object for the particle2 G4DynamicParticle* aParticle2= new G4DynamicParticle( G4Positron::Positron(), PositDirection, PositKineEnergy); aParticleChange.AddSecondary(aParticle2); aParticleChange.SetLocalEnergyDeposit(localEnergyDeposit); // // Kill the incident photon // aParticleChange.SetEnergyChange( 0. ); aParticleChange.SetStatusChange( fStopAndKill ); return G4VDiscreteProcess::PostStepDoIt( aTrack, aStep ); } V.Ivanchenko 01.09.03 Physics processes

Some remarks It is not necessary to know Geant4 kernel in order to implement a new process One have to follow the described interfaces Having several implementation for given process is normal for Geant4 V.Ivanchenko 01.09.03 Physics processes

Conclusion remarks The toolkit provides a wide choice of processes, so try to use existing processes User can substitute any of existing processes It is assumed that Geant4 user is at the same time a developer Geant4 team will appreciate an efforts of any user to implement his/her own process or model, if it is correct from physics point of view V.Ivanchenko 01.09.03 Physics processes