Generation of a primary event Ruhani Khanna INFNLNS

  • Slides: 16
Download presentation
Generation of a primary event Ruhani Khanna (INFN-LNS) XVI Seminar on Software for Nuclear,

Generation of a primary event Ruhani Khanna (INFN-LNS) XVI Seminar on Software for Nuclear, Sub-nuclear and Applied Physics Tuesday 28 th May, 2019 – Alghero, Italy softwareschool. infnlns@gmail. com 1

Lesson Outline 2 Introduction to some classes Primary Generation Action class Implementation Generators Further

Lesson Outline 2 Introduction to some classes Primary Generation Action class Implementation Generators Further details/ examples Task softwareschool. infnlns@gmail. com

Classes Global - only exists in memory for 1 instance, shared by all threads

Classes Global - only exists in memory for 1 instance, shared by all threads At Initialisation: At Execution: Thread-local - instance of each action class exists for each thread G 4 User. Detector. Constructio n G 4 VUser. Primary. Generator. Act ion G 4 VUser. Physics. List G 4 User. Run. Action G 4 VUser. Action. Initialization G 4 User. Event. Action To define use G 4 Run. Manager: : Set. User. Initialization () Invoked at initialisation G A P Cirrone, Ph. D - INFN-LNS (Italy) - G 4 User. Stacking. Action G 4 User. Tracking. Actio G 4 User. Stepping. Action To define use G 4 Run. Manager: : Set. User. Action() Invoked during an event

Primary Generator Action At Execution: Mandatory user class G 4 VUser. Primary. Generator. Ac

Primary Generator Action At Execution: Mandatory user class G 4 VUser. Primary. Generator. Ac tion Doesn’t generate primaries Invokes Generate. Primary. Vertex() (method to make the primary) Sends the primary particles to G 4 Event object G A P Cirrone, Ph. D - INFN-LNS (Italy) - Primary vertex and the primary particle are added to a GEANT 4 Event

Implementation in the src file Ex. P 02 Primary. Generator. Action: : Ex. P

Implementation in the src file Ex. P 02 Primary. Generator. Action: : Ex. P 02 Primary. Generator. Action() G 4 VUser. Primary. Generator. Action(), Class constructor Initiation of primary generator -> f. Particle. Gun(0) { G 4 Particle. Gun() G 4 int n_particle = 1; f. Particle. Gun = new G 4 Particle. Gun(n_particle); G 4 Particle. Table* particle. Table = G 4 Particle. Table: : Get. Particle. Table(); G 4 String particle. Name; Setting of default f. Particle. Gun->Set. Particle. Definition(particle. Table>Find. Particle(particle. Name="geantino")); values f. Particle. Gun->Set. Particle. Energy(1. 0*Ge. V); f. Particle. Gun->Set. Particle. Position(G 4 Three. Vector(0. 0, 0. 0)); Generate. Primaries() } Ex. P 02 Primary. Generator. Action: : ~Ex. P 02 Primary. Generator. Action() - Randomises particle { delete f. Particle. Gun; -by-particle values Class destructor } - Sets values to void Ex. P 02 Primary. Generator. Action: : Generate. Primaries(G 4 Event* an. Event) { primary generator G 4 Three. Vector v(1. 0, 0. 1); f. Particle. Gun->Set. Particle. Momentum. Direction(v); f. Particle. Gun->Generate. Primary. Vertex(an. Event); } Invokes Generate. Primary. Vertex() -> method of primary generator softwareschool. infnlns@gmail. com

Generators 6

Generators 6

G 4 VPrimary. Generator 7 Introduction to some classes Generate. Primaries(G 4 Event*a. Event)

G 4 VPrimary. Generator 7 Introduction to some classes Generate. Primaries(G 4 Event*a. Event) (mandatory event) Geant 4 provides 3 G 4 VPrimary. Generators: (all concrete implementation G 4 Particle. G un G 4 HEPEvt. Interfa ce G 4 General. Particle. Sour ce softwareschool. infnlns@gmail. com

G 4 Particle. Gun Shoots one primary particle of a certain energy from a

G 4 Particle. Gun Shoots one primary particle of a certain energy from a certain point at a certain time to a certain direction Various ‘Set’ methods available (/source/event/include/G 4 Particle. Gun. hh) - Void Set. Particle. Energy (G 4 Double a. Kinetic. Energy) - Void Set. Particle. Momentum (G 4 double a. Momentum) Methods can be repeated for generating more than onepprimary particle. Gun = G 4 Particle. Gun(); softwareschool. infnlns@gmail. com

Implementation example Can be repeated for generating more than one primary particles softwareschool. infnlns@gmail.

Implementation example Can be repeated for generating more than one primary particles softwareschool. infnlns@gmail. com

G 4 HEPEvt. Interface GEANT 4 provides an ASCII file interface (unlike usual FORTRAN

G 4 HEPEvt. Interface GEANT 4 provides an ASCII file interface (unlike usual FORTRAN code) for event generators G 4 HEPEvt. Interface reads this ASCII file produced by an Event generator to reproduce the G 4 Primary. Particle objects (in particular the /HEPEVT/ fortran block) Does not place for the primary particle so the interaction point must be set by the User softwareschool. infnlns@gmail. com

G 4 General. Particle. Source Designed to replace G 4 Particle. Gun class Allows

G 4 General. Particle. Source Designed to replace G 4 Particle. Gun class Allows specification of multiple particle sources each with independent definition of particle type, position, direction and energy distribution Primary vertex can be chosen on the surface of a certain volume (randomly) Momentum, direction and kinetic energy can also be randomised Distribution defined by UI commands f. Generate. Particle. Source = new G 4 Generate. Particle. Source(); …/source/event/include/G 4 General. Particle. Source. hh softwareschool. infnlns@gmail. com

Implementation example Source: point like, 100 Me. V proton along z /gps/pos/type point /gps/particle

Implementation example Source: point like, 100 Me. V proton along z /gps/pos/type point /gps/particle proton /gps/energy 100 Me. V /gps/direction 0 0 1 Source: plane source(2 x 2), 100 Me. V proton along z /gps/pos/type/plane /gps/pos/shape square /gps/pos/centre x y z /gps/pos/Halfx /gps/pos/Halfy softwareschool. infnlns@gmail. com

Comparison Particle Gun General Particle Source HEP event interface Simple and native Powerful Shoots

Comparison Particle Gun General Particle Source HEP event interface Simple and native Powerful Shoots one track at a time Controlled by UI commands Doesn’t give place of primary particle Interaction point must be set by user Easy to handle Capability of shooting particles from a surface of a volume and of randomising kinetic energy, position, direction, following (complicated) user softwareschool. infnlns@gmail. com

Further details Online manual: (http: //reat. space. qinetiq. com/gps/) softwareschool. infnlns@gmail. com

Further details Online manual: (http: //reat. space. qinetiq. com/gps/) softwareschool. infnlns@gmail. com

Thank you softwareschool. infnlns@gmail. com

Thank you softwareschool. infnlns@gmail. com

Tasks to do: Task 2 a: Particle Gun Task 2 b: General Particle Source

Tasks to do: Task 2 a: Particle Gun Task 2 b: General Particle Source http: //geant 4. lngs. infn. it/alghero 2019/task 2 softwareschool. infnlns@gmail. com