山下智弘 JST CREST/ 神戸大学 Borrowing especially from presentations of M. Asai(SLAC) Geant4 Japan 2007 17-19 Oct, RCNS, based on Geant4 9.0.p01.

Slides:



Advertisements
Similar presentations
Geant4 v9.2p02 User Interface I Makoto Asai (SLAC) Geant4 Tutorial Course.
Advertisements

Primary Particle KOI, Tatsumi Geant4 V9.4 Geant4 Tutorial at Texas A&M 11-Jan
山下智弘 JST CREST/ 神戸大学 Borrowing especially from presentations of M. Asai(SLAC) Geant4 Japan Oct, RCNS, based on Geant4 9.0.p01.
User Interface I Makoto Asai (SLAC) Geant4 Tutorial Course Geant4 v8.3.
Geant4 v9.2p02 User Interface II Makoto Asai (SLAC) Geant4 Tutorial Course.
Geant4 v9.2p02 Particle Gun 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.
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)
Geant4 v9.4 Primary Particle Makoto Asai (SLAC) Geant4 Tutorial 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.
Geant4 v9.3p01 Primary Particle Makoto Asai (SLAC) Geant4 Tutorial Course.
User Commands Makoto Asai (SLAC) Geant4 Users SLAC Feb. 19th, 2002.
Primary particle generation Makoto Asai (SLAC) Geant4 Users SLAC Feb. 18 th, 2002.
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.
Primary particle Geant4 tutorial Paris, 4-8 June 2007 Giovanni Santin ESA / ESTEC Rhea System SA With material from previous tutorials by Makoto Asai.
Tuesday, Nov 9th 9:30-12:30 –Visualization attributes –Physics processes 14:00-17:00 –Kinematics and event generation (from yesterday) Particle gun –Boolean.
17-19 Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan 2007 Geant4 Collaboration.
Physics I: Physics Lists Geant4 Tutorial at Jefferson Lab 10 July 2012 Dennis Wright (SLAC) Geant4 9.6 beta.
1 Primary particles Geant4 User's Tutorial CERN, February 2010 Talk from previous tutorial by Giovanni Santin Ecole Geant4, Annecy 2008.
Introduction to Geant4 User Interface J. Perl1 6 June 2005 Introduction to Geant4 User Interface Joseph Perl Stanford Linear Accelerator Center.
S. Guatelli, M.G Pia, INFN Genova G. Cosmo, S. Guatelli, M.G Pia Salamanca, July 2002
Basic Structure of the Geant4 Simulation Toolkit
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.
山下智弘 JST CREST/ 神戸大学 Borrowing especially from presentations of M. Asai(SLAC) Geant4 Japan Oct, RCNS, based on Geant4 9.0.p01.
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.
17-19 Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan 2007 Geant4 Collaboration.
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.
Maria Grazia Pia INFN Genova Salamanca, July 2002
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.
Run and Event G4Run and G4RunManager In Geant4, the Run is the largest unit of simulation and it consist of a series of events Within a Run, the detector.
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)
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.
17-19 Oct, 2007Geant4 Japan 2007 Geant4 Collaboration KEK/CRC 1.
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,
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
Maria Grazia Pia Retrieving information from kernel Acknowledgements: A. Lechner, J. Apostolakis, M. Asai, G. Cosmo, A. Howard.
Basics of a user application
Makoto Asai (SLAC) Geant4 Tutorial Course
Makoto Asai (SLAC) Geant4 Tutorial Course
Primary Particle Generation
Makoto Asai (SLAC) Geant4 Users CERN Nov. 11th, 2002
Physics I: Physics Lists
Primary Particle Generation
Makoto Asai (SLAC) Geant4 Tutorial Course
Makoto Asai (SLAC) Geant4 Tutorial Course
User Application
Geant4 course - exercices
User Application
User Application
The full set of lecture notes of this Geant4 Course is available at
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:

山下智弘 JST CREST/ 神戸大学 Borrowing especially from presentations of M. Asai(SLAC) Geant4 Japan Oct, RCNS, based on Geant4 9.0.p01

Outline I. G4VPrimaryGeneratorAction class II. Particle gun III. General particle source IV. Using Particle gun

I. G4VPrimaryGeneratorAction class  This class is one of mandatory user classes control the generation of primaries. This class itself should NOT generate primaries ○ invoke GeneratePrimaryVertex() method of primary generator(s) to make primaries.  Constructor of G4VPrimaryGeneratorAction 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)

I. G4VPrimaryGeneratorAction class 1. Primary vertices and particles  Primary vertices and primary particles are stored in G4Event in advance to processing an event. G4PrimaryVertex and G4PrimaryParticle classes ○ These classes don’t have any dependency to G4ParticleDefinition nor G4Track. Capability of bookkeeping decay chains ○ Primary particles may not necessarily be particles which can be tracked by Geant4.  Geant4 provides some concrete implementations of G4VPrimaryGenerrator. G4ParticleGun G4HEPEvtIInterface, G4HEPMCInterface G4GeneralParticleSource

II. Particle gun  Concrete implementations of G4VPrimaryGenerator A good example for experiment-specific primary generator implementation  It shoots one primary particle a certain energy from a certain point at a certain time to a certain direction. Various set methods are available Intercoms commands are also available for setting initial values  One of most frequently asked questions is : I want “particle shotgun”, “particle machinegun”, etc.  Instead of implementing such a fancy weapon, in your implementation of UserPrimaryGeneratorAction, you can Shoot random numbers in arbitrary distribution Use set methods of G4PartticleGun Use G4PartticleGun as many times as you want Use any other primary generators as many times as you want to make overlapping events

III. GenerralParticleSource  A concrete implementation of G4VPrimaryGenerrator  Suitable especially to space applications  Specifically, it allows the specifications of the spectral, spatial and angular distribution of the primary source particles.  Implementation MyPrimaryGeneratorAction::MyPrimaryGeneratorAction() { generator = new G4GeneralParticleSource; } void MyPrimaryGeneratorAction:: GeneratePrimaries(G4Event* anEvent) { generator->GeneratePrimaryVertex(anEvent); }  Detailed description

IV. Using Particle gun 1. PrimaryGeneratorActtion class G4ParticleGun; class G4Event; class MyPrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction { public: MyPrimaryGeneratorAction(); ~MyPrimaryGeneratorAction(); public: void GeneratePrimaries(G4Event*); private: G4ParticleGun* particleGun; }; Inherit G4VUserPrimaryGeneratorAction User have to define this method Use G4ParticleGun as primary generator

IV. Using Particle gun 1. PrimaryGeneratorActtion contd. MyPrimaryGeneratorAction::MyPrimaryGeneratorAction() { G4int n_particle = 1; particleGun = new G4ParticleGun(n_particle); G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable(); G4String pname = "proton"; G4ParticleDefinition* particle = particleTable->FindParticle(pname); particleGun->SetParticleDefinition(particle); particleGun->SetParticleMomentumDirection(G4ThreeVector(0., 0., -1.)); particleGun->SetParticleEnergy(150.0*MeV); G4double position = 0.0*m; particleGun->SetParticlePosition( G4ThreeVector(0.*cm, 0.*cm, position) ); } Get proton definition Set default particle, its energy, direction, and vertex

IV. Using Particle gun 1. PrimaryGeneratorActtion contd. MyPrimaryGeneratorAction::~MyPrimaryGeneratorAction() { delete particleGun; } void MyPrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent) { particleGun->GeneratePrimaryVertex(anEvent); }

IV. Using Particle gun 2. Particle gun commands(1)  In G4UIterminal, Idle> ls /gun shows list of commands Commands : List * List available particles. particle * Set particle to be generated. direction * Set momentum direction. energy * Set kinetic energy. position * Set starting position of the particle. time * Set initial time of the particle. polarization * Set polarization. number * Set number of particles to be generated. ion * Set properties of ion to be generated.

IV. Using Particle gun 2. Particle gun commands(2) Idle> help energy Command /gun/energy Guidance : Set kinetic energy. Parameter : Energy Parameter type : d Omittable : True Default value : taken from the current value Parameter : Unit Parameter type : s Omittable : True Default value : GeV Candidates : eV keV MeV GeV TeV PeV J electronvolt kiloelectronvolt megaelectronvolt gigaelectronvolt teraelectronvolt petaelectronvolt joule Idle>

IV. Using Particle gun 2. Particle gun commands(3) /gun/particle proton /gun/energy 150 MeV /gun/position m /gun/direction  Save a macrofile with 5 liens above, as gunProton150.mac  In Geant4 UIterminal (or in another macro file) Idle> /control/execute macros/gunProton150.mac will set the particle gun to shoot proton with the energy from the position to the direction in the macro file

IV. Using Particle gun 2. Randomize particle energy … #include "Randomize.hh“ … void MyPrimaryGeneratorAction::GeneratePrimaries( G4Event* anEvent) { G4double kinE = 150*MeV; G4double sigma = 10*MeV; kinE = G4RandGauss::shoot(kinE, sigma); particleGun->SetParticleEnergy(kinE); particleGun->GeneratePrimaryVertex(anEvent); }  Other quantities are also able to be randomized through Set method. Ran domize the energy with gaussian