Physics processes in general SLAC User’s Workshop February 18 – 22 2002 Marc Verderi Ecole Polytechnique - LLR.

Slides:



Advertisements
Similar presentations
Development of an Interface for Using EGS4 Physics Processes in Geant4 K.Murakami (KEK) 27/Mar./
Advertisements

Physics Lists from a pedestrian ESA/ESTEC G4 meeting, october 2010 Plenary Session VI : “New physics model development and physics list” Marc Verderi LLR,
Hadronic and Electromagnetic Physics: special applications V.Ivanchenko BINP, Novosibirsk, Russia & CERN, Geneve, Switzerland.
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.
Highlights of latest developments ESA/ESTEC Makoto Asai (SLAC)
Geant4 v9.3p01 Primary Particle Makoto Asai (SLAC) Geant4 Tutorial Course.
Primary Particle Makoto Asai (SLAC) Geant4 Tutorial Course Geant4 v8.2p01.
Abstraction: Polymorphism, pt. 1 Abstracting Objects.
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.
Physics III: Cuts, Decay and Optical Physics Geant4 Tutorial at Jefferson Lab 10 July 2012 Dennis Wright (SLAC) Geant4 9.6 beta.
Geant4: Electromagnetic Processes 2 V.Ivanchenko, BINP & CERN
Tabular Editors for Geant4 Geant4 Geometry Editor and Geant4 Physics Editor CHEP 2000 at Padova Hajime Yoshida Naruto University of Education.
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.
Tuesday, Nov 9th 9:30-12:30 –Visualization attributes –Physics processes 14:00-17:00 –Kinematics and event generation (from yesterday) Particle gun –Boolean.
Overview of Geant4 Physics 2 nd Finnish Geant4 Workshop 6-7 June 2005 Dennis Wright (SLAC)
Geant4 Electromagnetic Physics Introduction V.Ivanchenko, M.Maire, M.Verderi  Process interface  Physics categories  Electromagnetic physics  PhysicsList.
Physics I: Physics Lists Geant4 Tutorial at Jefferson Lab 10 July 2012 Dennis Wright (SLAC) Geant4 9.6 beta.
Special Topics in Nuclear Physics, JU, Second Semester, (Saed Dababneh). 1 Course web or
Maria Grazia Pia Detector Response Acknowledgements: A. Lechner, J. Apostolakis, M. Asai, G. Cosmo, A. Howard.
Geant4 Physics List V.Ivanchenko Thanks to P.Gumplinger, M.Maire, H.P.Wellisch  General Physics  Electromagnetic Physics  Optical Photons  Hadronic.
Primary particle Giovanni Santin ESA / ESTEC and RheaTech Ltd On behalf of the Geant4 collaboration Ecole Geant4 Annecy, and Nov 2008 With.
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.
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”
17-19 Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan 2007 Geant4 Collaboration.
Properties conserved in Strong and EM interactions
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.
WORK Bo-Wen Shiou. GNUmakefile GNUmakefile XXX.cc (ex:try03.cc) XXX.cc (ex:try03.cc) include folder (xxx.hh) include folder (xxx.hh) src folder (xxx.cc)
V.Ivanchenko Salamanca1 Geant4: Electromagnetic Processes 1  Introduction  Interfaces  PhysicsList  Optical process.
Physics I: Physics Lists Puebla Geant4 Tutorial 15 June 2010 Dennis Wright Geant4 V9.3.p01.
Geant4 release 5.1 summary Gabriele Cosmo EP/SFT.
Recap Introduction to Inheritance Inheritance in C++ IS-A Relationship Polymorphism in Inheritance Classes in Inheritance Visibility Rules Constructor.
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
Use of Ions in MT Makoto Asai 2013 Geant4 Collaboration Seville.
Physics II : processes Paris Geant4 Tutorial 5 June 2007 Marc Verderi Ecole Polytechnique - LLR.
1 Exercises 0 Go inside the “hadrontherapy” directory: cd hadrontherapy Copy the Hadrontherapy example to your home folder: cp –r $G4INSTALL/examples/advanced/hadrontherapy.
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.
Makoto Asai.  Parallel layered mass geometry  Other minor improvement  G4Exception.
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.
Makoto Asai.  In the past, material is considered only if it appears in the mass (tracking) world. The user might define parallel world(s) for artificial.
Interaction with the Geant4 kernel
Particles and Processes
Interaction with the Geant4 kernel
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.
Physics I: Physics Lists
Particles and Processes
A shortcut to the tracking
Hadronic Physics in Geant4
Read-out and detector response
Particles and Processes
User Application
Marc Verderi GEANT4 collaboration meeting 01/10/2002
The full set of lecture notes of this Geant4 Course is available at
Geant4: Electromagnetic Physics 4 V.Ivanchenko, BINP & CERN
The full set of lecture notes of this Geant4 Course is available at
Kernel Author: Makoto Asai.
Introduction to physics and processes
The full set of lecture notes of this Geant4 Course is available at
Monte Carlo /12/25.
Particles and Processes
Presentation transcript:

Physics processes in general SLAC User’s Workshop February 18 – Marc Verderi Ecole Polytechnique - LLR

Marc Verderi - Ecole Polytechnique SLAC User's Workshop.2 Introduction Present the ingredients needed to understand how to build a « physics list », which is the physics setup: It is the place where the user tells what particles, processes and production cuts will be used in his/her application; This is a mandatory and critical user’s task; We will go through several aspects regarding the « heart » of G EANT4; Present only the abstract aspect of processes: Presentations of the concrete processes follow;

Marc Verderi - Ecole Polytechnique SLAC User's Workshop.3 Categories involved The ingredients presented seat in the categories: Particles Track Processes We will show how they are handled by the Tracking; The « physics list » interface seats in the Run category.

Marc Verderi - Ecole Polytechnique SLAC User's Workshop.4 Layout I. What is tracked; Definition of particles; G4Track; II. The process interface; G4VProcess; How processes are used by the stepping; III. The production cuts; IV. Building the « physics lists ». V. User-defined limits

I.What is tracked in G EANT4 ; Speak about: G4ParticleDefinition; G4DynamicParticle; G4Track;

Marc Verderi - Ecole Polytechnique SLAC User's Workshop.6 The particle types in G EANT4 are described by the G4ParticleDefinition class; Class defined in source/particles/management; Describes the « intrisic » particle properties: Mass, width, spin, lifetime… Describes its « sensitivity » to physics: G4ParticleDefinition –This is realized by a G4ProcessManager ; –Attached to the G4ParticleDefinition ; –The G4ProcessManager manages the list of processes the user wants the particle to be sensitive to; –Note that G4ParticleDefinition doesn’t know by itself its sensitivity to physics. G4ParticleDefinition G4ProcessManager Process_2 Process_3 Process_1

Marc Verderi - Ecole Polytechnique SLAC User's Workshop.7 G4ParticleDefinition is the base class for defining concrete particles: Several layers are defined: G4ParticleDefinition G4VLepton G4VBoson G4VMeson G4VBaryon G4VIon G4VShortLivedParticles Concrete G4ParticleDefinition (1) G4ParticleWithCuts (Speak about later) G4Electron G4Geantino G4PionPlusG4Proton G4Alpha

Marc Verderi - Ecole Polytechnique SLAC User's Workshop.8 Concrete G4ParticleDefinition (2) Most common particles, with lifetime large enough, are implemented as static classes: Like G4Electron, K 0 S, gamma, pions, but also  … To allow –say- electrons in the simulation, the following call should be made in the « physics list »: G4Electron::ElectronDefinition(); Heavy ions are created on the fly by processes; Too many ions to have a class per ion ! An ion is tracked, and then its « ion type » disapears; Ions are all created from the static class G4GenericIon. To allow heavy ions in the simulation, you should call: G4GenericIon::GenericIonDefinition(); Resonances (G4VShortLivedParticles) are also created on the fly. Similar calls to the definitions (excited baryons, mesons …) should be made.

Marc Verderi - Ecole Polytechnique SLAC User's Workshop.9 Example: G4Electron class (1) Extract from source/particles/leptons/include/G4Electron.hh class G4Electron : public G4VLepton { public: static G4Electron* ElectronDefinition(); private: //hide constructor as private G4Electron ( const G4String& aName, G4double mass, G4double width, G4double charge, G4int iSpin, G4int iParity, G4int iConjugation, G4int iIsospin, G4int iIsospin3, G4int gParity, const G4String& pType, G4int lepton, G4int baryon, G4int encoding, G4bool stable, G4double lifetime, G4DecayTable *decaytable); private: static G4Electron theElectron; … };

Marc Verderi - Ecole Polytechnique SLAC User's Workshop.10 Example: G4Electron class (2) Extract from source/particles/leptons/src/G4Electron.cc G4Electron::G4Electron( const G4String& aName, G4double mass, G4double width, G4double charge, G4int iSpin, G4int iParity, G4int iConjugation, G4int iIsospin, G4int iIsospin3, G4int gParity, const G4String& pType, G4int lepton, G4int baryon, G4int encoding, G4bool stable, G4double lifetime, G4DecayTable *decaytable ) : G4VLepton ( aName, mass, width, charge, iSpin, IParity, iConjugation, iIsospin, iIsospin3, gParity, pType, lepton, baryon, encoding, stable,l ifetime, decaytable ) {SetParticleSubType("e");} G4Electron G4Electron::theElectron ( "e-", *MeV, 0.0*MeV, -1.*eplus, 1, 0, 0, 0, 0, 0, "lepton", 1, 0, 11, true, -1.0, NULL); G4Electron* G4Electron::ElectronDefinition(){return &theElectron;}

Marc Verderi - Ecole Polytechnique SLAC User's Workshop.11 G4DynamicParticle G4DynamicParticle describes the purely dynamic part (ie no position, nor geometrical information…) of the particle state: Momentum, energy, polarization; It hangs a G4ParticleDefinition pointer; Retains eventual pre-assigned decay informations: decay products; lifetime; Class defined in source/particles/management;

Marc Verderi - Ecole Polytechnique SLAC User's Workshop.12 G4Track G4Track defines the class of objects propagated by the G EANT4 tracking; Class defined in source/track; The G4Track represents a « snapshot » of the particle state; A G4Track object agregates: A G4ParticleDefinition; A G4ParticleDynamics; Geometrical informations: Position, current volume … Track ID, parent ID; process which created this G4Track; weigth, used for event biaising technic; … A G4Track is tracked from its birth until: It is killed: By an interaction Or because it comes to rest, and is stable; Or, by a user’s action (under his responsability !). Or, it exits the world volume; Class users need to be familiar with !

Marc Verderi - Ecole Polytechnique SLAC User's Workshop.13 Summary view of « What is tracked in G EANT4 » G4Track G4ParticleDefinition G4DynamicParticle G4ProcessManager Propagated by the tracking, Snapshot of the particle state. Momentum, pre-assigned decay… The « particle type »:  G4Electron,  G4PionPlus… « Hangs » the physics sensitivity; The physics processes; Process_2 Process_1 Process_3 The classes involved in the building the « physics list » are: The G4ParticleDefinition concrete classes; The G4ProcessManager; The processes;

II.The process interface; Speak about: G4VProcess; The Stepping;

Marc Verderi - Ecole Polytechnique SLAC User's Workshop.15 –PostStep actions: For describing point-like (inter)actions, like decay in flight, hard radiation… G4VProcess (1) Abstract class defining the common interface of all processes in G EANT4 : Used by all « physics » processes but is also used by the transportation, etc… Defined in source/processes/management Define three kinds of actions: –AlongStep actions: To describe continuous (inter)actions, occuring along the path of the particle, like ionisation; –AtRest actions: Decay, e + annihilation … AlongStep PostStep

Marc Verderi - Ecole Polytechnique SLAC User's Workshop.16 G4VProcess (2) A process can implement any combination of the three AtRest, AlongStep and PostStep actions: Eg: decay = AtRest + PostStep Each action defines two methods: –GetPhysicalInteractionLength(): Used to limit the step size: – either because the process « triggers » an interaction, a decay; –Or any other reasons, like fraction of energy loss; –geometry boundary; – user’s limit … –DoIt(): Implements the actual action to be applied on the track; And the related production of secondaries.

Marc Verderi - Ecole Polytechnique SLAC User's Workshop.17 G4VProcess (3) The « action » methods are thus: AtRestGetPhysicalInteractionLength(), AtRestDoIt(); AlongStepGetPhysicalInteractionLength(), AlongStepDoIt(); PostStepGetPhysicalInteractionLength(), PostStepDoIt(); A set of processes implementing given combinations of actions exists: G4VDiscreteProcess: only PostStep actions; G4VContinuousDiscreteProcess: AlongStep + PostStep actions; … G4VProcess also defines the method: G4bool IsApplicable(const G4ParticleDefinition &); which returns « true » if the process is applicable to the given particle type;

Marc Verderi - Ecole Polytechnique SLAC User's Workshop.18 G4VProcess & G4ProcessManager In practice the G4ProcessManager retains three vectors of actions: One for the AtRest methods of the particle; One for the AlongStep ones; And one for the PostStep actions. These are those vectors the user sets up in the « physics list » and which are used by the tracking.

Marc Verderi - Ecole Polytechnique SLAC User's Workshop.19 How the Stepping handles processes The stepping treats processes generically: The stepping does not know what processes it is handling; The stepping makes the processes to: Cooperate for AlongStep actions; Compete for PostStep and AtRest actions; Processes emit also « signal » to require particular treatment: notForced: « standard » case; forced: PostStepDoIt action applied anyway; conditionallyForced: PostStepDoIt applied if AlongStep has limited the step; … More on this will be said on session « Adding new process »;

Marc Verderi - Ecole Polytechnique SLAC User's Workshop.20 Stepping Invokation Sequence of Processes for a particle travelling 1. At the beginning of the step, determine the step length: Consider all processes attached to the current G4Track; Define the step length as the smallest of the lengths among: All AlongStepGetPhysicalInteractionLenght() All PostStepGetPhysicalInteractionLength() 2. Apply all AlongStepDoIt() actions, « at once »: Changes computed from particle state at the beginning of the step; Accumulated in the G4Step; Then applied to the G4Track, from the G4Step. 3. Apply PostStepDoIt() action(s) « sequentially », as long as the particle is alive: Apply PostStepDoIt() of process which proposed the smallest step length; apply « forced » and « conditionnally forced » actions.

Marc Verderi - Ecole Polytechnique SLAC User's Workshop.21 Stepping Invokation Sequence of Processes for a Particle at Rest 1. If the particle is at rest, is stable and can’t annihilate, it is killed by the tracking: More properly said: if a particle at rest has no « AtRest » actions defined, it is killed. 2. Otherwise determine the lifetime: Take the smallest time among: All AtRestGetPhysicalInteractionLenght() Called « physical interation lenght » but returns a time; 3. Apply AtRestDoIt() action of process which returned the smallest time.

Marc Verderi - Ecole Polytechnique SLAC User's Workshop.22 Processes ordering The ordering of processes matters ! Ordering of following processes is critical: Assuming n processes, the ordering of the AlongGetPhysicalInteractionLength of the last processes should be: [n-2] … [n-1] multiple scattering [n] transportation Why ? Processes return a « true path length »; The multiple scattering « virtually folds up » this true path length into a shorter « geometrical » path length; Based on this new length, the transportation can geometrically limits the step. Other processes ordering usually do not matter. 

III.The production cuts; Speak about: Why production cuts are needed; The cuts scheme in G EANT4

Marc Verderi - Ecole Polytechnique SLAC User's Workshop.24 The cuts in G EANT4 In G EANT4 there is no tracking cut: Particles are tracked down to a zero range/kinetic energy; Only production cuts exist; ie cuts allowing a particle to born or not; Why production cuts are needed ? Some electromagnetic processes involve infrared divergences: This leads to an infinity[huge number] of smaller and smaller energy photons[electrons] (like in bremstrahlung,  -ray productions); Production cuts limit this production to particles above the threshold; The remaining, divergent part is treated as a « net » continuous effect (ie « AlongStep » action); For other processes, production cuts can be an « option » to speed-up the simulation.

Marc Verderi - Ecole Polytechnique SLAC User's Workshop.25 Range versus Energy production cuts The production of a secondary particle is relevant if it can be « visible » in the detector: Ie produce a signal -say an energy deposition- visible compared to the signal of the primary alone; Range cut allows to easily define such visibility: « I want to produce particles able to travel at least 1 mm; » Criteria which can be applied uniformly accross the detector; A same energy cut leads to very different ranges: For the same particle type, depending on the material; For the same material, depending on particle type; Range cut has been adopted by G EANT4 ; Actual input to cross-section is the energy threshold, but the conversion range-energy is done automatically in G EANT4 ;

Marc Verderi - Ecole Polytechnique SLAC User's Workshop.26 «Violations» of the production threshold In some (many) cases, particles are produced, even if they are below the production threshold; This is intented to let the processes doing the « best » they can; This happens typically for: Decays; Positrons production: In order to simulate the subsequent gammas from the annihilation; Hadronic processes: Since no infrared divergences affect the cross-sections; Note these are not « hard-coded » exceptions, but is a sophisticated, generic, mechanism of the tracking;

Marc Verderi - Ecole Polytechnique SLAC User's Workshop.27 How G EANT4 produces the production cuts The user specifies a unique range cut; In the « physics list »; This range cut is converted into energy cuts: Each particle -G4ParticleWithCut- converts the range cut into an energy cut, for each material; Physics processes can then compute the cross- section based on those energy cuts; Done at initialization time;

IV.Building the « physics list »; Speak about: G4VUserPhysicsList; Concrete physics lists;

Marc Verderi - Ecole Polytechnique SLAC User's Workshop.29 G4VUserPhysicsList It is one of the « mandatory user classes »; Defined in source/run Defines the three pure virtual methods: ConstructParticles(); ConstructProcesses(); SetCuts(); You thus need to inherit from G4VUserPhysicsList to implement you own physics list; (Note that a G4UserPhysicsListMessenger allows to control interactively the physics list.)

Marc Verderi - Ecole Polytechnique SLAC User's Workshop.30 ConstructParticles() (1) To get particle G4XXX, you need to invoke the static method XXXDefinition() in your ConstructParticles() method: void MyPhysicsList::ConstructParticles() { G4XXX::XXXDefinition(); } For example, to have electrons, positrons and gammas only: void MyPhysicsList::ConstructParticles() { G4Electron::ElectronDefinition(); G4Positron::PositronDefinition(); G4Gamma::GammaDefinition(); }

Marc Verderi - Ecole Polytechnique SLAC User's Workshop.31 ConstructParticles() (2) Alternatively, some helper classes are provided: G4BosonConstructor, G4LeptonConstructor G4MesonConstructor, G4BaryonConstructor G4IonConstructor, G4ShortlivedConstructor You can use as: G4BaryonConstructor baryonConstructor; baryonConstructor.ConstructParticle(); Those helper classes are defined in source/particles/ bosons, leptons hadrons/mesons, hadrons/barions hadrons/ions, shortlived

Marc Verderi - Ecole Polytechnique SLAC User's Workshop.32 ConstructProcesses () The class heavily used there is the G4ProcessManager: Defined in source/processes/management It is used to attach processes to particles; And set their ordering; Several ways to « add » a process: AddProcess AddRestProcess, AddDiscreteProcess, AddContinuousProcess And to order AtRest/AlongStep/PostStep actions of processes: SetProcessOrdering SetProcessOrderingToFirst, SetProcessOrderingToLast (This is the ordering for the DoIt() methods, the GetPhysical- InteractionLength() ones have the reverse order.) Please review those G4ProcessManager methods ! Show now various examples.

Marc Verderi - Ecole Polytechnique SLAC User's Workshop.33 Helper method to add the transportation process: void G4VUserPhysicsList::AddTransportation() { G4Transportation* theTransportationProcess= new G4Transportation(); // loop over all particles in G4ParticleTable theParticleIterator->reset(); while( (*theParticleIterator)() ){ G4ParticleDefinition* particle = theParticleIterator->value(); G4ProcessManager* pmanager = particle->GetProcessManager(); if (!particle->IsShortLived()) { // Add transportation process for all particles other than "shortlived" if ( pmanager == 0) { // Error !! no process manager G4Exception("G4VUserPhysicsList::AddTransportation : no process manager!"); } else { // add transportation with ordering = ( -1, "first", "first" ) pmanager->AddProcess(theTransportationProcess); pmanager->SetProcessOrderingToFirst(theTransportationProcess, idxAlongStep); pmanager->SetProcessOrderingToFirst(theTransportationProcess, idxPostStep); } } else { // shortlived particle case } } Example 1: G4VUserPhysicsList::AddTransportation()

Marc Verderi - Ecole Polytechnique SLAC User's Workshop.34 Example 2: EM processes for gamma Simple example of « discrete » processes: ie only PostStep actions; Show usage of helper function AddDiscreteProcess; pmanager is the G4ProcessManager of the gamma; Assume the transportation has been set by AddTransportation; Code sample: // Construct processes for gamma: pmanager->AddDiscreteProcess(new G4GammaConversion()); pmanager->AddDiscreteProcess(new G4ComptonScattering()); pmanager->AddDiscreteProcess(new G4PhotoElectricEffect()); Simple case, where we don ’ t have to deal with processes ordering (except for the transportation which has been set to « first » elsewhere). A more complicated case now …

Marc Verderi - Ecole Polytechnique SLAC User's Workshop.35 Example 3: EM processes for positrons // Construct processes for positron G4VProcess* theeplusMultipleScattering = new G4MultipleScattering(); G4VProcess* theeplusIonisation = new G4eIonisation(); G4VProcess* theeplusBremsstrahlung = new G4eBremsstrahlung(); G4VProcess* theeplusAnnihilation = new G4eplusAnnihilation(); // add processes pmanager->AddProcess(theeplusMultipleScattering); pmanager->AddProcess(theeplusIonisation); pmanager->AddProcess(theeplusBremsstrahlung); pmanager->AddProcess(theeplusAnnihilation); // set ordering for AtRestDoIt pmanager->SetProcessOrderingToFirst(theeplusAnnihilation, idxAtRest); // set ordering for AlongStepDoIt pmanager->SetProcessOrdering(theeplusMultipleScattering, idxAlongStep, 1); pmanager->SetProcessOrdering(theeplusIonisation, idxAlongStep, 2); // set ordering for PostStepDoIt pmanager->SetProcessOrdering(theeplusMultipleScattering, idxPostStep, 1); pmanager->SetProcessOrdering(theeplusIonisation, idxPostStep, 2); pmanager->SetProcessOrdering(theeplusBremsstrahlung, idxPostStep, 3); pmanager->SetProcessOrdering(theeplusAnnihilation, idxPostStep, 4);

Marc Verderi - Ecole Polytechnique SLAC User's Workshop.36 An alternative way to implement particles and processes It exists the G4VModularPhysicsList class: Defined in source/run; Which inherits from G4VUserPhysicsList; Which makes use of a set of G4VPhysicsConstructor: Defined in source/run; G4VPhysicsConstructor defines the pure virtual methods: ContructParticle(); ConstructProcess(); It is a kind of « sub-physics list », each of those implementing - say- the EM physics only, the hadronics physics only, etc… Allows to avoid all the physics definition in a single class; Please see example/novice/N04

Marc Verderi - Ecole Polytechnique SLAC User's Workshop.37 SetCuts() (1) This pure virtual method is used to define the cut range; I will here talk only about the recommended way of setting cuts: Ie: same cut range for all particles; Setting particle dependent cuts is possible but might be reserved to advanced (perverted ? ;-> ) users. The G4VUserPhysicsList base class has the protected member: protected: G4double defaultCutValue; Which is set to 1.0*mm in the constructor; You can eventually change this value in your implementation of SetCuts(); The helper G4VUserPhysicsList::SetCutsWithDefault method implements the machinery to set the cuts using this defaultCutValue value;

Marc Verderi - Ecole Polytechnique SLAC User's Workshop.38 SetCuts() (2) A typical implementation of SetCuts() is then simply: void MyPhysicsList::SetCuts() { defaultCutValue = 1.0*mm; SetCutsWithDefault(); }

V.User-defined limits; Speak about: G4UserLimit; G4UserSpecialCuts process;

Marc Verderi - Ecole Polytechnique SLAC User's Workshop.40 G4UserLimit This class allows to define the following limits in a given G4LogicalVolume: Maximum step size; Maximum track length; Maximum track time; Minimun kinetic energy; Minimum range; Class defined in source/global/management The user can inherit from G4UserLimit, or can instanciate the default implementation; The object has then to be set to the G4LogicalVolume;

Marc Verderi - Ecole Polytechnique SLAC User's Workshop.41 G4UserSpecialCuts How to activate G4UserLimit ? The maximum step size is automatically taken into account by the stepping; This is only the case for this G4UserLimit’s attribute; For the other limits, the G4UserSpecialCuts process (discrete process) can be set in the physics list; Defined in source/processes/transportation Or, a simple implementation of discrete process can be done to deal with only the cuts the user is interested in;

Marc Verderi - Ecole Polytechnique SLAC User's Workshop.42 Conclusion The « physics list » exposes, deliberatly, the user to the choice of physics (particles + processes) relevant for his/her application; This is a critical task, but guided by the framework; Examples have to be used as starting point; Discussions, by , hypernews, etc…, are welcome to echange experiences and expertises !