Primary particle Giovanni Santin ESA ESTEC and Rhea

  • Slides: 15
Download presentation
Primary particle Giovanni Santin ESA / ESTEC and Rhea. Tech Ltd On behalf of

Primary particle Giovanni Santin ESA / ESTEC and Rhea. Tech Ltd On behalf of the Geant 4 collaboration Ecole Geant 4 Annecy, 18 -21 and 25 -28 Nov 2008 Giovanni Santin - Primary - Geant 4 tutorials tutorial, Paris With materialparticle from previous by Makoto Asai

Outline n General concepts – G 4 VUser. Primary. Generator. Action class – Primary

Outline n General concepts – G 4 VUser. Primary. Generator. Action class – Primary vertex and primary particle – Pre-assigned decays n Built-in primary particle generators – G 4 Particle. Gun – Interfaces to HEPEVT and HEPMC – General Particle Source (GPS) Giovanni Santin - Primary particle - Geant 4 tutorial, Paris 2007 2

General concepts Giovanni Santin - Primary particle - Geant 4 tutorial, Paris 2007 3

General concepts Giovanni Santin - Primary particle - Geant 4 tutorial, Paris 2007 3

User classes n Initialization classes – Use G 4 Run. Manager: : Set. User.

User classes n Initialization classes – Use G 4 Run. Manager: : Set. User. Initialization() to define. – Invoked at the initialization • G 4 VUser. Detector. Construction • G 4 VUser. Physics. List n Action classes – Use G 4 Run. Manager: : Set. User. Action() to define. – Invoked during an event loop • • • n G 4 VUser. Primary. Generator. Action G 4 User. Run. Action G 4 User. Event. Action G 4 User. Stacking. Action G 4 User. Tracking. Action G 4 User. Stepping. Action main() – Geant 4 does not provide main(). Note : classes written in orange are mandatory. Giovanni Santin - Primary particle - Geant 4 tutorial, Paris 2007 4

G 4 VUser. Primary. Generator. Action n This class is one of the mandatory

G 4 VUser. Primary. Generator. Action n This class is one of the mandatory user classes and controls the generation of primaries – What kind of particle (how many) what energy, position, direction, polarisation, etc n This class should NOT generate primaries itself but invoke Generate. Primary. Vertex() method of primary generator(s) to make primaries (G 4 VPrimary. Generator) n Constructor – Instantiate primary generator(s) – Set default values to it (them) n Generate. Primaries() method – Randomize particle-by-particle value(s) – Set these values to primary generator(s) • Never use hard-coded UI commands – Invoke Generate. Primary. Vertex() method of primary generator(s) Giovanni Santin - Primary particle - Geant 4 tutorial, Paris 2007 5

Primary vertices and primary particles n Primary vertices and primary particles are stored in

Primary vertices and primary particles n Primary vertices and primary particles are stored in G 4 Event in advance to processing an event. – G 4 Primary. Vertex and G 4 Primary. Particle classes – These classes don’t have any dependency to G 4 Particle. Definition nor G 4 Track. – They will become “primary tracks” only at Begin-of-Event phase and put into a “stack” My. Primary. Generator (G 4 VUser. Primary. Generator. Action) Computes desired primary properties My. Particle. Gun (G 4 VPrimary. Generator) Vertices and Primary particles are created Giovanni Santin - Primary particle - Geant 4 tutorial, Paris 2007 G 4 Event Primaries are stored for later tracking 6

Pre-assigned decay for primaries n Capability of bookkeeping decay chains n Primary particles may

Pre-assigned decay for primaries n Capability of bookkeeping decay chains n Primary particles may not necessarily be particles which can be tracked by Geant 4 – Pre-assigned decay channels attached to particles – Also, “exotic” particles can be imported from Particle Generators, followed by either decay or user defined physics processes (e. g. Higgs, W/Z boson, SUSY particle, …) Giovanni Santin - Primary particle - Geant 4 tutorial, Paris 2007 7

Built-in primary particle generators n Geant 4 provides some concrete implementations of G 4

Built-in primary particle generators n Geant 4 provides some concrete implementations of G 4 VPrimary. Generator. – G 4 Particle. Gun – G 4 HEPEvt. Interface, G 4 HEPMCInterface – G 4 General. Particle. Source Giovanni Santin - Primary particle - Geant 4 tutorial, Paris 2007 8

G 4 Particle. Gun n Concrete implementations of G 4 VPrimary. Generator – A

G 4 Particle. Gun n Concrete implementations of G 4 VPrimary. Generator – A good example for experiment-specific primary generator implementation n It shoots one primary particle of a certain energy from a certain point at a certain time to a certain direction. – Various C++ set methods are available n Intercoms commands are also available for setting initial values – – – – – /gun/List /gun/particle /gun/direction /gun/energy /gun/momentum. Amp /gun/position /gun/time /gun/polarization /gun/number List available particles Set particle to be generated Set momentum direction Set kinetic energy Set momentum Set absolute value of momentum Set starting position of the particle Set initial time of the particle Set polarization Set number of particles to be generated (per event) – /gun/ion Set properties of ion to be generated [usage] /gun/ion Z A Q Giovanni Santin - Primary particle - Geant 4 tutorial, Paris 2007 9

Complex sources with G 4 Particle. Gun (1) n G 4 Particle. Gun is

Complex sources with G 4 Particle. Gun (1) n G 4 Particle. Gun is basic, but it can be used from inside User. Primary. Generator. Action to model complex source types / distributions: – Generate the desired distributions (by shooting random numbers) – Use (C++) set methods of G 4 Particle. Gun – Use G 4 Particle. Gun as many times as you want – Use any other primary generators as many times as you want to make overlapping events Giovanni Santin - Primary particle - Geant 4 tutorial, Paris 2007 10

Complex sources with G 4 Particle. Gun (2) n Example of user Primary. Generator.

Complex sources with G 4 Particle. Gun (2) n Example of user Primary. Generator. Action using G 4 Particle. Gun void T 01 Primary. Generator. Action: : Generate. Primaries(G 4 Event* an. Event){ G 4 Particle. Definition* particle; G 4 int i = (int)(5. *G 4 Uniform. Rand()); switch(i){ case 0: particle = positron; break; case 1: . . . } particle. Gun->Set. Particle. Definition(particle); G 4 double pp = momentum+(G 4 Uniform. Rand()-0. 5)* sigma. Momentum; G 4 double mass = particle-> Get. PDGMass(); G 4 double Ekin = sqrt(pp*pp+mass*mass)-mass; particle. Gun->Set. Particle. Energy(Ekin); G 4 double angle = (G 4 Uniform. Rand()-0. 5)* sigma. Angle; particle. Gun->Set. Particle. Momentum. Direction (G 4 Three. Vector(sin(angle), 0. , cos(angle))); particle. Gun->Generate. Primary. Vertex(an. Event); } n You can repeat this for generating more than one primary particles. Giovanni Santin - Primary particle - Geant 4 tutorial, Paris 2007 11

Interfaces to external event generators n Concrete implementations of G 4 VPrimary. Generator –

Interfaces to external event generators n Concrete implementations of G 4 VPrimary. Generator – Good examples for experiment-specific primary generator implementation – Interface to external physics generators n G 4 HEPEvt. Interface – Event record structure based on /HEPEVT/ common block – Used by (FORTRAN) HEP physics generators – Developed and agreed on within the framework of the 1989 LEP physics study – ASCII file input n G 4 Hep. MCInterface – Hep. MC Event record for MC generators. Object Oriented, C++ – Used by new (C++) HEP physics generators – ASCII file input or direct linking to a generator through Hep. MC Giovanni Santin - Primary particle - Geant 4 tutorial, Paris 2007 12

User actions for external event generators n Adapted from examples/extended/eventgenerator/Hep. MCEx 01 and examples/extended/run.

User actions for external event generators n Adapted from examples/extended/eventgenerator/Hep. MCEx 01 and examples/extended/run. And. Event/RE 01 Primary. Generator. Action: : Primary. Generator. Action() { // Hep. MC m_current. Generator = new Hep. MCG 4 Ascii. Reader(); // HEPEvt // G 4 String filename = "pythia_event. data"; // m_current. Generator = new G 4 HEPEvt. Interface(filename); } Primary. Generator. Action: : ~Primary. Generator. Action() { delete m_current. Generator; } void Primary. Generator. Action: : Generate. Primaries(G 4 Event* an. Event) { m_current. Generator-> Generate. Primary. Vertex(an. Event); } n n /generator/hepmc. Ascii/open filename /run/beam. On 1 Giovanni Santin - Primary particle - Geant 4 tutorial, Paris 2007 13

G 4 General. Particle. Source (GPS) n An advanced concrete implementation of G 4

G 4 General. Particle. Source (GPS) n An advanced concrete implementation of G 4 VPrimary. Generator n Offers as pre-defined many common (and not so common) options – Position, angular and energy distributions – Multiple sources, with user defined relative intensity n Capability of event biasing (variance reduction). n All features can be used via C++ or command line (or macro) UI n See related talk this afternoon Giovanni Santin - Primary particle - Geant 4 tutorial, Paris 2007 14

Exercises Proton source n Vertices on rectangle along xz at +y edge of World

Exercises Proton source n Vertices on rectangle along xz at +y edge of World n Planar emission along -y n Monoenergetic: 500 Me. V n Giovanni Santin - Primary particle - Geant 4 tutorial, Paris 2007 15