1 Primary particles Geant4 User's Tutorial CERN, 15-19 February 2010 Talk from previous tutorial by Giovanni Santin Ecole Geant4, Annecy 2008.

Slides:



Advertisements
Similar presentations
Primary Particle KOI, Tatsumi Geant4 V9.4 Geant4 Tutorial at Texas A&M 11-Jan
Advertisements

山下智弘 JST CREST/ 神戸大学 Borrowing especially from presentations of M. Asai(SLAC) Geant4 Japan Oct, RCNS, based on Geant4 9.0.p01.
山下智弘 JST CREST/ 神戸大学 Borrowing especially from presentations of M. Asai(SLAC) Geant4 Japan Oct, RCNS, based on Geant4 9.0.p01.
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.
Makoto Asai (SLAC) Geant4 Users CERN Nov. 15 th, 2002 Customizing Run Management.
Geant4 v9.4 Primary Particle 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.
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.
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.
17-19 Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan 2007 Geant4 Collaboration.
Geant4 Training 2003 Basic structure of the Geant4 Simulation Toolkit The full set of lecture notes of this Geant4 Course is available.
Normalisation modelling sources Geant4 tutorial Paris, 4-8 June 2007 Giovanni Santin ESA / ESTEC Rhea System SA.
Source Specifications in MCNP
Maria Grazia Pia Detector Response Acknowledgements: A. Lechner, J. Apostolakis, M. Asai, G. Cosmo, A. Howard.
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.
Geant4 Event Biasing Marc Verderi, LLR (Heavily copied from Jane Tinslay, SLAC) June 2007.
Geant4 internal Classes and Objects Gunter Folger / CERN Geant4 course, Annecy 2008 User Action & Information Classes.
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.
User Application Luciano Pandola INFN-LNGS Partially based on a presentation by Maria Grazia Pia (INFN-Ge)
Alex Howard - Event Biasing Geant4 Users - Lisbon Event biasing and Variance Reduction - Geometrical Alex Howard, CERN Geant4 Users Workshop, Lisbon.
Geant4 internal Classes and Objects Geant4 Users’ Tutorial February 2010 Gunter Folger / CERN User Action & Information Classes.
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.
G4GeneralParticleSource Class: Developed by ESA as the space radiation environment is often quite complex in energy and angular distribution, and requires.
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.
Makoto Asai (SLAC) Getting Started MGP: added class diagram of basic user application.
22.July.2003 M.Smizanska: EvtGen in ATLAS EvtGen in ATLAS Outline: ATLAS EvtGen users: General requirements ATLAS EvtGen B-physics group requirements ATLAS.
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,
The interface to EvtGen in CMS Roberto Covarelli University of Rochester EvtGen workshop, 06/12/2010.
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.
Interaction with the Geant4 kernel
The Generator Phase in Gauss
Interaction with the Geant4 kernel
Basics of a user application
Geant4:User Actions and Analysis
Primary Particle Generation
Makoto Asai (SLAC) Geant4 Users CERN Nov. 11th, 2002
G.A.P.Cirrone, S.E.Mazzaglia - INFN/LNS, Italy
Primary Particle Generation
The n-3He Simulation Using Geant4
Use of Geant4 in experiment interactive frameworks AliRoot
G4GeneralParticleSource Class:
User Application
The n-3He Simulation Using Geant4
User Application
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
The Geant4 Hadrontherapy Advanced Example
Presentation transcript:

1 Primary particles Geant4 User's Tutorial CERN, February 2010 Talk from previous tutorial by Giovanni Santin Ecole Geant4, Annecy 2008

Outline General concepts G4VUserPrimaryGeneratorAction class Primary vertex and primary particle Built-in primary particle generators G4ParticleGun Interfaces to HEPEVT and HEPMC General Particle Source (GPS)

User Actions and Initializations Initialization classes Use G4RunManager::SetUserInitialization() to define. Invoked at the initialization G4VUserDetectorConstruction G4VUserPhysicsList Action classes Use G4RunManager::SetUserAction() to define. Invoked during an event loop G4VUserPrimaryGeneratorAction + G4UserRunAction / G4UserEventAction / G4UserStackingAction / G4UserTrackingAction/ G4UserSteppingAction / … 3 mandatory // mandatory User Action classes G4VUserPrimaryGeneratorAction* gen_action = new PrimaryGeneratorAction; runManager->SetUserAction(gen_action);  Main program (.cc file in your root development tree) : General concepts

G4VUserPrimaryGeneratorAction 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 This class should NOT generate primaries itself but invoke GeneratePrimaryVertex() method of the selected primary generator(s) to make primaries G4VPrimaryGenerator class provides the primary particle generators G4VUserPrimaryGeneratorAction class description : Constructor (& destructor) Instantiate primary generator and set default values GeneratePrimaries(G4Event *) method Randomize particle-by-particle value(s) Set these values to primary generator(s) Invoke GeneratePrimaryVertex() method of primary generator 4 General concepts

Primary vertices and primary particles Primary vertices and primary particles are stored in G4Event in advance to processing an event. G4PrimaryVertex and G4PrimaryParticle classes They will become “primary tracks” only at Begin-of-Event phase and put into a “stack” 5 MyPrimaryGenerator (G4VUserPrimaryGeneratorAction ) Computes desired primary properties MyParticleGun (G4VPrimaryGenerator) ) Vertices and Primary particles are created G4Event Primaries are stored for later tracking General concepts

Capability of bookkeeping decay chains  primary particles may not necessarily be particles which can be tracked by Geant4 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, …) 6 General concepts Primary vertices and primary particles

Built-in primary particle generators Geant4 provides some concrete implementations of G4VPrimaryGenerator. 1.G4ParticleGun 2.G4HEPEvtInterface, G4HEPMCInterface 3.G4GeneralParticleSource 7

G4ParticleGun Concrete implementations of G4VPrimaryGenerator It shoots one primary particle of a certain energy from a certain point at a certain time to a certain direction. ( a complete set of function is available ) UI commands are also available for setting initial values /gun/ListList available particles /gun/particleSet particle to be generated /gun/directionSet momentum direction /gun/energySet kinetic energy /gun/momentumSet momentum /gun/momentumAmpSet absolute value of momentum /gun/positionSet starting position of the particle /gun/timeSet initial time of the particle /gun/polarizationSet polarization /gun/numberSet number of particles to be generated (per event) /gun/ionSet properties of ion to be generated [usage] /gun/ion Z A Q 8 Built-in primary particle generators - G4ParticleGun

G4ParticleGun : complex sources G4ParticleGun is basic, but it can be used from inside UserPrimaryGeneratorAction to model complex source types or distributions: Generate the desired distributions (by shooting random numbers) Use (C++) set methods of G4ParticleGun Use G4ParticleGun as many times as you want Use any other primary generators as many times as you want to make overlapping events 9 Built-in primary particle generators - G4ParticleGun

Example of user PrimaryGeneratorAction using G4ParticleGun void T01PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent){ G4ParticleDefinition* particle; G4int i = (int)(5.*G4UniformRand()); switch(i){ case 0: particle = positron; break; case 1:... } 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); } 10 G4ParticleGun : complex sources Built-in primary particle generators  You can repeat this for generating more than one primary particles. choose particle set particle set kinetic energy and momentum generate event - G4ParticleGun

Interfaces to external event generators Concrete implementations of G4VPrimaryGenerator Good examples for experiment-specific primary generator implementation Interface to external physics generators  G4HEPEvtInterface 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  G4HepMCInterface HepMC 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 HepMC 11 Built-in primary particle generators - G4HEPEvtInterface, G4HEPMCInterface

User actions for external event generators Adapted from examples/extended/eventgenerator/HepMC/HepMCEx01 and examples/extended/runAndEvent/RE01 12 PrimaryGeneratorAction::PrimaryGeneratorAction() { // HepMC m_currentGenerator = new HepMCG4AsciiReader(); // HEPEvt // G4String filename = "pythia_event.data"; // m_currentGenerator = new G4HEPEvtInterface(filename); } PrimaryGeneratorAction::~PrimaryGeneratorAction() { delete m_currentGenerator; } void PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent) { m_currentGenerator-> GeneratePrimaryVertex(anEvent); } /generator/hepmcAscii/open filename /run/beamOn 1 Built-in primary particle generators + UI macro commands - G4HEPEvtInterface, G4HEPMCInterface

G4GeneralParticleSource (GPS) An advanced concrete implementation of G4VPrimaryGenerator First development (2000) University of Southampton (ESA contract), maintained and upgraded now mainly by QinetiQ and ESA Extensive up-to-date documentation at Offers as pre-defined many common (and not so common) options Position, angular and energy distributions Multiple sources, with user defined relative intensity Capability of event biasing All features can be used via C++ or command line (or macro) UI 13 Built-in primary particle generators - G4GeneralParticleSource

14 Primary vertex can be randomly positioned with several options Emission from point, plane,… Angular emission Several distributions; isotropic, cosine-law, focused, … With some additional parameters (min/max-theta, min/max-phi,…) Kinetic energy of the primary particle can also be randomized. Common options (e.g. mono-energetic, power-law), some extra shapes (e.g. black-body) or user defined Multiple sources With user defined relative intensity Capability of event biasing (variance reduction). By enhancing particle type, distribution of vertex point, energy and/or direction G4GeneralParticleSource (GPS) Built-in primary particle generators - G4GeneralParticleSource Features available in GPS:

15 Example of user PrimaryGeneratorAction using GPS MyPrimaryGeneratorAction::MyPrimaryGeneratorAction() { m_particleGun = new G4GeneralParticleSource(); } MyPrimaryGeneratorAction::~MyPrimaryGeneratorAction() { delete m_particleGun; } void MyPrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent) { m_particleGun->GeneratePrimaryVertex(anEvent); } + all user instructions given via macro UI commands User Actions for GPS Built-in primary particle generators - G4GeneralParticleSource

16 G4GeneralParticleSource (GPS) Built-in primary particle generators - G4GeneralParticleSource Many examples are available here : Example 1 /gps/particle proton /gps/ene/type Mono /gps/ene/mono 500 MeV /gps/pos/type Plane /gps/pos/shape Rectangle /gps/pos/rot /gps/pos/rot /gps/pos/halfx 46.2 cm /gps/pos/halfy 57.2 cm /gps/pos/centre cm /gps/direction 0 –1 0 /run/beamOn... mono energetic beam 500 Mev planar emission from a z  x plane along -y axis