Primary particle Makoto Asai SLAC Computing Services Geant

  • Slides: 9
Download presentation
Primary particle Makoto Asai (SLAC Computing Services) Geant 4 Tutorial Course @ DESY September

Primary particle Makoto Asai (SLAC Computing Services) Geant 4 Tutorial Course @ DESY September 30 th, 2003 Primary particles - M. Asai (SLAC) - Sept. 30, 2003 @ DESY

Primary vertices and particles 4 4 Primary vertices and primary particles should be stored

Primary vertices and particles 4 4 Primary vertices and primary particles should be stored in G 4 Event before processing an event. 4 G 4 Primary. Vertex and G 4 Primary. Particle classes 4 These classes don’t have any dependency to G 4 Particle. Definition nor G 4 Track. 4 Capability of bookkeeping decay chains 4 Primary particles may not necessarily be particles which can be tracked by Geant 4 provides some concrete implementations of G 4 VPrimary. Generator. 4 G 4 HEPEvt. Interface 4 G 4 HEPMCInterface 4 G 4 General. Particle. Source 4 G 4 Particle. Gun Primary particles - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 2

Interfaces to HEPEvt and Hep. MC 4 4 4 Concrete implementations of G 4

Interfaces to HEPEvt and Hep. MC 4 4 4 Concrete implementations of G 4 VPrimary. Generator 4 A good example for experiment-specific primary generator implementation G 4 HEPEvt. Interface 4 Suitable to /HEPEVT/ common block, which many of (FORTRAN) HEP physics generators are compliant to. 4 ASCII file input G 4 Hep. MCInterface 4 An interface to Hep. MC class, which a few new (C++) HEP physics generators are compliant to. 4 ASCII file input or direct linking to a generator through Hep. MC. Primary particles - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 3

G 4 General. Particle. Source 4 4 A concrete implementation of G 4 VPrimary.

G 4 General. Particle. Source 4 4 A concrete implementation of G 4 VPrimary. Generator Primary vertex is randomly chosen on the surface of a certain (radioactive) volume. Capability of event biasing (variance reduction). 4 By enhancing particle type, distribution of vertex point, energy and/or direction Suitable especially to space applications Primary particles - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 4

G 4 Particle. Gun 4 4 Concrete implementations of G 4 VPrimary. Generator 4

G 4 Particle. Gun 4 4 Concrete implementations of G 4 VPrimary. Generator 4 A good example for experiment-specific primary generator implementation It shoots one primary particle of a certain energy from a certain point at a certain time to a certain direction. 4 Various set methods are available 4 Intercoms commands are also available Primary particles - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 5

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

G 4 VUser. Primary. Generator. Action 4 This class is one of mandatory user action classes to control the generation of primaries. 4 4 This class itself should NOT generate primaries but invoke Generate. Primary. Vertex() method of primary generator(s). One of most frequently asked questions is : I want “particle shotgun”, “particle machinegun”, etc. 4 Instead of implementing such a fancy weapon, you can 4 Shoot random numbers in arbitrary distribution 4 Use set methods of G 4 Particle. Gun 4 Use G 4 Particle. Gun as many times as you want 4 Use any other primary generators as many times as you want Primary particles - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 6

G 4 VUser. Primary. Generator. Action 4 4 Constructor 4 Instantiate primary generator(s) 4

G 4 VUser. Primary. Generator. Action 4 4 Constructor 4 Instantiate primary generator(s) 4 Set default values to it(them) Generate. Primaries() method 4 Randomize particle-by-particle value(s) 4 Set them to primary generator(s) 4 Invoke Generate. Primary. Vertex() method of primary generator(s) 4 Never use hard-coded UI commands Primary particles - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 7

G 4 VUser. Primary. Generator. Action void T 01 Primary. Generator. Action: : Generate.

G 4 VUser. Primary. Generator. Action 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; . . . } 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); Primary particles - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 8

G 4 double angle = (G 4 Uniform. Rand()-0. 5)*sigma. Angle; particle. Gun->Set. Particle.

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); } 4 You can repeat this for generating more than one primary particles. Primary particles - M. Asai (SLAC) - Sept. 30, 2003 @ DESY 9