Geant4 v9.2p02 Particle Gun Makoto Asai (SLAC) Geant4 Tutorial Course.

Slides:



Advertisements
Similar presentations
First Step on User Commands Makoto Asai (SLAC) Geant4 Users CERN Nov. 11th, 2002.
Advertisements

Geant4 v9.2p02 User Interface I Makoto Asai (SLAC) Geant4 Tutorial Course.
Primary Particle KOI, Tatsumi Geant4 V9.4 Geant4 Tutorial at Texas A&M 11-Jan
User Interface I Makoto Asai (SLAC) Geant4 Tutorial Course Geant4 v8.3.
山下智弘 JST CREST/ 神戸大学 Borrowing especially from presentations of M. Asai(SLAC) Geant4 Japan Oct, RCNS, based on Geant4 9.0.p01.
GAMOS tutorial Histogram and Scorers Exercises
Geant4 v9.2p02 User Interface II Makoto Asai (SLAC) Geant4 Tutorial Course.
Geant4 v9.2p02 Primary Particle Makoto Asai (SLAC) Geant4 Tutorial Course.
Primary particle generation Makoto Asai (SLAC) Geant4 Users CERN Nov. 12 th, 2002.
Makoto Asai (SLAC) Geant4 Users SLAC Feb. 18 th, 2002 Getting Started.
14 May 2011 Geant4 Tutorial Introduction J. Perl 1 Geant4 Tutorial University of Pennsylvania May 2011 A five day hands-on course based on Geant4.
Primary particle generation Makoto Asai (SLAC) Geant4 Users SLAC Feb. 18 th, 2002.
Geant4 User Interface Overview Geant4 Mini-Tutorial Hebden Bridge 15 September 2007 Joseph Perl, SLAC (mostly stolen from a talk by Makoto Asai)
Makoto Asai (SLAC) Geant4 Users CERN Nov. 15 th, 2002 Customizing Run Management.
Geant4 v9.4 Primary Particle Makoto Asai (SLAC) Geant4 Tutorial Course.
10 January 2011 Geant4 Tutorial Introduction J. Perl 1 Geant4 Winter Course Tutorial Texas A&M University January 2011 A five day hands-on course.
Geant4 v9.4 User Interface I Makoto Asai (SLAC) Geant4 Tutorial Course.
Makoto Asai (SLAC) Geant4 Users CERN Nov. 11 th, 2002 Getting Started.
Makoto Asai (SLAC) Geant4 Users SLAC Feb. 18 th, 2002 Getting Started.
Highlights of latest developments ESA/ESTEC Makoto Asai (SLAC)
Geant4 v9.3p01 Primary Particle Makoto Asai (SLAC) Geant4 Tutorial Course.
Makoto Asai (SLAC) Geant4 Users SLAC Feb. 20th, 2002 Stack management, Digitization and Pile-up.
User Commands Makoto Asai (SLAC) Geant4 Users SLAC Feb. 19th, 2002.
Makoto Asai (SLAC) Geant4 Tutorial Course
Geant4 v9.3 Scoring II Makoto Asai (SLAC) Geant4 Tutorial Course.
Primary particle generation Makoto Asai (SLAC) Geant4 Users SLAC Feb. 18 th, 2002.
Makoto Asai (SLAC) Geant4 Users CERN Nov. 13th, 2002 Stack management, Digitization and Pile-up.
User Interface II Makoto Asai (SLAC) Geant4 Tutorial Course Geant4 v8.2p01.
Primary Particle Makoto Asai (SLAC) Geant4 Tutorial Course Geant4 v8.2p01.
Introduction to Geant4 Makoto Asai (SLAC) Geant4 Tutorial Course the 2nd Finnish Geant4 Workshop June , Helsinki Institute of Physics June 2005,
A stable interface to read and write IAEA phase-space files in Geant4 M. A. Cortés-Giraldo 1, R. Capote 2, J. M. Quesada 1 1 Dep. Física Atómica, Molecular.
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.
Primary particle Geant4 tutorial Paris, 4-8 June 2007 Giovanni Santin ESA / ESTEC Rhea System SA With material from previous tutorials by Makoto Asai.
17-19 Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan 2007 Geant4 Collaboration.
1 Primary particles Geant4 User's Tutorial CERN, February 2010 Talk from previous tutorial by Giovanni Santin Ecole Geant4, Annecy 2008.
S. Guatelli, M.G Pia, INFN Genova G. Cosmo, S. Guatelli, M.G Pia Salamanca, July 2002
Primary particle Giovanni Santin ESA / ESTEC and RheaTech Ltd On behalf of the Geant4 collaboration Ecole Geant4 Annecy, and Nov 2008 With.
UI command Makoto Asai (SLAC) Geant4 Tutorial CERN May 25-27, 2005 May 2005, Geant4 v7.0p01.
Monte Carlo /12/07. What is Geant ? Monte Carlo simulation tool for nuclear and particle physics Set up detectors –Sensitive detector which returns.
User Application Toolkit + User application toolkit Geant4 is a toolkit –i.e. you cannot “run” it out of the box –You must write.
Generating Primary Particles Each Geant4 Event starts with generation of one or multiple primary particles It is up to the user to define primary particle.
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)
Maria Grazia Pia Hands-on exercises Unit 2 Modelling the experimental set-up.
17-19 Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan 2007 Geant4 Collaboration.
Makoto Asai (SLAC) Getting Started MGP: added class diagram of basic user application.
Geant4 Training 2003 Primary Particle Generation The full set of lecture notes of this Geant4 Course is available at
Introduction to Geant4 Makoto Asai (SLAC) Geant4 Tutorial Course the 2nd Finnish Geant4 Workshop June , Helsinki Institute of Physics June 2005,
General Introduction and prospect Makoto Asai (SLAC PPA/SCA)
17-19 Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan 2007 Geant4 Collaboration.
1 Exercises 0 Go inside the “hadrontherapy” directory: cd hadrontherapy Copy the Hadrontherapy example to your home folder: cp –r $G4INSTALL/examples/advanced/hadrontherapy.
GPS General Particle Source
(CMS GEANT4 simulation)
Makoto Asai (SLAC) Geant4 Tutorial Course
Makoto Asai (SLAC) Geant4 Tutorial Course
Primary Particle Generation
Makoto Asai (SLAC) Geant4 Users CERN Nov. 11th, 2002
Primary Particle Generation
Makoto Asai (SLAC) Geant4 Tutorial Course
Makoto Asai (SLAC) Geant4 Tutorial Course
Use of Geant4 in experiment interactive frameworks AliRoot
Short Course IEEE NSS/MIC 2003 Katsuya Amako (KEK) Makoto Asai (SLAC)
User Application
The full set of lecture notes of this Geant4 Course is available at
Customizing Run Management
The full set of lecture notes of this Geant4 Course is available at
Kernel Author: Makoto Asai.
Primary particle Makoto Asai (SLAC Computing Services)
The full set of lecture notes of this Geant4 Course is available at
Makoto Asai (SLAC) Geant4 Users CERN Nov. 13th, 2002
Presentation transcript:

Geant4 v9.2p02 Particle Gun Makoto Asai (SLAC) Geant4 Tutorial Course

G4VUserPrimaryGeneratorAction This class is one of mandatory user classes to control the generation of primaries. –This class itself should NOT generate primaries but invoke GeneratePrimaryVertex() method of primary generator(s) to make primaries. Constructor –Instantiate primary generator(s) –Set default values to it(them) GeneratePrimaries() method –Randomize particle-by-particle value(s) –Set these values to primary generator(s) Never use hard-coded UI commands –Invoke GeneratePrimaryVertex() method of primary generator(s) Particle Gun - M.Asai (SLAC)2

Particle Gun vs. General Particle Source Particle Gun –Simple and naïve –Shoot one track at a time –Easy to handle. Use set methods to alternate track-by-track or event-by- event values. General Particle Source –Powerful –Controlled by UI commands. Almost impossible to control through set methods –Capability of shooting particles from a surface of a volume. –Capability of randomizing kinetic energy, position and/or direction following a user-specified distribution (histogram). Particle Gun - M.Asai (SLAC)3 If you need to shoot primary particles from a surface of a volume, either outward or inward, GPS is the choice. If you need a complicated distribution, not flat or simple Gaussian, GPS is the choice. Otherwise, use Particle Gun.

What to do and where to do In the constructor of your UserPrimaryGeneratorAction –Instantiate G4ParticleGun –Set default values by set methods of G4ParticleGun Particle type, kinetic energy, position and direction In your macro file or from your interactive terminal session –Set values for a run Particle type, kinetic energy, position and direction In the GeneratePrimaries() method of your UserPrimaryGeneratorAction –Shoot random number(s) and prepare track-by-track or event-by-event values Kinetic energy, position and direction –Use set methods of G4ParticleGun to set such values –Then invoke GeneratePrimaryVertex() method of G4ParticleGun –If you need more than one primary tracks per event, loop over randomization and GeneratePrimaryVertex(). examples/extended/analysis/A01/src/A01PrimaryGeneratorAction.cc is a good example to start with. Particle Gun - M.Asai (SLAC)4

G4VUserPrimaryGeneratorAction void A01PrimaryGeneratorAction:: GeneratePrimaries(G4Event* anEvent) { G4ParticleDefinition* particle; G4int i = (int)(5.*G4UniformRand()); switch(i) { case 0: particle = positron; break;... } particleGun->SetParticleDefinition(particle); G4double pp = momentum+(G4UniformRand()-0.5)*sigmaMomentum; G4double mass = particle->GetPDGMass(); G4double Ekin = sqrt(pp*pp+mass*mass)-mass; particleGun->SetParticleEnergy(Ekin); G4double angle = (G4UniformRand()-0.5)*sigmaAngle; particleGun->SetParticleMomentumDirection (G4ThreeVector(sin(angle),0.,cos(angle))); particleGun->GeneratePrimaryVertex(anEvent); } You can repeat this for generating more than one primary particles. Particle Gun - M.Asai (SLAC)5